OK I'm finally making some headway using this SDK, however now I'm getting errors when trying to search for devices. I'm using the code from the DeviceInfo sample which works fine. However in my code the CreateEx call is returning EN_SYSTEM_CALL_FAILED. Here is my code, can anyone tell me what's wrong?
Code:
LONG NumberOfDVDDevices = 0;
EXCEPTION_NUMBER ExceptionNumber = EN_SUCCESS;
ULONG SystemError = ERROR_SUCCESS;
ULONG Version = 0;
CHAR VersionText[1024];
ExceptionNumber = StarBurn_UpStartEx((PVOID)(&g__UCHAR__RegistrationKey ), sizeof(g__UCHAR__RegistrationKey));
if (ExceptionNumber == EN_SUCCESS)
{
CHAR ExceptionText[ 1024 ];
CDB_FAILURE_INFORMATION FailureInformation;
ULONG ululSystemError = ERROR_SUCCESS;
char Name[128] = "\0";
int i = 0;
//
// Try to find all devices
//
for (i = 0; i < 20; i++)
{
PVOID pCdvdBurnerGrabber = NULL;
EXCEPTION_NUMBER ExceptionNumber =
StarBurn_CdvdBurnerGrabber_CreateEx(
&pCdvdBurnerGrabber,
(PCHAR) (&ExceptionText),
sizeof(ExceptionText),
&ululSystemError,
&FailureInformation,
(PCALLBACK) (FindCallback),
NULL,
Name,
1
);
//
// Check for success
//
if (ExceptionNumber == EN_SUCCESS)
{
if (pCdvdBurnerGrabber != NULL)
{
//
// Free allocated memory
//
StarBurn_Destroy(&pCdvdBurnerGrabber);
pCdvdBurnerGrabber = NULL;
}
CString test;
test.Format("%s", Name);
AfxMessageBox(test);
}
}
StarBurn_DownShut();
}
Here is what the ExceptionText variable reports
Quote:
ExceptionText 0x0012dbf0 "CStarBurn_ScsiTransportSPTI::CStarBurn_ScsiTransportSPTI(): CreateFile( '\\.\', 0xc0000000, 3, 0x00000000, 3, 0, 0x00000000 ) failed, status 123 ( 0x7b )" char [1024]
I've tried the code both statically and dynamically linked, and tried both a release and debug build. All of them fail in exactly the same way.
I also tried the ASPI version using just Create instead of CreateEx and that worked. However this app is targeted at XP, so I's like to use STPI if I can.
Thanks,
Dan