另一种选择是将MS OS Descriptor 添加到设备固件中。您可以通过该描述符修改您需要的注册表属性。
所有必要的信息都可以在spec 中找到。以下是此类描述符的外观。
const uint8_t msOs20DescriptorSet[10 + 76 + 6] =
{
//
// Microsoft OS 2.0 Descriptor Set Header
//
0x0A, 0x00, // wLength - 10 bytes
0x00, 0x00, // wDescriptorType, MSOS20_SET_HEADER_DESCRIPTOR
0x00, 0x00, 0x03, 0x06, // dwWindowsVersion – 0x06030000 for Windows Blue
0x5C, 0x00, // wTotalLength – 92 bytes
//
// Microsoft OS 2.0 Registry Value Feature Descriptor
//
0x4C, 0x00, // wLength - 76 bytes
0x04, 0x00, // wDescriptorType – 4 for Registry Property
0x04, 0x00, // wPropertyDataType - 4 for REG_DWORD
0x3E, 0x00, // wPropertyNameLength – 62 bytes
'E', 0, // Property Name - EnhancedPowerManagementEnabled
'n', 0,
'h', 0,
'a', 0,
'n', 0,
'c', 0,
'e', 0,
'd', 0,
'P', 0,
'o', 0,
'w', 0,
'e', 0,
'r', 0,
'M', 0,
'a', 0,
'n', 0,
'a', 0,
'g', 0,
'e', 0,
'm', 0,
'e', 0,
'n', 0,
't', 0,
'E', 0,
'n', 0,
'a', 0,
'b', 0,
'l', 0,
'e', 0,
'd', 0,
0, 0,
0x04, 0x00, // wPropertyDataLength – 4 bytes
0x00, 0x00, 0x00, 0x00, // PropertyData - 0x00000000
// Microsoft OS 2.0 vendor revision descriptor
0x06, 0x00, // wLength - 6 bytes
0x08, 0x00, // wDescriptorType, MS_OS_20_FEATURE_VENDOR_REVISION
0x01, 0x00, /* VendorRevision, if this value changes between enumerations the registry
property descriptors will be updated in registry during that enumeration. */
};