Desktop Functions: Smart Device Functions:
|
CM_Get_Device_ID_List_Size (setupapi)
C# Signature:[DllImport("setupapi.dll")] static extern int CM_Get_Device_ID_List_Size(ref uint idListlen, int dnDevInst, uint ulFlags); VB Signature:
Declare Function CM_Get_Device_ID_List_Size Lib "setupapi.dll" (TODO) As TODO User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:None. Tips & Tricks:Please add some! Sample Code:const ulong CM_GETIDLIST_FILTER_PRESENT = 0x00000100; uint idListLen = 0; string filter = null; List<string> deviceInstanceIdStrs = new List<string>(); int cmRet = CM_Get_Device_ID_List_Size(ref idListLen, 0, (uint)CM_GETIDLIST_FILTER_PRESENT); if (0 == cmRet) {
byte[] data = new byte[idListLen]; } return deviceInstanceIdStrs; ///-------------------------------------------------------------------- /// <summary> /// Converts a buffer of raw bytes into a list of strings /// </summary> /// <param name="rawData"> /// Buffer of raw data /// </param> /// <returns> /// The list of strings extracted from the buffer /// </returns> ///-------------------------------------------------------------------- public List<string> BytesToStrings(byte[] rawData) {
int limit = rawData.Length; // Set Max } Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|