jwarpcasync.pas 23 KB

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