コード例 #1
0
ファイル: DeviceNode.cs プロジェクト: RichardTang/UCIS.Core
 public String[] GetPropertyStringArray(CMRDP property)
 {
     Byte[] buffer = GetProperty(property);
     if (buffer == null)
     {
         return(null);
     }
     return(SetupApi.GetAsStringArray(buffer, buffer.Length));
 }
コード例 #2
0
ファイル: DeviceNode.cs プロジェクト: RichardTang/UCIS.Core
        public Byte[] GetProperty(CMRDP property)
        {
            uint proplength = 0;
            uint proptype;
            CR   ret = SetupApi.CM_Get_DevNode_Registry_Property(DevInst, property, out proptype, null, ref proplength, 0);

            if (ret == CR.NO_SUCH_VALUE || ret == CR.NO_SUCH_DEVNODE)
            {
                return(null);
            }
            if (ret != CR.BUFFER_SMALL)
            {
                CMException.Throw(ret, "CM_Get_DevNode_Registry_Property");
            }
            Byte[] propbuffer = new Byte[proplength];
            ret = SetupApi.CM_Get_DevNode_Registry_Property(DevInst, property, out proptype, propbuffer, ref proplength, 0);
            CMException.Throw(ret, "CM_Get_DevNode_Registry_Property");
            if (propbuffer.Length > proplength)
            {
                Array.Resize(ref propbuffer, (int)proplength);
            }
            return(propbuffer);
        }
コード例 #3
0
ファイル: SetupApi.cs プロジェクト: UCIS/UCIS.Core
 public static extern CR CM_Get_DevNode_Registry_Property(UInt32 dnDevInst, CMRDP ulProperty, out UInt32 pulRegDataType, Byte[] Buffer, ref UInt32 pulLength, UInt32 ulFlags);