Hans Leidekker : wbemprox: Accept the root\default namespace.

Alexandre Julliard julliard at winehq.org
Wed Aug 21 14:09:06 CDT 2013


Module: wine
Branch: master
Commit: d799a664f46623282b6173ff8bcf5562444a30d4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d799a664f46623282b6173ff8bcf5562444a30d4

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Aug 21 14:09:28 2013 +0200

wbemprox: Accept the root\default namespace.

---

 dlls/wbemprox/tests/services.c |    8 +++++++-
 dlls/wbemprox/wbemlocator.c    |    5 ++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/wbemprox/tests/services.c b/dlls/wbemprox/tests/services.c
index 5d659b1..7f8a7a2 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 e869a6a..07bd89f 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




More information about the wine-cvs mailing list