-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRPCSharedBrokerSessionMgr1_TLB.pas
878 lines (786 loc) · 41.1 KB
/
RPCSharedBrokerSessionMgr1_TLB.pas
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
{ **************************************************************
Package: XWB - Kernel RPCBroker
Date Created: Sept 18, 1997 (Version 1.1)
Site Name: Oakland, OI Field Office, Dept of Veteran Affairs
Developers: Joel Ivey
Description: Type library for use with SharedRPCBroker.
Current Release: Version 1.1 Patch 40 (January 7, 2005))
*************************************************************** }
unit RPCSharedBrokerSessionMgr1_TLB;
{$MODE Delphi}
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// PASTLWTR : $Revision: 1.88.1.0.1.0 $
// File generated on 1/25/2002 11:58:49 AM from Type Library described below.
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
// ************************************************************************ //
// Type Lib: D:\Development\RPCSharedBroker\Exe1\RPCSharedBrokerSessionMgr1.exe (1)
// IID\LCID: {1F7D1EB0-E54F-46F0-B485-2D56743EBB70}\0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
// (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
// Errors:
// Error creating palette bitmap of (TSharedBroker) : Invalid GUID format
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface
uses Windows, ActiveX, Classes, Graphics, OleServer{, OleCtrls, StdVCL};
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
RPCSharedBrokerSessionMgr1MajorVersion = 1;
RPCSharedBrokerSessionMgr1MinorVersion = 0;
LIBID_RPCSharedBrokerSessionMgr1: TGUID = '{1F7D1EB0-E54F-46F0-B485-2D56743EBB70}';
IID_ISharedBroker: TGUID = '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
DIID_ISharedBrokerEvents: TGUID = '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
CLASS_SharedBroker: TGUID = '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
// *********************************************************************//
// Declaration of Enumerations defined in Type Library
// *********************************************************************//
// Constants for enum ISharedBrokerErrorCode
type
ISharedBrokerErrorCode = TOleEnum;
const
GeneralFailure = $00000000;
Success = $00000001;
UniqueRpcIdDoesNotExist = $00000002;
UniqueClientIdDoesNotExist = $00000003;
RpcHistoryIndexOutOfRange = $00000004;
RpcHistoryNotEnabled = $00000005;
CouldNotSetContext = $00000006;
CouldNotConnect = $00000007;
ClientIndexOutOfRange = $00000008;
NilClientPointer = $00000009;
ConnectionIndexOutOfRange = $0000000A;
// Constants for enum IRegistryRootEnum
type
IRegistryRootEnum = TOleEnum;
const
HKCR = $00000000;
HKCU = $00000001;
HKLM = $00000002;
HKU = $00000003;
HKCC = $00000004;
HKDD = $00000005;
// Constants for enum ISharedBrokerConnection
type
ISharedBrokerConnection = OleVariant;
const
Failed = $00000000;
New = $00000001;
Shared = $00000002;
Debug = $00000003;
// Constants for enum ISharedBrokerClient
type
ISharedBrokerClient = TOleEnum;
const
BrokerClient = $00000000;
DebuggerClient = $00000001;
// Constants for enum ISharedBrokerShowErrorMsgs
type
ISharedBrokerShowErrorMsgs = TOleEnum;
const
isemRaise = $00000000;
isemQuiet = $00000001;
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ISharedBroker = interface;
ISharedBrokerDisp = dispinterface;
ISharedBrokerEvents = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
SharedBroker = ISharedBroker;
// *********************************************************************//
// Interface: ISharedBroker
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
// *********************************************************************//
ISharedBroker = interface(IDispatch)
['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
const ServerPort: WideString; WantDebug: WordBool;
AllowShared: WordBool; KernelLogin: WordBool;
ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
var LoginStr: WideString; out UniqueClientIId: SYSINT;
out ErrorMsg: WideString): ISharedBrokerErrorCode; safecall;
function BrokerDisconnect: ISharedBrokerErrorCode; safecall;
function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; safecall;
function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
RpcTimeLimit: Integer; out RpcResults: WideString;
out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; safecall;
function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
const Name: WideString; const Default: WideString;
out RegResult: WideString): ISharedBrokerErrorCode; safecall;
function Get_RpcVersion: WideString; safecall;
procedure Set_RpcVersion(const version: WideString); safecall;
function Get_RpcHistoryEnabled: WordBool; safecall;
procedure Set_RpcHistoryEnabled(enabled: WordBool); safecall;
function Get_PerClientRpcHistoryLimit: Integer; safecall;
procedure Set_PerClientRpcHistoryLimit(limit: Integer); safecall;
function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; safecall;
function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode; safecall;
function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; safecall;
function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; safecall;
function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; safecall;
function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
out connectedServerIp: WideString;
out connectedServerPort: Integer;
out lastContext: WideString): ISharedBrokerErrorCode; safecall;
function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
out connectionIndex: Integer): ISharedBrokerErrorCode; safecall;
function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out brokerContext: WideString; out RpcName: WideString;
out RpcParams: WideString; out rpcResult: WideString;
out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
out uniqueRpcId: Integer; out brokerContext: WideString;
out RpcName: WideString; out RpcParams: WideString;
out rpcResult: WideString; out rpcStartDateTime: Double;
out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode; safecall;
function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; safecall;
function Get_CurrentContext: WideString; safecall;
function Get_User: WideString; safecall;
function Get_Login: WideString; safecall;
procedure Set_Login(const Value: WideString); safecall;
function Get_RpcbError: WideString; safecall;
function Get_Socket: Integer; safecall;
function Get_KernelLogin: WordBool; safecall;
procedure Set_KernelLogin(Value: WordBool); safecall;
function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs; safecall;
procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs); safecall;
property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
property CurrentContext: WideString read Get_CurrentContext;
property User: WideString read Get_User;
property Login: WideString read Get_Login write Set_Login;
property RpcbError: WideString read Get_RpcbError;
property Socket: Integer read Get_Socket;
property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
end;
// *********************************************************************//
// DispIntf: ISharedBrokerDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
// *********************************************************************//
ISharedBrokerDisp = dispinterface
['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
const ServerPort: WideString; WantDebug: WordBool;
AllowShared: WordBool; KernelLogin: WordBool;
ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
var LoginStr: WideString; out UniqueClientIId: SYSINT;
out ErrorMsg: WideString): ISharedBrokerErrorCode; dispid 1;
function BrokerDisconnect: ISharedBrokerErrorCode; dispid 2;
function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; dispid 3;
function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
RpcTimeLimit: Integer; out RpcResults: WideString;
out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; dispid 4;
function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
const Name: WideString; const Default: WideString;
out RegResult: WideString): ISharedBrokerErrorCode; dispid 5;
property RpcVersion: WideString dispid 7;
property RpcHistoryEnabled: WordBool dispid 6;
property PerClientRpcHistoryLimit: Integer dispid 8;
function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; dispid 10;
function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode; dispid 11;
function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; dispid 12;
function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; dispid 13;
function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; dispid 14;
function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
out connectedServerIp: WideString;
out connectedServerPort: Integer;
out lastContext: WideString): ISharedBrokerErrorCode; dispid 15;
function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
out connectionIndex: Integer): ISharedBrokerErrorCode; dispid 16;
function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out brokerContext: WideString; out RpcName: WideString;
out RpcParams: WideString; out rpcResult: WideString;
out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 17;
function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
out uniqueRpcId: Integer; out brokerContext: WideString;
out RpcName: WideString; out RpcParams: WideString;
out rpcResult: WideString; out rpcStartDateTime: Double;
out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 18;
function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode; dispid 19;
function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; dispid 20;
property CurrentContext: WideString readonly dispid 9;
property User: WideString readonly dispid 22;
property Login: WideString dispid 23;
property RpcbError: WideString readonly dispid 24;
property Socket: Integer readonly dispid 25;
property KernelLogin: WordBool dispid 26;
property ShowErrorMsgs: ISharedBrokerShowErrorMsgs dispid 27;
end;
// *********************************************************************//
// DispIntf: ISharedBrokerEvents
// Flags: (4096) Dispatchable
// GUID: {CBEA7167-4F9B-465A-B82E-4CEBDF933C35}
// *********************************************************************//
ISharedBrokerEvents = dispinterface
['{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}']
procedure OnLogout; dispid 1;
procedure OnRpcCallRecorded(uniqueRpcId: SYSINT); dispid 2;
procedure OnClientConnect(UniqueClientId: SYSINT; Connection: ISharedBrokerConnection); dispid 3;
procedure OnClientDisconnect(UniqueClientId: SYSINT); dispid 4;
procedure OnContextChanged(connectionIndex: SYSINT; const NewContext: WideString); dispid 5;
procedure OnRPCBFailure(const ErrorText: WideString); dispid 6;
procedure OnLoginError(const ErrorText: WideString); dispid 7;
procedure OnConnectionDropped(connectionIndex: SYSINT; const ErrorText: WideString); dispid 8;
end;
// *********************************************************************//
// The Class CoSharedBroker provides a Create and CreateRemote method to
// create instances of the default interface ISharedBroker exposed by
// the CoClass SharedBroker. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoSharedBroker = class
class function Create: ISharedBroker;
class function CreateRemote(const MachineName: string): ISharedBroker;
end;
TSharedBrokerOnRpcCallRecorded = procedure(Sender: TObject; uniqueRpcId: SYSINT) of object;
TSharedBrokerOnClientConnect = procedure(Sender: TObject; UniqueClientId: SYSINT;
Connection: ISharedBrokerConnection) of object;
TSharedBrokerOnClientDisconnect = procedure(Sender: TObject; UniqueClientId: SYSINT) of object;
TSharedBrokerOnContextChanged = procedure(Sender: TObject; connectionIndex: SYSINT;
var NewContext: OleVariant) of object;
TSharedBrokerOnRPCBFailure = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
TSharedBrokerOnLoginError = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
TSharedBrokerOnConnectionDropped = procedure(Sender: TObject; connectionIndex: SYSINT;
var ErrorText: OleVariant) of object;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TSharedBroker
// Help String : SharedBroker Object
// Default Interface: ISharedBroker
// Def. Intf. DISP? : No
// Event Interface: ISharedBrokerEvents
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TSharedBrokerProperties= class;
{$ENDIF}
TSharedBroker = class(TOleServer)
private
FOnLogout: TNotifyEvent;
FOnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded;
FOnClientConnect: TSharedBrokerOnClientConnect;
FOnClientDisconnect: TSharedBrokerOnClientDisconnect;
FOnContextChanged: TSharedBrokerOnContextChanged;
FOnRPCBFailure: TSharedBrokerOnRPCBFailure;
FOnLoginError: TSharedBrokerOnLoginError;
FOnConnectionDropped: TSharedBrokerOnConnectionDropped;
FIntf: ISharedBroker;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TSharedBrokerProperties;
function GetServerProperties: TSharedBrokerProperties;
{$ENDIF}
function GetDefaultInterface: ISharedBroker;
protected
procedure InitServerData; override;
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
function Get_RpcVersion: WideString;
procedure Set_RpcVersion(const version: WideString);
function Get_RpcHistoryEnabled: WordBool;
procedure Set_RpcHistoryEnabled(enabled: WordBool);
function Get_PerClientRpcHistoryLimit: Integer;
procedure Set_PerClientRpcHistoryLimit(limit: Integer);
function Get_CurrentContext: WideString;
function Get_User: WideString;
function Get_Login: WideString;
procedure Set_Login(const Value: WideString);
function Get_RpcbError: WideString;
function Get_Socket: Integer;
function Get_KernelLogin: WordBool;
procedure Set_KernelLogin(Value: WordBool);
function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: ISharedBroker);
procedure Disconnect; override;
function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
const ServerPort: WideString; WantDebug: WordBool;
AllowShared: WordBool; KernelLogin: WordBool;
ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
var LoginStr: WideString; out UniqueClientIId: SYSINT;
out ErrorMsg: WideString): ISharedBrokerErrorCode;
function BrokerDisconnect: ISharedBrokerErrorCode;
function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
RpcTimeLimit: Integer; out RpcResults: WideString;
out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
const Name: WideString; const Default: WideString;
out RegResult: WideString): ISharedBrokerErrorCode;
function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode;
function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode;
function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
out connectedServerIp: WideString;
out connectedServerPort: Integer;
out lastContext: WideString): ISharedBrokerErrorCode;
function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
out connectionIndex: Integer): ISharedBrokerErrorCode;
function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out brokerContext: WideString; out RpcName: WideString;
out RpcParams: WideString; out rpcResult: WideString;
out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
out uniqueRpcId: Integer; out brokerContext: WideString;
out RpcName: WideString; out RpcParams: WideString;
out rpcResult: WideString; out rpcStartDateTime: Double;
out rpcDuration: Integer): ISharedBrokerErrorCode;
function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode;
function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
property DefaultInterface: ISharedBroker read GetDefaultInterface;
property CurrentContext: WideString read Get_CurrentContext;
property User: WideString read Get_User;
property RpcbError: WideString read Get_RpcbError;
property Socket: Integer read Get_Socket;
property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
property Login: WideString read Get_Login write Set_Login;
property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TSharedBrokerProperties read GetServerProperties;
{$ENDIF}
property OnLogout: TNotifyEvent read FOnLogout write FOnLogout;
property OnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded read FOnRpcCallRecorded write FOnRpcCallRecorded;
property OnClientConnect: TSharedBrokerOnClientConnect read FOnClientConnect write FOnClientConnect;
property OnClientDisconnect: TSharedBrokerOnClientDisconnect read FOnClientDisconnect write FOnClientDisconnect;
property OnContextChanged: TSharedBrokerOnContextChanged read FOnContextChanged write FOnContextChanged;
property OnRPCBFailure: TSharedBrokerOnRPCBFailure read FOnRPCBFailure write FOnRPCBFailure;
property OnLoginError: TSharedBrokerOnLoginError read FOnLoginError write FOnLoginError;
property OnConnectionDropped: TSharedBrokerOnConnectionDropped read FOnConnectionDropped write FOnConnectionDropped;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TSharedBroker
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TSharedBrokerProperties = class(TPersistent)
private
FServer: TSharedBroker;
function GetDefaultInterface: ISharedBroker;
constructor Create(AServer: TSharedBroker);
protected
function Get_RpcVersion: WideString;
procedure Set_RpcVersion(const version: WideString);
function Get_RpcHistoryEnabled: WordBool;
procedure Set_RpcHistoryEnabled(enabled: WordBool);
function Get_PerClientRpcHistoryLimit: Integer;
procedure Set_PerClientRpcHistoryLimit(limit: Integer);
function Get_CurrentContext: WideString;
function Get_User: WideString;
function Get_Login: WideString;
procedure Set_Login(const Value: WideString);
function Get_RpcbError: WideString;
function Get_Socket: Integer;
function Get_KernelLogin: WordBool;
procedure Set_KernelLogin(Value: WordBool);
function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
public
property DefaultInterface: ISharedBroker read GetDefaultInterface;
published
property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
property Login: WideString read Get_Login write Set_Login;
property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
end;
{$ENDIF}
// procedure Register;
implementation
uses ComObj;
class function CoSharedBroker.Create: ISharedBroker;
begin
Result := CreateComObject(CLASS_SharedBroker) as ISharedBroker;
end;
class function CoSharedBroker.CreateRemote(const MachineName: string): ISharedBroker;
begin
Result := CreateRemoteComObject(MachineName, CLASS_SharedBroker) as ISharedBroker;
end;
procedure TSharedBroker.InitServerData;
const
CServerData: TServerData = (
ClassID: '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
IntfIID: '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
EventIID: '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TSharedBroker.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
ConnectEvents(punk);
Fintf:= punk as ISharedBroker;
end;
end;
procedure TSharedBroker.ConnectTo(svrIntf: ISharedBroker);
begin
Disconnect;
FIntf := svrIntf;
ConnectEvents(FIntf);
end;
procedure TSharedBroker.DisConnect;
begin
if Fintf <> nil then
begin
DisconnectEvents(FIntf);
FIntf := nil;
end;
end;
function TSharedBroker.GetDefaultInterface: ISharedBroker;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TSharedBroker.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TSharedBrokerProperties.Create(Self);
{$ENDIF}
end;
destructor TSharedBroker.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TSharedBroker.GetServerProperties: TSharedBrokerProperties;
begin
Result := FProps;
end;
{$ENDIF}
procedure TSharedBroker.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
case DispID of
-1: Exit; // DISPID_UNKNOWN
1: if Assigned(FOnLogout) then
FOnLogout(Self);
2: if Assigned(FOnRpcCallRecorded) then
FOnRpcCallRecorded(Self, Params[0] {SYSINT});
3: if Assigned(FOnClientConnect) then
FOnClientConnect(Self, Params[0] {SYSINT}, Params[1] {ISharedBrokerConnection});
4: if Assigned(FOnClientDisconnect) then
FOnClientDisconnect(Self, Params[0] {SYSINT});
5: if Assigned(FOnContextChanged) then
FOnContextChanged(Self, Params[0] {SYSINT}, Params[1] {const WideString});
6: if Assigned(FOnRPCBFailure) then
FOnRPCBFailure(Self, Params[0] {const WideString});
7: if Assigned(FOnLoginError) then
FOnLoginError(Self, Params[0] {const WideString});
8: if Assigned(FOnConnectionDropped) then
FOnConnectionDropped(Self, Params[0] {SYSINT}, Params[1] {const WideString});
end; {case DispID}
end;
function TSharedBroker.Get_RpcVersion: WideString;
begin
Result := DefaultInterface.Get_RpcVersion;
end;
procedure TSharedBroker.Set_RpcVersion(const version: WideString);
begin
DefaultInterface.Set_RpcVersion(version);
end;
function TSharedBroker.Get_RpcHistoryEnabled: WordBool;
begin
Result := DefaultInterface.Get_RpcHistoryEnabled;
end;
procedure TSharedBroker.Set_RpcHistoryEnabled(enabled: WordBool);
begin
DefaultInterface.Set_RpcHistoryEnabled(enabled);
end;
function TSharedBroker.Get_PerClientRpcHistoryLimit: Integer;
begin
Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
end;
procedure TSharedBroker.Set_PerClientRpcHistoryLimit(limit: Integer);
begin
DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
end;
function TSharedBroker.Get_CurrentContext: WideString;
begin
Result := DefaultInterface.Get_CurrentContext;
end;
function TSharedBroker.Get_User: WideString;
begin
Result := DefaultInterface.Get_User;
end;
function TSharedBroker.Get_Login: WideString;
begin
Result := DefaultInterface.Get_Login;
end;
procedure TSharedBroker.Set_Login(const Value: WideString);
begin
DefaultInterface.Set_Login(Value);
end;
function TSharedBroker.Get_RpcbError: WideString;
begin
Result := DefaultInterface.Get_RpcbError;
end;
function TSharedBroker.Get_Socket: Integer;
begin
Result := DefaultInterface.Get_Socket;
end;
function TSharedBroker.Get_KernelLogin: WordBool;
begin
Result := DefaultInterface.Get_KernelLogin;
end;
procedure TSharedBroker.Set_KernelLogin(Value: WordBool);
begin
DefaultInterface.Set_KernelLogin(Value);
end;
function TSharedBroker.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
begin
Result := DefaultInterface.Get_ShowErrorMsgs;
end;
procedure TSharedBroker.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
begin
DefaultInterface.Set_ShowErrorMsgs(Value);
end;
function TSharedBroker.BrokerConnect(const ClientName: WideString;
ConnectionType: ISharedBrokerClient;
const ServerPort: WideString; WantDebug: WordBool;
AllowShared: WordBool; KernelLogin: WordBool;
ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
var LoginStr: WideString; out UniqueClientIId: SYSINT;
out ErrorMsg: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.BrokerConnect(ClientName, ConnectionType, ServerPort, WantDebug,
AllowShared, KernelLogin, ShowErrMsgs, RpcTimeLim,
LoginStr, UniqueClientIId, ErrorMsg);
end;
function TSharedBroker.BrokerDisconnect: ISharedBrokerErrorCode;
begin
Result := DefaultInterface.BrokerDisconnect;
end;
function TSharedBroker.BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.BrokerSetContext(OptionName);
end;
function TSharedBroker.BrokerCall(const RpcName: WideString; const RpcParams: WideString;
RpcTimeLimit: Integer; out RpcResults: WideString;
out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.BrokerCall(RpcName, RpcParams, RpcTimeLimit, RpcResults,
UniqueRpcCallId);
end;
function TSharedBroker.ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
const Name: WideString; const Default: WideString;
out RegResult: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.ReadRegDataDefault(Root, Key, Name, Default, RegResult);
end;
function TSharedBroker.GetRpcHistoryCountForClient(UniqueClientId: Integer;
out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetRpcHistoryCountForClient(UniqueClientId, rpcHistoryCount);
end;
function TSharedBroker.GetClientIdAndNameFromIndex(clientIndex: Integer;
out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetClientIdAndNameFromIndex(clientIndex, UniqueClientId, ClientName);
end;
function TSharedBroker.LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.LogoutConnectedClients(logoutTimeLimit);
end;
function TSharedBroker.GetClientNameFromUniqueClientId(UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetClientNameFromUniqueClientId(UniqueClientId, ClientName);
end;
function TSharedBroker.GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetActiveBrokerConnectionIndexCount(connectionIndexCount);
end;
function TSharedBroker.GetActiveBrokerConnectionInfo(connectionIndex: Integer;
out connectedServerIp: WideString;
out connectedServerPort: Integer;
out lastContext: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetActiveBrokerConnectionInfo(connectionIndex, connectedServerIp,
connectedServerPort, lastContext);
end;
function TSharedBroker.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
out connectionIndex: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId,
connectionIndex);
end;
function TSharedBroker.GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
out brokerContext: WideString;
out RpcName: WideString; out RpcParams: WideString;
out rpcResult: WideString;
out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetRpcCallFromHistory(uniqueRpcId, UniqueClientId, brokerContext,
RpcName, RpcParams, rpcResult, rpcStartDateTime,
rpcDuration);
end;
function TSharedBroker.GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
out uniqueRpcId: Integer;
out brokerContext: WideString;
out RpcName: WideString;
out RpcParams: WideString;
out rpcResult: WideString;
out rpcStartDateTime: Double;
out rpcDuration: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetRpcCallFromHistoryIndex(UniqueClientId, rpcCallIndex, uniqueRpcId,
brokerContext, RpcName, RpcParams,
rpcResult, rpcStartDateTime, rpcDuration);
end;
function TSharedBroker.GetRpcClientIdFromHistory(uniqueRpcId: Integer;
out UniqueClientId: Integer;
out ClientName: WideString): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetRpcClientIdFromHistory(uniqueRpcId, UniqueClientId, ClientName);
end;
function TSharedBroker.GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
begin
Result := DefaultInterface.GetConnectedClientCount(connectedClientCount);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TSharedBrokerProperties.Create(AServer: TSharedBroker);
begin
inherited Create;
FServer := AServer;
end;
function TSharedBrokerProperties.GetDefaultInterface: ISharedBroker;
begin
Result := FServer.DefaultInterface;
end;
function TSharedBrokerProperties.Get_RpcVersion: WideString;
begin
Result := DefaultInterface.Get_RpcVersion;
end;
procedure TSharedBrokerProperties.Set_RpcVersion(const version: WideString);
begin
DefaultInterface.Set_RpcVersion(version);
end;
function TSharedBrokerProperties.Get_RpcHistoryEnabled: WordBool;
begin
Result := DefaultInterface.Get_RpcHistoryEnabled;
end;
procedure TSharedBrokerProperties.Set_RpcHistoryEnabled(enabled: WordBool);
begin
DefaultInterface.Set_RpcHistoryEnabled(enabled);
end;
function TSharedBrokerProperties.Get_PerClientRpcHistoryLimit: Integer;
begin
Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
end;
procedure TSharedBrokerProperties.Set_PerClientRpcHistoryLimit(limit: Integer);
begin
DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
end;
function TSharedBrokerProperties.Get_CurrentContext: WideString;
begin
Result := DefaultInterface.Get_CurrentContext;
end;
function TSharedBrokerProperties.Get_User: WideString;
begin
Result := DefaultInterface.Get_User;
end;
function TSharedBrokerProperties.Get_Login: WideString;
begin
Result := DefaultInterface.Get_Login;
end;
procedure TSharedBrokerProperties.Set_Login(const Value: WideString);
begin
DefaultInterface.Set_Login(Value);
end;
function TSharedBrokerProperties.Get_RpcbError: WideString;
begin
Result := DefaultInterface.Get_RpcbError;
end;
function TSharedBrokerProperties.Get_Socket: Integer;
begin
Result := DefaultInterface.Get_Socket;
end;
function TSharedBrokerProperties.Get_KernelLogin: WordBool;
begin
Result := DefaultInterface.Get_KernelLogin;
end;
procedure TSharedBrokerProperties.Set_KernelLogin(Value: WordBool);
begin
DefaultInterface.Set_KernelLogin(Value);
end;
function TSharedBrokerProperties.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
begin
Result := DefaultInterface.Get_ShowErrorMsgs;
end;
procedure TSharedBrokerProperties.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
begin
DefaultInterface.Set_ShowErrorMsgs(Value);
end;
{$ENDIF}
{
procedure Register;
begin
RegisterComponents('Kernel',[TSharedBroker]);
end;
}
end.