Another test, x64 only because of HotPlug.dll =>
(change the DeviceInstanceId...)
// #include <Cfgmgr32.h>
typedef CONFIGRET(WINAPI* HPED)(HWND hWnd, PCWSTR DeviceInstanceId, DWORD dwFlags);
HPED HotPlugEjectDevice = NULL;
HMODULE hDLL = LoadLibrary(TEXT("HotPlug.dll"));
if (hDLL != NULL)
{
HotPlugEjectDevice = (HPED)GetProcAddress(hDLL, "HotPlugEjectDevice");
if (HotPlugEjectDevice)
{
CONFIGRET cr = HotPlugEjectDevice(NULL, TEXT("USB\\VID_1058&PID_1001\\574341505734363536363133"), 0);
// Test cr...
}
}