Group: PnP Configuration Manager - Library: setupapi
Disconnecting USB Mass Storage Device programmatically
CMAPI CONFIGRET WINAPI
CM_Request_Device_Eject_Ex (
IN DEVINST dnDevInst,
OUT PPNP_VETO_TYPE pVetoType,
OUT LPTSTR pszVetoName,
IN ULONG ulNameLength,
IN ULONG ulFlags,
IN HMACHINE hMachine
);
DECLARE INTEGER CM_Request_Device_Eject_Ex IN setupapi;
INTEGER dnDevInst,;
INTEGER pVetoType,;
INTEGER pszVetoName,;
LONG ulNameLength,;
LONG ulFlags,;
INTEGER hMachine
dnDevInst Caller-supplied device instance handle that is bound to the machine handle supplied by hMachine.
pVetoType (Optional.) Can be set to NULL.
pszVetoName (Optional.) Can be set to NULL.
ulNameLength (Optional.) Caller-supplied value representing the length of the string buffer supplied by pszVetoName. This should be set to MAX_PATH.
ulFlags Not used.
hMachine Caller-supplied machine handle to which the caller-supplied device instance handle is bound.
If the operation succeeds, the function returns CR_SUCCESS (0).
Initially I expected the function to be located in cfgmgr32.dll not in setupapi.dll.