use ncalrpc instead of a named pipe

svn path=/trunk/; revision=40134
This commit is contained in:
Christoph von Wittich 2009-03-20 13:44:06 +00:00
parent 893ccc059d
commit 59ceaaac16

View file

@ -20,6 +20,7 @@
/* INCLUDES ****************************************************************/ /* INCLUDES ****************************************************************/
#define WIN32_NO_STATUS
#include <windows.h> #include <windows.h>
#include "wlansvc_c.h" #include "wlansvc_c.h"
@ -37,9 +38,9 @@ WLANSVC_HANDLE_bind(WLANSVC_HANDLE szMachineName)
TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n"); TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n");
Status = RpcStringBindingComposeW(NULL, Status = RpcStringBindingComposeW(NULL,
L"ncacn_np", L"ncalrpc",
szMachineName, szMachineName,
L"\\pipe\\trkwks", L"wlansvc",
NULL, NULL,
&pszStringBinding); &pszStringBinding);
if (Status != RPC_S_OK) if (Status != RPC_S_OK)
@ -102,13 +103,14 @@ WlanOpenHandle(IN DWORD dwClientVersion,
OUT HANDLE *phClientHandle) OUT HANDLE *phClientHandle)
{ {
DWORD dwError = ERROR_SUCCESS; DWORD dwError = ERROR_SUCCESS;
WCHAR szDummy[] = L"localhost";
if ((pReserved != NULL) || (pdwNegotiatedVersion == NULL) || (phClientHandle == NULL)) if ((pReserved != NULL) || (pdwNegotiatedVersion == NULL) || (phClientHandle == NULL))
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
RpcTryExcept RpcTryExcept
{ {
dwError = _RpcOpenHandle(NULL, dwError = _RpcOpenHandle(szDummy,
dwClientVersion, dwClientVersion,
pdwNegotiatedVersion, pdwNegotiatedVersion,
(WLANSVC_RPC_HANDLE) phClientHandle); (WLANSVC_RPC_HANDLE) phClientHandle);