jwarpcasync.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. {******************************************************************************}
  2. { }
  3. { Asynchronous RPC API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: rpcnasync.h, released August 2001. The original Pascal }
  9. { code is: RpcAsync.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. unit JwaRpcASync;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "RpcAsync.h"'}
  46. {$HPPEMIT ''}
  47. {$HPPEMIT 'typedef RPC_EXTENDED_ERROR_INFO* PRPC_EXTENDED_ERROR_INFO'}
  48. {$HPPEMIT 'typedef RPC_ERROR_ENUM_HANDLE* PRPC_ERROR_ENUM_HANDLE'}
  49. {$HPPEMIT ''}
  50. {$I jediapilib.inc}
  51. interface
  52. uses
  53. JwaRpc, JwaRpcDce, JwaWinBase, JwaWinNT, JwaWinType;
  54. type
  55. _RPC_NOTIFICATION_TYPES = (
  56. RpcNotificationTypeNone,
  57. RpcNotificationTypeEvent,
  58. RpcNotificationTypeApc,
  59. RpcNotificationTypeIoc,
  60. RpcNotificationTypeHwnd,
  61. RpcNotificationTypeCallback);
  62. {$EXTERNALSYM _RPC_NOTIFICATION_TYPES}
  63. RPC_NOTIFICATION_TYPES = _RPC_NOTIFICATION_TYPES;
  64. {$EXTERNALSYM RPC_NOTIFICATION_TYPES}
  65. TRpcNotificationTypes = RPC_NOTIFICATION_TYPES;
  66. PFN_RPCNOTIFICATION_ROUTINE = ^RPCNOTIFICATION_ROUTINE;
  67. {$EXTERNALSYM PFN_RPCNOTIFICATION_ROUTINE}
  68. _RPC_ASYNC_EVENT = (
  69. RpcCallComplete,
  70. RpcSendComplete,
  71. RpcReceiveComplete);
  72. {$EXTERNALSYM _RPC_ASYNC_EVENT}
  73. RPC_ASYNC_EVENT = _RPC_ASYNC_EVENT;
  74. {$EXTERNALSYM RPC_ASYNC_EVENT}
  75. TRpcASynchEvent = RPC_ASYNC_EVENT;
  76. _RPC_ASYNC_STATE = record
  77. Size: Cardinal; // size of this structure
  78. Signature: Cardinal;
  79. Lock: Longint;
  80. Flags: Cardinal;
  81. StubInfo: Pointer;
  82. UserInfo: Pointer;
  83. RuntimeInfo: Pointer;
  84. Event: RPC_ASYNC_EVENT;
  85. NotificationType: RPC_NOTIFICATION_TYPES;
  86. u: record
  87. case Integer of
  88. //
  89. // Notification by APC
  90. //
  91. 0: (
  92. NotificationRoutine: PFN_RPCNOTIFICATION_ROUTINE;
  93. hThread: HANDLE);
  94. //
  95. // Notification by IO completion port
  96. //
  97. 1: (
  98. hIOPort: HANDLE;
  99. dwNumberOfBytesTransferred: DWORD;
  100. dwCompletionKey: DWORD_PTR;
  101. lpOverlapped: LPOVERLAPPED);
  102. //
  103. // Notification by window message
  104. //
  105. 2: (
  106. hWnd: HWND;
  107. Msg: UINT);
  108. //
  109. // Notification by event
  110. //
  111. 4: (
  112. hEvent: HANDLE);
  113. //
  114. // Notification by callback function
  115. //
  116. // This option is available only to OLE
  117. //
  118. //5: (
  119. // NotificationRoutine: PFN_RPCNOTIFICATION_ROUTINE);
  120. end;
  121. Reserved: array [0..3] of LONG_PTR;
  122. end;
  123. {$EXTERNALSYM _RPC_ASYNC_STATE}
  124. RPC_ASYNC_STATE = _RPC_ASYNC_STATE;
  125. {$EXTERNALSYM RPC_ASYNC_STATE}
  126. PRPC_ASYNC_STATE = ^RPC_ASYNC_STATE;
  127. {$EXTERNALSYM PRPC_ASYNC_STATE}
  128. TRpcASynchState = RPC_ASYNC_STATE;
  129. PRpcASynchState = PRPC_ASYNC_STATE;
  130. RPCNOTIFICATION_ROUTINE = procedure(var pAsync: RPC_ASYNC_STATE;
  131. Context: Pointer; Event: RPC_ASYNC_EVENT); stdcall;
  132. {$EXTERNALSYM RPCNOTIFICATION_ROUTINE}
  133. // PFN_RPCNOTIFICATION_ROUTINE = ^RPCNOTIFICATION_ROUTINE;
  134. // {$EXTERNALSYM PFN_RPCNOTIFICATION_ROUTINE}
  135. TRpcNotificationRoutine = RPCNOTIFICATION_ROUTINE;
  136. PRpcNotificationRoutine = PFN_RPCNOTIFICATION_ROUTINE;
  137. // Possible values for Flags
  138. const
  139. RPC_C_NOTIFY_ON_SEND_COMPLETE = $1;
  140. {$EXTERNALSYM RPC_C_NOTIFY_ON_SEND_COMPLETE}
  141. RPC_C_INFINITE_TIMEOUT = INFINITE;
  142. {$EXTERNALSYM RPC_C_INFINITE_TIMEOUT}
  143. function RpcAsyncGetCallHandle(var pAsync: RPC_ASYNC_STATE): Pointer;
  144. {$EXTERNALSYM RpcAsyncGetCallHandle}
  145. function RpcAsyncInitializeHandle(var pAsync: RPC_ASYNC_STATE; Size: Cardinal): RPC_STATUS; stdcall;
  146. {$EXTERNALSYM RpcAsyncInitializeHandle}
  147. function RpcAsyncRegisterInfo(var pAsync: RPC_ASYNC_STATE): RPC_STATUS; stdcall;
  148. {$EXTERNALSYM RpcAsyncRegisterInfo}
  149. function RpcAsyncGetCallStatus(var pAsync: RPC_ASYNC_STATE): RPC_STATUS; stdcall;
  150. {$EXTERNALSYM RpcAsyncGetCallStatus}
  151. function RpcAsyncCompleteCall(var pAsync: RPC_ASYNC_STATE; Reply: Pointer): RPC_STATUS; stdcall;
  152. {$EXTERNALSYM RpcAsyncCompleteCall}
  153. function RpcAsyncAbortCall(var pAsync: RPC_ASYNC_STATE; ExceptionCode: Cardinal): RPC_STATUS; stdcall;
  154. {$EXTERNALSYM RpcAsyncAbortCall}
  155. function RpcAsyncCancelCall(var pAsync: RPC_ASYNC_STATE; fAbort: BOOL): RPC_STATUS; stdcall;
  156. {$EXTERNALSYM RpcAsyncCancelCall}
  157. function RpcAsyncCleanupThread(dwTimeout: DWORD): RPC_STATUS; stdcall;
  158. {$EXTERNALSYM RpcAsyncCleanupThread}
  159. type
  160. tagExtendedErrorParamTypes = (
  161. eeptFiller0,
  162. eeptAnsiString,
  163. eeptUnicodeString,
  164. eeptLongVal,
  165. eeptShortVal,
  166. eeptPointerVal,
  167. eeptNone,
  168. eeptBinary);
  169. {$EXTERNALSYM tagExtendedErrorParamTypes}
  170. ExtendedErrorParamTypes = tagExtendedErrorParamTypes;
  171. {$EXTERNALSYM ExtendedErrorParamTypes}
  172. TExtendedErrorParamTypes = ExtendedErrorParamTypes;
  173. const
  174. MaxNumberOfEEInfoParams = 4;
  175. {$EXTERNALSYM MaxNumberOfEEInfoParams}
  176. RPC_EEINFO_VERSION = 1;
  177. {$EXTERNALSYM RPC_EEINFO_VERSION}
  178. type
  179. tagBinaryParam = record
  180. Buffer: Pointer;
  181. Size: Word;
  182. end;
  183. {$EXTERNALSYM tagBinaryParam}
  184. BinaryParam = tagBinaryParam;
  185. {$EXTERNALSYM BinaryParam}
  186. TBinaryParam = BinaryParam;
  187. tagRPC_EE_INFO_PARAM = record
  188. ParameterType: ExtendedErrorParamTypes;
  189. case Integer of
  190. 0: (AnsiString: LPSTR);
  191. 1: (UnicodeString: LPWSTR);
  192. 2: (LVal: Longint);
  193. 3: (SVal: Word);
  194. 4: (PVal: ULONGLONG);
  195. 5: (BVal: BinaryParam);
  196. end;
  197. {$EXTERNALSYM tagRPC_EE_INFO_PARAM}
  198. RPC_EE_INFO_PARAM = tagRPC_EE_INFO_PARAM;
  199. {$EXTERNALSYM RPC_EE_INFO_PARAM}
  200. TRpcEeInfoParam = RPC_EE_INFO_PARAM;
  201. const
  202. EEInfoPreviousRecordsMissing = 1;
  203. {$EXTERNALSYM EEInfoPreviousRecordsMissing}
  204. EEInfoNextRecordsMissing = 2;
  205. {$EXTERNALSYM EEInfoNextRecordsMissing}
  206. EEInfoUseFileTime = 4;
  207. {$EXTERNALSYM EEInfoUseFileTime}
  208. EEInfoGCCOM = 11;
  209. {$EXTERNALSYM EEInfoGCCOM}
  210. EEInfoGCFRS = 12;
  211. {$EXTERNALSYM EEInfoGCFRS}
  212. type
  213. tagRPC_EXTENDED_ERROR_INFO = record
  214. Version: ULONG;
  215. ComputerName: LPWSTR;
  216. ProcessID: ULONG;
  217. u: record
  218. case Integer of
  219. 0: ( SystemTime: SYSTEMTIME);
  220. 1: (FileTime: FILETIME);
  221. end;
  222. GeneratingComponent: ULONG;
  223. Status: ULONG;
  224. DetectionLocation: USHORT;
  225. Flags: USHORT;
  226. NumberOfParameters: Integer;
  227. Parameters: array [0..MaxNumberOfEEInfoParams - 1] of RPC_EE_INFO_PARAM;
  228. end;
  229. {$EXTERNALSYM tagRPC_EXTENDED_ERROR_INFO}
  230. RPC_EXTENDED_ERROR_INFO = tagRPC_EXTENDED_ERROR_INFO;
  231. {$EXTERNALSYM RPC_EXTENDED_ERROR_INFO}
  232. PRPC_EXTENDED_ERROR_INFO = ^RPC_EXTENDED_ERROR_INFO;
  233. {$NODEFINE PRPC_EXTENDED_ERROR_INFO}
  234. TRpcExtendedErrorInfo = RPC_EXTENDED_ERROR_INFO;
  235. PRpcExtendedErrorInfo = ^RPC_EXTENDED_ERROR_INFO;
  236. tagRPC_ERROR_ENUM_HANDLE = record
  237. Signature: ULONG;
  238. CurrentPos: Pointer;
  239. Head: Pointer;
  240. end;
  241. {$EXTERNALSYM tagRPC_ERROR_ENUM_HANDLE}
  242. RPC_ERROR_ENUM_HANDLE = tagRPC_ERROR_ENUM_HANDLE;
  243. {$EXTERNALSYM RPC_ERROR_ENUM_HANDLE}
  244. PRPC_ERROR_ENUM_HANDLE = ^RPC_ERROR_ENUM_HANDLE;
  245. {$NODEFINE PRPC_ERROR_ENUM_HANDLE}
  246. TRpcErrorEnumHandle = RPC_ERROR_ENUM_HANDLE;
  247. PRpcErrorEnumHandle = PRPC_ERROR_ENUM_HANDLE;
  248. function RpcErrorStartEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  249. {$EXTERNALSYM RpcErrorStartEnumeration}
  250. function RpcErrorGetNextRecord(EnumHandle: PRPC_ERROR_ENUM_HANDLE; CopyStrings: BOOL;
  251. var ErrorInfo: RPC_EXTENDED_ERROR_INFO): RPC_STATUS; stdcall;
  252. {$EXTERNALSYM RpcErrorGetNextRecord}
  253. function RpcErrorEndEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  254. {$EXTERNALSYM RpcErrorEndEnumeration}
  255. function RpcErrorResetEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  256. {$EXTERNALSYM RpcErrorResetEnumeration}
  257. function RpcErrorGetNumberOfRecords(var EnumHandle: RPC_ERROR_ENUM_HANDLE; var Records: Integer): RPC_STATUS; stdcall;
  258. {$EXTERNALSYM RpcErrorGetNumberOfRecords}
  259. function RpcErrorSaveErrorInfo(EnumHandle: PRPC_ERROR_ENUM_HANDLE; var ErrorBlob: PVOID; var BlobSize: size_t): RPC_STATUS; stdcall;
  260. {$EXTERNALSYM RpcErrorSaveErrorInfo}
  261. function RpcErrorLoadErrorInfo(ErrorBlob: PVOID; BlobSize: size_t; var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  262. {$EXTERNALSYM RpcErrorLoadErrorInfo}
  263. function RpcErrorAddRecord(ErrorInfo: PRPC_EXTENDED_ERROR_INFO): RPC_STATUS; stdcall;
  264. {$EXTERNALSYM RpcErrorAddRecord}
  265. procedure RpcErrorClearInformation; stdcall;
  266. {$EXTERNALSYM RpcErrorClearInformation}
  267. function RpcGetAuthorizationContextForClient(ClientBinding: RPC_BINDING_HANDLE; ImpersonateOnReturn: BOOL;
  268. Reserved1: PVOID; pExpirationTime: PLARGE_INTEGER; Reserved2: LUID; Reserved3: DWORD;
  269. Reserved4: PVOID; var pAuthzClientContext: PVOID): RPC_STATUS; stdcall;
  270. {$EXTERNALSYM RpcGetAuthorizationContextForClient}
  271. function RpcFreeAuthorizationContext(var pAuthzClientContext: PVOID): RPC_STATUS; stdcall;
  272. {$EXTERNALSYM RpcFreeAuthorizationContext}
  273. function RpcSsContextLockExclusive(ServerBindingHandle: RPC_BINDING_HANDLE; UserContext: PVOID): RPC_STATUS; stdcall;
  274. {$EXTERNALSYM RpcSsContextLockExclusive}
  275. function RpcSsContextLockShared(ServerBindingHandle: RPC_BINDING_HANDLE; UserContext: PVOID): RPC_STATUS; stdcall;
  276. {$EXTERNALSYM RpcSsContextLockShared}
  277. const
  278. RPC_CALL_ATTRIBUTES_VERSION = 1;
  279. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_VERSION}
  280. RPC_QUERY_SERVER_PRINCIPAL_NAME = 2;
  281. {$EXTERNALSYM RPC_QUERY_SERVER_PRINCIPAL_NAME}
  282. RPC_QUERY_CLIENT_PRINCIPAL_NAME = 4;
  283. {$EXTERNALSYM RPC_QUERY_CLIENT_PRINCIPAL_NAME}
  284. type
  285. tagRPC_CALL_ATTRIBUTES_V1_W = record
  286. Version: Cardinal;
  287. Flags: Cardinal;
  288. ServerPrincipalNameBufferLength: Cardinal;
  289. ServerPrincipalName: PWord;
  290. ClientPrincipalNameBufferLength: Cardinal;
  291. ClientPrincipalName: PWord;
  292. AuthenticationLevel: Cardinal;
  293. AuthenticationService: Cardinal;
  294. NullSession: BOOL;
  295. end;
  296. {$EXTERNALSYM tagRPC_CALL_ATTRIBUTES_V1_W}
  297. RPC_CALL_ATTRIBUTES_V1_W = tagRPC_CALL_ATTRIBUTES_V1_W;
  298. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1_W}
  299. TRpcCallAttributesV1W = RPC_CALL_ATTRIBUTES_V1_W;
  300. tagRPC_CALL_ATTRIBUTES_V1_A = record
  301. Version: Cardinal;
  302. Flags: Cardinal;
  303. ServerPrincipalNameBufferLength: Cardinal;
  304. ServerPrincipalName: PChar;
  305. ClientPrincipalNameBufferLength: Cardinal;
  306. ClientPrincipalName: PChar;
  307. AuthenticationLevel: Cardinal;
  308. AuthenticationService: Cardinal;
  309. NullSession: BOOL;
  310. end;
  311. {$EXTERNALSYM tagRPC_CALL_ATTRIBUTES_V1_A}
  312. RPC_CALL_ATTRIBUTES_V1_A = tagRPC_CALL_ATTRIBUTES_V1_A;
  313. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1_A}
  314. TRpcCallAttributesV1A = RPC_CALL_ATTRIBUTES_V1_A;
  315. {$IFDEF UNICODE}
  316. RPC_CALL_ATTRIBUTES_V1 = RPC_CALL_ATTRIBUTES_V1_W;
  317. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1}
  318. TRpcCallAttributesV1 = TRpcCallAttributesV1W;
  319. {$ELSE}
  320. RPC_CALL_ATTRIBUTES_V1 = RPC_CALL_ATTRIBUTES_V1_A;
  321. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1}
  322. TRpcCallAttributesV1 = TRpcCallAttributesV1A;
  323. {$ENDIF UNICODE}
  324. function RpcServerInqCallAttributesW(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  325. {$EXTERNALSYM RpcServerInqCallAttributesW}
  326. function RpcServerInqCallAttributesA(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  327. {$EXTERNALSYM RpcServerInqCallAttributesA}
  328. function RpcServerInqCallAttributes(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  329. {$EXTERNALSYM RpcServerInqCallAttributes}
  330. type
  331. RPC_CALL_ATTRIBUTES = RPC_CALL_ATTRIBUTES_V1;
  332. {$EXTERNALSYM RPC_CALL_ATTRIBUTES}
  333. TRpcCallAttributes = RPC_CALL_ATTRIBUTES;
  334. implementation
  335. const
  336. rpclib = 'rpc4rt.dll';
  337. {$IFDEF UNICODE}
  338. AWSuffix = 'W';
  339. {$ELSE}
  340. AWSuffix = 'A';
  341. {$ENDIF UNICODE}
  342. function RpcAsyncGetCallHandle(var pAsync: RPC_ASYNC_STATE): Pointer;
  343. begin
  344. Result := pAsync.RuntimeInfo;
  345. end;
  346. {$IFDEF DYNAMIC_LINK}
  347. var
  348. _RpcAsyncInitializeHandle: Pointer;
  349. function RpcAsyncInitializeHandle;
  350. begin
  351. GetProcedureAddress(_RpcAsyncInitializeHandle, rpclib, 'RpcAsyncInitializeHandle');
  352. asm
  353. MOV ESP, EBP
  354. POP EBP
  355. JMP [_RpcAsyncInitializeHandle]
  356. end;
  357. end;
  358. var
  359. _RpcAsyncRegisterInfo: Pointer;
  360. function RpcAsyncRegisterInfo;
  361. begin
  362. GetProcedureAddress(_RpcAsyncRegisterInfo, rpclib, 'RpcAsyncRegisterInfo');
  363. asm
  364. MOV ESP, EBP
  365. POP EBP
  366. JMP [_RpcAsyncRegisterInfo]
  367. end;
  368. end;
  369. var
  370. _RpcAsyncGetCallStatus: Pointer;
  371. function RpcAsyncGetCallStatus;
  372. begin
  373. GetProcedureAddress(_RpcAsyncGetCallStatus, rpclib, 'RpcAsyncGetCallStatus');
  374. asm
  375. MOV ESP, EBP
  376. POP EBP
  377. JMP [_RpcAsyncGetCallStatus]
  378. end;
  379. end;
  380. var
  381. _RpcAsyncCompleteCall: Pointer;
  382. function RpcAsyncCompleteCall;
  383. begin
  384. GetProcedureAddress(_RpcAsyncCompleteCall, rpclib, 'RpcAsyncCompleteCall');
  385. asm
  386. MOV ESP, EBP
  387. POP EBP
  388. JMP [_RpcAsyncCompleteCall]
  389. end;
  390. end;
  391. var
  392. _RpcAsyncAbortCall: Pointer;
  393. function RpcAsyncAbortCall;
  394. begin
  395. GetProcedureAddress(_RpcAsyncAbortCall, rpclib, 'RpcAsyncAbortCall');
  396. asm
  397. MOV ESP, EBP
  398. POP EBP
  399. JMP [_RpcAsyncAbortCall]
  400. end;
  401. end;
  402. var
  403. _RpcAsyncCancelCall: Pointer;
  404. function RpcAsyncCancelCall;
  405. begin
  406. GetProcedureAddress(_RpcAsyncCancelCall, rpclib, 'RpcAsyncCancelCall');
  407. asm
  408. MOV ESP, EBP
  409. POP EBP
  410. JMP [_RpcAsyncCancelCall]
  411. end;
  412. end;
  413. var
  414. _RpcAsyncCleanupThread: Pointer;
  415. function RpcAsyncCleanupThread;
  416. begin
  417. GetProcedureAddress(_RpcAsyncCleanupThread, rpclib, 'RpcAsyncCleanupThread');
  418. asm
  419. MOV ESP, EBP
  420. POP EBP
  421. JMP [_RpcAsyncCleanupThread]
  422. end;
  423. end;
  424. var
  425. _RpcErrorStartEnumeration: Pointer;
  426. function RpcErrorStartEnumeration;
  427. begin
  428. GetProcedureAddress(_RpcErrorStartEnumeration, rpclib, 'RpcErrorStartEnumeration');
  429. asm
  430. MOV ESP, EBP
  431. POP EBP
  432. JMP [_RpcErrorStartEnumeration]
  433. end;
  434. end;
  435. var
  436. _RpcErrorGetNextRecord: Pointer;
  437. function RpcErrorGetNextRecord;
  438. begin
  439. GetProcedureAddress(_RpcErrorGetNextRecord, rpclib, 'RpcErrorGetNextRecord');
  440. asm
  441. MOV ESP, EBP
  442. POP EBP
  443. JMP [_RpcErrorGetNextRecord]
  444. end;
  445. end;
  446. var
  447. _RpcErrorEndEnumeration: Pointer;
  448. function RpcErrorEndEnumeration;
  449. begin
  450. GetProcedureAddress(_RpcErrorEndEnumeration, rpclib, 'RpcErrorEndEnumeration');
  451. asm
  452. MOV ESP, EBP
  453. POP EBP
  454. JMP [_RpcErrorEndEnumeration]
  455. end;
  456. end;
  457. var
  458. _RpcErrorResetEnumeration: Pointer;
  459. function RpcErrorResetEnumeration;
  460. begin
  461. GetProcedureAddress(_RpcErrorResetEnumeration, rpclib, 'RpcErrorResetEnumeration');
  462. asm
  463. MOV ESP, EBP
  464. POP EBP
  465. JMP [_RpcErrorResetEnumeration]
  466. end;
  467. end;
  468. var
  469. _RpcErrorGetNumberOfRecords: Pointer;
  470. function RpcErrorGetNumberOfRecords;
  471. begin
  472. GetProcedureAddress(_RpcErrorGetNumberOfRecords, rpclib, 'RpcErrorGetNumberOfRecords');
  473. asm
  474. MOV ESP, EBP
  475. POP EBP
  476. JMP [_RpcErrorGetNumberOfRecords]
  477. end;
  478. end;
  479. var
  480. _RpcErrorSaveErrorInfo: Pointer;
  481. function RpcErrorSaveErrorInfo;
  482. begin
  483. GetProcedureAddress(_RpcErrorSaveErrorInfo, rpclib, 'RpcErrorSaveErrorInfo');
  484. asm
  485. MOV ESP, EBP
  486. POP EBP
  487. JMP [_RpcErrorSaveErrorInfo]
  488. end;
  489. end;
  490. var
  491. _RpcErrorLoadErrorInfo: Pointer;
  492. function RpcErrorLoadErrorInfo;
  493. begin
  494. GetProcedureAddress(_RpcErrorLoadErrorInfo, rpclib, 'RpcErrorLoadErrorInfo');
  495. asm
  496. MOV ESP, EBP
  497. POP EBP
  498. JMP [_RpcErrorLoadErrorInfo]
  499. end;
  500. end;
  501. var
  502. _RpcErrorAddRecord: Pointer;
  503. function RpcErrorAddRecord;
  504. begin
  505. GetProcedureAddress(_RpcErrorAddRecord, rpclib, 'RpcErrorAddRecord');
  506. asm
  507. MOV ESP, EBP
  508. POP EBP
  509. JMP [_RpcErrorAddRecord]
  510. end;
  511. end;
  512. var
  513. _RpcErrorClearInformation: Pointer;
  514. procedure RpcErrorClearInformation;
  515. begin
  516. GetProcedureAddress(_RpcErrorClearInformation, rpclib, 'RpcErrorClearInformation');
  517. asm
  518. MOV ESP, EBP
  519. POP EBP
  520. JMP [_RpcErrorClearInformation]
  521. end;
  522. end;
  523. var
  524. _RpcGetAuthContextForClient: Pointer;
  525. function RpcGetAuthorizationContextForClient;
  526. begin
  527. GetProcedureAddress(_RpcGetAuthContextForClient, rpclib, 'RpcGetAuthorizationContextForClient');
  528. asm
  529. MOV ESP, EBP
  530. POP EBP
  531. JMP [_RpcGetAuthContextForClient]
  532. end;
  533. end;
  534. var
  535. _RpcFreeAuthorizationContext: Pointer;
  536. function RpcFreeAuthorizationContext;
  537. begin
  538. GetProcedureAddress(_RpcFreeAuthorizationContext, rpclib, 'RpcFreeAuthorizationContext');
  539. asm
  540. MOV ESP, EBP
  541. POP EBP
  542. JMP [_RpcFreeAuthorizationContext]
  543. end;
  544. end;
  545. var
  546. _RpcSsContextLockExclusive: Pointer;
  547. function RpcSsContextLockExclusive;
  548. begin
  549. GetProcedureAddress(_RpcSsContextLockExclusive, rpclib, 'RpcSsContextLockExclusive');
  550. asm
  551. MOV ESP, EBP
  552. POP EBP
  553. JMP [_RpcSsContextLockExclusive]
  554. end;
  555. end;
  556. var
  557. _RpcSsContextLockShared: Pointer;
  558. function RpcSsContextLockShared;
  559. begin
  560. GetProcedureAddress(_RpcSsContextLockShared, rpclib, 'RpcSsContextLockShared');
  561. asm
  562. MOV ESP, EBP
  563. POP EBP
  564. JMP [_RpcSsContextLockShared]
  565. end;
  566. end;
  567. var
  568. _RpcServerInqCallAttributesA: Pointer;
  569. function RpcServerInqCallAttributesA;
  570. begin
  571. GetProcedureAddress(_RpcServerInqCallAttributesA, rpclib, 'RpcServerInqCallAttributesA');
  572. asm
  573. MOV ESP, EBP
  574. POP EBP
  575. JMP [_RpcServerInqCallAttributesA]
  576. end;
  577. end;
  578. var
  579. _RpcServerInqCallAttributesW: Pointer;
  580. function RpcServerInqCallAttributesW;
  581. begin
  582. GetProcedureAddress(_RpcServerInqCallAttributesW, rpclib, 'RpcServerInqCallAttributesW');
  583. asm
  584. MOV ESP, EBP
  585. POP EBP
  586. JMP [_RpcServerInqCallAttributesW]
  587. end;
  588. end;
  589. var
  590. _RpcServerInqCallAttributes: Pointer;
  591. function RpcServerInqCallAttributes;
  592. begin
  593. GetProcedureAddress(_RpcServerInqCallAttributes, rpclib, 'RpcServerInqCallAttributes' + AWSuffix);
  594. asm
  595. MOV ESP, EBP
  596. POP EBP
  597. JMP [_RpcServerInqCallAttributes]
  598. end;
  599. end;
  600. {$ELSE}
  601. function RpcAsyncInitializeHandle; external rpclib name 'RpcAsyncInitializeHandle';
  602. function RpcAsyncRegisterInfo; external rpclib name 'RpcAsyncRegisterInfo';
  603. function RpcAsyncGetCallStatus; external rpclib name 'RpcAsyncGetCallStatus';
  604. function RpcAsyncCompleteCall; external rpclib name 'RpcAsyncCompleteCall';
  605. function RpcAsyncAbortCall; external rpclib name 'RpcAsyncAbortCall';
  606. function RpcAsyncCancelCall; external rpclib name 'RpcAsyncCancelCall';
  607. function RpcAsyncCleanupThread; external rpclib name 'RpcAsyncCleanupThread';
  608. function RpcErrorStartEnumeration; external rpclib name 'RpcErrorStartEnumeration';
  609. function RpcErrorGetNextRecord; external rpclib name 'RpcErrorGetNextRecord';
  610. function RpcErrorEndEnumeration; external rpclib name 'RpcErrorEndEnumeration';
  611. function RpcErrorResetEnumeration; external rpclib name 'RpcErrorResetEnumeration';
  612. function RpcErrorGetNumberOfRecords; external rpclib name 'RpcErrorGetNumberOfRecords';
  613. function RpcErrorSaveErrorInfo; external rpclib name 'RpcErrorSaveErrorInfo';
  614. function RpcErrorLoadErrorInfo; external rpclib name 'RpcErrorLoadErrorInfo';
  615. function RpcErrorAddRecord; external rpclib name 'RpcErrorAddRecord';
  616. procedure RpcErrorClearInformation; external rpclib name 'RpcErrorClearInformation';
  617. function RpcGetAuthorizationContextForClient; external rpclib name 'RpcGetAuthorizationContextForClient';
  618. function RpcFreeAuthorizationContext; external rpclib name 'RpcFreeAuthorizationContext';
  619. function RpcSsContextLockExclusive; external rpclib name 'RpcSsContextLockExclusive';
  620. function RpcSsContextLockShared; external rpclib name 'RpcSsContextLockShared';
  621. function RpcServerInqCallAttributesA; external rpclib name 'RpcServerInqCallAttributesA';
  622. function RpcServerInqCallAttributesW; external rpclib name 'RpcServerInqCallAttributesW';
  623. function RpcServerInqCallAttributes; external rpclib name 'RpcServerInqCallAttributes' + AWSuffix;
  624. {$ENDIF DYNAMIC_LINK}
  625. end.