#1 Burning Software

It is currently Thu Mar 28, 2024 11:56 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Fri Oct 11, 2013 11:40 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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.


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Mon Oct 14, 2013 5:07 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
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.


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Wed Oct 16, 2013 4:56 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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.


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Thu Oct 17, 2013 7:58 am 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Why don't you use StarBurnX (ActiveX component) ?


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Mon Oct 21, 2013 4:20 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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).


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Tue Oct 22, 2013 11:48 am 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
What is the problem with SPTI?


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Tue Oct 22, 2013 3:35 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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
            );


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Wed Oct 23, 2013 6:56 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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 2265 times
Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Wed Oct 23, 2013 8:18 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
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:


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Thu Oct 24, 2013 1:44 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Hi!

So .. does it work properly now ? :)

Regards,

Dmitry


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Thu Oct 24, 2013 3:47 pm 
Offline

Joined: Fri Oct 11, 2013 11:23 pm
Posts: 8
Yep, everything is working great now that I'm using StarBurnX!


Top
 Profile  
 
 Post subject: Re: StarBurn_GetDeviceLetter() fails when using internal name
PostPosted: Thu Oct 24, 2013 4:23 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Ok :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group