Rocket Division Software
http://www.starburnsoftware.com/forum/

StarBurn_GetDeviceLetter() fails when using internal name
http://www.starburnsoftware.com/forum/starburn-sdk-f3/starburn-getdeviceletter-fails-when-using-internal-name-t2478.html
Page 1 of 1

Author:  lhill [ Fri Oct 11, 2013 11:40 pm ]
Post subject:  StarBurn_GetDeviceLetter() fails when using internal name

The problem: Using the CD/DVD/etc device's internal name, the call to StarBurn_GetDeviceLetter fails with the following:
Quote:
Exception: EN_NOT_FOUND, Status: 0, Exception Text: {}


I am using the SPTI protocol. Before you say, "why would you ever do that? Just migrate to SPTD and be done with it," unfortunately, some of my company's customers do not allow us to install the SPTD drivers on their machines. Thus, SPTI is a requirement and I'm trudging through it.

That said, I believe the problem is due to the device name I am passing to StarBurn_GetDeviceLetter. The device name I am using is the internal name from SetupDiGetDeviceInterfaceDetail, which is working exactly as expected. Everything leading up to and including the call to SetupDiGetDeviceInterfaceDetail was fashioned after the SDK's C example, FindDeviceEx. I have also tried removing the "\\?\" portion from the front of the internal name string, but to no avail. Unfortunately, none of the C examples call StarBurn_GetDeviceLetter, and the ones that do (C# DataBurnerVS2010 and Common\CDVDDevice.cpp) do not find the devices in the same way I am doing.

NOTE: I am using C#, exporting the necessary functions from the StarBurn DLL.

Author:  andrey(staff) [ Mon Oct 14, 2013 5:07 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Hello,

It must be name: CdRom0 or CdRom1 or CdRom2 or ....

Please look file "Program Files (x86)\StarBurn Software\StarBurn SDK V15.1 'Stingray'\Samples\StarBurn Core\MSVC\Shared\DeviceFinder.cpp"

method: void CDeviceFinder::FindSPTIDevices()

CdRom# names are used to create SPTI device in this method.

Author:  lhill [ Wed Oct 16, 2013 4:56 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Well, as it turns out, I backed out my changes and reverted back to using QueryDosDevice on the drive letters (e.g. "D:") to get the internal names like you mentioned ("CdRom<X>"). This was not working before when calling CreateEx (it did with CreateExEx). I figured out the problem, though. The function signature I was using for CreateEx had to change to accept the device name as a StringBuilder, rather than a String marshaled as a LPWSTR. See below if you are curious:

Previously:
Code:
[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,
            [MarshalAs(UnmanagedType.LPWStr)]
         String DeviceName,
            int CacheSizeInMBs
            );


Now:
Code:
        [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
            );


Thank you for your assistance.

Author:  andrey(staff) [ Thu Oct 17, 2013 7:58 am ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Why don't you use StarBurnX (ActiveX component) ?

Author:  lhill [ Mon Oct 21, 2013 4:20 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Mostly because I had already started using StarBurn Core without knowing there was such a thing as StarBurnX. I might look into the StarBurnX samples now that I am having an issue with multisession discs using SPTI (but not ASPI).

Author:  andrey(staff) [ Tue Oct 22, 2013 11:48 am ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

What is the problem with SPTI?

Author:  lhill [ Tue Oct 22, 2013 3:35 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

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
            );

Author:  lhill [ Wed Oct 23, 2013 6:56 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

So, I've been trying out StarBurnX and I'm liking it so far. Much easier to use. However, I can't get a disc to burn. StarBurnX is complaining that there is no free space on the disc. The disc is a blank CD-RW. I have used it several times with success with the C# sample DataBurner that was provided with the SDK. I cannot for the life of me figure out what I am doing differently from the sample project. My log file is attached.

Your assistance is greatly appreciated.


Edit: I can't seem to attach the log file.
Edit2: Finally got the file to attach. Had to zip. Your forum apparently does not accept almost every file extension (even no extension).

Attachments:
starburnlog.zip [24.82 KiB]
Downloaded 2264 times

Author:  lhill [ Wed Oct 23, 2013 8:18 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Apologies for the triple post. But I discovered the cause of my problem.

There is a bug (or intentional oversight) with the IDataFolder::AddDirectory method. The path name of the directory passed to the function must have a trailing backslash. The documentation does not say this and if left out, the burner crashes in the manner described by my log file. The path I was passing did not have a trailing backslash. Now it does. :roll:

Author:  andrey(staff) [ Thu Oct 24, 2013 1:44 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Hi!

So .. does it work properly now ? :)

Regards,

Dmitry

Author:  lhill [ Thu Oct 24, 2013 3:47 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Yep, everything is working great now that I'm using StarBurnX!

Author:  andrey(staff) [ Thu Oct 24, 2013 4:23 pm ]
Post subject:  Re: StarBurn_GetDeviceLetter() fails when using internal name

Ok :)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/