阅读:969回复:1
那位高手帮我看看这段代码阿??T_T
HMACHINE m_hMachine;
CONFIGRET cr; cr = CM_Connect_Machine(\"\\\\\\\\super\", &m_hMachine);//计算机名称 HDEVINFO DeviceInfoSet; DeviceInfoSet = SetupDiCreateDeviceInfoListEx(NULL, NULL,\"\\\\\\\\super\",NULL); hDevInfo = SetupDiGetClassDevsEx((LPGUID) &GUID_CLASS_USB_DEVICE, 0, 0, DIGCF_PRESENT, DeviceInfoSet, \"super\", NULL); for (i=0;SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData) ;i++) { ………… cr = CM_Get_DevNode_Status_Ex( &ulStatus, &ulProblemNumber, DeviceInfoData.DevInst, 0, m_hMachine); if ( CR_SUCCESS == cr ) { …… } else { …… } if ((DN_DISABLEABLE & ulStatus ) != 0 ) { …… } else { continue; } if ((DN_REMOVABLE & ulStatus ) != 0 ) { …… } else { continue; } cr = CM_Request_Device_Eject_Ex( DeviceInfoData.DevInst, &pnpvietotype, vetoname, len, 0, m_hMachine); if ( CR_SUCCESS == cr ) { …… } else { …… } } SetupDiDestroyDeviceInfoList(hDevInfo); CM_Disconnect_Machine(m_hMachine); 这是代码,可以断本机的usb设备,但是对远程的控制中,SetupDiEnumDeviceInfo这个函数读取的时候还是正确的,但到了CM_Get_DevNode_Status_Ex这个函数就不正确的,返回的是错误代码是CR_INVALID_DEVNODE,就是说DeviceInfoData.DevInst是无效的,哪位高手告诉我,这是怎么回事阿?? |
|
沙发#
发布于:2005-03-21 13:16
为什么没有人回阿??高手在哪里阿??我自己顶一下 :( :( :(
|
|