From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/wbemdisp/locator.c | 22 ++++++++++++++++++++-- dlls/wbemdisp/tests/wbemdisp.c | 2 -- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index ab23b8c51f7..6a3d3cbf467 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -3694,8 +3694,26 @@ static HRESULT WINAPI objectpath_get_ParentNamespace( ISWbemObjectPath *iface, B static HRESULT WINAPI objectpath_get_DisplayName( ISWbemObjectPath *iface, BSTR *strDisplayName ) { - FIXME( "\n" ); - return E_NOTIMPL; + struct objectpath *objectpath = impl_from_ISWbemObjectPath( iface ); + ULONG len = 0; + WCHAR *buf; + HRESULT hr; + + FIXME( "%p, %p semi-stub\n", objectpath, strDisplayName ); + + if (FAILED( hr = IWbemPath_GetText( objectpath->path, WBEMPATH_GET_SERVER_TOO, &len, NULL ) )) return hr; + if (!(buf = SysAllocStringLen( L"winmgmts:", len + ARRAY_SIZE( L"winmgmts:" ) - 2 ) )) return E_OUTOFMEMORY; + /* TODO: add 'authenticationLevel' and 'impersonationLevel' from the security object. Native also + * includes 'Name', 'SoftwareElementID', 'SoftwareElementState' and 'TargetOperatingSystem' values. + * The last three are currently missing from the properties. */ + if (FAILED( hr = IWbemPath_GetText( objectpath->path, WBEMPATH_GET_SERVER_TOO, &len, buf + wcslen( buf ) ) )) + { + SysFreeString( buf ); + buf = NULL; + } + + *strDisplayName = buf; + return hr; } static HRESULT WINAPI objectpath_put_DisplayName( ISWbemObjectPath *iface, BSTR strDisplayName ) diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c index 940f9370026..261ff86b4bd 100644 --- a/dlls/wbemdisp/tests/wbemdisp.c +++ b/dlls/wbemdisp/tests/wbemdisp.c @@ -272,9 +272,7 @@ static void test_ParseDisplayName(void) ok( hr == S_OK, "got %#lx\n", hr ); VariantClear( &res ); - dispname = NULL; hr = ISWbemObjectPath_get_DisplayName( objpath, &dispname ); - todo_wine ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( dispname ); ISWbemObjectPath_Release( objpath ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11711