Re: W2K's BulkUsb example causes an error when discon nect a device

>Also, as disconneting, pnp routine is called in the order of

IRP_MN_SURPRISE_REMOVAL -> IRP_MN_REMOVE, but isn’t called
IRP_MN_QUERY_REMOVE. Is this right?=20 When does IRP_MN_QUERY_REMOVE?
Is this related to above warning =
message?

You’ll get the _QUERY_REMOVE->_REMOVE sequence on a “graceful” remove (
theory being that you can fail a _QUERY_REMOVE should you have some reason
to). However, if your hardware gets unceremoniously yanked out you don’t
have much of a choice about whether or not it can be removed so you’ll get
the _SURPRISE_REMOVAL->_REMOVE sequence (which you can’t fail).

-scott

----- Original Message -----
From: “Bill McKenzie”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Wednesday, July 10, 2002 2:13 PM
Subject: [ntdev] Re: W2K’s BulkUsb example causes an error when disconnect a
device

> Do NOT bother setting the SurpriseRemovalOK field to TRUE in your dispatch
> routine, as this will do nothing. Rather, stick a completion routine in
the
> IRP, and in your completion routine set the SurpriseRemovalOK field to
TRUE.
> This is a bug in the USB stack in that the USB bus drivers do not check
this
> field to see what is set by higher drivers in the stack.
>
> Also, this sample could be better. One thing you should definitely
consider
> is using a lookaside list for the URBs you allocate memory for in your
> driver. This list will minimize fragmention of NonPagedPool memory caused
> by your driver.
>
> –
> Bill McKenzie
>
>
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev…
>
> When you get the query device capabilities irp in your PNP dispatch
routine,
> set the SurpriseRemovalOK field to TRUE. This indicates that the device
> need not be stopped before hot removing it.
>
> D
>
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> -----Original Message-----
> From: HyungJune Kim [mailto:xxxxx@hynix.com]
> Sent: Tuesday, July 09, 2002 2:58 AM
> To: NT Developers Interest List
> Subject: [ntdev] W2K’s BulkUsb example causes an error when disconnect a
> device
>
> Hi Guru,
>
> I have a USB device which transfers data in BULK mode.
>
> I use W2K DDK’s “bulkusb” example.
>
> The problem is
> when I disconnect the device, following error message always occurrs.
>
> “You removed a device without stopping. You should stop the device
> before remove.”
>
> So I haven’t seen PnP for this device.
>
> I didn’t modify the source.
> I’m wondering if the “bulkusb” example has bugs.
>
> If you know why, please let me know.
> Any help would be appreciated!
>
> Regards,
> HyungJune Kim
>
>
>
>
>
> b?떴췾탂?즷쾟▷?i엏♡u??
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hynix.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
b떄?.?㎍\Ч??&??'뒀칓u音▧蘗d翁{.n?+돴촾wZnV쭛??h뺞칬{]z??b꾼(껭(