Commit 99619619 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

wbemprox: Allow connecting to localhost.

parent 12a2b849
......@@ -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;
......
......@@ -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;
}
......
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