https://bugs.winehq.org/show_bug.cgi?id=51871
Bug ID: 51871 Summary: PSScript fails with 0x80041002 (WBEM_E_NOT_FOUND) ( system property L"__Derivation" not implemented) Product: Wine Version: 6.19 Hardware: x86-64 URL: https://www.powershellgallery.com/packages/Traverse/0. 6/Content/Private%5CGet-WMICustom.ps1 OS: Linux Status: NEW Keywords: download, source Severity: normal Priority: P2 Component: wmi&wbemprox Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: ---
Hi, I`d like to make powershell script from the URL to work in wine in Powershell 7. (Background: Powershell 7 doesn`t have Get-WMIObject and GetCIMInstance doesn`t work; if the above script works it`s simple to just write an own simple Get-WMIObject which is for example used by chocolatey to retrieve some properties from win32_operatingsystem)
Output from running script in psconsole: Out-Default: The following exception occurred while retrieving the type name hierarchy: "Error code: 0x80041002".
In the console: 07f0:fixme:wbemprox:get_system_propval system property L"__Derivation" not implemented
Actually it turns out that returning complete stub for "__Derivation" is enough to make the script enough work for my purpose
I now use hack below, and that`s enough to fix this bug for me, but I guess it`s not ok enough for inclusion in wine. So if someone could write proper stub or advise howto improve patch that would be great
diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 77ed27e105d..b253f19a6ed 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -1006,6 +1006,13 @@ static HRESULT get_system_propval( const struct view *view, UINT table_index, UI if (type) *type = CIM_STRING; return S_OK; } + if (!wcsicmp( name, L"__DERIVATION" )) + { + if (ret) + V_VT( ret ) = VT_BSTR | VT_ARRAY; + if (type) *type = CIM_STRING | VT_ARRAY; + return S_OK; + } FIXME("system property %s not implemented\n", debugstr_w(name)); return WBEM_E_NOT_FOUND; } diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 69bb8e7977e..9bb8d559b06 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1642,6 +1642,7 @@ static void test_Win32_VideoController( IWbemServices *services ) if (hr != S_OK) break;
check_property( obj, L"__CLASS", VT_BSTR, CIM_STRING ); + check_property( obj, L"__DERIVATION", VT_BSTR | VT_ARRAY, CIM_STRING | CIM_FLAG_ARRAY); check_property( obj, L"__GENUS", VT_I4, CIM_SINT32 ); check_property( obj, L"__NAMESPACE", VT_BSTR, CIM_STRING ); check_property( obj, L"__PATH", VT_BSTR, CIM_STRING );
https://bugs.winehq.org/show_bug.cgi?id=51871
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- Created attachment 70790 --> https://bugs.winehq.org/attachment.cgi?id=70790 patch
This patch returns an empty array. Does that work?
https://bugs.winehq.org/show_bug.cgi?id=51871
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
--- Comment #2 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Hans Leidekker from comment #1)
Created attachment 70790 [details] patch
This patch returns an empty array. Does that work?
Yes, that`s ok! After applying patch and loading the script it now successfully is able to retrieve properties:
PS Z:\home\louis> $(Get-WmiCustom win32_operatingsystem).caption Microsoft Windows 7 Professional
PS Z:\home\louis> $(Get-WmiCustom win32_operatingsystem).Version 6.1.7601
Thanks a lot for taking this up.
For completeness I've pasted +wbemprox console output below
wine: Read access denied for device L"\??\Z:\", FS volume label and serial are not available. 048c:trace:wbemprox:DllGetClassObject {4590f811-1d3a-11d0-891f-00aa004b2e24} {00000001-0000-0000-c000-000000000046} 0000000031FCF230 048c:trace:wbemprox:wbemprox_cf_CreateInstance 0000000000000000 {dc12a687-737f-11cf-884d-00aa004b2e24} 0000000031FCF238 048c:trace:wbemprox:WbemLocator_create (0000000031FCF198) 048c:trace:wbemprox:WbemLocator_create returning iface 00000000248DE900 048c:trace:wbemprox:wbem_locator_QueryInterface 00000000248DE900 {dc12a687-737f-11cf-884d-00aa004b2e24} 0000000031FCF238 048c:trace:wbemprox:wbem_locator_ConnectServer 00000000248DE900, L"\\localhost\root\cimv2", (null), (null), L"", 0x00000080, L"", 0000000000000000, 0000000031FCF5C8) 048c:fixme:wbemprox:wbem_locator_ConnectServer authentication not supported 048c:fixme:wbemprox:wbem_locator_ConnectServer specific locale not supported 048c:fixme:wbemprox:wbem_locator_ConnectServer unsupported flags 048c:trace:wbemprox:WbemServices_create namespace L"cimv2", context 0000000000000000, ppObj 0000000031FCF5C8. 048c:trace:wbemprox:WbemServices_create returning iface 00000000248DE9C0 048c:trace:wbemprox:wbem_services_QueryInterface 00000000248DE9C0 {0000013d-0000-0000-c000-000000000046} 0000000031FCF208 048c:fixme:wbemprox:client_security_QueryBlanket semi-stub. 048c:fixme:wbemprox:client_security_Release 0000000062CA2D40 048c:trace:wbemprox:wbem_services_QueryInterface 00000000248DE9C0 {00000000-0000-0000-c000-000000000046} 0000000031FCF1A0 048c:trace:wbemprox:wbem_services_QueryInterface 00000000248DE9C0 {0000013d-0000-0000-c000-000000000046} 0000000031FCF1B0 048c:fixme:wbemprox:client_security_SetBlanket 0000000062CA2D40, 00000000248DE9C0, 0, 0, L"<COLE_DEFAULT_PRINCIPAL>", 1, 3, 0000000000000000, 0x00000020 048c:fixme:wbemprox:client_security_Release 0000000062CA2D40 048c:trace:wbemprox:wbem_locator_Release destroying 00000000248DE900 048c:trace:wbemprox:wbem_services_QueryInterface 00000000248DE9C0 {9556dc99-828c-11cf-a37e-00aa003240c7} 0000000031FCEEC0 0470:trace:wbemprox:wbem_services_QueryInterface 00000000248DE9C0 {9556dc99-828c-11cf-a37e-00aa003240c7} 0000000030B7E240 0470:trace:wbemprox:wbem_services_ExecQuery 00000000248DE9C0, L"WQL", L"SELECT * FROM win32_operatingsystem", 0x00000010, 0000000000000000, 0000000030B7E820 0470:trace:wbemprox:grab_table returning 0000000062CA2810 0470:trace:wbemprox:parse_query wql_parse returned 0 0470:trace:wbemprox:fill_operatingsystem created 1 rows 0470:trace:wbemprox:EnumWbemClassObject_create 0000000030B7E820 0470:trace:wbemprox:EnumWbemClassObject_create returning iface 00000000248D1170 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D1170, {0000013d-0000-0000-c000-000000000046}, 0000000030B7E448 0470:fixme:wbemprox:client_security_QueryBlanket semi-stub. 0470:fixme:wbemprox:client_security_Release 0000000062CA2D40 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D1170, {00000000-0000-0000-c000-000000000046}, 0000000030B7E3E0 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D1170, {0000013d-0000-0000-c000-000000000046}, 0000000030B7E3F0 0470:fixme:wbemprox:client_security_SetBlanket 0000000062CA2D40, 00000000248D1170, 0, 0, L"<COLE_DEFAULT_PRINCIPAL>", 1, 3, 0000000000000000, 0x00000020 0470:fixme:wbemprox:client_security_Release 0000000062CA2D40 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D1170, {027947e1-d731-11ce-a357-000000000001}, 0000000030B7E0C0 0470:trace:wbemprox:enum_class_object_Clone 00000000248D1170, 0000000030B7E710 0470:trace:wbemprox:EnumWbemClassObject_create 0000000030B7E710 0470:trace:wbemprox:EnumWbemClassObject_create returning iface 00000000248D3EF0 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D3EF0, {0000013d-0000-0000-c000-000000000046}, 0000000030B7E3F8 0470:fixme:wbemprox:client_security_QueryBlanket semi-stub. 0470:fixme:wbemprox:client_security_Release 0000000062CA2D40 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D3EF0, {00000000-0000-0000-c000-000000000046}, 0000000030B7E390 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D3EF0, {0000013d-0000-0000-c000-000000000046}, 0000000030B7E3A0 0470:fixme:wbemprox:client_security_SetBlanket 0000000062CA2D40, 00000000248D3EF0, 0, 0, L"<COLE_DEFAULT_PRINCIPAL>", 1, 3, 0000000000000000, 0x00000020 0470:fixme:wbemprox:client_security_Release 0000000062CA2D40 0470:trace:wbemprox:enum_class_object_QueryInterface 00000000248D3EF0, {027947e1-d731-11ce-a357-000000000001}, 0000000030B7E070 0470:trace:wbemprox:enum_class_object_Reset 00000000248D3EF0 0470:trace:wbemprox:enum_class_object_Next 00000000248D3EF0, 15000, 1, 00000000248D3D80, 00000000032E3208 0470:fixme:wbemprox:enum_class_object_Next timeout not supported 0470:trace:wbemprox:create_class_object L"Win32_OperatingSystem", 00000000248D3D80 0470:trace:wbemprox:create_class_object returning iface 00000000248D4190 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {00000000-0000-0000-c000-000000000046}, 0000000030B7DF90 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {b196b283-bab4-101a-b69c-00aa00341d07}, 0000000030B7DCB8 0470:fixme:wbemprox:class_object_QueryInterface interface {b196b283-bab4-101a-b69c-00aa00341d07} not implemented 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {ecc8691b-c1db-4dc0-855e-65f6c551af49}, 0000000030B7DBC8 0470:fixme:wbemprox:class_object_QueryInterface interface {ecc8691b-c1db-4dc0-855e-65f6c551af49} not implemented 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {94ea2b94-e9cc-49e0-c0ff-ee64ca8f5b90}, 0000000030B7DB58 0470:fixme:wbemprox:class_object_QueryInterface interface {94ea2b94-e9cc-49e0-c0ff-ee64ca8f5b90} not implemented 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {00000003-0000-0000-c000-000000000046}, 0000000030B7DB48 0470:fixme:wbemprox:class_object_QueryInterface interface {00000003-0000-0000-c000-000000000046} not implemented 0470:trace:wbemprox:class_object_QueryInterface 00000000248D4190, {dc12a681-737f-11cf-884d-00aa004b2e24}, 0000000030B7DD20 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__GENUS", 00000000, 0000000030B7E668, 0000000030B7E7C0, 0000000030B7E7B8 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__PATH", 00000000, 0000000030B7E618, 0000000030B7E770, 0000000030B7E768 0470:trace:wbemprox:enum_class_object_Next 00000000248D3EF0, 15000, 1, 00000000248DC8C0, 00000000032E3208 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__NAMESPACE", 00000000, 0000000030B7EC58, 00000000032E7640, 00000000032E7644 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__NAMESPACE", 00000000, 0000000030B7EC68, 00000000032E7640, 00000000032E7644 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__CLASS", 00000000, 0000000030B7EC58, 00000000032E7770, 00000000032E7774 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__CLASS", 00000000, 0000000030B7EC68, 00000000032E7770, 00000000032E7774 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__Derivation", 00000000, 0000000030B7EC58, 00000000032E79E8, 00000000032E79EC 0470:fixme:wbemprox:get_system_propval returning empty array for __DERIVATION 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__Derivation", 00000000, 0000000030B7EC68, 00000000032E79E8, 00000000032E79EC 0470:fixme:wbemprox:get_system_propval returning empty array for __DERIVATION 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__CLASS", 00000000, 0000000030B7EC58, 00000000032E7DA0, 00000000032E7DA4 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__CLASS", 00000000, 0000000030B7EC68, 00000000032E7DA0, 00000000032E7DA4 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__Derivation", 00000000, 0000000030B7EC58, 00000000032E7FE0, 00000000032E7FE4 0470:fixme:wbemprox:get_system_propval returning empty array for __DERIVATION 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__Derivation", 00000000, 0000000030B7EC68, 00000000032E7FE0, 00000000032E7FE4 0470:fixme:wbemprox:get_system_propval returning empty array for __DERIVATION 0470:trace:wbemprox:class_object_GetNames 00000000248D4190, (null), 00000030, 0000000030B7ECD8 {VT_EMPTY}, 0000000030B7ECC0 0470:fixme:wbemprox:class_object_GetNames qualifier not supported 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__GENUS", 00000000, 0000000030B7ECC8, 00000000032EA090, 00000000032EA094 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__CLASS", 00000000, 0000000030B7ECC8, 00000000032EA0E8, 00000000032EA0EC 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__RELPATH", 00000000, 0000000030B7ECC8, 00000000032EA168, 00000000032EA16C 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__PROPERTY_COUNT", 00000000, 0000000030B7ECC8, 00000000032EA1E8, 00000000032EA1EC 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__SERVER", 00000000, 0000000030B7ECC8, 00000000032EA240, 00000000032EA244 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__NAMESPACE", 00000000, 0000000030B7ECC8, 00000000032EA2A8, 00000000032EA2AC 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"__PATH", 00000000, 0000000030B7ECC8, 00000000032EA318, 00000000032EA31C 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"caption", 00000000, 0000000030B7ED48, 00000000032EA4A8, 00000000032EA4AC 0470:trace:wbemprox:class_object_Get 00000000248D4190, L"caption", 00000000, 0000000030B7EE08, 00000000032EA4A8, 00000000032EA4AC 0430:trace:wbemprox:enum_class_object_Release destroying 00000000248D1170 0430:trace:wbemprox:class_object_Release destroying 00000000248D4190 0430:trace:wbemprox:enum_class_object_Release destroying 00000000248D3EF0
https://bugs.winehq.org/show_bug.cgi?id=51871
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- (In reply to Louis Lenders from comment #2)
(In reply to Hans Leidekker from comment #1)
Created attachment 70790 [details] patch
This patch returns an empty array. Does that work?
Yes, that`s ok! After applying patch and loading the script it now successfully is able to retrieve properties:
Great! Do you want to submit the patch or should I do it?
https://bugs.winehq.org/show_bug.cgi?id=51871
--- Comment #4 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Hans Leidekker from comment #3)
(In reply to Louis Lenders from comment #2)
(In reply to Hans Leidekker from comment #1)
Created attachment 70790 [details] patch
This patch returns an empty array. Does that work?
Yes, that`s ok! After applying patch and loading the script it now successfully is able to retrieve properties:
Great! Do you want to submit the patch or should I do it?
Hi Hans, please you submit and regards
https://bugs.winehq.org/show_bug.cgi?id=51871
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #5 from winetest@luukku.com --- a patch related to this bug was merged so is this fixed now?
https://bugs.winehq.org/show_bug.cgi?id=51871
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |2243229043b9af45376e27df55a | |3fa279590a9b4 Status|NEW |RESOLVED
--- Comment #6 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to winetest from comment #5)
a patch related to this bug was merged so is this fixed now?
yes. this is fixed by 2243229043b9af45376e27df55a3fa279590a9b4
Thanks Hans (again)!
Just for documentation, in case an app in future might depend on real values for system prop "__Derivation":
I ran the script on my windows-laptop in Powershell 7 (Core) and also tested in "real" powershell 5.1 (without script as powershell 5.1 does have Get-WMIObject).
It then yields in both cases same output:
Powershell 7: $(Get-WmiCustom win32_operatingsystem).__DERIVATION
CIM_OperatingSystem CIM_LogicalElement CIM_ManagedSystemElement
Powershell 5.1: $(Get-WMIObject win32_operatingsystem).__DERIVATION
CIM_OperatingSystem CIM_LogicalElement CIM_ManagedSystemElement
https://bugs.winehq.org/show_bug.cgi?id=51871
--- Comment #7 from winetest@luukku.com --- I also Believe https://source.winehq.org/patches/data/217105 was somehow related and made wine more feature complete.
https://bugs.winehq.org/show_bug.cgi?id=51871
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.20.