Surprise Removal on Windows 98

Hello:
I am developing USB PC camera video driver for Windows 98. I use
the following Win2000 DDK sample to develop:
NTDDK\src\wdm\videocap\usbintel
NTDDK\src\wdm\videocap\usbcamd

I encounter a problem, when I play video with “Amcap.exe”, and I
unplug the USB cable of video device, the system sometimes be hung.
How should I solve this problem? Should I handle
“SRB_SURPRISE_REMOVAL” ? Or where is the sample of “usbcamd” to solve it?

Any hints, tips, URLs, comments greatly appreciated!

Best Regards,
Gordon


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Gordon,
Win98 doesnot handle IRP_MN_SURPRISE_REMOVAL,
so that is not the problem. The problem could be that
in the IRP_MN_REMOVE_DEVICE handler, generally as a
good design, we wait for the processing of all the
IRPs and then only go forward removing the device and
this would be done using the cancel spinlock.
So to handle the current situation, you need to cancel
all the out standing IRPs and then release the cancel
spinlock so that the removal is complete.

This is the reason for hanging the system.

Cheers,
Jay

— xxxxx@sunplus.com.tw wrote:

Hello:
I am developing USB PC camera video driver
for Windows 98. I use
the following Win2000 DDK sample to develop:
NTDDK\src\wdm\videocap\usbintel
NTDDK\src\wdm\videocap\usbcamd

I encounter a problem, when I play video
with “Amcap.exe”, and I
unplug the USB cable of video device, the system
sometimes be hung.
How should I solve this problem? Should I
handle
“SRB_SURPRISE_REMOVAL” ? Or where is the sample of
“usbcamd” to solve it?

Any hints, tips, URLs, comments greatly
appreciated!

Best Regards,
Gordon


You are currently subscribed to ntdev as:
xxxxx@yahoo.com
To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com