ReactOS 0.4.15-dev-7924-g5949c20
main.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wlansvc_c.h>
#include <wine/debug.h>
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wlanapi)
 
DWORD WlanRpcStatusToWinError (RPC_STATUS Status)
 
handle_t __RPC_USER WLANSVC_HANDLE_bind (WLANSVC_HANDLE szMachineName)
 
void __RPC_USER WLANSVC_HANDLE_unbind (WLANSVC_HANDLE szMachineName, handle_t hBinding)
 
PVOID WINAPI WlanAllocateMemory (IN DWORD dwSize)
 
VOID WINAPI WlanFreeMemory (IN PVOID pMem)
 
DWORD WINAPI WlanConnect (IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN const PWLAN_CONNECTION_PARAMETERS pConnectionParameters, PVOID pReserved)
 
DWORD WINAPI WlanDisconnect (IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved)
 
DWORD WINAPI WlanOpenHandle (IN DWORD dwClientVersion, PVOID pReserved, OUT DWORD *pdwNegotiatedVersion, OUT HANDLE *phClientHandle)
 
DWORD WINAPI WlanCloseHandle (IN HANDLE hClientHandle, PVOID pReserved)
 
DWORD WINAPI WlanEnumInterfaces (IN HANDLE hClientHandle, PVOID pReserved, OUT PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
 
DWORD WINAPI WlanScan (IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN PDOT11_SSID pDot11Ssid, IN PWLAN_RAW_DATA pIeData, PVOID pReserved)
 
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)
 
DWORD WINAPI WlanGetInterfaceCapability (IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved, OUT PWLAN_INTERFACE_CAPABILITY *ppCapability)
 
DWORD WINAPI WlanRegisterNotification (IN HANDLE hClientHandle, IN DWORD dwNotifSource, IN BOOL bIgnoreDuplicate, WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext, PVOID pReserved, PDWORD pdwPrevNotifSource)
 
DWORD WINAPI WlanReasonCodeToString (IN DWORD dwReasonCode, IN DWORD dwBufferSize, IN PWCHAR pStringBuffer, PVOID pReserved)
 
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)
 
DWORD WINAPI WlanSetSecuritySettings (IN HANDLE hClientHandle, IN WLAN_SECURABLE_OBJECT SecurableObject, IN LPCWSTR strModifiedSDDL)
 
DWORD WINAPI WlanGetAvailableNetworkList (IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN DWORD dwFlags, PVOID pReserved, OUT PWLAN_AVAILABLE_NETWORK_LIST *ppAvailableNetworkList)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 24 of file main.c.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 25 of file main.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 23 of file main.c.

Function Documentation

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 389 of file main.c.

390{
392}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 395 of file main.c.

396{
398}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wlanapi  )

◆ WlanAllocateMemory()

PVOID WINAPI WlanAllocateMemory ( IN DWORD  dwSize)

Definition at line 111 of file main.c.

112{
113 return HeapAlloc(GetProcessHeap(), 0, dwSize);
114}
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

◆ WlanCloseHandle()

DWORD WINAPI WlanCloseHandle ( IN HANDLE  hClientHandle,
PVOID  pReserved 
)

Definition at line 203 of file main.c.

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}
DWORD _RpcCloseHandle(LPWLANSVC_RPC_HANDLE phClientHandle)
Definition: rpcserver.c:97
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
DWORD WlanRpcStatusToWinError(RPC_STATUS Status)
Definition: main.c:36
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132

Referenced by WlanCloseHandle_test(), and WlanOpenHandle_test().

◆ WlanConnect()

DWORD WINAPI WlanConnect ( IN HANDLE  hClientHandle,
IN const GUID pInterfaceGuid,
IN const PWLAN_CONNECTION_PARAMETERS  pConnectionParameters,
PVOID  pReserved 
)

Definition at line 125 of file main.c.

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}
DWORD _RpcConnect(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGuid, const PWLAN_CONNECTION_PARAMETERS *pConnectionParameters)
Definition: rpcserver.c:310

◆ WlanDisconnect()

DWORD WINAPI WlanDisconnect ( IN HANDLE  hClientHandle,
IN const GUID pInterfaceGuid,
PVOID  pReserved 
)

Definition at line 150 of file main.c.

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}
DWORD _RpcDisconnect(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGUID)
Definition: rpcserver.c:319

◆ WlanEnumInterfaces()

DWORD WINAPI WlanEnumInterfaces ( IN HANDLE  hClientHandle,
PVOID  pReserved,
OUT PWLAN_INTERFACE_INFO_LIST ppInterfaceList 
)

Definition at line 226 of file main.c.

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}
DWORD _RpcEnumInterfaces(WLANSVC_RPC_HANDLE hClientHandle, PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
Definition: rpcserver.c:114

Referenced by WlanEnumInterfaces_test().

◆ WlanFreeMemory()

VOID WINAPI WlanFreeMemory ( IN PVOID  pMem)

Definition at line 118 of file main.c.

119{
120 HeapFree(GetProcessHeap(), 0, pMem);
121}

◆ WlanGetAvailableNetworkList()

DWORD WINAPI WlanGetAvailableNetworkList ( IN HANDLE  hClientHandle,
IN const GUID pInterfaceGuid,
IN DWORD  dwFlags,
PVOID  pReserved,
OUT PWLAN_AVAILABLE_NETWORK_LIST ppAvailableNetworkList 
)

Definition at line 375 of file main.c.

380{
381 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (ppAvailableNetworkList == NULL))
383
385 return ERROR_SUCCESS;
386}
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlanGetInterfaceCapability()

DWORD WINAPI WlanGetInterfaceCapability ( IN HANDLE  hClientHandle,
IN const GUID pInterfaceGuid,
PVOID  pReserved,
OUT PWLAN_INTERFACE_CAPABILITY ppCapability 
)

Definition at line 293 of file main.c.

297{
298 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (ppCapability == NULL))
300
302 return ERROR_SUCCESS;
303}

Referenced by WlanGetInterfaceCapability_test().

◆ WlanIhvControl()

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 at line 333 of file main.c.

341{
342 if ((hClientHandle == NULL) || (pInterfaceGuid == NULL) || (pdwBytesReturned == NULL))
344
346 return ERROR_SUCCESS;
347}

◆ WlanOpenHandle()

DWORD WINAPI WlanOpenHandle ( IN DWORD  dwClientVersion,
PVOID  pReserved,
OUT DWORD pdwNegotiatedVersion,
OUT HANDLE phClientHandle 
)

Definition at line 174 of file main.c.

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}
DWORD _RpcOpenHandle(wchar_t *arg_1, DWORD dwClientVersion, DWORD *pdwNegotiatedVersion, LPWLANSVC_RPC_HANDLE phClientHandle)
Definition: rpcserver.c:67
#define L(x)
Definition: ntvdm.h:50
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by WlanOpenHandle_test().

◆ WlanQueryInterface()

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 at line 276 of file main.c.

283{
284 if ((pReserved != NULL) || (pInterfaceGuid == NULL) || (hClientHandle == NULL) || (pdwDataSize == NULL) || (ppData == NULL))
286
288 return ERROR_SUCCESS;
289}
PSDBQUERYRESULT_VISTA PVOID * ppData
Definition: env.c:56

◆ WlanReasonCodeToString()

DWORD WINAPI WlanReasonCodeToString ( IN DWORD  dwReasonCode,
IN DWORD  dwBufferSize,
IN PWCHAR  pStringBuffer,
PVOID  pReserved 
)

Definition at line 319 of file main.c.

323{
324 if ((pReserved != NULL) || (pStringBuffer == NULL) || (dwBufferSize == 0))
326
328 return ERROR_SUCCESS;
329}

◆ WlanRegisterNotification()

DWORD WINAPI WlanRegisterNotification ( IN HANDLE  hClientHandle,
IN DWORD  dwNotifSource,
IN BOOL  bIgnoreDuplicate,
WLAN_NOTIFICATION_CALLBACK  funcCallback,
PVOID  pCallbackContext,
PVOID  pReserved,
PDWORD  pdwPrevNotifSource 
)

Definition at line 305 of file main.c.

312{
314 return ERROR_SUCCESS;
315}

◆ WlanRpcStatusToWinError()

DWORD WlanRpcStatusToWinError ( RPC_STATUS  Status)

Definition at line 36 of file main.c.

37{
38 switch (Status)
39 {
43
47
50
51 default:
52 return (DWORD)Status;
53 }
54}
#define ERROR_INVALID_ADDRESS
Definition: compat.h:106
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
Status
Definition: gdiplustypes.h:25
#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

Referenced by WlanCloseHandle(), WlanConnect(), WlanDisconnect(), WlanEnumInterfaces(), WlanOpenHandle(), WlanScan(), and WlanSetSecuritySettings().

◆ WlanScan()

DWORD WINAPI WlanScan ( IN HANDLE  hClientHandle,
IN const GUID pInterfaceGuid,
IN PDOT11_SSID  pDot11Ssid,
IN PWLAN_RAW_DATA  pIeData,
PVOID  pReserved 
)

Definition at line 250 of file main.c.

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}
DWORD _RpcScan(WLANSVC_RPC_HANDLE hClientHandle, const GUID *pInterfaceGuid, PDOT11_SSID pDot11Ssid, PWLAN_RAW_DATA pIeData)
Definition: rpcserver.c:254

◆ WlanSetSecuritySettings()

DWORD WINAPI WlanSetSecuritySettings ( IN HANDLE  hClientHandle,
IN WLAN_SECURABLE_OBJECT  SecurableObject,
IN LPCWSTR  strModifiedSDDL 
)

Definition at line 351 of file main.c.

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}
DWORD _RpcSetSecuritySettings(WLANSVC_RPC_HANDLE hClientHandle, WLAN_SECURABLE_OBJECT SecurableObject, const wchar_t *strModifiedSDDL)
Definition: rpcserver.c:599
@ WLAN_SECURABLE_OBJECT_COUNT
Definition: wlanapi.h:46

◆ WLANSVC_HANDLE_bind()

handle_t __RPC_USER WLANSVC_HANDLE_bind ( WLANSVC_HANDLE  szMachineName)

Definition at line 57 of file main.c.

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}
#define ERR(fmt,...)
Definition: debug.h:110
handle_t hBinding
Definition: ctx_c.c:54
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
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ WLANSVC_HANDLE_unbind()

void __RPC_USER WLANSVC_HANDLE_unbind ( WLANSVC_HANDLE  szMachineName,
handle_t  hBinding 
)

Definition at line 95 of file main.c.

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}
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787