Win 2000 SP4
I use a service application to call CM_Request_Device_Eject on an USB
stick as soon as the WM_DEVICECHANGE DBT_DEVICE_ARRIVAL was received.

CM_Request_Device_Eject returns CR_ACCESS_DENIED with an empty veto
buffer. GetLastError talks about an overlapped IO in progress.
Trying repeatedly for 40 secs sleeping 200 msecs each time does not
change anything.

It works fine for a normal application.

Re: CM_Request_Device_Eject problem by Eliyas

Eliyas
Sun Feb 13 10:17:35 CST 2005

Is you service running in the context of Local System Account?

--
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/driver/default.mspx
http://www.microsoft.com/whdc/driver/kernel/KB-drv.mspx



Re: CM_Request_Device_Eject problem by Marc

Marc
Sat Feb 12 21:10:45 CST 2005

If your process is not interactive and the device's CM_DEVCAP_DOCKDEVICE is
not set, you need SeLoadDriverPrivilege.

Marc Reinig
System Solutions

"Robert Marquardt" <robert_marquardt@gmx.de> wrote in message
news:OzcYf9SEFHA.560@TK2MSFTNGP15.phx.gbl...
> Win 2000 SP4
> I use a service application to call CM_Request_Device_Eject on an USB
> stick as soon as the WM_DEVICECHANGE DBT_DEVICE_ARRIVAL was received.
>
> CM_Request_Device_Eject returns CR_ACCESS_DENIED with an empty veto
> buffer. GetLastError talks about an overlapped IO in progress.
> Trying repeatedly for 40 secs sleeping 200 msecs each time does not change
> anything.
>
> It works fine for a normal application.



Re: CM_Request_Device_Eject problem by Robert

Robert
Mon Feb 14 01:47:35 CST 2005

Marc Reinig wrote:

> If your process is not interactive and the device's CM_DEVCAP_DOCKDEVICE is
> not set, you need SeLoadDriverPrivilege.

The process is interactive (i need it to show the GetLastError etc).
I will see what i can do about the privilege.

Re: CM_Request_Device_Eject problem by Robert

Robert
Mon Feb 14 01:49:06 CST 2005

Another problem i have is that it can take up to 30 secs to complete
CM_Request_Device_Eject. Using it interactively (normal eject tray icon)
works much faster.