=?UTF-8?Q?Michael=20M=C3=BCller=20?=: wbemprox: Allow connecting to localhost.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 29 09:22:17 CDT 2015


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

Author: Michael Müller <michael at fds-team.de>
Date:   Thu Apr 16 21:27:22 2015 +0200

wbemprox: Allow connecting to localhost.

---

 dlls/wbemprox/tests/services.c | 6 +++++-
 dlls/wbemprox/wbemlocator.c    | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wbemprox/tests/services.c b/dlls/wbemprox/tests/services.c
index 8ab6e83..4c42a50 100644
--- a/dlls/wbemprox/tests/services.c
+++ b/dlls/wbemprox/tests/services.c
@@ -111,6 +111,8 @@ static void test_IWbemLocator(void)
     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 WCHAR path25W[] = {'\\','\\','l','o','c','a','l','h','o','s','t','\\','R','O','O','T',0};
+    static const WCHAR path26W[] = {'\\','\\','L','O','C','A','L','H','O','S','T','\\','R','O','O','T',0};
     static const struct
     {
         const WCHAR *path;
@@ -144,7 +146,9 @@ static void test_IWbemLocator(void)
         { path21W, S_OK },
         { path22W, S_OK },
         { path23W, WBEM_E_INVALID_NAMESPACE },
-        { path24W, WBEM_E_INVALID_NAMESPACE }
+        { path24W, WBEM_E_INVALID_NAMESPACE },
+        { path25W, S_OK },
+        { path26W, S_OK }
     };
     IWbemLocator *locator;
     IWbemServices *services;
diff --git a/dlls/wbemprox/wbemlocator.c b/dlls/wbemprox/wbemlocator.c
index 463e6d4..6ed0aed 100644
--- a/dlls/wbemprox/wbemlocator.c
+++ b/dlls/wbemprox/wbemlocator.c
@@ -89,10 +89,11 @@ static HRESULT WINAPI wbem_locator_QueryInterface(
 static BOOL is_local_machine( const WCHAR *server )
 {
     static const WCHAR dotW[] = {'.',0};
+    static const WCHAR localhostW[] = {'l','o','c','a','l','h','o','s','t',0};
     WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 1];
     DWORD len = sizeof(buffer) / sizeof(buffer[0]);
 
-    if (!server || !strcmpW( server, dotW )) return TRUE;
+    if (!server || !strcmpW( server, dotW ) || !strcmpiW( server, localhostW )) return TRUE;
     if (GetComputerNameW( buffer, &len ) && !strcmpiW( server, buffer )) return TRUE;
     return FALSE;
 }




More information about the wine-cvs mailing list