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 #define COM_NO_WINDOWS_H
29 #include <wlansvc_c.h>
31 #include <wine/debug.h>
33 WINE_DEFAULT_DEBUG_CHANNEL(wlanapi
);
36 WLANSVC_HANDLE_bind(WLANSVC_HANDLE szMachineName
)
38 handle_t hBinding
= NULL
;
39 LPWSTR pszStringBinding
;
42 TRACE("RPC_SERVICE_STATUS_HANDLE_bind() called\n");
44 Status
= RpcStringBindingComposeW(NULL
,
50 if (Status
!= RPC_S_OK
)
52 ERR("RpcStringBindingCompose returned 0x%x\n", Status
);
56 /* Set the binding handle that will be used to bind to the server. */
57 Status
= RpcBindingFromStringBindingW(pszStringBinding
,
59 if (Status
!= RPC_S_OK
)
61 ERR("RpcBindingFromStringBinding returned 0x%x\n", Status
);
64 Status
= RpcStringFreeW(&pszStringBinding
);
65 if (Status
!= RPC_S_OK
)
67 ERR("RpcStringFree returned 0x%x\n", Status
);
74 WLANSVC_HANDLE_unbind(WLANSVC_HANDLE szMachineName
,
79 TRACE("WLANSVC_HANDLE_unbind() called\n");
81 Status
= RpcBindingFree(&hBinding
);
82 if (Status
!= RPC_S_OK
)
84 ERR("RpcBindingFree returned 0x%x\n", Status
);
90 WlanAllocateMemory(IN DWORD dwSize
)
92 return HeapAlloc(GetProcessHeap(), 0, dwSize
);
97 WlanFreeMemory(IN PVOID pMem
)
99 HeapFree(GetProcessHeap(), 0, pMem
);
104 WlanOpenHandle(IN DWORD dwClientVersion
,
106 OUT DWORD
*pdwNegotiatedVersion
,
107 OUT HANDLE
*phClientHandle
)
109 DWORD dwError
= ERROR_SUCCESS
;
110 WCHAR szDummy
[] = L
"localhost";
112 if ((pReserved
!= NULL
) || (pdwNegotiatedVersion
== NULL
) || (phClientHandle
== NULL
))
113 return ERROR_INVALID_PARAMETER
;
117 dwError
= _RpcOpenHandle(szDummy
,
119 pdwNegotiatedVersion
,
120 (WLANSVC_RPC_HANDLE
) phClientHandle
);
122 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
124 dwError
= RpcExceptionCode();
133 WlanCloseHandle(IN HANDLE hClientHandle
,
136 DWORD dwError
= ERROR_SUCCESS
;
138 if ((pReserved
!= NULL
) || (hClientHandle
== NULL
))
139 return ERROR_INVALID_PARAMETER
;
143 _RpcCloseHandle(hClientHandle
);
145 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
147 dwError
= RpcExceptionCode();
156 WlanEnumInterfaces(IN HANDLE hClientHandle
,
158 OUT PWLAN_INTERFACE_INFO_LIST
*ppInterfaceList
)
160 DWORD dwError
= ERROR_SUCCESS
;
162 if ((pReserved
!= NULL
) || (ppInterfaceList
== NULL
) || (hClientHandle
== NULL
))
163 return ERROR_INVALID_PARAMETER
;
167 _RpcEnumInterfaces(hClientHandle
, ppInterfaceList
);
169 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
171 dwError
= RpcExceptionCode();
180 WlanScan(IN HANDLE hClientHandle
,
181 IN GUID
*pInterfaceGuid
,
182 IN PDOT11_SSID pDot11Ssid
,
183 IN PWLAN_RAW_DATA pIeData
,
186 DWORD dwError
= ERROR_SUCCESS
;
188 if ((pReserved
!= NULL
) || (pInterfaceGuid
== NULL
) || (hClientHandle
== NULL
))
189 return ERROR_INVALID_PARAMETER
;
193 _RpcScan(hClientHandle
, pInterfaceGuid
, pDot11Ssid
, pIeData
);
195 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
197 dwError
= RpcExceptionCode();
204 void __RPC_FAR
* __RPC_USER
205 midl_user_allocate(SIZE_T len
)
207 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
211 midl_user_free(void __RPC_FAR
* ptr
)
213 HeapFree(GetProcessHeap(), 0, ptr
);