Exemplo n.º 1
0
        public String[] GetInterfaces(Guid classGuid)
        {
            uint len;
            CR   ret = SetupApi.CM_Get_Device_Interface_List_Size(out len, ref classGuid, DeviceID, 0);

            CMException.Throw(ret, "CM_Get_Device_Interface_List_Size");
            if (len <= 1)
            {
                return(null);
            }
            Byte[] buffer = new Byte[2 * len];
            ret = SetupApi.CM_Get_Device_Interface_List(ref classGuid, DeviceID, buffer, len, 0);
            CMException.Throw(ret, "CM_Get_Device_Interface_List");
            return(SetupApi.GetAsStringArray(buffer, 2 * (int)len));
        }