2 * Wireless LAN API (wlanapi.dll)
4 * Copyright 2009 Christoph von Wittich (Christoph@ApiViewer.de)
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.
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.
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
22 /* INCLUDES ****************************************************************/
23 #define WIN32_NO_STATUS
25 #include "wlansvc_c.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(wlanapi
);
32 WLANSVC_HANDLE_bind(WLANSVC_HANDLE szMachineName
)
34 handle_t hBinding
= NULL
;
35 LPWSTR pszStringBinding
;
38 TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n");
40 Status
= RpcStringBindingComposeW(NULL
,
46 if (Status
!= RPC_S_OK
)
48 ERR("RpcStringBindingCompose returned 0x%x\n", Status
);
52 /* Set the binding handle that will be used to bind to the server. */
53 Status
= RpcBindingFromStringBindingW(pszStringBinding
,
55 if (Status
!= RPC_S_OK
)
57 ERR("RpcBindingFromStringBinding returned 0x%x\n", Status
);
60 Status
= RpcStringFreeW(&pszStringBinding
);
61 if (Status
!= RPC_S_OK
)
63 ERR("RpcStringFree returned 0x%x\n", Status
);
70 WLANSVC_HANDLE_unbind(WLANSVC_HANDLE szMachineName
,
75 TRACE("WLANSVC_HANDLE_unbind() called\n");
77 Status
= RpcBindingFree(&hBinding
);
78 if (Status
!= RPC_S_OK
)
80 ERR("RpcBindingFree returned 0x%x\n", Status
);
86 WlanAllocateMemory(IN DWORD dwSize
)
88 return HeapAlloc(GetProcessHeap(), 0, dwSize
);
93 WlanFreeMemory(IN PVOID pMem
)
95 HeapFree(GetProcessHeap(), 0, pMem
);
100 WlanOpenHandle(IN DWORD dwClientVersion
,
102 OUT DWORD
*pdwNegotiatedVersion
,
103 OUT HANDLE
*phClientHandle
)
105 DWORD dwError
= ERROR_SUCCESS
;
106 WCHAR szDummy
[] = L
"localhost";
108 if ((pReserved
!= NULL
) || (pdwNegotiatedVersion
== NULL
) || (phClientHandle
== NULL
))
109 return ERROR_INVALID_PARAMETER
;
113 dwError
= _RpcOpenHandle(szDummy
,
115 pdwNegotiatedVersion
,
116 (WLANSVC_RPC_HANDLE
) phClientHandle
);
118 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
120 dwError
= RpcExceptionCode();
129 WlanCloseHandle(IN HANDLE hClientHandle
,
132 DWORD dwError
= ERROR_SUCCESS
;
134 if ((pReserved
!= NULL
) || (hClientHandle
== NULL
))
135 return ERROR_INVALID_PARAMETER
;
139 _RpcCloseHandle(hClientHandle
);
141 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
143 dwError
= RpcExceptionCode();
152 WlanEnumInterfaces(IN HANDLE hClientHandle
,
154 OUT PWLAN_INTERFACE_INFO_LIST
*ppInterfaceList
)
156 DWORD dwError
= ERROR_SUCCESS
;
158 if ((pReserved
!= NULL
) || (ppInterfaceList
== NULL
) || (hClientHandle
== NULL
))
159 return ERROR_INVALID_PARAMETER
;
163 _RpcEnumInterfaces(hClientHandle
, ppInterfaceList
);
165 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
167 dwError
= RpcExceptionCode();
176 WlanScan(IN HANDLE hClientHandle
,
177 IN GUID
*pInterfaceGuid
,
178 IN PDOT11_SSID pDot11Ssid
,
179 IN PWLAN_RAW_DATA pIeData
,
182 DWORD dwError
= ERROR_SUCCESS
;
184 if ((pReserved
!= NULL
) || (pInterfaceGuid
== NULL
) || (hClientHandle
== NULL
))
185 return ERROR_INVALID_PARAMETER
;
189 _RpcScan(hClientHandle
, pInterfaceGuid
, pDot11Ssid
, pIeData
);
191 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
193 dwError
= RpcExceptionCode();
200 void __RPC_FAR
* __RPC_USER
201 midl_user_allocate(SIZE_T len
)
203 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
207 midl_user_free(void __RPC_FAR
* ptr
)
209 HeapFree(GetProcessHeap(), 0, ptr
);