i am calling IoVolumeDeviceToDosName from InstanceSetup routine. It’s working fine for all the USB hard disks.
But i encountered a problem with Seagate USB hard disk only on Windows XP SP2. The “Safely Remove Hardware” icon
in the system tray becomes unresponsive whenever i plug in that USB hard disk.
i also checked with swapbuffers sample in wdk which calls RtlVolumeDeviceToDosName from InstanceSetup routine.
it also produces the same problem.
i checked with !locks command which produces following output
kd> !thread 822667a0
THREAD 822667a0 Cid 07b4.07d8 Teb: 7ffdc000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
8233fe54 Semaphore Limit 0x1
IRP List:
845def68: (0006,0094) Flags: 40000070 Mdl: 00000000
82a32e70: (0006,0190) Flags: 40000884 Mdl: 00000000
Not impersonating
DeviceMap e1004460
Owning Process 0 Image:
Attached Process 81ef7190 Image: FreeAgentService.exe
Wait Start TickCount 41390 Ticks: 7680 (0:00:02:00.000)
Context Switch Count 444
UserTime 00:00:00.000
KernelTime 00:00:00.234
Win32 Start Address 0x00409510
Start Address 0x7c810856
Stack Init ba319000 Current ba318500 Base ba319000 Limit ba316000 Call 0
Priority 14 BasePriority 8 PriorityDecrement 6 DecrementCount 16
ChildEBP RetAddr Args to Child
ba318518 8050017a 82266810 822667a0 804f99be nt!KiSwapContext+0x2e (FPO: [Uses EBP] [0,0,4])
ba318524 804f99be 00000000 8233fe38 845def68 nt!KiSwapThread+0x46 (FPO: [0,0,0])
ba31854c f84b7d5e 00000000 00000000 00000000 nt!KeWaitForSingleObject+0x1c2 (FPO: [5,5,4])
ba318578 804eddf9 845defd8 8233fe54 806d02e8 MountMgr!MountMgrDeviceControl+0x2e (FPO: [2,1,4])
ba318588 8064b5a8 00000103 00000200 00000000 nt!IopfCallDriver+0x31 (FPO: [0,0,0])
ba3185ac 804f0be3 00000000 ba318854 00000000 nt!IovCallDriver+0xa0 (FPO: [0,4,0])
ba3187fc ba525768 821d1220 81871c88 80531934 nt!IoVolumeDeviceToDosName+0x155 (FPO: [2,143,4])
ba318820 bae45121 ba318854 00000005 00000008 mydrv!MyInstanceSetup+0xd8 (FPO: [Non-Fpo]) (CONV: stdcall)
ba318838 bae3cebb ba318854 00000005 00000008 fltMgr!FltvInstanceSetup+0x1b (FPO: [4,0,0])
ba31886c bae3d442 821e6c10 00000005 80544080 fltMgr!FltpDoInstanceSetupNotification+0x4b (FPO: [2,6,4])
ba3188cc bae3d7cd 81da7248 81feac10 00000005 fltMgr!FltpInitInstance+0x272 (FPO: [Non-Fpo])
ba31893c bae3d8d8 81da7248 81feac10 00000005 fltMgr!FltpCreateInstanceFromName+0x295 (FPO: [7,17,0])
ba3189a4 bae4482d 81da7248 81feac10 00000005 fltMgr!FltpEnumerateRegistryInstances+0xf4 (FPO: [Non-Fpo])
ba3189f4 bae3c0da 81feac10 82288ee8 81e4a918 fltMgr!FltpDoFilterNotificationForNewVolume+0xf5 (FPO: [Non-Fpo])
ba318a28 804eddf9 82288ee8 82a32fdc 806d02e8 fltMgr!FltpCreate+0x16a (FPO: [2,7,4])
ba318a38 8064b5a8 82a32e80 82a32e70 8211e038 nt!IopfCallDriver+0x31 (FPO: [0,0,0])
ba318a5c 805773bc 821d1208 81dc0ebc ba318c04 nt!IovCallDriver+0xa0 (FPO: [0,4,0])
ba318b3c 805b365e 821d1220 00000000 81dc0e18 nt!IopParseDevice+0xa58 (FPO: [Non-Fpo])
ba318bc4 805afb3f 00000000 ba318c04 00000040 nt!ObpLookupObjectName+0x56a (FPO: [11,19,4])
ba318c18 8056a133 00000000 00000000 5b534101 nt!ObOpenObjectByName+0xeb (FPO: [7,5,4])
ba318c94 8056aaaa 00bca90c c0100080 00bca8ac nt!IopCreateFile+0x407 (FPO: [Non-Fpo])
ba318cf0 8056d17c 00bca90c c0100080 00bca8ac nt!IoCreateFile+0x8e (FPO: [14,3,0])
ba318d30 8053c808 00bca90c c0100080 00bca8ac nt!NtCreateFile+0x30 (FPO: [11,0,0])
ba318d30 7c90eb94 00bca90c c0100080 00bca8ac nt!KiFastCallEntry+0xf8 (FPO: [0,0] TrapFrame @ ba318d64)
WARNING: Frame IP not in any known module. Following frames may be wrong.
00bca904 00000000 00000000 00000000 00000000 0x7c90eb94
kd> !thread 8235d3c8
THREAD 8235d3c8 Cid 0004.0038 Teb: 00000000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
81e13288 SynchronizationEvent
8235d4b8 NotificationTimer
Not impersonating
DeviceMap e1004460
Owning Process 0 Image:
Attached Process 8235f660 Image: System
Wait Start TickCount 48923 Ticks: 147 (0:00:00:02.296)
Context Switch Count 844
UserTime 00:00:00.000
KernelTime 00:00:00.546
Start Address nt!ExpWorkerThread (0x80533cd0)
Stack Init f88ff000 Current f88fe528 Base f88ff000 Limit f88fc000 Call 0
Priority 12 BasePriority 12 PriorityDecrement 0 DecrementCount 16
ChildEBP RetAddr Args to Child
f88fe540 8050017a 8235d438 8235d3c8 804f99be nt!KiSwapContext+0x2e (FPO: [Uses EBP] [0,0,4])
f88fe54c 804f99be 00000000 822ac10c 8235d3c8 nt!KiSwapThread+0x46 (FPO: [0,0,0])
f88fe574 80531544 00000000 00000000 00000000 nt!KeWaitForSingleObject+0x1c2 (FPO: [5,5,4])
f88fe5b0 805319a3 822ac000 81b29430 f88fe5dc nt!ExpWaitForResource+0xd2 (FPO: [0,5,0])
f88fe5c0 bae44466 822ac10c 00000001 81883d00 nt!ExAcquireResourceExclusiveLite+0x6f (FPO: [2,0,0])
f88fe5dc bae37820 81b29430 822ac10c 00000000 fltMgr!FltpLinkVolume+0x6a (FPO: [2,0,4])
f88fe638 bae3beb4 81ade770 81883c48 82103020 fltMgr!FltpAttachDeviceObject+0xf4 (FPO: [Non-Fpo])
f88fe6b4 bae3c1b8 82103020 82cf4de0 81e4a918 fltMgr!FltpFsControlMountVolume+0x1de (FPO: [Non-Fpo])
f88fe6e0 804eddf9 82103020 82cf4de0 806d02e8 fltMgr!FltpFsControl+0x58 (FPO: [2,6,4])
f88fe6f0 8064b5a8 818fbd58 82cf4de0 82103020 nt!IopfCallDriver+0x31 (FPO: [0,0,0])
f88fe714 80575da7 f88fe864 806d0298 818fbd58 nt!IovCallDriver+0xa0 (FPO: [0,4,0])
f88fe764 804f4009 c000014f f88fe800 00000000 nt!IopMountVolume+0x1b9 (FPO: [5,15,0])
f88fe794 80576d2a 822c41e0 818fbd58 f88fe8c8 nt!IopCheckVpbMounted+0x5b (FPO: [4,2,4])
f88fe884 805b365e 818fbd58 00000000 81e6d008 nt!IopParseDevice+0x3c6 (FPO: [Non-Fpo])
f88fe90c 805afb3f 00000000 f88fe94c 00000240 nt!ObpLookupObjectName+0x56a (FPO: [11,19,4])
f88fe960 8056a133 00000000 00000000 00000000 nt!ObOpenObjectByName+0xeb (FPO: [7,5,4])
f88fe9dc 8056aaaa f88feb84 0012019f f88feb5c nt!IopCreateFile+0x407 (FPO: [Non-Fpo])
f88fea38 8056d17c f88feb84 0012019f f88feb5c nt!IoCreateFile+0x8e (FPO: [14,3,0])
f88fea78 8053c808 f88feb84 0012019f f88feb5c nt!NtCreateFile+0x30 (FPO: [11,0,0])
f88fea78 804fd569 f88feb84 0012019f f88feb5c nt!KiFastCallEntry+0xf8 (FPO: [0,0] TrapFrame @ f88feaac)
f88feb1c f84b10c8 f88feb84 0012019f f88feb5c nt!ZwCreateFile+0x11 (FPO: [11,0,0])
f88feb88 f84b4ca5 e1e2d901 00000000 82103a88 MountMgr!OpenRemoteDatabase+0xf8 (FPO: [2,11,4])
f88fed0c f84af45b 82103a9c 81d71688 8233fd80 MountMgr!ReconcileThisDatabaseWithMasterWorker+0x11d (FPO: [1,90,4])
f88fed60 8056abd5 8233fd80 8233fe38 8055a1fc MountMgr!WorkerThread+0x111 (FPO: [2,15,4])
f88fed74 80533dd0 81d71688 00000000 8235d3c8 nt!IopProcessWorkItem+0x13 (FPO: [1,0,4])
f88fedac 805c4a28 81d71688 00000000 00000000 nt!ExpWorkerThread+0x100 (FPO: [1,8,0])
f88feddc 80540fa2 80533cd0 00000001 00000000 nt!PspSystemThreadStartup+0x34 (FPO: [Non-Fpo])
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
Has anyone encountered such problem?? any pointers will be appreciated.