When I told them to stop, the window popped up saying "trying to stop USB Devices" (that should probably say "Trying to stop Device(s)" ... since its capable of more than usb now.
Anyway, once the window popped up, it just sat there. The program was not "unresponsive" persay, because I could still cancel it at any time. However, it WAS stuck in some very long retry loop. Upon a closer look at the log, it appears that it was a permission problem.
First off, you should be able to detect if permission is denied, and give a warning. Secondly, I found you a couple documents about how to code your app to invoke admin level access temporarilly.
1. http://developersoven.blogspot.com/2007 ... -part.html
2. http://pascalfonteneau.developpez.com/a ... Delphi.pdf
Basicly, you need to execute one section of your program in a separate dll/exe (i didn't read it thouroughly) and when that dll/exe is called in a certian way, it will call the UAC box. It may be possible to call your own exe file again, but it looked like it was a compiled in option, so second exe/dll may be required.
here is the exact error:
Code: Select all
12.07.2008 15:24:44:020 -------------------------------------------------------- New exception: Delphi exception, type Exception, message: Os Error: 5 (Access is denied) Exception code: 250477278 Exception flags: 3 Number of parameters: 7 (no debug info) Find error: 75FE42EB call stack - 0 : (no debug info) Find error: 0052B8CF call stack - 1 : (no debug info) Find error: 0052E270 call stack - 2 : (no debug info) Find error: 0052D138 call stack - 3 : (no debug info) Find error: 0052D2D3 call stack - 4 : (no debug info) Find error: 00532734 call stack - 5 : (no debug info) Find error: 00429C55 call stack - 6 : (no debug info) Find error: 004052FE call stack - 7 : (no debug info) Find error: 75FE490D call stack - 8 : (no debug info) Find error: 76F8E4B2 call stack - 9 : (no debug info) Find error: 76F8E485 call stack - 10 : (no debug info) Find error: FFFFFFFC
Code: Select all
12.07.2008 15:24:44:019 -------------------------------------------------------- New exception: Exception code: 2460516 Exception flags: 1677721600 Number of parameters: 1360477 (no debug info) Find error: E58B0000
You have made up for that with a routine that will re-enable certian drives that have been previously ejected. When the drive is reinserted, the program says the device is "returned" at this time the program "re-enables it" ... was it not possible to do the "uninstall" option? if it was, it would be one less step to potentially cause problems. (see later)
Imagine that re-enable routine not activating, and some angry user gets on the forum, or emails you threatening to sue, because his drive has been "broken" by your software... yes, it is VERY easily fixed (by re-enabling in device manager) ... but the angry user doesn't know that.
At very least you should add a comment about re-enabling in device manager if anything goes wrong to the initial warning about stopping an unsupported device.
Speaking of, sorry for making this really long, but I just found one such bug in the re-enable routine. It sametimes does not remember it re-enabled the drive. I just ejected the same device twice (eject, power down, insert, eject) and it reenabled it instantly... before I had a chance to power it down. This may be due to the failed ejects made earlier as that did not have permissions. I tried it once or twice more, and it seemed to function correctly.