diff --git a/dlls/wbemprox/tests/services.c b/dlls/wbemprox/tests/services.c index 5d659b1beea..7f8a7a23b26 100644 --- a/dlls/wbemprox/tests/services.c +++ b/dlls/wbemprox/tests/services.c @@ -108,6 +108,9 @@ static void test_IWbemLocator(void) static const WCHAR path19W[] = {'R','O','O','T','\\','\\','C','I','M','V','2',0}; static const WCHAR path20W[] = {'R','O','O','T','\\','C','I','M','V','2','\\',0}; static const WCHAR path21W[] = {'R','O','O','T','/','C','I','M','V','2',0}; + static const WCHAR path22W[] = {'r','o','o','t','\\','d','e','f','a','u','l','t',0}; + static const WCHAR path23W[] = {'r','o','o','t','\\','c','i','m','v','0',0}; + static const WCHAR path24W[] = {'r','o','o','t','\\','c','i','m','v','1',0}; static const struct { const WCHAR *path; @@ -138,7 +141,10 @@ static void test_IWbemLocator(void) { path18W, S_OK }, { path19W, WBEM_E_INVALID_NAMESPACE }, { path20W, WBEM_E_INVALID_NAMESPACE }, - { path21W, S_OK } + { path21W, S_OK }, + { path22W, S_OK }, + { path23W, WBEM_E_INVALID_NAMESPACE }, + { path24W, WBEM_E_INVALID_NAMESPACE } }; IWbemLocator *locator; IWbemServices *services; diff --git a/dlls/wbemprox/wbemlocator.c b/dlls/wbemprox/wbemlocator.c index e869a6abf16..07bd89fc54e 100644 --- a/dlls/wbemprox/wbemlocator.c +++ b/dlls/wbemprox/wbemlocator.c @@ -101,6 +101,7 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na { static const WCHAR rootW[] = {'R','O','O','T'}; static const WCHAR cimv2W[] = {'C','I','M','V','2'}; + static const WCHAR defaultW[] = {'D','E','F','A','U','L','T'}; HRESULT hr = WBEM_E_INVALID_NAMESPACE; const WCHAR *p, *q; unsigned int len; @@ -138,7 +139,9 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na goto done; } q++; - if ((len = strlenW( q )) != sizeof(cimv2W) / sizeof(cimv2W[0]) || memicmpW( q, cimv2W, len )) + len = strlenW( q ); + if ((len != sizeof(cimv2W) / sizeof(cimv2W[0]) || memicmpW( q, cimv2W, len )) && + (len != sizeof(defaultW) / sizeof(defaultW[0]) || memicmpW( q, defaultW, len ))) goto done; if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY; else