summaryrefslogtreecommitdiffstats
path: root/winpr/libwinpr/rpc/rpc.c
blob: 99c2c7ebdcc4caae218f6e67c03befef088cc856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
/**
 * WinPR: Windows Portable Runtime
 * Microsoft Remote Procedure Call (MSRPC)
 *
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <winpr/config.h>

#include <winpr/crt.h>
#include <winpr/rpc.h>
#include <winpr/crypto.h>

#if !defined(_WIN32) || defined(_UWP)

#include "../log.h"
#define TAG WINPR_TAG("rpc")

RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
                               ULONG_PTR optionValue)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
                               ULONG_PTR* pOptionValue)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, unsigned long* AuthnLevel)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR* StringBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR* StringBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
                                    RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
                                    RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, RPC_CSTR* Protseq,
                                  RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint,
                                  RPC_CSTR* NetworkOptions)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, RPC_WSTR* Protseq,
                                  RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint,
                                  RPC_WSTR* NetworkOptions)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcStringFreeA(RPC_CSTR* String)
{
	if (String)
		free(*String);

	return RPC_S_OK;
}

RPC_STATUS RpcStringFreeW(RPC_WSTR* String)
{
	if (String)
		free(*String);

	return RPC_S_OK;
}

RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** ProtseqVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** ProtseqVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV** MgrEpv)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls,
                           unsigned int DontWait)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
                                 unsigned int Flags, unsigned int MaxCalls,
                                 RPC_IF_CALLBACK_FN* IfCallback)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
                                unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize,
                                RPC_IF_CALLBACK_FN* IfCallbackFn)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
                                 unsigned int WaitForCallsToComplete)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
                                   int RundownContextHandles)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor,
                                     PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                     void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                       void* SecurityDescriptor, PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor,
                                  PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor,
                                  PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint,
                                  void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint,
                                    void* SecurityDescriptor, PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint,
                                  void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint,
                                    void* SecurityDescriptor, PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                  void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                    void* SecurityDescriptor, PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                  void* SecurityDescriptor)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
                                    void* SecurityDescriptor, PRPC_POLICY Policy)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

void RpcServerYield(void)
{
	WLog_ERR(TAG, "Not implemented");
}

RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtWaitServerListen(void)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

void RpcSsDontSerializeContext(void)
{
	WLog_ERR(TAG, "Not implemented");
}

RPC_STATUS RpcMgmtEnableIdleCleanup(void)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc,
                                      RPC_CSTR* ServerPrincName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc,
                                      RPC_WSTR* ServerPrincName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax,
                                     RPC_CSTR* EntryName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax,
                                     RPC_WSTR* EntryName)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcRevertToSelf(void)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
                                    RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
                                    unsigned long* AuthnSvc, unsigned long* AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
                                    RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
                                    unsigned long* AuthnSvc, unsigned long* AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
                                      RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
                                      unsigned long* AuthnSvc, unsigned long* AuthzSvc,
                                      unsigned long Flags)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
                                      RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
                                      unsigned long* AuthnSvc, unsigned long* AuthzSvc,
                                      unsigned long Flags)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName,
                                  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
                                  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName,
                                  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
                                  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName,
                                  unsigned long AuthnLevel, unsigned long AuthnSvc,
                                  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName,
                                    unsigned long AuthnLevel, unsigned long AuthnSvc,
                                    RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc,
                                    RPC_SECURITY_QOS* SecurityQos)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName,
                                  unsigned long AuthnLevel, unsigned long AuthnSvc,
                                  RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName,
                                    unsigned long AuthnLevel, unsigned long AuthnSvc,
                                    RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc,
                                    RPC_SECURITY_QOS* SecurityQOS)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName,
                                    unsigned long* AuthnLevel, unsigned long* AuthnSvc,
                                    RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
                                    unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName,
                                    unsigned long* AuthnLevel, unsigned long* AuthnSvc,
                                    RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
                                    unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, unsigned long AuthnSvc,
                                      RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, unsigned long AuthnSvc,
                                      RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding,
                                      RPC_BINDING_HANDLE* ServerBinding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

void RpcRaiseException(RPC_STATUS exception)
{
	WLog_ERR(TAG, "RpcRaiseException: 0x%08luX", exception);
	exit((int)exception);
}

RPC_STATUS RpcTestCancel(void)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcCancelThread(void* Thread)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

/**
 * UUID Functions
 */

static UUID UUID_NIL = {
	0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
};

RPC_STATUS UuidCreate(UUID* Uuid)
{
	winpr_RAND_pseudo(Uuid, 16);
	return RPC_S_OK;
}

RPC_STATUS UuidCreateSequential(UUID* Uuid)
{
	winpr_RAND_pseudo(Uuid, 16);
	return RPC_S_OK;
}

RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid)
{
	*StringUuid = (RPC_CSTR)malloc(36 + 1);

	if (!(*StringUuid))
		return RPC_S_OUT_OF_MEMORY;

	if (!Uuid)
		Uuid = &UUID_NIL;

	/**
	 * Format is 32 hex digits partitioned in 5 groups:
	 * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
	 */
	sprintf_s((char*)*StringUuid, 36 + 1, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
	          Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
	          Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], Uuid->Data4[6], Uuid->Data4[7]);
	return RPC_S_OK;
}

RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid)
{
	BYTE bin[36];

	if (!StringUuid)
		return UuidCreateNil(Uuid);

	if (strlen((char*)StringUuid) != 36)
		return RPC_S_INVALID_STRING_UUID;

	if ((StringUuid[8] != '-') || (StringUuid[13] != '-') || (StringUuid[18] != '-') ||
	    (StringUuid[23] != '-'))
	{
		return RPC_S_INVALID_STRING_UUID;
	}

	for (int index = 0; index < 36; index++)
	{
		if ((index == 8) || (index == 13) || (index == 18) || (index == 23))
			continue;

		if ((StringUuid[index] >= '0') && (StringUuid[index] <= '9'))
			bin[index] = StringUuid[index] - '0';
		else if ((StringUuid[index] >= 'a') && (StringUuid[index] <= 'f'))
			bin[index] = StringUuid[index] - 'a' + 10;
		else if ((StringUuid[index] >= 'A') && (StringUuid[index] <= 'F'))
			bin[index] = StringUuid[index] - 'A' + 10;
		else
			return RPC_S_INVALID_STRING_UUID;
	}

	Uuid->Data1 = ((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) | (bin[3] << 16) |
	               (bin[4] << 12) | (bin[5] << 8) | (bin[6] << 4) | bin[7]);
	Uuid->Data2 = ((bin[9] << 12) | (bin[10] << 8) | (bin[11] << 4) | bin[12]);
	Uuid->Data3 = ((bin[14] << 12) | (bin[15] << 8) | (bin[16] << 4) | bin[17]);
	Uuid->Data4[0] = ((bin[19] << 4) | bin[20]);
	Uuid->Data4[1] = ((bin[21] << 4) | bin[22]);
	Uuid->Data4[2] = ((bin[24] << 4) | bin[25]);
	Uuid->Data4[3] = ((bin[26] << 4) | bin[27]);
	Uuid->Data4[4] = ((bin[28] << 4) | bin[29]);
	Uuid->Data4[5] = ((bin[30] << 4) | bin[31]);
	Uuid->Data4[6] = ((bin[32] << 4) | bin[33]);
	Uuid->Data4[7] = ((bin[34] << 4) | bin[35]);
	return RPC_S_OK;
}

RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
{
	*Status = RPC_S_OK;

	if (!Uuid1)
		Uuid1 = &UUID_NIL;

	if (!Uuid2)
		Uuid2 = &UUID_NIL;

	if (Uuid1->Data1 != Uuid2->Data1)
		return (Uuid1->Data1 < Uuid2->Data1) ? -1 : 1;

	if (Uuid1->Data2 != Uuid2->Data2)
		return (Uuid1->Data2 < Uuid2->Data2) ? -1 : 1;

	if (Uuid1->Data3 != Uuid2->Data3)
		return (Uuid1->Data3 < Uuid2->Data3) ? -1 : 1;

	for (int index = 0; index < 8; index++)
	{
		if (Uuid1->Data4[index] != Uuid2->Data4[index])
			return (Uuid1->Data4[index] < Uuid2->Data4[index]) ? -1 : 1;
	}

	return 0;
}

RPC_STATUS UuidCreateNil(UUID* NilUuid)
{
	CopyMemory((void*)NilUuid, (void*)&UUID_NIL, 16);
	return RPC_S_OK;
}

int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
{
	return ((UuidCompare(Uuid1, Uuid2, Status) == 0) ? TRUE : FALSE);
}

unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status)
{
	return UuidEqual(Uuid, &UUID_NIL, Status);
}

RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                                   UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                                   UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                          UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                          UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                           UUID_VECTOR* UuidVector)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType,
                                RPC_IF_ID* IfId, unsigned long VersOption, UUID* ObjectUuid,
                                RPC_EP_INQ_HANDLE* InquiryContext)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
                                RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
                                RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId,
                               RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding)
{
	WLog_ERR(TAG, "Not implemented");
	return 0;
}

#endif