Skip to content

Latest commit

 

History

History
117 lines (82 loc) · 4.92 KB

nf-cfgmgr32-cm_request_device_ejectw.md

File metadata and controls

117 lines (82 loc) · 4.92 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:cfgmgr32.CM_Request_Device_EjectW
CM_Request_Device_EjectW function (cfgmgr32.h)
The CM_Request_Device_Eject function prepares a local device instance for safe removal, if the device is removable. If the device can be physically ejected, it will be. (Unicode)
CM_Request_Device_Eject
CM_Request_Device_Eject function [Device and Driver Installation]
CM_Request_Device_EjectW
cfgmgr32/CM_Request_Device_Eject
cfgmgr32/CM_Request_Device_EjectW
cfgmgrfn_2c8cc2aa-56fe-4ab3-8063-0db0dcbc3098.xml
devinst.cm_request_device_eject
devinst\cm_request_device_eject.htm
devinst
a73317c8-52e4-4f2c-855c-94259dc77846
12/05/2018
CM_Request_Device_Eject, CM_Request_Device_Eject function [Device and Driver Installation], CM_Request_Device_EjectW, cfgmgr32/CM_Request_Device_Eject, cfgmgr32/CM_Request_Device_EjectW, cfgmgrfn_2c8cc2aa-56fe-4ab3-8063-0db0dcbc3098.xml, devinst.cm_request_device_eject
cfgmgr32.h
Cfgmgr32.h
Desktop
Available in Microsoft Windows 2000 and later versions of Windows.
CM_Request_Device_EjectW (Unicode)
Cfgmgr32.lib
Windows
19H1
CM_Request_Device_EjectW
cfgmgr32/CM_Request_Device_EjectW
c++
APIRef
kbSyntax
LibDef
Cfgmgr32.lib
Cfgmgr32.dll
CM_Request_Device_Eject
CM_Request_Device_EjectW

CM_Request_Device_EjectW function

-description

The CM_Request_Device_Eject function prepares a local device instance for safe removal, if the device is removable. If the device can be physically ejected, it will be.

-parameters

-param dnDevInst [in]

Caller-supplied device instance handle that is bound to the local machine.

-param pVetoType [out, optional]

(Optional.) If not NULL, this points to a location that, if the removal request fails, receives a PNP_VETO_TYPE-typed value indicating the reason for the failure.

-param pszVetoName [out, optional]

(Optional.) If not NULL, this is a caller-supplied pointer to a string buffer that receives a text string. The type of information this string provides is dependent on the value received by pVetoType. For information about these strings, see PNP_VETO_TYPE.

-param ulNameLength [in]

(Optional.) Caller-supplied value representing the length of the string buffer supplied by pszVetoName. This should be set to MAX_PATH.

-param ulFlags [in]

Not used.

-returns

If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.

-remarks

If pszVetoName is NULL, the PnP manager displays a message to the user indicating the device was removed or, if the request failed, identifying the reason for the failure. If pszVetoName is not NULL, the PnP manager does not display a message. (Note, however, that for Microsoft Windows 2000 only, the PnP manager displays a message even if pszVetoName is not NULL, if the device's CM_DEVCAP_DOCKDEVICE capability is set.)

Callers of CM_Request_Device_Eject sometimes require SeUndockPrivilege or SeLoadDriverPrivilege, as follows:

  • If the device's CM_DEVCAP_DOCKDEVICE capability is set (the device is a "dock" device), callers must have SeUndockPrivilege. (SeLoadDriverPrivilege is not required.)
  • If the device's CM_DEVCAP_DOCKDEVICE capability is not set (the device is not a "dock" device), and if the calling process is either not interactive or is running in a multi-user environment in a session not attached to the physical console (such as a remote Terminal Services session), callers of this function must have SeLoadDriverPrivilege.
Privileges are described in the Microsoft Windows SDK documentation.

For information about using device instance handles that are bound to the local machine, see CM_Get_Child.

-see-also

CM_Get_Child

CM_Query_And_Remove_SubTree

CM_Query_And_Remove_SubTree_Ex

CM_Request_Device_Eject_Ex