Both with SPTI and SPTD, I am having to eject the disc and re-insert it to get the operating system (Win7 x64) to recognize that new files have been added to the disc. I have verified, using Process Hacker, that my program is not holding onto a handle to the drive, and I have tried many things to try to get Windows to see the files: closing my program altogether, repolling the device with StarBurn, repolling the device with Windows. But nothing does the trick except ejecting and re-inserting the disc. ASPI does not have this problem.
I am not getting any errors while burning. The function signatures I'm using for ASPI, STPI, and SPTD, respectively are as follows:
Code:
[DllImport("StarBurn.dll")]
private static extern EXCEPTION_NUMBER StarBurn_CdvdBurnerGrabber_Create(
out uint CdvdBurnerGrabber,
IntPtr pExceptionText,
int ExceptionTextSize,
out uint SystemError,
out CDB_FAILURE_INFORMATION CDB_Failure_Type,
CallbackDelegate MyCallback,
IntPtr Context,
byte PortID,
byte BusID,
byte TargetID,
byte LUN,
int CacheSize
);
[DllImport("StarBurn.dll")]
private static extern EXCEPTION_NUMBER StarBurn_CdvdBurnerGrabber_CreateEx(
out uint CdvdBurnerGrabber,
IntPtr pExceptionText,
int ExceptionTextSize,
out uint SystemError,
out CDB_FAILURE_INFORMATION CDB_Failure_Type,
CallbackDelegate MyCallback,
IntPtr Context,
StringBuilder DeviceName,
int CacheSizeInMBs
);
[DllImport("StarBurn.dll")]
private static extern EXCEPTION_NUMBER StarBurn_CdvdBurnerGrabber_CreateExEx(
out uint CdvdBurnerGrabber,
IntPtr pExceptionText,
int ExceptionTextSize,
out uint SystemError,
out CDB_FAILURE_INFORMATION CDB_Failure_Type,
CallbackDelegate MyCallback,
IntPtr Context,
[MarshalAs(UnmanagedType.LPWStr)]
String DeviceName,
byte pIsExclusiveAccess,
int CacheSizeInMBs
);