4528481dfe9a5bdbf20bedef1276fc21e7801cbf
[reactos.git] / base / services / wlansvc / rpcserver.c
1 /*
2 * PROJECT: ReactOS WLAN Service
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/services/wlansvc/rpcserver.c
5 * PURPOSE: RPC server interface
6 * COPYRIGHT: Copyright 2009 Christoph von Wittich
7 */
8
9 /* INCLUDES ****************************************************************/
10 #include <windows.h>
11 #include <iphlpapi.h>
12
13 #include "wlansvc_s.h"
14
15 #define NDEBUG
16 #include <debug.h>
17 //#define GET_IF_ENTRY2_IMPLEMENTED 1
18
19 DWORD _RpcOpenHandle(
20 wchar_t *arg_1,
21 DWORD dwClientVersion,
22 DWORD *pdwNegotiatedVersion,
23 LPWLANSVC_RPC_HANDLE phClientHandle)
24 {
25 UNIMPLEMENTED;
26 return ERROR_CALL_NOT_IMPLEMENTED;
27 }
28
29 DWORD _RpcCloseHandle(
30 LPWLANSVC_RPC_HANDLE phClientHandle)
31 {
32 UNIMPLEMENTED;
33 return ERROR_CALL_NOT_IMPLEMENTED;
34 }
35
36 DWORD _RpcEnumInterfaces(
37 WLANSVC_RPC_HANDLE hClientHandle,
38 PWLAN_INTERFACE_INFO_LIST *ppInterfaceList)
39 {
40 #if GET_IF_ENTRY2_IMPLEMENTED
41 DWORD dwNumInterfaces;
42 DWORD dwResult, dwSize;
43 DWORD dwIndex;
44 MIB_IF_ROW2 IfRow;
45 PWLAN_INTERFACE_INFO_LIST InterfaceList;
46
47 if (!hClientHandle || !ppInterfaceList)
48 return ERROR_INVALID_PARAMETER;
49
50 dwResult = GetNumberOfInterfaces(&dwNumInterfaces);
51 dwSize = sizeof(WLAN_INTERFACE_INFO_LIST);
52 if (dwResult != NO_ERROR)
53 {
54 /* set num interfaces to zero when an error occurs */
55 dwNumInterfaces = 0;
56 }
57 else
58 {
59 if (dwNumInterfaces > 1)
60 {
61 /* add extra size for interface */
62 dwSize += (dwNumInterfaces-1) * sizeof(WLAN_INTERFACE_INFO);
63 }
64 }
65
66 /* allocate interface list */
67 InterfaceList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
68 if (!InterfaceList)
69 {
70 return ERROR_NOT_ENOUGH_MEMORY;
71 }
72
73 *ppInterfaceList = InterfaceList;
74 if (!dwNumInterfaces)
75 {
76 return ERROR_SUCCESS;
77 }
78
79 for(dwIndex = 0; dwIndex < dwNumInterfaces; dwIndex++)
80 {
81 ZeroMemory(&IfRow, sizeof(MIB_IF_ROW2));
82 IfRow.InterfaceIndex = dwIndex;
83
84 dwResult = GetIfEntry2(&IfRow);
85 if (dwResult == NO_ERROR)
86 {
87 if (IfRow.Type == IF_TYPE_IEEE80211 && IfRow.InterfaceAndOperStatusFlags.HardwareInterface)
88 {
89 RtlMoveMemory(&InterfaceList->InterfaceInfo[InterfaceList->dwNumberOfItems].InterfaceGuid, &IfRow.InterfaceGuid, sizeof(GUID));
90 wcscpy(InterfaceList->InterfaceInfo[InterfaceList->dwNumberOfItems].strInterfaceDescription, IfRow.Description);
91 //FIXME set state
92 InterfaceList->dwNumberOfItems++;
93 }
94 }
95 }
96
97 return ERROR_SUCCESS;
98 #else
99 UNIMPLEMENTED;
100 return ERROR_CALL_NOT_IMPLEMENTED;
101 #endif
102 }
103
104 DWORD _RpcSetAutoConfigParameter(
105 WLANSVC_RPC_HANDLE hClientHandle,
106 long OpCode,
107 DWORD dwDataSize,
108 LPBYTE pData)
109 {
110 UNIMPLEMENTED;
111 return ERROR_CALL_NOT_IMPLEMENTED;
112 }
113
114 DWORD _RpcQueryAutoConfigParameter(
115 WLANSVC_RPC_HANDLE hClientHandle,
116 DWORD OpCode,
117 LPDWORD pdwDataSize,
118 char **ppData,
119 DWORD *pWlanOpcodeValueType)
120 {
121 UNIMPLEMENTED;
122 return ERROR_CALL_NOT_IMPLEMENTED;
123 }
124
125 DWORD _RpcGetInterfaceCapability(
126 WLANSVC_RPC_HANDLE hClientHandle,
127 GUID *pInterfaceGuid,
128 PWLAN_INTERFACE_CAPABILITY *ppCapability)
129 {
130 UNIMPLEMENTED;
131 return ERROR_CALL_NOT_IMPLEMENTED;
132 }
133
134 DWORD _RpcSetInterface(
135 WLANSVC_RPC_HANDLE hClientHandle,
136 GUID *pInterfaceGuid,
137 DWORD OpCode,
138 DWORD dwDataSize,
139 LPBYTE pData)
140 {
141 UNIMPLEMENTED;
142 return ERROR_CALL_NOT_IMPLEMENTED;
143 }
144
145 DWORD _RpcQueryInterface(
146 WLANSVC_RPC_HANDLE hClientHandle,
147 GUID *pInterfaceGuid,
148 long OpCode,
149 LPDWORD pdwDataSize,
150 LPBYTE *ppData,
151 LPDWORD pWlanOpcodeValueType)
152 {
153 UNIMPLEMENTED;
154 return ERROR_CALL_NOT_IMPLEMENTED;
155 }
156
157 DWORD _RpcIhvControl(
158 WLANSVC_RPC_HANDLE hClientHandle,
159 GUID *pInterfaceGuid,
160 DWORD Type,
161 DWORD dwInBufferSize,
162 LPBYTE pInBuffer,
163 DWORD dwOutBufferSize,
164 LPBYTE pOutBuffer,
165 LPDWORD pdwBytesReturned)
166 {
167 UNIMPLEMENTED;
168 return ERROR_CALL_NOT_IMPLEMENTED;
169 }
170
171 DWORD _RpcScan(
172 WLANSVC_RPC_HANDLE hClientHandle,
173 GUID *pInterfaceGuid,
174 PDOT11_SSID pDot11Ssid,
175 PWLAN_RAW_DATA pIeData)
176 {
177 /*
178 DWORD dwBytesReturned;
179 HANDLE hDevice;
180 ULONG OidCode = OID_802_11_BSSID_LIST_SCAN;
181 PNDIS_802_11_BSSID_LIST pBssIDList;
182
183 DeviceIoControl(hDevice,
184 IOCTL_NDIS_QUERY_GLOBAL_STATS,
185 &OidCode,
186 sizeof(ULONG),
187 NULL,
188 0,
189 &dwBytesReturned,
190 NULL);
191 */
192 UNIMPLEMENTED;
193 return ERROR_CALL_NOT_IMPLEMENTED;
194 }
195
196 DWORD _RpcGetAvailableNetworkList(
197 WLANSVC_RPC_HANDLE hClientHandle,
198 GUID *pInterfaceGuid,
199 DWORD dwFlags,
200 WLAN_AVAILABLE_NETWORK_LIST **ppAvailableNetworkList)
201 {
202 UNIMPLEMENTED;
203 return ERROR_CALL_NOT_IMPLEMENTED;
204 }
205
206 DWORD _RpcGetNetworkBssList(
207 WLANSVC_RPC_HANDLE hClientHandle,
208 GUID *pInterfaceGuid,
209 PDOT11_SSID pDot11Ssid,
210 short dot11BssType,
211 DWORD bSecurityEnabled,
212 LPDWORD dwBssListSize,
213 LPBYTE *ppWlanBssList)
214 {
215 UNIMPLEMENTED;
216 return ERROR_CALL_NOT_IMPLEMENTED;
217 }
218
219 DWORD _RpcConnect(
220 WLANSVC_RPC_HANDLE hClientHandle,
221 GUID *pInterfaceGuid,
222 PWLAN_CONNECTION_PARAMETERS *pConnectionParameters)
223 {
224 UNIMPLEMENTED;
225 return ERROR_CALL_NOT_IMPLEMENTED;
226 }
227
228 DWORD _RpcDisconnect(
229 WLANSVC_RPC_HANDLE hClientHandle,
230 GUID *pInterfaceGUID)
231 {
232 UNIMPLEMENTED;
233 return ERROR_CALL_NOT_IMPLEMENTED;
234 }
235
236 DWORD _RpcRegisterNotification(
237 WLANSVC_RPC_HANDLE hClientHandle,
238 DWORD arg_2,
239 LPDWORD pdwPrevNotifSource)
240 {
241 UNIMPLEMENTED;
242 return ERROR_CALL_NOT_IMPLEMENTED;
243 }
244
245 DWORD _RpcAsyncGetNotification(
246 WLANSVC_RPC_HANDLE hClientHandle,
247 PWLAN_NOTIFICATION_DATA *NotificationData)
248 {
249 UNIMPLEMENTED;
250 return ERROR_CALL_NOT_IMPLEMENTED;
251 }
252
253 DWORD _RpcSetProfileEapUserData(
254 WLANSVC_RPC_HANDLE hClientHandle,
255 GUID *pInterfaceGuid,
256 wchar_t *strProfileName,
257 EAP_METHOD_TYPE MethodType,
258 DWORD dwFlags,
259 DWORD dwEapUserDataSize,
260 LPBYTE pbEapUserData)
261 {
262 UNIMPLEMENTED;
263 return ERROR_CALL_NOT_IMPLEMENTED;
264 }
265
266 DWORD _RpcSetProfile(
267 WLANSVC_RPC_HANDLE hClientHandle,
268 GUID *pInterfaceGuid,
269 DWORD dwFlags,
270 wchar_t *strProfileXml,
271 wchar_t *strAllUserProfileSecurity,
272 BOOL bOverwrite,
273 LPDWORD pdwReasonCode)
274 {
275 UNIMPLEMENTED;
276 return ERROR_CALL_NOT_IMPLEMENTED;
277 }
278
279 DWORD _RpcGetProfile(
280 WLANSVC_RPC_HANDLE hClientHandle,
281 GUID *pInterfaceGuid,
282 wchar_t *strProfileName,
283 wchar_t **pstrProfileXml,
284 LPDWORD pdwFlags,
285 LPDWORD pdwGrantedAccess)
286 {
287 UNIMPLEMENTED;
288 return ERROR_CALL_NOT_IMPLEMENTED;
289 }
290
291 DWORD _RpcDeleteProfile(
292 WLANSVC_RPC_HANDLE hClientHandle,
293 GUID *pInterfaceGuid,
294 wchar_t *strProfileName)
295 {
296 UNIMPLEMENTED;
297 return ERROR_CALL_NOT_IMPLEMENTED;
298 }
299
300 DWORD _RpcRenameProfile(
301 WLANSVC_RPC_HANDLE hClientHandle,
302 GUID *pInterfaceGuid,
303 wchar_t *strOldProfileName,
304 wchar_t *strNewProfileName)
305 {
306 UNIMPLEMENTED;
307 return ERROR_CALL_NOT_IMPLEMENTED;
308 }
309
310 DWORD _RpcSetProfileList(
311 WLANSVC_RPC_HANDLE hClientHandle,
312 GUID *pInterfaceGuid,
313 DWORD dwItems,
314 BYTE **strProfileNames)
315 {
316 UNIMPLEMENTED;
317 return ERROR_CALL_NOT_IMPLEMENTED;
318 }
319
320 DWORD _RpcGetProfileList(
321 WLANSVC_RPC_HANDLE hClientHandle,
322 GUID *pInterfaceGuid,
323 PWLAN_PROFILE_INFO_LIST *ppProfileList)
324 {
325 UNIMPLEMENTED;
326 return ERROR_CALL_NOT_IMPLEMENTED;
327 }
328
329 DWORD _RpcSetProfilePosition(
330 WLANSVC_RPC_HANDLE hClientHandle,
331 GUID *pInterfaceGuid,
332 wchar_t *strProfileName,
333 DWORD dwPosition)
334 {
335 UNIMPLEMENTED;
336 return ERROR_CALL_NOT_IMPLEMENTED;
337 }
338
339 DWORD _RpcSetProfileCustomUserData(
340 WLANSVC_RPC_HANDLE hClientHandle,
341 GUID *pInterfaceGuid,
342 wchar_t *strProfileName,
343 DWORD dwDataSize,
344 LPBYTE pData)
345 {
346 UNIMPLEMENTED;
347 return ERROR_CALL_NOT_IMPLEMENTED;
348 }
349
350 DWORD _RpcGetProfileCustomUserData(
351 WLANSVC_RPC_HANDLE hClientHandle,
352 GUID *pInterfaceGuid,
353 wchar_t *strProfileName,
354 LPDWORD dwDataSize,
355 LPBYTE *pData)
356 {
357 UNIMPLEMENTED;
358 return ERROR_CALL_NOT_IMPLEMENTED;
359 }
360
361 DWORD _RpcSetFilterList(
362 WLANSVC_RPC_HANDLE hClientHandle,
363 short wlanFilterListType,
364 PDOT11_NETWORK_LIST pNetworkList)
365 {
366 UNIMPLEMENTED;
367 return ERROR_CALL_NOT_IMPLEMENTED;
368 }
369
370 DWORD _RpcGetFilterList(
371 WLANSVC_RPC_HANDLE hClientHandle,
372 short wlanFilterListType,
373 PDOT11_NETWORK_LIST *pNetworkList)
374 {
375 UNIMPLEMENTED;
376 return ERROR_CALL_NOT_IMPLEMENTED;
377 }
378
379 DWORD _RpcSetPsdIEDataList(
380 WLANSVC_RPC_HANDLE hClientHandle,
381 wchar_t *strFormat,
382 DWORD dwDataListSize,
383 LPBYTE pPsdIEDataList)
384 {
385 UNIMPLEMENTED;
386 return ERROR_CALL_NOT_IMPLEMENTED;
387 }
388
389 DWORD _RpcSaveTemporaryProfile(
390 WLANSVC_RPC_HANDLE hClientHandle,
391 GUID *pInterfaceGuid,
392 wchar_t *strProfileName,
393 wchar_t *strAllUserProfileSecurity,
394 DWORD dwFlags,
395 BOOL bOverWrite)
396 {
397 UNIMPLEMENTED;
398 return ERROR_CALL_NOT_IMPLEMENTED;
399 }
400
401 DWORD _RpcIsUIRequestPending(
402 wchar_t *arg_1,
403 GUID *pInterfaceGuid,
404 struct_C *arg_3,
405 LPDWORD arg_4)
406 {
407 UNIMPLEMENTED;
408 return ERROR_CALL_NOT_IMPLEMENTED;
409 }
410
411 DWORD _RpcSetUIForwardingNetworkList(
412 wchar_t *arg_1,
413 GUID *arg_2,
414 DWORD dwSize,
415 GUID *arg_4)
416 {
417 UNIMPLEMENTED;
418 return ERROR_CALL_NOT_IMPLEMENTED;
419 }
420
421 DWORD _RpcIsNetworkSuppressed(
422 wchar_t *arg_1,
423 DWORD arg_2,
424 GUID *pInterfaceGuid,
425 LPDWORD arg_4)
426 {
427 UNIMPLEMENTED;
428 return ERROR_CALL_NOT_IMPLEMENTED;
429 }
430
431 DWORD _RpcRemoveUIForwardingNetworkList(
432 wchar_t *arg_1,
433 GUID *pInterfaceGuid)
434 {
435 UNIMPLEMENTED;
436 return ERROR_CALL_NOT_IMPLEMENTED;
437 }
438
439 DWORD _RpcQueryExtUIRequest(
440 wchar_t *arg_1,
441 GUID *arg_2,
442 GUID *arg_3,
443 short arg_4,
444 GUID *pInterfaceGuid,
445 struct_C **arg_6)
446 {
447 UNIMPLEMENTED;
448 return ERROR_CALL_NOT_IMPLEMENTED;
449 }
450
451 DWORD _RpcUIResponse(
452 wchar_t *arg_1,
453 struct_C *arg_2,
454 struct_D *arg_3)
455 {
456 UNIMPLEMENTED;
457 return ERROR_CALL_NOT_IMPLEMENTED;
458 }
459
460 DWORD _RpcGetProfileKeyInfo(
461 wchar_t *arg_1,
462 DWORD arg_2,
463 GUID *pInterfaceGuid,
464 wchar_t *arg_4,
465 DWORD arg_5,
466 LPDWORD arg_6,
467 char *arg_7,
468 LPDWORD arg_8)
469 {
470 UNIMPLEMENTED;
471 return ERROR_CALL_NOT_IMPLEMENTED;
472 }
473
474 DWORD _RpcAsyncDoPlap(
475 wchar_t *arg_1,
476 GUID *pInterfaceGuid,
477 wchar_t *arg_3,
478 DWORD dwSize,
479 struct_E arg_5[])
480 {
481 UNIMPLEMENTED;
482 return ERROR_CALL_NOT_IMPLEMENTED;
483 }
484
485 DWORD _RpcQueryPlapCredentials(
486 wchar_t *arg_1,
487 LPDWORD dwSize,
488 struct_E **arg_3,
489 wchar_t **arg_4,
490 GUID *pInterfaceGuid,
491 LPDWORD arg_6,
492 LPDWORD arg_7,
493 LPDWORD arg_8,
494 LPDWORD arg_9)
495 {
496 UNIMPLEMENTED;
497 return ERROR_CALL_NOT_IMPLEMENTED;
498 }
499
500 DWORD _RpcCancelPlap(
501 wchar_t *arg_1,
502 GUID *pInterfaceGuid)
503 {
504 UNIMPLEMENTED;
505 return ERROR_CALL_NOT_IMPLEMENTED;
506 }
507
508 DWORD _RpcSetSecuritySettings(
509 WLANSVC_RPC_HANDLE hClientHandle,
510 WLAN_SECURABLE_OBJECT SecurableObject,
511 wchar_t *strModifiedSDDL)
512 {
513 UNIMPLEMENTED;
514 return ERROR_CALL_NOT_IMPLEMENTED;
515 }
516
517 DWORD _RpcGetSecuritySettings(
518 WLANSVC_RPC_HANDLE hClientHandle,
519 WLAN_SECURABLE_OBJECT SecurableObject,
520 WLAN_OPCODE_VALUE_TYPE *pValueType,
521 wchar_t **pstrCurrentSDDL,
522 LPDWORD pdwGrantedAccess)
523 {
524 UNIMPLEMENTED;
525 return ERROR_CALL_NOT_IMPLEMENTED;
526 }
527
528 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
529 {
530 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
531 }
532
533
534 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
535 {
536 HeapFree(GetProcessHeap(), 0, ptr);
537 }
538
539
540 void __RPC_USER WLANSVC_RPC_HANDLE_rundown(WLANSVC_RPC_HANDLE hClientHandle)
541 {
542 }
543