wbemprox: Return WBEM_E_NOT_FOUND from get_object() if no object is available.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49685
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-08-09 19:30:09 -05:00 committed by Alexandre Julliard
parent bae98df328
commit a0c9aab5de
2 changed files with 11 additions and 3 deletions

View File

@ -450,6 +450,7 @@ HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
{
IEnumWbemClassObject *iter;
struct path *path;
ULONG count;
HRESULT hr;
hr = parse_path( object_path, &path );
@ -461,7 +462,8 @@ HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
free_path( path );
return hr;
}
hr = create_class_object( path->class, iter, 0, NULL, obj );
hr = IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, obj, &count );
if (hr == WBEM_S_FALSE) hr = WBEM_E_NOT_FOUND;
IEnumWbemClassObject_Release( iter );
free_path( path );
return hr;

View File

@ -267,7 +267,9 @@ static void test_Win32_Service( IWbemServices *services )
if (hr != S_OK)
{
win_skip( "Win32_Service not available\n" );
goto out;
SysFreeString( empty );
SysFreeString( class );
return;
}
check_property( service, L"ProcessID", VT_I4, CIM_UINT32 );
@ -343,9 +345,13 @@ static void test_Win32_Service( IWbemServices *services )
ok( hr == S_OK, "got %08x\n", hr );
if (service) IWbemClassObject_Release( service );
out:
SysFreeString( empty );
SysFreeString( class );
class = SysAllocString( L"Win32_Service.Name=\"nonexistent\"" );
hr = IWbemServices_GetObject( services, class, 0, NULL, &service, NULL );
ok( hr == WBEM_E_NOT_FOUND, "got %#08x\n", hr );
SysFreeString( class );
}
static void test_Win32_Bios( IWbemServices *services )