Commit d799a664 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Accept the root\default namespace.

parent 00bbc620
...@@ -108,6 +108,9 @@ static void test_IWbemLocator(void) ...@@ -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 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 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 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 static const struct
{ {
const WCHAR *path; const WCHAR *path;
...@@ -138,7 +141,10 @@ static void test_IWbemLocator(void) ...@@ -138,7 +141,10 @@ static void test_IWbemLocator(void)
{ path18W, S_OK }, { path18W, S_OK },
{ path19W, WBEM_E_INVALID_NAMESPACE }, { path19W, WBEM_E_INVALID_NAMESPACE },
{ path20W, 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; IWbemLocator *locator;
IWbemServices *services; IWbemServices *services;
......
...@@ -101,6 +101,7 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na ...@@ -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 rootW[] = {'R','O','O','T'};
static const WCHAR cimv2W[] = {'C','I','M','V','2'}; 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; HRESULT hr = WBEM_E_INVALID_NAMESPACE;
const WCHAR *p, *q; const WCHAR *p, *q;
unsigned int len; unsigned int len;
...@@ -138,7 +139,9 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na ...@@ -138,7 +139,9 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na
goto done; goto done;
} }
q++; 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; goto done;
if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY; if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment