FreeRDP
winpr/libwinpr/rpc/rpc.c
1 
20 #include <winpr/config.h>
21 
22 #include <winpr/crt.h>
23 #include <winpr/rpc.h>
24 #include <winpr/crypto.h>
25 
26 #if !defined(_WIN32) || defined(_UWP)
27 
28 #include "../log.h"
29 #define TAG WINPR_TAG("rpc")
30 
31 RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding)
32 {
33  WLog_ERR(TAG, "Not implemented");
34  return 0;
35 }
36 
37 RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding)
38 {
39  WLog_ERR(TAG, "Not implemented");
40  return 0;
41 }
42 
43 RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
44  ULONG_PTR optionValue)
45 {
46  WLog_ERR(TAG, "Not implemented");
47  return 0;
48 }
49 
50 RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
51  ULONG_PTR* pOptionValue)
52 {
53  WLog_ERR(TAG, "Not implemented");
54  return 0;
55 }
56 
57 RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding)
58 {
59  WLog_ERR(TAG, "Not implemented");
60  return 0;
61 }
62 
63 RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding)
64 {
65  WLog_ERR(TAG, "Not implemented");
66  return 0;
67 }
68 
69 RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding)
70 {
71  WLog_ERR(TAG, "Not implemented");
72  return 0;
73 }
74 
75 RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
76 {
77  WLog_ERR(TAG, "Not implemented");
78  return 0;
79 }
80 
81 RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding)
82 {
83  WLog_ERR(TAG, "Not implemented");
84  return 0;
85 }
86 
87 RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
88 {
89  WLog_ERR(TAG, "Not implemented");
90  return 0;
91 }
92 
93 RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, unsigned long* AuthnLevel)
94 {
95  WLog_ERR(TAG, "Not implemented");
96  return 0;
97 }
98 
99 RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR* StringBinding)
100 {
101  WLog_ERR(TAG, "Not implemented");
102  return 0;
103 }
104 
105 RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR* StringBinding)
106 {
107  WLog_ERR(TAG, "Not implemented");
108  return 0;
109 }
110 
111 RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector)
112 {
113  WLog_ERR(TAG, "Not implemented");
114  return 0;
115 }
116 
117 RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
118  RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding)
119 {
120  WLog_ERR(TAG, "Not implemented");
121  return 0;
122 }
123 
124 RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
125  RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding)
126 {
127  WLog_ERR(TAG, "Not implemented");
128  return 0;
129 }
130 
131 RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, RPC_CSTR* Protseq,
132  RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint,
133  RPC_CSTR* NetworkOptions)
134 {
135  WLog_ERR(TAG, "Not implemented");
136  return 0;
137 }
138 
139 RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, RPC_WSTR* Protseq,
140  RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint,
141  RPC_WSTR* NetworkOptions)
142 {
143  WLog_ERR(TAG, "Not implemented");
144  return 0;
145 }
146 
147 RPC_STATUS RpcStringFreeA(RPC_CSTR* String)
148 {
149  if (String)
150  free(*String);
151 
152  return RPC_S_OK;
153 }
154 
155 RPC_STATUS RpcStringFreeW(RPC_WSTR* String)
156 {
157  if (String)
158  free(*String);
159 
160  return RPC_S_OK;
161 }
162 
163 RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId)
164 {
165  WLog_ERR(TAG, "Not implemented");
166  return 0;
167 }
168 
169 RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq)
170 {
171  WLog_ERR(TAG, "Not implemented");
172  return 0;
173 }
174 
175 RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq)
176 {
177  WLog_ERR(TAG, "Not implemented");
178  return 0;
179 }
180 
181 RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout)
182 {
183  WLog_ERR(TAG, "Not implemented");
184  return 0;
185 }
186 
187 RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout)
188 {
189  WLog_ERR(TAG, "Not implemented");
190  return 0;
191 }
192 
193 RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout)
194 {
195  WLog_ERR(TAG, "Not implemented");
196  return 0;
197 }
198 
199 RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** ProtseqVector)
200 {
201  WLog_ERR(TAG, "Not implemented");
202  return 0;
203 }
204 
205 RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** ProtseqVector)
206 {
207  WLog_ERR(TAG, "Not implemented");
208  return 0;
209 }
210 
211 RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid)
212 {
213  WLog_ERR(TAG, "Not implemented");
214  return 0;
215 }
216 
217 RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn)
218 {
219  WLog_ERR(TAG, "Not implemented");
220  return 0;
221 }
222 
223 RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid)
224 {
225  WLog_ERR(TAG, "Not implemented");
226  return 0;
227 }
228 
229 RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector)
230 {
231  WLog_ERR(TAG, "Not implemented");
232  return 0;
233 }
234 
235 RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector)
236 {
237  WLog_ERR(TAG, "Not implemented");
238  return 0;
239 }
240 
241 RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector)
242 {
243  WLog_ERR(TAG, "Not implemented");
244  return 0;
245 }
246 
247 RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV** MgrEpv)
248 {
249  WLog_ERR(TAG, "Not implemented");
250  return 0;
251 }
252 
253 RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls,
254  unsigned int DontWait)
255 {
256  WLog_ERR(TAG, "Not implemented");
257  return 0;
258 }
259 
260 RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv)
261 {
262  WLog_ERR(TAG, "Not implemented");
263  return 0;
264 }
265 
266 RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
267  unsigned int Flags, unsigned int MaxCalls,
268  RPC_IF_CALLBACK_FN* IfCallback)
269 {
270  WLog_ERR(TAG, "Not implemented");
271  return 0;
272 }
273 
274 RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
275  unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize,
276  RPC_IF_CALLBACK_FN* IfCallbackFn)
277 {
278  WLog_ERR(TAG, "Not implemented");
279  return 0;
280 }
281 
282 RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
283  unsigned int WaitForCallsToComplete)
284 {
285  WLog_ERR(TAG, "Not implemented");
286  return 0;
287 }
288 
289 RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
290  int RundownContextHandles)
291 {
292  WLog_ERR(TAG, "Not implemented");
293  return 0;
294 }
295 
296 RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor)
297 {
298  WLog_ERR(TAG, "Not implemented");
299  return 0;
300 }
301 
302 RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor,
303  PRPC_POLICY Policy)
304 {
305  WLog_ERR(TAG, "Not implemented");
306  return 0;
307 }
308 
309 RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
310  void* SecurityDescriptor)
311 {
312  WLog_ERR(TAG, "Not implemented");
313  return 0;
314 }
315 
316 RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
317  void* SecurityDescriptor, PRPC_POLICY Policy)
318 {
319  WLog_ERR(TAG, "Not implemented");
320  return 0;
321 }
322 
323 RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
324 {
325  WLog_ERR(TAG, "Not implemented");
326  return 0;
327 }
328 
329 RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor,
330  PRPC_POLICY Policy)
331 {
332  WLog_ERR(TAG, "Not implemented");
333  return 0;
334 }
335 
336 RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
337 {
338  WLog_ERR(TAG, "Not implemented");
339  return 0;
340 }
341 
342 RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor,
343  PRPC_POLICY Policy)
344 {
345  WLog_ERR(TAG, "Not implemented");
346  return 0;
347 }
348 
349 RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint,
350  void* SecurityDescriptor)
351 {
352  WLog_ERR(TAG, "Not implemented");
353  return 0;
354 }
355 
356 RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint,
357  void* SecurityDescriptor, PRPC_POLICY Policy)
358 {
359  WLog_ERR(TAG, "Not implemented");
360  return 0;
361 }
362 
363 RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint,
364  void* SecurityDescriptor)
365 {
366  WLog_ERR(TAG, "Not implemented");
367  return 0;
368 }
369 
370 RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint,
371  void* SecurityDescriptor, PRPC_POLICY Policy)
372 {
373  WLog_ERR(TAG, "Not implemented");
374  return 0;
375 }
376 
377 RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
378  void* SecurityDescriptor)
379 {
380  WLog_ERR(TAG, "Not implemented");
381  return 0;
382 }
383 
384 RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
385  void* SecurityDescriptor, PRPC_POLICY Policy)
386 {
387  WLog_ERR(TAG, "Not implemented");
388  return 0;
389 }
390 
391 RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
392  void* SecurityDescriptor)
393 {
394  WLog_ERR(TAG, "Not implemented");
395  return 0;
396 }
397 
398 RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
399  void* SecurityDescriptor, PRPC_POLICY Policy)
400 {
401  WLog_ERR(TAG, "Not implemented");
402  return 0;
403 }
404 
405 void RpcServerYield(void)
406 {
407  WLog_ERR(TAG, "Not implemented");
408 }
409 
410 RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector)
411 {
412  WLog_ERR(TAG, "Not implemented");
413  return 0;
414 }
415 
416 RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics)
417 {
418  WLog_ERR(TAG, "Not implemented");
419  return 0;
420 }
421 
422 RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding)
423 {
424  WLog_ERR(TAG, "Not implemented");
425  return 0;
426 }
427 
428 RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
429 {
430  WLog_ERR(TAG, "Not implemented");
431  return 0;
432 }
433 
434 RPC_STATUS RpcMgmtWaitServerListen(void)
435 {
436  WLog_ERR(TAG, "Not implemented");
437  return 0;
438 }
439 
440 RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize)
441 {
442  WLog_ERR(TAG, "Not implemented");
443  return 0;
444 }
445 
446 void RpcSsDontSerializeContext(void)
447 {
448  WLog_ERR(TAG, "Not implemented");
449 }
450 
451 RPC_STATUS RpcMgmtEnableIdleCleanup(void)
452 {
453  WLog_ERR(TAG, "Not implemented");
454  return 0;
455 }
456 
457 RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector)
458 {
459  WLog_ERR(TAG, "Not implemented");
460  return 0;
461 }
462 
463 RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector)
464 {
465  WLog_ERR(TAG, "Not implemented");
466  return 0;
467 }
468 
469 RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc,
470  RPC_CSTR* ServerPrincName)
471 {
472  WLog_ERR(TAG, "Not implemented");
473  return 0;
474 }
475 
476 RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc,
477  RPC_WSTR* ServerPrincName)
478 {
479  WLog_ERR(TAG, "Not implemented");
480  return 0;
481 }
482 
483 RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName)
484 {
485  WLog_ERR(TAG, "Not implemented");
486  return 0;
487 }
488 
489 RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName)
490 {
491  WLog_ERR(TAG, "Not implemented");
492  return 0;
493 }
494 
495 RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
496 {
497  WLog_ERR(TAG, "Not implemented");
498  return 0;
499 }
500 
501 RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax,
502  RPC_CSTR* EntryName)
503 {
504  WLog_ERR(TAG, "Not implemented");
505  return 0;
506 }
507 
508 RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax,
509  RPC_WSTR* EntryName)
510 {
511  WLog_ERR(TAG, "Not implemented");
512  return 0;
513 }
514 
515 RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
516 {
517  WLog_ERR(TAG, "Not implemented");
518  return 0;
519 }
520 
521 RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle)
522 {
523  WLog_ERR(TAG, "Not implemented");
524  return 0;
525 }
526 
527 RPC_STATUS RpcRevertToSelf(void)
528 {
529  WLog_ERR(TAG, "Not implemented");
530  return 0;
531 }
532 
533 RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
534  RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
535  unsigned long* AuthnSvc, unsigned long* AuthzSvc)
536 {
537  WLog_ERR(TAG, "Not implemented");
538  return 0;
539 }
540 
541 RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
542  RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
543  unsigned long* AuthnSvc, unsigned long* AuthzSvc)
544 {
545  WLog_ERR(TAG, "Not implemented");
546  return 0;
547 }
548 
549 RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
550  RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
551  unsigned long* AuthnSvc, unsigned long* AuthzSvc,
552  unsigned long Flags)
553 {
554  WLog_ERR(TAG, "Not implemented");
555  return 0;
556 }
557 
558 RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
559  RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
560  unsigned long* AuthnSvc, unsigned long* AuthzSvc,
561  unsigned long Flags)
562 {
563  WLog_ERR(TAG, "Not implemented");
564  return 0;
565 }
566 
567 RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName,
568  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
569  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
570 {
571  WLog_ERR(TAG, "Not implemented");
572  return 0;
573 }
574 
575 RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName,
576  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
577  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
578 {
579  WLog_ERR(TAG, "Not implemented");
580  return 0;
581 }
582 
583 RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName,
584  unsigned long AuthnLevel, unsigned long AuthnSvc,
585  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
586 {
587  WLog_ERR(TAG, "Not implemented");
588  return 0;
589 }
590 
591 RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName,
592  unsigned long AuthnLevel, unsigned long AuthnSvc,
593  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc,
594  RPC_SECURITY_QOS* SecurityQos)
595 {
596  WLog_ERR(TAG, "Not implemented");
597  return 0;
598 }
599 
600 RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName,
601  unsigned long AuthnLevel, unsigned long AuthnSvc,
602  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
603 {
604  WLog_ERR(TAG, "Not implemented");
605  return 0;
606 }
607 
608 RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName,
609  unsigned long AuthnLevel, unsigned long AuthnSvc,
610  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc,
611  RPC_SECURITY_QOS* SecurityQOS)
612 {
613  WLog_ERR(TAG, "Not implemented");
614  return 0;
615 }
616 
617 RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName,
618  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
619  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
620  unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
621 {
622  WLog_ERR(TAG, "Not implemented");
623  return 0;
624 }
625 
626 RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName,
627  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
628  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
629  unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
630 {
631  WLog_ERR(TAG, "Not implemented");
632  return 0;
633 }
634 
635 RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, unsigned long AuthnSvc,
636  RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
637 {
638  WLog_ERR(TAG, "Not implemented");
639  return 0;
640 }
641 
642 RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, unsigned long AuthnSvc,
643  RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
644 {
645  WLog_ERR(TAG, "Not implemented");
646  return 0;
647 }
648 
649 RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding,
650  RPC_BINDING_HANDLE* ServerBinding)
651 {
652  WLog_ERR(TAG, "Not implemented");
653  return 0;
654 }
655 
656 void RpcRaiseException(RPC_STATUS exception)
657 {
658  WLog_ERR(TAG, "RpcRaiseException: 0x%08luX", exception);
659  exit((int)exception);
660 }
661 
662 RPC_STATUS RpcTestCancel(void)
663 {
664  WLog_ERR(TAG, "Not implemented");
665  return 0;
666 }
667 
668 RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle)
669 {
670  WLog_ERR(TAG, "Not implemented");
671  return 0;
672 }
673 
674 RPC_STATUS RpcCancelThread(void* Thread)
675 {
676  WLog_ERR(TAG, "Not implemented");
677  return 0;
678 }
679 
680 RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout)
681 {
682  WLog_ERR(TAG, "Not implemented");
683  return 0;
684 }
685 
690 static UUID UUID_NIL = {
691  0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
692 };
693 
694 RPC_STATUS UuidCreate(UUID* Uuid)
695 {
696  winpr_RAND_pseudo(Uuid, 16);
697  return RPC_S_OK;
698 }
699 
700 RPC_STATUS UuidCreateSequential(UUID* Uuid)
701 {
702  winpr_RAND_pseudo(Uuid, 16);
703  return RPC_S_OK;
704 }
705 
706 RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid)
707 {
708  *StringUuid = (RPC_CSTR)malloc(36 + 1);
709 
710  if (!(*StringUuid))
711  return RPC_S_OUT_OF_MEMORY;
712 
713  if (!Uuid)
714  Uuid = &UUID_NIL;
715 
720  (void)sprintf_s((char*)*StringUuid, 36 + 1, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
721  Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1],
722  Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], Uuid->Data4[6],
723  Uuid->Data4[7]);
724  return RPC_S_OK;
725 }
726 
727 RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid)
728 {
729  WLog_ERR(TAG, "Not implemented");
730  return 0;
731 }
732 
733 RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid)
734 {
735  BYTE bin[36];
736 
737  if (!StringUuid)
738  return UuidCreateNil(Uuid);
739 
740  if (strlen((char*)StringUuid) != 36)
741  return RPC_S_INVALID_STRING_UUID;
742 
743  if ((StringUuid[8] != '-') || (StringUuid[13] != '-') || (StringUuid[18] != '-') ||
744  (StringUuid[23] != '-'))
745  {
746  return RPC_S_INVALID_STRING_UUID;
747  }
748 
749  for (int index = 0; index < 36; index++)
750  {
751  if ((index == 8) || (index == 13) || (index == 18) || (index == 23))
752  continue;
753 
754  if ((StringUuid[index] >= '0') && (StringUuid[index] <= '9'))
755  bin[index] = StringUuid[index] - '0';
756  else if ((StringUuid[index] >= 'a') && (StringUuid[index] <= 'f'))
757  bin[index] = StringUuid[index] - 'a' + 10;
758  else if ((StringUuid[index] >= 'A') && (StringUuid[index] <= 'F'))
759  bin[index] = StringUuid[index] - 'A' + 10;
760  else
761  return RPC_S_INVALID_STRING_UUID;
762  }
763 
764  Uuid->Data1 = (UINT32)((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) | (bin[3] << 16) |
765  (bin[4] << 12) | (bin[5] << 8) | (bin[6] << 4) | bin[7]);
766  Uuid->Data2 = (UINT16)((bin[9] << 12) | (bin[10] << 8) | (bin[11] << 4) | bin[12]);
767  Uuid->Data3 = (UINT16)((bin[14] << 12) | (bin[15] << 8) | (bin[16] << 4) | bin[17]);
768  Uuid->Data4[0] = (UINT8)((bin[19] << 4) | bin[20]);
769  Uuid->Data4[1] = (UINT8)((bin[21] << 4) | bin[22]);
770  Uuid->Data4[2] = (UINT8)((bin[24] << 4) | bin[25]);
771  Uuid->Data4[3] = (UINT8)((bin[26] << 4) | bin[27]);
772  Uuid->Data4[4] = (UINT8)((bin[28] << 4) | bin[29]);
773  Uuid->Data4[5] = (UINT8)((bin[30] << 4) | bin[31]);
774  Uuid->Data4[6] = (UINT8)((bin[32] << 4) | bin[33]);
775  Uuid->Data4[7] = (UINT8)((bin[34] << 4) | bin[35]);
776  return RPC_S_OK;
777 }
778 
779 RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid)
780 {
781  WLog_ERR(TAG, "Not implemented");
782  return 0;
783 }
784 
785 signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
786 {
787  *Status = RPC_S_OK;
788 
789  if (!Uuid1)
790  Uuid1 = &UUID_NIL;
791 
792  if (!Uuid2)
793  Uuid2 = &UUID_NIL;
794 
795  if (Uuid1->Data1 != Uuid2->Data1)
796  return (Uuid1->Data1 < Uuid2->Data1) ? -1 : 1;
797 
798  if (Uuid1->Data2 != Uuid2->Data2)
799  return (Uuid1->Data2 < Uuid2->Data2) ? -1 : 1;
800 
801  if (Uuid1->Data3 != Uuid2->Data3)
802  return (Uuid1->Data3 < Uuid2->Data3) ? -1 : 1;
803 
804  for (int index = 0; index < 8; index++)
805  {
806  if (Uuid1->Data4[index] != Uuid2->Data4[index])
807  return (Uuid1->Data4[index] < Uuid2->Data4[index]) ? -1 : 1;
808  }
809 
810  return 0;
811 }
812 
813 RPC_STATUS UuidCreateNil(UUID* NilUuid)
814 {
815  CopyMemory((void*)NilUuid, (void*)&UUID_NIL, 16);
816  return RPC_S_OK;
817 }
818 
819 int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
820 {
821  return ((UuidCompare(Uuid1, Uuid2, Status) == 0) ? TRUE : FALSE);
822 }
823 
824 unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status)
825 {
826  WLog_ERR(TAG, "Not implemented");
827  return 0;
828 }
829 
830 int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status)
831 {
832  return UuidEqual(Uuid, &UUID_NIL, Status);
833 }
834 
835 RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
836  UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
837 {
838  WLog_ERR(TAG, "Not implemented");
839  return 0;
840 }
841 
842 RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
843  UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
844 {
845  WLog_ERR(TAG, "Not implemented");
846  return 0;
847 }
848 
849 RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
850  UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
851 {
852  WLog_ERR(TAG, "Not implemented");
853  return 0;
854 }
855 
856 RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
857  UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
858 {
859  WLog_ERR(TAG, "Not implemented");
860  return 0;
861 }
862 
863 RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
864  UUID_VECTOR* UuidVector)
865 {
866  WLog_ERR(TAG, "Not implemented");
867  return 0;
868 }
869 
870 RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText)
871 {
872  WLog_ERR(TAG, "Not implemented");
873  return 0;
874 }
875 
876 RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText)
877 {
878  WLog_ERR(TAG, "Not implemented");
879  return 0;
880 }
881 
882 RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType,
883  RPC_IF_ID* IfId, unsigned long VersOption, UUID* ObjectUuid,
884  RPC_EP_INQ_HANDLE* InquiryContext)
885 {
886  WLog_ERR(TAG, "Not implemented");
887  return 0;
888 }
889 
890 RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext)
891 {
892  WLog_ERR(TAG, "Not implemented");
893  return 0;
894 }
895 
896 RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
897  RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation)
898 {
899  WLog_ERR(TAG, "Not implemented");
900  return 0;
901 }
902 
903 RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
904  RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation)
905 {
906  WLog_ERR(TAG, "Not implemented");
907  return 0;
908 }
909 
910 RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId,
911  RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
912 {
913  WLog_ERR(TAG, "Not implemented");
914  return 0;
915 }
916 
917 RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn)
918 {
919  WLog_ERR(TAG, "Not implemented");
920  return 0;
921 }
922 
923 RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding)
924 {
925  WLog_ERR(TAG, "Not implemented");
926  return 0;
927 }
928 
929 #endif