ReactOS 0.4.16-dev-297-gc569aee
main.c
Go to the documentation of this file.
1/*
2 * Wireless LAN API (wlanapi.dll)
3 *
4 * Copyright 2009 Christoph von Wittich (Christoph@ApiViewer.de)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21
22/* INCLUDES ****************************************************************/
23#define WIN32_NO_STATUS
24#define _INC_WINDOWS
25#define COM_NO_WINDOWS_H
26#include <stdarg.h>
27#include <windef.h>
28#include <winbase.h>
29#include <wlansvc_c.h>
30
31#include <wine/debug.h>
32
34
37{
38 switch (Status)
39 {
43
47
50
51 default:
52 return (DWORD)Status;
53 }
54}
55
58{
60 LPWSTR pszStringBinding;
62
63 TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n");
64
66 L"ncalrpc",
67 szMachineName,
68 L"wlansvc",
69 NULL,
70 &pszStringBinding);
71 if (Status != RPC_S_OK)
72 {
73 ERR("RpcStringBindingCompose returned 0x%x\n", Status);
74 return NULL;
75 }
76
77 /* Set the binding handle that will be used to bind to the server. */
78 Status = RpcBindingFromStringBindingW(pszStringBinding,
79 &hBinding);
80 if (Status != RPC_S_OK)
81 {
82 ERR("RpcBindingFromStringBinding returned 0x%x\n", Status);
83 }
84
85 Status = RpcStringFreeW(&pszStringBinding);
86 if (Status != RPC_S_OK)
87 {
88 ERR("RpcStringFree returned 0x%x\n", Status);
89 }
90
91 return hBinding;
92}
93
94void __RPC_USER
97{
99
100 TRACE("WLANSVC_HANDLE_unbind() called\n");
101
103 if (Status != RPC_S_OK)
104 {
105 ERR("RpcBindingFree returned 0x%x\n", Status);
106 }
107}
108
109PVOID
110WINAPI
112{
113 return HeapAlloc(GetProcessHeap(), 0, dwSize);
114}
115
116VOID
117WINAPI
119{
120 HeapFree(GetProcessHeap(), 0, pMem);
121}
122
123DWORD
124WINAPI
125WlanConnect(IN HANDLE hClientHandle,
126 IN const GUID *pInterfaceGuid,
127 IN const PWLAN_CONNECTION_PARAMETERS pConnectionParameters,
128 PVOID pReserved)
129{
130 DWORD dwResult = ERROR_SUCCESS;
131
132 if ((pReserved != NULL) || (hClientHandle == NULL) || (pInterfaceGuid == NULL) || (pConnectionParameters == NULL))
134
136 {
137 dwResult = _RpcConnect(hClientHandle, pInterfaceGuid, &pConnectionParameters);
138 }
140 {
142 }
144
145 return dwResult;
146}
147
148DWORD
149WINAPI
151 IN const GUID *pInterfaceGuid,
152 PVOID pReserved)
153{
154 DWORD dwResult = ERROR_SUCCESS;
155
156 if ((pReserved != NULL) || (hClientHandle == NULL) || (pInterfaceGuid == NULL))
158
160 {
161 dwResult = _RpcDisconnect(hClientHandle, pInterfaceGuid);
162 }
164 {
166 }
168
169 return dwResult;
170}
171
172DWORD
173WINAPI
174WlanOpenHandle(IN DWORD dwClientVersion,
175 PVOID pReserved,
176 OUT DWORD *pdwNegotiatedVersion,
177 OUT HANDLE *phClientHandle)
178{
179 DWORD dwResult = ERROR_SUCCESS;
180 WCHAR szDummy[] = L"localhost";
181
182 if ((pReserved != NULL) || (pdwNegotiatedVersion == NULL) || (phClientHandle == NULL))
184
186 {
187 dwResult = _RpcOpenHandle(szDummy,
188 dwClientVersion,
189 pdwNegotiatedVersion,
190 (WLANSVC_RPC_HANDLE) phClientHandle);
191 }
193 {
195 }
197
198 return dwResult;
199}
200
201DWORD
202WINAPI
204 PVOID pReserved)
205{
206 DWORD dwResult = ERROR_SUCCESS;
207
208 if ((pReserved != NULL) || (hClientHandle == NULL))
210
212 {
213 dwResult = _RpcCloseHandle(&hClientHandle);
214 }
216 {
218 }
220
221 return dwResult;
222}
223
224DWORD
225WINAPI
227 PVOID pReserved,
228 OUT PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
229{
230 DWORD dwResult = ERROR_SUCCESS;
231
232 if ((pReserved != NULL) || (ppInterfaceList == NULL) || (hClientHandle == NULL))
234
236 {
237 dwResult = _RpcEnumInterfaces(hClientHandle, ppInterfaceList);
238 }
240 {
242 }
244
245 return dwResult;
246}
247
248DWORD
249WINAPI
250WlanScan(IN HANDLE hClientHandle,
251 IN const GUID *pInterfaceGuid,
252 IN PDOT11_SSID pDot11Ssid,
253 IN PWLAN_RAW_DATA pIeData,
254 PVOID pReserved)
255{
256 DWORD dwResult = ERROR_SUCCESS;
257
258 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL))
260
262 {
263 dwResult = _RpcScan(hClientHandle, pInterfaceGuid, pDot11Ssid, pIeData);
264 }
266 {
268 }
270
271 return dwResult;
272}
273
274DWORD
275WINAPI
277 IN const GUID *pInterfaceGuid,
279 PVOID pReserved,
280 OUT PDWORD pdwDataSize,
282 WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType)
283{
284 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (pdwDataSize == NULL) || (ppData == NULL))
286
288 return ERROR_SUCCESS;
289}
290
291DWORD
292WINAPI
294 IN const GUID *pInterfaceGuid,
295 PVOID pReserved,
296 OUT PWLAN_INTERFACE_CAPABILITY *ppCapability)
297{
298 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (ppCapability == NULL))
300
302 return ERROR_SUCCESS;
303}
304
306 IN DWORD dwNotifSource,
307 IN BOOL bIgnoreDuplicate,
308 WLAN_NOTIFICATION_CALLBACK funcCallback,
309 PVOID pCallbackContext,
310 PVOID pReserved,
311 PDWORD pdwPrevNotifSource)
312{
314 return ERROR_SUCCESS;
315}
316
317DWORD
318WINAPI
320 IN DWORD dwBufferSize,
321 IN PWCHAR pStringBuffer,
322 PVOID pReserved)
323{
324 if ((pReserved != NULL) || (pStringBuffer == NULL) || (dwBufferSize == 0))
326
328 return ERROR_SUCCESS;
329}
330
331DWORD
332WINAPI
334 IN const GUID *pInterfaceGuid,
336 IN DWORD dwInBufferSize,
337 IN PVOID pInBuffer,
338 IN DWORD dwOutBufferSize,
339 PVOID pOutBuffer,
340 OUT PDWORD pdwBytesReturned)
341{
342 if ((hClientHandle == NULL) || (pInterfaceGuid == NULL) || (pdwBytesReturned == NULL))
344
346 return ERROR_SUCCESS;
347}
348
349DWORD
350WINAPI
352 IN WLAN_SECURABLE_OBJECT SecurableObject,
353 IN LPCWSTR strModifiedSDDL)
354{
355 DWORD dwResult = ERROR_SUCCESS;
356
357 if ((hClientHandle == NULL) || (strModifiedSDDL == NULL) || (SecurableObject >= WLAN_SECURABLE_OBJECT_COUNT))
359
361 {
362 dwResult = _RpcSetSecuritySettings(hClientHandle, SecurableObject, strModifiedSDDL);
363 }
365 {
367 }
369
370 return dwResult;
371}
372
373DWORD
374WINAPI
376 IN const GUID *pInterfaceGuid,
378 PVOID pReserved,
379 OUT PWLAN_AVAILABLE_NETWORK_LIST *ppAvailableNetworkList)
380{
381 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (ppAvailableNetworkList == NULL))
383
385 return ERROR_SUCCESS;
386}
387
390{
392}
393
394void __RPC_USER
396{
398}
399
Type
Definition: Type.h:7
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
DWORD _RpcOpenHandle(wchar_t *arg_1, DWORD dwClientVersion, DWORD *pdwNegotiatedVersion, LPWLANSVC_RPC_HANDLE phClientHandle)
Definition: rpcserver.c:67
DWORD _RpcEnumInterfaces(WLANSVC_RPC_HANDLE hClientHandle, PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
Definition: rpcserver.c:114
DWORD _RpcDisconnect(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGUID)
Definition: rpcserver.c:319
DWORD _RpcConnect(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGuid, const PWLAN_CONNECTION_PARAMETERS *pConnectionParameters)
Definition: rpcserver.c:310
DWORD _RpcCloseHandle(LPWLANSVC_RPC_HANDLE phClientHandle)
Definition: rpcserver.c:97
DWORD _RpcSetSecuritySettings(WLANSVC_RPC_HANDLE hClientHandle, WLAN_SECURABLE_OBJECT SecurableObject, const wchar_t *strModifiedSDDL)
Definition: rpcserver.c:599
DWORD _RpcScan(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGuid, PDOT11_SSID pDot11Ssid, PWLAN_RAW_DATA pIeData)
Definition: rpcserver.c:254
#define ERR(fmt,...)
Definition: precomp.h:57
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
handle_t hBinding
Definition: ctx_c.c:54
#define ERROR_SUCCESS
Definition: deptool.c:10
OpCode
Definition: dlist.c:229
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_ADDRESS
Definition: compat.h:106
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD WINAPI WlanScan(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN PDOT11_SSID pDot11Ssid, IN PWLAN_RAW_DATA pIeData, PVOID pReserved)
Definition: main.c:250
VOID WINAPI WlanFreeMemory(IN PVOID pMem)
Definition: main.c:118
DWORD WlanRpcStatusToWinError(RPC_STATUS Status)
Definition: main.c:36
DWORD WINAPI WlanRegisterNotification(IN HANDLE hClientHandle, IN DWORD dwNotifSource, IN BOOL bIgnoreDuplicate, WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext, PVOID pReserved, PDWORD pdwPrevNotifSource)
Definition: main.c:305
DWORD WINAPI WlanDisconnect(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved)
Definition: main.c:150
DWORD WINAPI WlanGetInterfaceCapability(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved, OUT PWLAN_INTERFACE_CAPABILITY *ppCapability)
Definition: main.c:293
void __RPC_USER WLANSVC_HANDLE_unbind(WLANSVC_HANDLE szMachineName, handle_t hBinding)
Definition: main.c:95
DWORD WINAPI WlanSetSecuritySettings(IN HANDLE hClientHandle, IN WLAN_SECURABLE_OBJECT SecurableObject, IN LPCWSTR strModifiedSDDL)
Definition: main.c:351
DWORD WINAPI WlanIhvControl(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN WLAN_IHV_CONTROL_TYPE Type, IN DWORD dwInBufferSize, IN PVOID pInBuffer, IN DWORD dwOutBufferSize, PVOID pOutBuffer, OUT PDWORD pdwBytesReturned)
Definition: main.c:333
DWORD WINAPI WlanOpenHandle(IN DWORD dwClientVersion, PVOID pReserved, OUT DWORD *pdwNegotiatedVersion, OUT HANDLE *phClientHandle)
Definition: main.c:174
DWORD WINAPI WlanCloseHandle(IN HANDLE hClientHandle, PVOID pReserved)
Definition: main.c:203
handle_t __RPC_USER WLANSVC_HANDLE_bind(WLANSVC_HANDLE szMachineName)
Definition: main.c:57
DWORD WINAPI WlanConnect(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN const PWLAN_CONNECTION_PARAMETERS pConnectionParameters, PVOID pReserved)
Definition: main.c:125
DWORD WINAPI WlanEnumInterfaces(IN HANDLE hClientHandle, PVOID pReserved, OUT PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
Definition: main.c:226
DWORD WINAPI WlanQueryInterface(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN WLAN_INTF_OPCODE OpCode, PVOID pReserved, OUT PDWORD pdwDataSize, OUT PVOID *ppData, WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType)
Definition: main.c:276
PVOID WINAPI WlanAllocateMemory(IN DWORD dwSize)
Definition: main.c:111
DWORD WINAPI WlanGetAvailableNetworkList(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN DWORD dwFlags, PVOID pReserved, OUT PWLAN_AVAILABLE_NETWORK_LIST *ppAvailableNetworkList)
Definition: main.c:375
DWORD WINAPI WlanReasonCodeToString(IN DWORD dwReasonCode, IN DWORD dwBufferSize, IN PWCHAR pStringBuffer, PVOID pReserved)
Definition: main.c:319
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
GLenum GLsizei len
Definition: glext.h:6722
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PSDBQUERYRESULT_VISTA PVOID * ppData
Definition: env.c:56
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static PVOID ptr
Definition: dispmode.c:27
#define L(x)
Definition: ntvdm.h:50
DWORD * PDWORD
Definition: pedump.c:68
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
#define RpcEndExcept
Definition: rpc.h:128
#define midl_user_free
Definition: rpc.h:45
#define __RPC_FAR
Definition: rpc.h:56
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
long RPC_STATUS
Definition: rpc.h:52
#define __RPC_USER
Definition: rpc.h:65
#define RpcExceptionCode()
Definition: rpc.h:132
#define midl_user_allocate
Definition: rpc.h:44
#define TRACE(s)
Definition: solgame.cpp:4
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
#define OUT
Definition: typedefs.h:40
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1088
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1083
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
#define RPC_X_BYTE_COUNT_TOO_SMALL
Definition: winerror.h:1089
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013
enum _WLAN_INTF_OPCODE WLAN_INTF_OPCODE
void(__stdcall * WLAN_NOTIFICATION_CALLBACK)(PWLAN_NOTIFICATION_DATA, PVOID)
Definition: wlanapi.h:245
enum _WLAN_OPCODE_VALUE_TYPE WLAN_OPCODE_VALUE_TYPE
enum _WLAN_IHV_CONTROL_TYPE WLAN_IHV_CONTROL_TYPE
enum _WLAN_SECURABLE_OBJECT WLAN_SECURABLE_OBJECT
@ WLAN_SECURABLE_OBJECT_COUNT
Definition: wlanapi.h:59
LPWSTR WLANSVC_HANDLE
Definition: wlansvc.idl:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185