diff --git a/reactos/boot/bootdata/hivesys_i386.inf b/reactos/boot/bootdata/hivesys_i386.inf index c433cca047a..14c7c7b3a5e 100644 --- a/reactos/boot/bootdata/hivesys_i386.inf +++ b/reactos/boot/bootdata/hivesys_i386.inf @@ -1041,6 +1041,17 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","ObjectName",0x00000000,"LocalS HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Start",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Type",0x00010001,0x00000110 +; WLAN service +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","DependOnService",0x00010000,"RPCSS" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","DisplayName",0x00000000,"WLAN Service" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Description",0x00000000,"WLAN Service" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Group",0x00000000,"TDI" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ImagePath",0x00020000,"%SystemRoot%\system32\wlansvc.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ObjectName",0x00000000,"LocalSystem" +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Type",0x00010001,0x00000110 + ; Simple TCP services HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Description",0x00000000,"Supports the following TCP/IP services: Chargen, Daytime, Discard, Echo, QOTD" HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simple TCP/IP Services" diff --git a/reactos/boot/bootdata/packages/reactos.dff b/reactos/boot/bootdata/packages/reactos.dff index 853a9c08b09..30908eeb7b2 100644 --- a/reactos/boot/bootdata/packages/reactos.dff +++ b/reactos/boot/bootdata/packages/reactos.dff @@ -86,6 +86,7 @@ base\services\spoolsv\spoolsv.exe 1 base\services\tcpsvcs\tcpsvcs.exe 1 base\services\tcpsvcs\quotes 5 base\services\umpnpmgr\umpnpmgr.exe 1 +base\services\wlansvc\wlansvc.exe 1 base\setup\setup\setup.exe 1 base\setup\vmwinst\vmwinst.exe 1 @@ -746,6 +747,7 @@ modules\rostests\winetests\version\version_winetest.exe 7 o modules\rostests\winetests\winhttp\winhttp_winetest.exe 7 optional modules\rostests\winetests\wininet\wininet_winetest.exe 7 optional modules\rostests\winetests\wintrust\wintrust_winetest.exe 7 optional +modules\rostests\winetests\wlanapi\wlanapi_winetest.exe 7 optional modules\rostests\winetests\ws2_32\ws2_32_winetest.exe 7 optional modules\wallpaper\Angelus_02_ROSWP.bmp 4 optional diff --git a/reactos/dll/win32/wlanapi/main.c b/reactos/dll/win32/wlanapi/main.c index 19f9c2e8f02..af85f65c00c 100644 --- a/reactos/dll/win32/wlanapi/main.c +++ b/reactos/dll/win32/wlanapi/main.c @@ -23,8 +23,62 @@ #include #include "wlansvc_c.h" -#define NDEBUG -#include +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wlanapi); + +handle_t __RPC_USER +WLANSVC_HANDLE_bind(WLANSVC_HANDLE szMachineName) +{ + handle_t hBinding = NULL; + LPWSTR pszStringBinding; + RPC_STATUS Status; + + TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n"); + + Status = RpcStringBindingComposeW(NULL, + L"ncacn_np", + szMachineName, + L"\\pipe\\trkwks", + NULL, + &pszStringBinding); + if (Status != RPC_S_OK) + { + ERR("RpcStringBindingCompose returned 0x%x\n", Status); + return NULL; + } + + /* Set the binding handle that will be used to bind to the server. */ + Status = RpcBindingFromStringBindingW(pszStringBinding, + &hBinding); + if (Status != RPC_S_OK) + { + ERR("RpcBindingFromStringBinding returned 0x%x\n", Status); + } + + Status = RpcStringFreeW(&pszStringBinding); + if (Status != RPC_S_OK) + { + ERR("RpcStringFree returned 0x%x\n", Status); + } + + return hBinding; +} + +void __RPC_USER +WLANSVC_HANDLE_unbind(WLANSVC_HANDLE szMachineName, + handle_t hBinding) +{ + RPC_STATUS Status; + + TRACE("WLANSVC_HANDLE_unbind() called\n"); + + Status = RpcBindingFree(&hBinding); + if (Status != RPC_S_OK) + { + ERR("RpcBindingFree returned 0x%x\n", Status); + } +} PVOID WINAPI @@ -40,6 +94,34 @@ WlanFreeMemory(IN PVOID pMem) HeapFree(GetProcessHeap(), 0, pMem); } +DWORD +WINAPI +WlanOpenHandle(IN DWORD dwClientVersion, + PVOID pReserved, + OUT DWORD *pdwNegotiatedVersion, + OUT HANDLE *phClientHandle) +{ + DWORD dwError = ERROR_SUCCESS; + + if ((pReserved != NULL) || (pdwNegotiatedVersion == NULL) || (phClientHandle == NULL)) + return ERROR_INVALID_PARAMETER; + + RpcTryExcept + { + dwError = _RpcOpenHandle(NULL, + dwClientVersion, + pdwNegotiatedVersion, + (WLANSVC_RPC_HANDLE) phClientHandle); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + dwError = RpcExceptionCode(); + } + RpcEndExcept; + + return dwError; +} + DWORD WINAPI WlanCloseHandle(IN HANDLE hClientHandle, @@ -47,6 +129,9 @@ WlanCloseHandle(IN HANDLE hClientHandle, { DWORD dwError = ERROR_SUCCESS; + if ((pReserved != NULL) || (hClientHandle == NULL)) + return ERROR_INVALID_PARAMETER; + RpcTryExcept { _RpcCloseHandle(hClientHandle); diff --git a/reactos/dll/win32/wlanapi/wlanapi.rbuild b/reactos/dll/win32/wlanapi/wlanapi.rbuild index 20c8f810519..6b07c3c1e29 100644 --- a/reactos/dll/win32/wlanapi/wlanapi.rbuild +++ b/reactos/dll/win32/wlanapi/wlanapi.rbuild @@ -3,6 +3,7 @@ . . wlansvc_client + wine kernel32 rpcrt4 pseh diff --git a/reactos/dll/win32/wlanapi/wlanapi.spec b/reactos/dll/win32/wlanapi/wlanapi.spec index d91be46a21a..e0ae5b67a34 100644 --- a/reactos/dll/win32/wlanapi/wlanapi.spec +++ b/reactos/dll/win32/wlanapi/wlanapi.spec @@ -15,7 +15,7 @@ @ stub WlanGetProfileList @ stub WlanGetSecuritySettings @ stub WlanIhvControl -@ stub WlanOpenHandle +@ stdcall WlanOpenHandle (long ptr ptr ptr) @ stub WlanQueryAutoConfigParameter @ stub WlanQueryInterface @ stub WlanReasonCodeToString diff --git a/reactos/include/reactos/idl/wlansvc.idl b/reactos/include/reactos/idl/wlansvc.idl index 49d8aa44e85..addaa1839f7 100644 --- a/reactos/include/reactos/idl/wlansvc.idl +++ b/reactos/include/reactos/idl/wlansvc.idl @@ -7,6 +7,7 @@ typedef [context_handle] PVOID WLANSVC_RPC_HANDLE; typedef WLANSVC_RPC_HANDLE* LPWLANSVC_RPC_HANDLE; +typedef [handle] LPWSTR WLANSVC_HANDLE; /* FIXME */ typedef struct struct_C { @@ -46,7 +47,7 @@ interface wlansvc_interface { /* Function: 0x00 */ DWORD _RpcOpenHandle( - [in] wchar_t * arg_1, + [in] WLANSVC_HANDLE szMachineName, [in] DWORD dwClientVersion, [in, out] DWORD* pdwNegotiatedVersion, [in, out] LPWLANSVC_RPC_HANDLE phClientHandle);