From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/cfgmgr32/cfgmgr32.c | 127 ++++++++++++++++++ dlls/cfgmgr32/cfgmgr32.spec | 8 +- dlls/cfgmgr32/tests/cfgmgr32.c | 229 +++++++++++++++++++++++++++++++++ 3 files changed, 360 insertions(+), 4 deletions(-) diff --git a/dlls/cfgmgr32/cfgmgr32.c b/dlls/cfgmgr32/cfgmgr32.c index ac194614645..280f10dd4db 100644 --- a/dlls/cfgmgr32/cfgmgr32.c +++ b/dlls/cfgmgr32/cfgmgr32.c @@ -575,6 +575,79 @@ static LSTATUS open_device_key( HKEY root, const struct device *dev, REGSAM acce return open_enum_key( root, path, access, open, hkey ); } +static const struct property_desc device_properties[] = +{ + /* ansi-compatible CM_DRP properties */ + { &DEVPKEY_Device_DeviceDesc, DEVPROP_TYPE_STRING, L"DeviceDesc" }, + { &DEVPKEY_Device_HardwareIds, DEVPROP_TYPE_STRING_LIST, L"HardwareId" }, + { &DEVPKEY_Device_CompatibleIds, DEVPROP_TYPE_STRING_LIST, L"CompatibleIDs" }, + { &DEVPKEY_Device_Service, DEVPROP_TYPE_STRING, L"Service" }, + { &DEVPKEY_Device_Class, DEVPROP_TYPE_STRING, L"Class" }, + { &DEVPKEY_Device_ClassGuid, DEVPROP_TYPE_GUID, L"ClassGuid" }, + { &DEVPKEY_Device_Driver, DEVPROP_TYPE_STRING, L"Driver" }, + { &DEVPKEY_Device_ConfigFlags, DEVPROP_TYPE_UINT32, L"ConfigFlags" }, + { &DEVPKEY_Device_Manufacturer, DEVPROP_TYPE_STRING, L"Mfg" }, + { &DEVPKEY_Device_FriendlyName, DEVPROP_TYPE_STRING, L"FriendlyName" }, + { &DEVPKEY_Device_LocationInfo, DEVPROP_TYPE_STRING, L"LocationInformation" }, + { &DEVPKEY_Device_PDOName, DEVPROP_TYPE_STRING, L"PDOName" }, + { &DEVPKEY_Device_Capabilities, DEVPROP_TYPE_UINT32, L"Capabilities" }, + { &DEVPKEY_Device_UINumber, DEVPROP_TYPE_UINT32, L"UINumber" }, + { &DEVPKEY_Device_UpperFilters, DEVPROP_TYPE_STRING_LIST, L"UpperFilters" }, + { &DEVPKEY_Device_LowerFilters, DEVPROP_TYPE_STRING_LIST, L"LowerFilters" }, + { &DEVPKEY_Device_BusTypeGuid, DEVPROP_TYPE_GUID, L"BusTypeGuid" }, + { &DEVPKEY_Device_LegacyBusType, DEVPROP_TYPE_UINT32, L"LegacyBusType" }, + { &DEVPKEY_Device_BusNumber, DEVPROP_TYPE_UINT32, L"BusNumber" }, + { &DEVPKEY_Device_EnumeratorName, DEVPROP_TYPE_STRING, L"EnumeratorName" }, + { &DEVPKEY_Device_Security, DEVPROP_TYPE_SECURITY_DESCRIPTOR, L"Security" }, + { &DEVPKEY_Device_SecuritySDS, DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING, L"SecuritySDS" }, + { &DEVPKEY_Device_DevType, DEVPROP_TYPE_UINT32, L"DevType" }, + { &DEVPKEY_Device_Exclusive, DEVPROP_TYPE_BOOLEAN, L"Exclusive" }, + { &DEVPKEY_Device_Characteristics, DEVPROP_TYPE_UINT32, L"Characteristics" }, + { &DEVPKEY_Device_Address, DEVPROP_TYPE_UINT32, L"Address" }, + { &DEVPKEY_Device_UINumberDescFormat, DEVPROP_TYPE_STRING, L"UINumberDescFormat" }, + { &DEVPKEY_Device_PowerData, DEVPROP_TYPE_BINARY, L"PowerData" }, + { &DEVPKEY_Device_RemovalPolicy, DEVPROP_TYPE_UINT32, L"RemovalPolicy" }, + { &DEVPKEY_Device_RemovalPolicyDefault, DEVPROP_TYPE_UINT32, L"RemovalPolicyDefault" }, + { &DEVPKEY_Device_RemovalPolicyOverride, DEVPROP_TYPE_UINT32, L"RemovalPolicyOverride" }, + { &DEVPKEY_Device_InstallState, DEVPROP_TYPE_UINT32, L"InstallState" }, + { &DEVPKEY_Device_LocationPaths, DEVPROP_TYPE_STRING_LIST, L"LocationPaths" }, + { &DEVPKEY_Device_BaseContainerId, DEVPROP_TYPE_GUID, L"BaseContainerId" }, +}; + +static LSTATUS query_device_property( HKEY hkey, struct property *prop ) +{ + for (UINT i = 0; i < ARRAY_SIZE(device_properties); i++) + { + const struct property_desc *desc = device_properties + i; + if (memcmp( desc->key, &prop->key, sizeof(prop->key) )) continue; + if (!desc->name) return query_property( hkey, L"Properties\\", desc->type, prop ); + return query_named_property( hkey, desc->name, desc->type, prop ); + } + + if (!memcmp( &DEVPKEY_Device_DeviceDesc, &prop->key, sizeof(prop->key.fmtid) )) + { + FIXME( "property %#lx not implemented\n", prop->key.pid - 1 ); + return ERROR_UNKNOWN_PROPERTY; + } + + return query_property( hkey, L"Properties\\", DEVPROP_TYPE_EMPTY, prop ); +} + +static LSTATUS get_device_property( HKEY root, const struct device *dev, struct property *prop ) +{ + LSTATUS err; + HKEY hkey; + + if (!(err = open_device_key( root, dev, KEY_QUERY_VALUE, TRUE, &hkey ))) + { + err = query_device_property( hkey, prop ); + RegCloseKey( hkey ); + } + + if (err && err != ERROR_MORE_DATA) *prop->size = 0; + return err; +} + static CRITICAL_SECTION devnode_cs; static CRITICAL_SECTION_DEBUG devnode_cs_debug = { 0, 0, &devnode_cs, @@ -1397,3 +1470,57 @@ CONFIGRET WINAPI CM_Open_DevNode_Key( DEVINST node, REGSAM access, ULONG profile { return CM_Open_DevNode_Key_Ex( node, access, profile, disposition, hkey, flags, NULL ); } + +/*********************************************************************** + * CM_Get_DevNode_Registry_Property_ExW (cfgmgr32.@) + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW( DEVINST node, ULONG property, ULONG *type, void *buffer, ULONG *len, ULONG flags, HMACHINE machine ) +{ + struct property prop; + struct device dev; + LSTATUS err; + + TRACE( "node %#lx, property %#lx, type %p, buffer %p, len %p, flags %#lx, machine %p\n", node, property, type, buffer, len, flags, machine ); + if (machine) FIXME( "machine %p not implemented!\n", machine ); + if (flags) FIXME( "flags %#lx not implemented!\n", flags ); + + if (devnode_get_device( node, &dev )) return CR_INVALID_DEVNODE; + if ((err = init_registry_property( &prop, &DEVPKEY_Device_DeviceDesc, property, type, buffer, len, FALSE ))) return map_error( err ); + + return map_error( get_device_property( HKEY_LOCAL_MACHINE, &dev, &prop ) ); +} + +/*********************************************************************** + * CM_Get_DevNode_Registry_Property_ExA (cfgmgr32.@) + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExA( DEVINST node, ULONG property, ULONG *type, void *buffer, ULONG *len, ULONG flags, HMACHINE machine ) +{ + struct property prop; + struct device dev; + LSTATUS err; + + TRACE( "node %#lx, property %#lx, type %p, buffer %p, len %p, flags %#lx, machine %p\n", node, property, type, buffer, len, flags, machine ); + if (machine) FIXME( "machine %p not implemented!\n", machine ); + if (flags) FIXME( "flags %#lx not implemented!\n", flags ); + + if (devnode_get_device( node, &dev )) return CR_INVALID_DEVNODE; + if ((err = init_registry_property( &prop, &DEVPKEY_Device_DeviceDesc, property, type, buffer, len, TRUE ))) return map_error( err ); + + return map_error( get_device_property( HKEY_LOCAL_MACHINE, &dev, &prop ) ); +} + +/*********************************************************************** + * CM_Get_DevNode_Registry_PropertyW (cfgmgr32.@) + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW( DEVINST node, ULONG property, ULONG *type, void *buffer, ULONG *len, ULONG flags ) +{ + return CM_Get_DevNode_Registry_Property_ExW( node, property, type, buffer, len, flags, NULL ); +} + +/*********************************************************************** + * CM_Get_DevNode_Registry_PropertyA (cfgmgr32.@) + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA( DEVINST node, ULONG property, ULONG *type, void *buffer, ULONG *len, ULONG flags ) +{ + return CM_Get_DevNode_Registry_Property_ExA( node, property, type, buffer, len, flags, NULL ); +} diff --git a/dlls/cfgmgr32/cfgmgr32.spec b/dlls/cfgmgr32/cfgmgr32.spec index 59e628d6165..9f5ed24ebf0 100644 --- a/dlls/cfgmgr32/cfgmgr32.spec +++ b/dlls/cfgmgr32/cfgmgr32.spec @@ -88,10 +88,10 @@ @ stdcall CM_Get_DevNode_Property_ExW(long ptr ptr ptr ptr long ptr) setupapi.CM_Get_DevNode_Property_ExW @ stub CM_Get_DevNode_Property_Keys @ stub CM_Get_DevNode_Property_Keys_Ex -@ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) setupapi.CM_Get_DevNode_Registry_PropertyA -@ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) setupapi.CM_Get_DevNode_Registry_PropertyW -@ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long ptr) setupapi.CM_Get_DevNode_Registry_Property_ExA -@ stdcall CM_Get_DevNode_Registry_Property_ExW(long long ptr ptr ptr long ptr) setupapi.CM_Get_DevNode_Registry_Property_ExW +@ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) +@ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) +@ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long ptr) +@ stdcall CM_Get_DevNode_Registry_Property_ExW(long long ptr ptr ptr long ptr) @ stdcall CM_Get_DevNode_Status(ptr ptr long long) setupapi.CM_Get_DevNode_Status @ stdcall CM_Get_DevNode_Status_Ex(ptr ptr long long ptr) setupapi.CM_Get_DevNode_Status_Ex @ stdcall CM_Get_Device_IDA(ptr ptr long long) diff --git a/dlls/cfgmgr32/tests/cfgmgr32.c b/dlls/cfgmgr32/tests/cfgmgr32.c index 1babd6e52da..0bc02591129 100644 --- a/dlls/cfgmgr32/tests/cfgmgr32.c +++ b/dlls/cfgmgr32/tests/cfgmgr32.c @@ -3089,6 +3089,234 @@ static void test_CM_Open_DevNode_Key(void) RtlFreeUnicodeString( &user ); } +static void test_CM_Get_DevNode_Registry_Property(void) +{ + WCHAR iface[4096], instance_id[MAX_PATH], buffer[MAX_PATH]; + DWORD size, type, len; + CONFIGRET ret; + DEVINST node; + GUID guid; + + + guid = GUID_DEVINTERFACE_HID; + ret = CM_Get_Device_Interface_ListW( &guid, NULL, iface, ARRAY_SIZE(iface), CM_GET_DEVICE_INTERFACE_LIST_PRESENT ); + if (broken( !*iface )) + { + skip( "No HID device present, skipping tests\n" ); + return; + } + ok_x4( ret, ==, CR_SUCCESS ); + size = sizeof(instance_id); + ret = CM_Get_Device_Interface_PropertyW( iface, &DEVPKEY_Device_InstanceId, &type, (BYTE *)instance_id, &size, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_x4( type, ==, DEVPROP_TYPE_STRING ); + + node = 0xdeadbeef; + ret = CM_Locate_DevNodeW( &node, instance_id, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_x4( node, ==, 2 ); + + + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( 0, CM_DRP_CLASSGUID, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_INVALID_DEVNODE ); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, NULL, NULL, NULL, 0 ); + ok_x4( ret, ==, CR_INVALID_POINTER ); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, &type, buffer, NULL, 0 ); + ok_x4( ret, ==, CR_INVALID_POINTER ); + len = 1; + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, &type, NULL, &len, 0 ); + ok_x4( ret, ==, CR_INVALID_POINTER ); + + len = 0; + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, &type, NULL, &len, 0 ); + ok_x4( ret, ==, CR_BUFFER_SMALL ); + ok_x4( len, ==, 78 ); + len = 1; + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_BUFFER_SMALL ); + ok_x4( len, ==, 78 ); + + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( 10, CM_DRP_CLASSGUID, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_INVALID_DEVNODE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, 0, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_INVALID_PROPERTY ); + + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_DEVICEDESC, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_SZ ); + ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_HARDWAREID, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_MULTI_SZ ); + ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_COMPATIBLEIDS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_MULTI_SZ ); + ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_SERVICE, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + ok_u4( type, ==, 0xdeadbeef ); + ok_u4( len, ==, 0 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_SZ ); + ok_u4( len, ==, 18 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CLASSGUID, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_SZ ); + ok_u4( len, ==, 78 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_DRIVER, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_SZ ); + ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CONFIGFLAGS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_SUCCESS ); + ok_u4( type, ==, REG_DWORD ); + ok_u4( len, ==, 4 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_MFG, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_SZ ); + todo_wine ok_u4( len, >, 1 ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_FRIENDLYNAME, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_LOCATION_INFORMATION, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + ok_u4( type, ==, 0xdeadbeef ); + ok_u4( len, ==, 0 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_SZ ); + todo_wine ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CAPABILITIES, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_UI_NUMBER, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_UPPERFILTERS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_LOWERFILTERS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_BUSTYPEGUID, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_BINARY ); + todo_wine ok_u4( len, ==, 16 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_LEGACYBUSTYPE, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_BUSNUMBER, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_ENUMERATOR_NAME, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_SZ ); + todo_wine ok_u4( len, >, 1 ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_SECURITY, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_SECURITY_SDS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_DEVTYPE, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_EXCLUSIVE, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_CHARACTERISTICS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_ADDRESS, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_UI_NUMBER_DESC_FORMAT, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_DEVICE_POWER_DATA, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_BINARY ); + todo_wine ok_u4( len, >, 1 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_REMOVAL_POLICY, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_REMOVAL_POLICY_HW_DEFAULT, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_REMOVAL_POLICY_OVERRIDE, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_INSTALL_STATE, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_DWORD ); + todo_wine ok_u4( len, ==, 4 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_LOCATION_PATHS, &type, buffer, &len, 0 ); + ok_x4( ret, ==, CR_NO_SUCH_VALUE ); + ok_u4( type, ==, 0xdeadbeef ); + ok_u4( len, ==, 0 ); + type = 0xdeadbeef; + len = sizeof(buffer); + ret = CM_Get_DevNode_Registry_PropertyW( node, CM_DRP_BASE_CONTAINERID, &type, buffer, &len, 0 ); + todo_wine ok_x4( ret, ==, CR_SUCCESS ); + todo_wine ok_u4( type, ==, REG_SZ ); + todo_wine ok_u4( len, ==, 78 ); +} + static void test_CM_Get_Class_Property_Keys(void) { GUID guid = GUID_DEVCLASS_HIDCLASS; @@ -3164,6 +3392,7 @@ START_TEST(cfgmgr32) test_CM_Get_Device_ID_List(); test_CM_Register_Notification(); test_CM_Open_DevNode_Key(); + test_CM_Get_DevNode_Registry_Property(); test_DevGetObjects(); test_DevCreateObjectQuery(); test_DevGetObjectProperties_invalid(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10436