PRB: OSR 2.1/2.5 - IoDeleteDevice() Might Cause Blue Screen
PSS ID Number: 186758
Article Last Modified on 10/20/2003
The information in this article applies to:
- Microsoft Win32 Device Development Kit (DDK) for Windows 95, when used with:
- the operating system: Microsoft Windows 95
This article was previously published under Q186758
SYMPTOMS
Under OSR 2.1 and OSR 2.5, when you call the WDM service IoDeleteDevice()
for a device object with one or more open file handles a blue-screen
BugCheck error of 36 occurs.
CAUSE
Under OSR 2.1 and OSR 2.5, when you unplug a USB device its WDM device
driver receives a IRP_MN_REMOVE_DEVICE IRP. In response to this IRP, a WDM
driver typically calls IoDeleteDevice() for its device object. If there are
open file handles for the device object, IoDeleteDevice() produces a
BugCheck blue-screen with an error code of DEVICE_REFERENCE_COUNT_NOT_ZERO
(36h).
RESOLUTION
To work around this behavior, a WDM driver must defer deletion of the
device object until all open file handles for the device object have been
closed.
STATUS
This behavior is by design. This behavior does not occur in Windows 98.
Additional query words: kbDSupport kbdsh KeBugCheckEx kbNoKeyword USB WDM
Keywords: kbprb KB186758
Technology: kbAudDeveloper kbOSWin95 kbOSWinSearch kbWin32DDKSearch kbWin32sSearch kbWinDDKSearch