static void test_IWbemPath_GetText(void) { IWbemPath *path; WCHAR buf[128]; ULONG len, count; HRESULT hr; CoInitialize( NULL ); hr = CoCreateInstance( &CLSID_WbemDefPath, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemPath, (void **)&path ); if (hr != S_OK) { win_skip( "can't create WbemDefPath instance, skipping tests\n" ); return; } hr = IWbemPath_GetText( path, 0, NULL, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); hr = IWbemPath_GetText( path, 0, &len, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); ok( len == sizeof(buf)/sizeof(buf[0]), "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == 1, "unexpected length %u\n", len ); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, NULL, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, &len, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); ok( len == sizeof(buf)/sizeof(buf[0]), "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); todo_wine ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); todo_wine ok( len == 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path8 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path9 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path9 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path13 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path13 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path14 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path14 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path15 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path15 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path12 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path12 ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path1 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( !count, "got %u\n", count ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path6 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); len = 0; hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, NULL ); ok( hr == S_OK, "got %08x\n", hr ); ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path16 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path17 ); ok( hr == S_OK, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); todo_wine ok( !lstrcmpW( buf, path17 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); todo_wine ok( len == lstrlenW( path17 ) + 1, "unexpected length %u\n", len ); IWbemPath_Release( path ); CoUninitialize(); }
static void test_IWbemPath_RemoveNamespaceAt(void) { static const ULONGLONG expected_flags = WBEMPATH_INFO_ANON_LOCAL_MACHINE | WBEMPATH_INFO_IS_INST_REF | WBEMPATH_INFO_HAS_SUBSCOPES | WBEMPATH_INFO_V2_COMPLIANT | WBEMPATH_INFO_CIM_COMPLIANT | WBEMPATH_INFO_PATH_HAD_SERVER; static const WCHAR cimv2W[] = {'c','i','m','v','2',0}; IWbemPath *path; WCHAR buf[16]; ULONG len, count; ULONGLONG flags; HRESULT hr; if (!(path = create_path())) return; hr = IWbemPath_RemoveNamespaceAt( path, 0 ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path17 ); ok( hr == S_OK, "got %08x\n", hr ); flags = 0; hr = IWbemPath_GetInfo( path, 0, &flags ); ok( hr == S_OK, "got %08x\n", hr ); ok( flags == expected_flags, "got %lx%08lx\n", (unsigned long)(flags >> 32), (unsigned long)flags ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); hr = IWbemPath_RemoveNamespaceAt( path, 0 ); ok( hr == S_OK, "got %08x\n", hr ); flags = 0; hr = IWbemPath_GetInfo( path, 0, &flags ); ok( hr == S_OK, "got %08x\n", hr ); ok( flags == expected_flags, "got %lx%08lx\n", (unsigned long)(flags >> 32), (unsigned long)flags ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 1, "got %u\n", count ); buf[0] = 0; len = sizeof(buf) / sizeof(buf[0]); hr = IWbemPath_GetNamespaceAt( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, cimv2W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( cimv2W ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_RemoveNamespaceAt( path, 0 ); ok( hr == S_OK, "got %08x\n", hr ); flags = 0; hr = IWbemPath_GetInfo( path, 0, &flags ); ok( hr == S_OK, "got %08x\n", hr ); ok( flags == expected_flags, "got %lx%08lx\n", (unsigned long)(flags >> 32), (unsigned long)flags ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( !count, "got %u\n", count ); buf[0] = 0; len = sizeof(buf) / sizeof(buf[0]); hr = IWbemPath_GetNamespaceAt( path, 0, &len, buf ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); IWbemPath_Release( path ); }
static void test_IWbemPath_SetNamespaceAt(void) { static const ULONGLONG expected_flags = WBEMPATH_INFO_ANON_LOCAL_MACHINE | WBEMPATH_INFO_V1_COMPLIANT | WBEMPATH_INFO_V2_COMPLIANT | WBEMPATH_INFO_CIM_COMPLIANT | WBEMPATH_INFO_SERVER_NAMESPACE_ONLY; static const WCHAR rootW[] = {'r','o','o','t',0}; static const WCHAR cimv2W[] = {'c','i','m','v','2',0}; IWbemPath *path; WCHAR buf[16]; ULONG len, count; ULONGLONG flags; HRESULT hr; if (!(path = create_path())) return; hr = IWbemPath_SetNamespaceAt( path, 0, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); hr = IWbemPath_SetNamespaceAt( path, 1, cimv2W ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); hr = IWbemPath_SetNamespaceAt( path, 0, cimv2W ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 1, "got %u\n", count ); flags = 0; hr = IWbemPath_GetInfo( path, 0, &flags ); ok( hr == S_OK, "got %08x\n", hr ); ok( flags == expected_flags, "got %lx%08lx\n", (unsigned long)(flags >> 32), (unsigned long)flags ); buf[0] = 0; len = sizeof(buf) / sizeof(buf[0]); hr = IWbemPath_GetNamespaceAt( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, cimv2W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( cimv2W ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetNamespaceAt( path, 0, rootW ); ok( hr == S_OK, "got %08x\n", hr ); flags = 0; hr = IWbemPath_GetInfo( path, 0, &flags ); ok( hr == S_OK, "got %08x\n", hr ); ok( flags == expected_flags, "got %lx%08lx\n", (unsigned long)(flags >> 32), (unsigned long)flags ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); buf[0] = 0; len = sizeof(buf) / sizeof(buf[0]); hr = IWbemPath_GetNamespaceAt( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, rootW ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( rootW ) + 1, "unexpected length %u\n", len ); buf[0] = 0; len = sizeof(buf) / sizeof(buf[0]); hr = IWbemPath_GetNamespaceAt( path, 1, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, cimv2W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( cimv2W ) + 1, "unexpected length %u\n", len ); IWbemPath_Release( path ); }
static void test_IWbemPath_GetText(void) { static const WCHAR serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e','.','N','a','m','e','=', '\"','S','e','r','v','i','c','e','\"',0}; static const WCHAR classW[] = {'W','i','n','3','2','_','C','l','a','s','s',0}; static const WCHAR expected1W[] = {'r','o','o','t','\\','c','i','m','v','2',':','W','i','n','3','2','_', 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','d','=', '"','C',':','"',0}; static const WCHAR expected2W[] = {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k','.', 'D','e','v','i','c','e','I','d','=','"','C',':','"',0}; static const WCHAR expected3W[] = {'\\','\\','.','\\','r','o','o','t','\\','c','i','m','v','2',0}; WCHAR buf[128]; ULONG len, count; IWbemPath *path; HRESULT hr; if (!(path = create_path())) return; hr = IWbemPath_GetText( path, 0, NULL, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); hr = IWbemPath_GetText( path, 0, &len, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); ok( len == sizeof(buf)/sizeof(buf[0]), "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == 1, "unexpected length %u\n", len ); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, NULL, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, &len, NULL ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); ok( len == sizeof(buf)/sizeof(buf[0]), "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_ORIGINAL, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); todo_wine ok( !buf[0], "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); todo_wine ok( len == 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path8 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path9 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path9 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path13 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path13 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path14 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path14 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path15 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path15 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path12 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path12 ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path1 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( !count, "got %u\n", count ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path6 ); ok( hr == S_OK, "got %08x\n", hr ); count = 0xdeadbeef; hr = IWbemPath_GetNamespaceCount( path, &count ); ok( hr == S_OK, "got %08x\n", hr ); ok( count == 2, "got %u\n", count ); len = 0; hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, NULL ); ok( hr == S_OK, "got %08x\n", hr ); ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path16 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path17 ); ok( hr == S_OK, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, path17 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( path17 ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, 0, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, expected1W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( expected1W ) + 1, "unexpected length %u\n", len ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, expected2W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( expected2W ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path15 ); ok( hr == S_OK, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, expected3W ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( expected3W ) + 1, "unexpected length %u\n", len ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path18 ); ok( hr == S_OK, "got %08x\n", hr ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path19 ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path20 ); ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr ); IWbemPath_Release( path ); if (!(path = create_path())) return; hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, serviceW ); ok( hr == S_OK, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, serviceW ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( serviceW ) + 1, "unexpected length %u\n", len ); IWbemPath_Release( path ); if (!(path = create_path())) return; hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, classW ); ok( hr == S_OK, "got %08x\n", hr ); len = sizeof(buf)/sizeof(buf[0]); memset( buf, 0x55, sizeof(buf) ); hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, buf ); ok( hr == S_OK, "got %08x\n", hr ); ok( !lstrcmpW( buf, classW ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) ); ok( len == lstrlenW( classW ) + 1, "unexpected length %u\n", len ); IWbemPath_Release( path ); }