public String[] GetPropertyStringArray(CMRDP property) { Byte[] buffer = GetProperty(property); if (buffer == null) { return(null); } return(SetupApi.GetAsStringArray(buffer, buffer.Length)); }
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); }
public static extern CR CM_Get_DevNode_Registry_Property(UInt32 dnDevInst, CMRDP ulProperty, out UInt32 pulRegDataType, Byte[] Buffer, ref UInt32 pulLength, UInt32 ulFlags);