Vista - Hub Driver - IoDeleteDevice

Hi All,

I am looking for a few good ideas as to what is (or maybe) going wrong with the system. Basically, I have written a hub driver that creates and deletes usb devices on Vista. What is suspect is that whenever I load the Microsoft Hub Driver above and then delete the device I get this error. Every other device class is nice enough to go away without any problem.

I will point out that the DeviceObject that is being deleted is valid at the time of deletion.

Any ideas?

Thank you all in advance,

Cheers,

-Randy

3: kd> !analyze -v

*******************************************************************************

* *

* Bugcheck Analysis *

* *

*******************************************************************************

PAGE_FAULT_IN_NONPAGED_AREA (50)

Invalid system memory was referenced. This cannot be protected by try-except,

it must be protected by a Probe. Typically the address is just plain bad or it

is pointing at freed memory.

Arguments:

Arg1: bad0b1d4, memory referenced.

Arg2: 00000001, value 0 = read operation, 1 = write operation.

Arg3: 81df1968, If non-zero, the instruction address which referenced the bad memory

address.

Arg4: 00000002, (reserved)

Debugging Details:


WRITE_ADDRESS: bad0b1d4

FAULTING_IP:

nt!ObMakeTemporaryObject+31

81df1968 f00fba2800 lock bts dword ptr [eax],0

MM_INTERNAL_CODE: 2

DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT

BUGCHECK_STR: 0x50

PROCESS_NAME: System

CURRENT_IRQL: 0

TRAP_FRAME: 82ce38cc – (.trap 0xffffffff82ce38cc)

ErrCode = 00000002

eax=bad0b1d4 ebx=85805dc0 ecx=bad0b1d4 edx=0000002e esi=85805da8 edi=00000124

eip=81df1968 esp=82ce3940 ebp=82ce394c iopl=0 nv up ei ng nz na pe nc

cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010286

nt!ObMakeTemporaryObject+0x31:

81df1968 f00fba2800 lock bts dword ptr [eax],0 ds:0023:bad0b1d4=???

Resetting default scope

LAST_CONTROL_TRANSFER: from 81cd873f to 81c81760

STACK_TEXT:

82ce343c 81cd873f 00000003 82ce8fcc 00000000 nt!RtlpBreakWithStatusInstruction

82ce348c 81cd91ac 00000003 c05d6858 00000000 nt!KiBugCheckDebugBreak+0x1c

82ce3838 81ca9ef2 00000050 bad0b1d4 00000001 nt!KeBugCheck2+0x5f4

82ce38b4 81c8fa74 00000001 bad0b1d4 00000000 nt!MmAccessFault+0x106

82ce38b4 81df1968 00000001 bad0b1d4 00000000 nt!KiTrap0E+0xdc

82ce394c 81c0c078 85805dc0 8747654c 85805dc0 nt!ObMakeTemporaryObject+0x31

82ce3968 a374b3aa 85805dc0 5f6c6573 00000005 nt!IoDeleteDevice+0x75

82ce39f0 a374b495 85805e78 856fe948 82ce3a20 XXXXXX!DeleteDevice+0x17a [c:\development\drivers\windows\driver_libraries\xxxdevice.c @ 3193]

82ce3a00 a374c99d 85805e78 857953e8 00000002 XXXXXXX! RemoveDevice+0x75 [c:\development\drivers\windows\driver_libraries\xxxdevice.c @ 3242]

82ce3a20 a3741fea 85805dc0 857953e8 00000001 XXXXXXX! DispatchPnp+0xdd [c:\development\drivers\windows\driver_librariesxxxdevice.c @ 4133]

82ce3a4c 81c27ecf 85805dc0 857953e8 857953e8 XXXXXXX !DispatchSwitch+0xea [c:\development\ \drivers\windows\driver_libraries\drvlib\driver.c @ 34]

82ce3a64 8bbedc5e 857954a0 874760e0 857953e8 nt!IofCallDriver+0x63

82ce3a78 8bbd1f7f 87476554 00000000 857954c4 usbhub!UsbhFdoPnp_RemoveDevice+0xe0

82ce3a9c 8bbcdcac 87476028 857953e8 87476028 usbhub!UsbhFdoPnp+0x6f

82ce3ab0 81c27ecf 87476028 857953e8 82ce3b54 usbhub!UsbhGenDispatch+0x63

82ce3ac8 81daf4a9 85805dc0 858087e0 85805dc0 nt!IofCallDriver+0x63

82ce3afc 81daf70f 85805dc0 82ce3b30 00000000 nt!IopSynchronousCall+0xce

82ce3b58 81c06561 85805dc0 00000002 a5ced248 nt!IopRemoveDevice+0xd5

82ce3b84 81da5ced 00000018 a5ced248 00000000 nt!PnpRemoveLockedDeviceNode+0x172

82ce3b9c 81da5f67 00000018 00000000 00000000 nt!PnpDeleteLockedDeviceNode+0x2b

82ce3bcc 81da5c8d 85805dc0 a5ced248 00000002 nt!PnpDeleteLockedDeviceNodes+0x4c

82ce3c04 81da5c0e 85700f18 00000000 81fa4ea0 nt!PnpDelayedRemoveWorker+0x54

82ce3c20 81c06321 85805dc0 00000001 857c9930 nt!PnpChainDereferenceComplete+0xeb

82ce3c4c 81daabc5 87c230c8 00000001 00000000 nt!PnpIsChainDereferenced+0x77

82ce3d04 81daac2b 82ce3d34 00000000 a441c1f8 nt!PnpProcessQueryRemoveAndEject+0xb99

82ce3d1c 81da9793 00000000 81cfde3c 84ea62d8 nt!PnpProcessTargetDeviceEvent+0x38

82ce3d44 81c78e18 88131df8 00000000 84ea62d8 nt!PnpDeviceEventWorker+0x201

82ce3d7c 81e254a8 88131df8 82ce8680 00000000 nt!ExpWorkerThread+0xfd

82ce3dc0 81c9145e 81c78d1b 00000001 00000000 nt!PspSystemThreadStartup+0x9d

00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 9/18/2007 11:53 AM