Paul Gofman : wbemprox: Add Microsoft\\Windows\\Storage namespace.

Alexandre Julliard julliard at winehq.org
Tue Sep 14 16:00:11 CDT 2021


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

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Mon Sep 13 17:13:29 2021 +0300

wbemprox: Add Microsoft\\Windows\\Storage namespace.

Fixes Life is Strange: True Colors error on start.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wbemprox/builtin.c          |  1 +
 dlls/wbemprox/tests/services.c   | 39 +++++++++++++++++++++++++++++++++++++++
 dlls/wbemprox/wbemprox_private.h |  1 +
 3 files changed, 41 insertions(+)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index ad96182af6b..442a9015951 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -4128,6 +4128,7 @@ static const struct
 builtin_namespaces[WBEMPROX_NAMESPACE_LAST] =
 {
     {L"cimv2", cimv2_builtin_classes, ARRAY_SIZE(cimv2_builtin_classes)},
+    {L"Microsoft\\Windows\\Storage", NULL, 0},
 };
 
 void init_table_list( void )
diff --git a/dlls/wbemprox/tests/services.c b/dlls/wbemprox/tests/services.c
index 5ad73e7a8ec..86ee99c335c 100644
--- a/dlls/wbemprox/tests/services.c
+++ b/dlls/wbemprox/tests/services.c
@@ -247,11 +247,50 @@ todo_wine
     IWbemContext_Release( context );
 }
 
+static void test_namespaces(void)
+{
+    static const struct
+    {
+        const WCHAR *path;
+        BOOL broken;
+    }
+    tests[] =
+    {
+        {L"ROOT\\CIMV2"},
+        {L"ROOT\\Microsoft\\Windows\\Storage", TRUE /* Before Win8. */},
+    };
+    IWbemLocator *locator;
+    IWbemServices *services;
+    unsigned int i;
+    BSTR resource;
+    HRESULT hr;
+
+    hr = CoCreateInstance( &CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (void **)&locator );
+    if (hr != S_OK)
+    {
+        win_skip( "can't create instance of WbemLocator.\n" );
+        return;
+    }
+
+    for (i = 0; i < ARRAY_SIZE( tests ); i++)
+    {
+        resource = SysAllocString( tests[i].path );
+        hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services );
+        ok( hr == S_OK || broken( tests[i].broken && hr == WBEM_E_INVALID_NAMESPACE ), "%u: got %08x\n", i, hr );
+        SysFreeString( resource );
+        if (hr == S_OK)
+            IWbemServices_Release( services );
+    }
+
+    IWbemLocator_Release( locator );
+}
+
 START_TEST(services)
 {
     CoInitialize( NULL );
     test_IClientSecurity();
     test_IWbemLocator();
     test_IWbemContext();
+    test_namespaces();
     CoUninitialize();
 }
diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
index cd655e54243..6b94bbb9ef6 100644
--- a/dlls/wbemprox/wbemprox_private.h
+++ b/dlls/wbemprox/wbemprox_private.h
@@ -23,6 +23,7 @@
 enum wbm_namespace
 {
     WBEMPROX_NAMESPACE_CIMV2,
+    WBEMPROX_NAMESPACE_MS_WINDOWS_STORAGE,
     WBEMPROX_NAMESPACE_LAST,
 };
 




More information about the wine-cvs mailing list