Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "CM_Request_Device_Eject" in [All]

setupapi

.
Summary
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.
.

static extern int CM_Request_Device_EjectA(int dnDevInst, ref int pVetoType, StringBuilder pszVetoName, int ulNameLength, int ulFlags);

.
Documentation
CM_Request_Device_Eject @msdn on MSDN
.

    static extern int CM_Request_Device_Eject(UInt32 devinst, out PNP_VETO_TYPE pVetoType, System.Text.StringBuilder pszVetoName, int ulNameLength, int ulFlags);

.

Declare Function CM_Request_Device_Eject Lib "setupapi.dll" (TODO) As TODO

.

    CM_Request_Device_Eject_NoUi also can be used to eject a device. It has the same signature too.

.

        bool success = (CR_SUCCESS == CM_Request_Device_Eject(devinst, out pnp_veto_type, sb, sb.Capacity, 0));

.

           CM_Request_Device_Eject_NoUi((int)USBData.DevInst, IntPtr.Zero, null, 0, 0); // USBData, a SP_DEVINFO_DATA structure.

.

           int hr = CM_Request_Device_Eject((int)USBData.DevInst, out veto, sb, sb.Capacity, 0);

.
Documentation
[CM_Request_Device_Eject] on MSDN

 
Access PInvoke.net directly from VS: