jwarpcasync.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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.13 2007/09/05 11:58:52 dezipaitor Exp $
  43. {$IFNDEF JWA_OMIT_SECTIONS}
  44. unit JwaRpcASync;
  45. {$WEAKPACKAGEUNIT}
  46. {$ENDIF JWA_OMIT_SECTIONS}
  47. {$HPPEMIT ''}
  48. {$HPPEMIT '#include "RpcAsync.h"'}
  49. {$HPPEMIT ''}
  50. {$HPPEMIT 'typedef RPC_EXTENDED_ERROR_INFO* PRPC_EXTENDED_ERROR_INFO'}
  51. {$HPPEMIT 'typedef RPC_ERROR_ENUM_HANDLE* PRPC_ERROR_ENUM_HANDLE'}
  52. {$HPPEMIT ''}
  53. {$IFNDEF JWA_OMIT_SECTIONS}
  54. {$I jediapilib.inc}
  55. interface
  56. uses
  57. JwaRpc, JwaRpcDce, JwaWinBase, JwaWinNT, JwaWinType;
  58. {$ENDIF JWA_OMIT_SECTIONS}
  59. {$IFNDEF JWA_IMPLEMENTATIONSECTION}
  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. {This function is removed due to
  164. http://www.freepascal.org/mantis/view.php?id=10364
  165. and
  166. http://sourceforge.net/tracker/index.php?func=detail&aid=1846986&group_id=121894&atid=694029
  167. function RpcAsyncCleanupThread(dwTimeout: DWORD): RPC_STATUS; stdcall;}
  168. {.$EXTERNALSYM RpcAsyncCleanupThread}
  169. type
  170. tagExtendedErrorParamTypes = (
  171. eeptFiller0,
  172. eeptAnsiString,
  173. eeptUnicodeString,
  174. eeptLongVal,
  175. eeptShortVal,
  176. eeptPointerVal,
  177. eeptNone,
  178. eeptBinary);
  179. {$EXTERNALSYM tagExtendedErrorParamTypes}
  180. ExtendedErrorParamTypes = tagExtendedErrorParamTypes;
  181. {$EXTERNALSYM ExtendedErrorParamTypes}
  182. TExtendedErrorParamTypes = ExtendedErrorParamTypes;
  183. const
  184. MaxNumberOfEEInfoParams = 4;
  185. {$EXTERNALSYM MaxNumberOfEEInfoParams}
  186. RPC_EEINFO_VERSION = 1;
  187. {$EXTERNALSYM RPC_EEINFO_VERSION}
  188. type
  189. tagBinaryParam = record
  190. Buffer: Pointer;
  191. Size: Word;
  192. end;
  193. {$EXTERNALSYM tagBinaryParam}
  194. BinaryParam = tagBinaryParam;
  195. {$EXTERNALSYM BinaryParam}
  196. TBinaryParam = BinaryParam;
  197. tagRPC_EE_INFO_PARAM = record
  198. ParameterType: ExtendedErrorParamTypes;
  199. case Integer of
  200. 0: (AnsiString: LPSTR);
  201. 1: (UnicodeString: LPWSTR);
  202. 2: (LVal: Longint);
  203. 3: (SVal: Word);
  204. 4: (PVal: ULONGLONG);
  205. 5: (BVal: BinaryParam);
  206. end;
  207. {$EXTERNALSYM tagRPC_EE_INFO_PARAM}
  208. RPC_EE_INFO_PARAM = tagRPC_EE_INFO_PARAM;
  209. {$EXTERNALSYM RPC_EE_INFO_PARAM}
  210. TRpcEeInfoParam = RPC_EE_INFO_PARAM;
  211. const
  212. EEInfoPreviousRecordsMissing = 1;
  213. {$EXTERNALSYM EEInfoPreviousRecordsMissing}
  214. EEInfoNextRecordsMissing = 2;
  215. {$EXTERNALSYM EEInfoNextRecordsMissing}
  216. EEInfoUseFileTime = 4;
  217. {$EXTERNALSYM EEInfoUseFileTime}
  218. EEInfoGCCOM = 11;
  219. {$EXTERNALSYM EEInfoGCCOM}
  220. EEInfoGCFRS = 12;
  221. {$EXTERNALSYM EEInfoGCFRS}
  222. type
  223. tagRPC_EXTENDED_ERROR_INFO = record
  224. Version: ULONG;
  225. ComputerName: LPWSTR;
  226. ProcessID: ULONG;
  227. u: record
  228. case Integer of
  229. 0: ( SystemTime: SYSTEMTIME);
  230. 1: (FileTime: FILETIME);
  231. end;
  232. GeneratingComponent: ULONG;
  233. Status: ULONG;
  234. DetectionLocation: USHORT;
  235. Flags: USHORT;
  236. NumberOfParameters: Integer;
  237. Parameters: array [0..MaxNumberOfEEInfoParams - 1] of RPC_EE_INFO_PARAM;
  238. end;
  239. {$EXTERNALSYM tagRPC_EXTENDED_ERROR_INFO}
  240. RPC_EXTENDED_ERROR_INFO = tagRPC_EXTENDED_ERROR_INFO;
  241. {$EXTERNALSYM RPC_EXTENDED_ERROR_INFO}
  242. PRPC_EXTENDED_ERROR_INFO = ^RPC_EXTENDED_ERROR_INFO;
  243. {$NODEFINE PRPC_EXTENDED_ERROR_INFO}
  244. TRpcExtendedErrorInfo = RPC_EXTENDED_ERROR_INFO;
  245. PRpcExtendedErrorInfo = ^RPC_EXTENDED_ERROR_INFO;
  246. tagRPC_ERROR_ENUM_HANDLE = record
  247. Signature: ULONG;
  248. CurrentPos: Pointer;
  249. Head: Pointer;
  250. end;
  251. {$EXTERNALSYM tagRPC_ERROR_ENUM_HANDLE}
  252. RPC_ERROR_ENUM_HANDLE = tagRPC_ERROR_ENUM_HANDLE;
  253. {$EXTERNALSYM RPC_ERROR_ENUM_HANDLE}
  254. PRPC_ERROR_ENUM_HANDLE = ^RPC_ERROR_ENUM_HANDLE;
  255. {$NODEFINE PRPC_ERROR_ENUM_HANDLE}
  256. TRpcErrorEnumHandle = RPC_ERROR_ENUM_HANDLE;
  257. PRpcErrorEnumHandle = PRPC_ERROR_ENUM_HANDLE;
  258. function RpcErrorStartEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  259. {$EXTERNALSYM RpcErrorStartEnumeration}
  260. function RpcErrorGetNextRecord(EnumHandle: PRPC_ERROR_ENUM_HANDLE; CopyStrings: BOOL;
  261. var ErrorInfo: RPC_EXTENDED_ERROR_INFO): RPC_STATUS; stdcall;
  262. {$EXTERNALSYM RpcErrorGetNextRecord}
  263. function RpcErrorEndEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  264. {$EXTERNALSYM RpcErrorEndEnumeration}
  265. function RpcErrorResetEnumeration(var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  266. {$EXTERNALSYM RpcErrorResetEnumeration}
  267. function RpcErrorGetNumberOfRecords(var EnumHandle: RPC_ERROR_ENUM_HANDLE; var Records: Integer): RPC_STATUS; stdcall;
  268. {$EXTERNALSYM RpcErrorGetNumberOfRecords}
  269. function RpcErrorSaveErrorInfo(EnumHandle: PRPC_ERROR_ENUM_HANDLE; var ErrorBlob: PVOID; var BlobSize: size_t): RPC_STATUS; stdcall;
  270. {$EXTERNALSYM RpcErrorSaveErrorInfo}
  271. function RpcErrorLoadErrorInfo(ErrorBlob: PVOID; BlobSize: size_t; var EnumHandle: RPC_ERROR_ENUM_HANDLE): RPC_STATUS; stdcall;
  272. {$EXTERNALSYM RpcErrorLoadErrorInfo}
  273. function RpcErrorAddRecord(ErrorInfo: PRPC_EXTENDED_ERROR_INFO): RPC_STATUS; stdcall;
  274. {$EXTERNALSYM RpcErrorAddRecord}
  275. procedure RpcErrorClearInformation; stdcall;
  276. {$EXTERNALSYM RpcErrorClearInformation}
  277. function RpcGetAuthorizationContextForClient(ClientBinding: RPC_BINDING_HANDLE; ImpersonateOnReturn: BOOL;
  278. Reserved1: PVOID; pExpirationTime: PLARGE_INTEGER; Reserved2: LUID; Reserved3: DWORD;
  279. Reserved4: PVOID; var pAuthzClientContext: PVOID): RPC_STATUS; stdcall;
  280. {$EXTERNALSYM RpcGetAuthorizationContextForClient}
  281. function RpcFreeAuthorizationContext(var pAuthzClientContext: PVOID): RPC_STATUS; stdcall;
  282. {$EXTERNALSYM RpcFreeAuthorizationContext}
  283. function RpcSsContextLockExclusive(ServerBindingHandle: RPC_BINDING_HANDLE; UserContext: PVOID): RPC_STATUS; stdcall;
  284. {$EXTERNALSYM RpcSsContextLockExclusive}
  285. function RpcSsContextLockShared(ServerBindingHandle: RPC_BINDING_HANDLE; UserContext: PVOID): RPC_STATUS; stdcall;
  286. {$EXTERNALSYM RpcSsContextLockShared}
  287. const
  288. RPC_CALL_ATTRIBUTES_VERSION = 1;
  289. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_VERSION}
  290. RPC_QUERY_SERVER_PRINCIPAL_NAME = 2;
  291. {$EXTERNALSYM RPC_QUERY_SERVER_PRINCIPAL_NAME}
  292. RPC_QUERY_CLIENT_PRINCIPAL_NAME = 4;
  293. {$EXTERNALSYM RPC_QUERY_CLIENT_PRINCIPAL_NAME}
  294. type
  295. tagRPC_CALL_ATTRIBUTES_V1_W = record
  296. Version: Cardinal;
  297. Flags: Cardinal;
  298. ServerPrincipalNameBufferLength: Cardinal;
  299. ServerPrincipalName: PWord;
  300. ClientPrincipalNameBufferLength: Cardinal;
  301. ClientPrincipalName: PWord;
  302. AuthenticationLevel: Cardinal;
  303. AuthenticationService: Cardinal;
  304. NullSession: BOOL;
  305. end;
  306. {$EXTERNALSYM tagRPC_CALL_ATTRIBUTES_V1_W}
  307. RPC_CALL_ATTRIBUTES_V1_W = tagRPC_CALL_ATTRIBUTES_V1_W;
  308. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1_W}
  309. TRpcCallAttributesV1W = RPC_CALL_ATTRIBUTES_V1_W;
  310. tagRPC_CALL_ATTRIBUTES_V1_A = record
  311. Version: Cardinal;
  312. Flags: Cardinal;
  313. ServerPrincipalNameBufferLength: Cardinal;
  314. ServerPrincipalName: PChar;
  315. ClientPrincipalNameBufferLength: Cardinal;
  316. ClientPrincipalName: PChar;
  317. AuthenticationLevel: Cardinal;
  318. AuthenticationService: Cardinal;
  319. NullSession: BOOL;
  320. end;
  321. {$EXTERNALSYM tagRPC_CALL_ATTRIBUTES_V1_A}
  322. RPC_CALL_ATTRIBUTES_V1_A = tagRPC_CALL_ATTRIBUTES_V1_A;
  323. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1_A}
  324. TRpcCallAttributesV1A = RPC_CALL_ATTRIBUTES_V1_A;
  325. {$IFDEF UNICODE}
  326. RPC_CALL_ATTRIBUTES_V1 = RPC_CALL_ATTRIBUTES_V1_W;
  327. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1}
  328. TRpcCallAttributesV1 = TRpcCallAttributesV1W;
  329. {$ELSE}
  330. RPC_CALL_ATTRIBUTES_V1 = RPC_CALL_ATTRIBUTES_V1_A;
  331. {$EXTERNALSYM RPC_CALL_ATTRIBUTES_V1}
  332. TRpcCallAttributesV1 = TRpcCallAttributesV1A;
  333. {$ENDIF UNICODE}
  334. function RpcServerInqCallAttributesW(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  335. {$EXTERNALSYM RpcServerInqCallAttributesW}
  336. function RpcServerInqCallAttributesA(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  337. {$EXTERNALSYM RpcServerInqCallAttributesA}
  338. function RpcServerInqCallAttributes(ClientBinding: RPC_BINDING_HANDLE; RpcCallAttributes: Pointer): RPC_STATUS; stdcall;
  339. {$EXTERNALSYM RpcServerInqCallAttributes}
  340. type
  341. RPC_CALL_ATTRIBUTES = RPC_CALL_ATTRIBUTES_V1;
  342. {$EXTERNALSYM RPC_CALL_ATTRIBUTES}
  343. TRpcCallAttributes = RPC_CALL_ATTRIBUTES;
  344. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  345. {$IFNDEF JWA_OMIT_SECTIONS}
  346. implementation
  347. //uses ...
  348. {$ENDIF JWA_OMIT_SECTIONS}
  349. {$IFNDEF JWA_INTERFACESECTION}
  350. {$IFNDEF JWA_INCLUDEMODE}
  351. const
  352. rpclib = 'rpc4rt.dll';
  353. {$IFDEF UNICODE}
  354. AWSuffix = 'W';
  355. {$ELSE}
  356. AWSuffix = 'A';
  357. {$ENDIF UNICODE}
  358. {$ENDIF JWA_INCLUDEMODE}
  359. function RpcAsyncGetCallHandle(var pAsync: RPC_ASYNC_STATE): Pointer;
  360. begin
  361. Result := pAsync.RuntimeInfo;
  362. end;
  363. {$IFDEF DYNAMIC_LINK}
  364. var
  365. _RpcAsyncInitializeHandle: Pointer;
  366. function RpcAsyncInitializeHandle;
  367. begin
  368. GetProcedureAddress(_RpcAsyncInitializeHandle, rpclib, 'RpcAsyncInitializeHandle');
  369. asm
  370. MOV ESP, EBP
  371. POP EBP
  372. JMP [_RpcAsyncInitializeHandle]
  373. end;
  374. end;
  375. var
  376. _RpcAsyncRegisterInfo: Pointer;
  377. function RpcAsyncRegisterInfo;
  378. begin
  379. GetProcedureAddress(_RpcAsyncRegisterInfo, rpclib, 'RpcAsyncRegisterInfo');
  380. asm
  381. MOV ESP, EBP
  382. POP EBP
  383. JMP [_RpcAsyncRegisterInfo]
  384. end;
  385. end;
  386. var
  387. _RpcAsyncGetCallStatus: Pointer;
  388. function RpcAsyncGetCallStatus;
  389. begin
  390. GetProcedureAddress(_RpcAsyncGetCallStatus, rpclib, 'RpcAsyncGetCallStatus');
  391. asm
  392. MOV ESP, EBP
  393. POP EBP
  394. JMP [_RpcAsyncGetCallStatus]
  395. end;
  396. end;
  397. var
  398. _RpcAsyncCompleteCall: Pointer;
  399. function RpcAsyncCompleteCall;
  400. begin
  401. GetProcedureAddress(_RpcAsyncCompleteCall, rpclib, 'RpcAsyncCompleteCall');
  402. asm
  403. MOV ESP, EBP
  404. POP EBP
  405. JMP [_RpcAsyncCompleteCall]
  406. end;
  407. end;
  408. var
  409. _RpcAsyncAbortCall: Pointer;
  410. function RpcAsyncAbortCall;
  411. begin
  412. GetProcedureAddress(_RpcAsyncAbortCall, rpclib, 'RpcAsyncAbortCall');
  413. asm
  414. MOV ESP, EBP
  415. POP EBP
  416. JMP [_RpcAsyncAbortCall]
  417. end;
  418. end;
  419. var
  420. _RpcAsyncCancelCall: Pointer;
  421. function RpcAsyncCancelCall;
  422. begin
  423. GetProcedureAddress(_RpcAsyncCancelCall, rpclib, 'RpcAsyncCancelCall');
  424. asm
  425. MOV ESP, EBP
  426. POP EBP
  427. JMP [_RpcAsyncCancelCall]
  428. end;
  429. end;
  430. {
  431. {This function is removed due to
  432. http://www.freepascal.org/mantis/view.php?id=10364
  433. and
  434. http://sourceforge.net/tracker/index.php?func=detail&aid=1846986&group_id=121894&atid=694029
  435. var
  436. _RpcAsyncCleanupThread: Pointer;
  437. function RpcAsyncCleanupThread;
  438. begin
  439. GetProcedureAddress(_RpcAsyncCleanupThread, rpclib, 'RpcAsyncCleanupThread');
  440. asm
  441. MOV ESP, EBP
  442. POP EBP
  443. JMP [_RpcAsyncCleanupThread]
  444. end;
  445. end;
  446. }
  447. var
  448. _RpcErrorStartEnumeration: Pointer;
  449. function RpcErrorStartEnumeration;
  450. begin
  451. GetProcedureAddress(_RpcErrorStartEnumeration, rpclib, 'RpcErrorStartEnumeration');
  452. asm
  453. MOV ESP, EBP
  454. POP EBP
  455. JMP [_RpcErrorStartEnumeration]
  456. end;
  457. end;
  458. var
  459. _RpcErrorGetNextRecord: Pointer;
  460. function RpcErrorGetNextRecord;
  461. begin
  462. GetProcedureAddress(_RpcErrorGetNextRecord, rpclib, 'RpcErrorGetNextRecord');
  463. asm
  464. MOV ESP, EBP
  465. POP EBP
  466. JMP [_RpcErrorGetNextRecord]
  467. end;
  468. end;
  469. var
  470. _RpcErrorEndEnumeration: Pointer;
  471. function RpcErrorEndEnumeration;
  472. begin
  473. GetProcedureAddress(_RpcErrorEndEnumeration, rpclib, 'RpcErrorEndEnumeration');
  474. asm
  475. MOV ESP, EBP
  476. POP EBP
  477. JMP [_RpcErrorEndEnumeration]
  478. end;
  479. end;
  480. var
  481. _RpcErrorResetEnumeration: Pointer;
  482. function RpcErrorResetEnumeration;
  483. begin
  484. GetProcedureAddress(_RpcErrorResetEnumeration, rpclib, 'RpcErrorResetEnumeration');
  485. asm
  486. MOV ESP, EBP
  487. POP EBP
  488. JMP [_RpcErrorResetEnumeration]
  489. end;
  490. end;
  491. var
  492. _RpcErrorGetNumberOfRecords: Pointer;
  493. function RpcErrorGetNumberOfRecords;
  494. begin
  495. GetProcedureAddress(_RpcErrorGetNumberOfRecords, rpclib, 'RpcErrorGetNumberOfRecords');
  496. asm
  497. MOV ESP, EBP
  498. POP EBP
  499. JMP [_RpcErrorGetNumberOfRecords]
  500. end;
  501. end;
  502. var
  503. _RpcErrorSaveErrorInfo: Pointer;
  504. function RpcErrorSaveErrorInfo;
  505. begin
  506. GetProcedureAddress(_RpcErrorSaveErrorInfo, rpclib, 'RpcErrorSaveErrorInfo');
  507. asm
  508. MOV ESP, EBP
  509. POP EBP
  510. JMP [_RpcErrorSaveErrorInfo]
  511. end;
  512. end;
  513. var
  514. _RpcErrorLoadErrorInfo: Pointer;
  515. function RpcErrorLoadErrorInfo;
  516. begin
  517. GetProcedureAddress(_RpcErrorLoadErrorInfo, rpclib, 'RpcErrorLoadErrorInfo');
  518. asm
  519. MOV ESP, EBP
  520. POP EBP
  521. JMP [_RpcErrorLoadErrorInfo]
  522. end;
  523. end;
  524. var
  525. _RpcErrorAddRecord: Pointer;
  526. function RpcErrorAddRecord;
  527. begin
  528. GetProcedureAddress(_RpcErrorAddRecord, rpclib, 'RpcErrorAddRecord');
  529. asm
  530. MOV ESP, EBP
  531. POP EBP
  532. JMP [_RpcErrorAddRecord]
  533. end;
  534. end;
  535. var
  536. _RpcErrorClearInformation: Pointer;
  537. procedure RpcErrorClearInformation;
  538. begin
  539. GetProcedureAddress(_RpcErrorClearInformation, rpclib, 'RpcErrorClearInformation');
  540. asm
  541. MOV ESP, EBP
  542. POP EBP
  543. JMP [_RpcErrorClearInformation]
  544. end;
  545. end;
  546. var
  547. _RpcGetAuthContextForClient: Pointer;
  548. function RpcGetAuthorizationContextForClient;
  549. begin
  550. GetProcedureAddress(_RpcGetAuthContextForClient, rpclib, 'RpcGetAuthorizationContextForClient');
  551. asm
  552. MOV ESP, EBP
  553. POP EBP
  554. JMP [_RpcGetAuthContextForClient]
  555. end;
  556. end;
  557. var
  558. _RpcFreeAuthorizationContext: Pointer;
  559. function RpcFreeAuthorizationContext;
  560. begin
  561. GetProcedureAddress(_RpcFreeAuthorizationContext, rpclib, 'RpcFreeAuthorizationContext');
  562. asm
  563. MOV ESP, EBP
  564. POP EBP
  565. JMP [_RpcFreeAuthorizationContext]
  566. end;
  567. end;
  568. var
  569. _RpcSsContextLockExclusive: Pointer;
  570. function RpcSsContextLockExclusive;
  571. begin
  572. GetProcedureAddress(_RpcSsContextLockExclusive, rpclib, 'RpcSsContextLockExclusive');
  573. asm
  574. MOV ESP, EBP
  575. POP EBP
  576. JMP [_RpcSsContextLockExclusive]
  577. end;
  578. end;
  579. var
  580. _RpcSsContextLockShared: Pointer;
  581. function RpcSsContextLockShared;
  582. begin
  583. GetProcedureAddress(_RpcSsContextLockShared, rpclib, 'RpcSsContextLockShared');
  584. asm
  585. MOV ESP, EBP
  586. POP EBP
  587. JMP [_RpcSsContextLockShared]
  588. end;
  589. end;
  590. var
  591. _RpcServerInqCallAttributesA: Pointer;
  592. function RpcServerInqCallAttributesA;
  593. begin
  594. GetProcedureAddress(_RpcServerInqCallAttributesA, rpclib, 'RpcServerInqCallAttributesA');
  595. asm
  596. MOV ESP, EBP
  597. POP EBP
  598. JMP [_RpcServerInqCallAttributesA]
  599. end;
  600. end;
  601. var
  602. _RpcServerInqCallAttributesW: Pointer;
  603. function RpcServerInqCallAttributesW;
  604. begin
  605. GetProcedureAddress(_RpcServerInqCallAttributesW, rpclib, 'RpcServerInqCallAttributesW');
  606. asm
  607. MOV ESP, EBP
  608. POP EBP
  609. JMP [_RpcServerInqCallAttributesW]
  610. end;
  611. end;
  612. var
  613. _RpcServerInqCallAttributes: Pointer;
  614. function RpcServerInqCallAttributes;
  615. begin
  616. GetProcedureAddress(_RpcServerInqCallAttributes, rpclib, 'RpcServerInqCallAttributes' + AWSuffix);
  617. asm
  618. MOV ESP, EBP
  619. POP EBP
  620. JMP [_RpcServerInqCallAttributes]
  621. end;
  622. end;
  623. {$ELSE}
  624. function RpcAsyncInitializeHandle; external rpclib name 'RpcAsyncInitializeHandle';
  625. function RpcAsyncRegisterInfo; external rpclib name 'RpcAsyncRegisterInfo';
  626. function RpcAsyncGetCallStatus; external rpclib name 'RpcAsyncGetCallStatus';
  627. function RpcAsyncCompleteCall; external rpclib name 'RpcAsyncCompleteCall';
  628. function RpcAsyncAbortCall; external rpclib name 'RpcAsyncAbortCall';
  629. function RpcAsyncCancelCall; external rpclib name 'RpcAsyncCancelCall';
  630. {This function is removed due to
  631. http://www.freepascal.org/mantis/view.php?id=10364
  632. and
  633. http://sourceforge.net/tracker/index.php?func=detail&aid=1846986&group_id=121894&atid=694029
  634. }
  635. //function RpcAsyncCleanupThread; external rpclib name 'RpcAsyncCleanupThread';
  636. function RpcErrorStartEnumeration; external rpclib name 'RpcErrorStartEnumeration';
  637. function RpcErrorGetNextRecord; external rpclib name 'RpcErrorGetNextRecord';
  638. function RpcErrorEndEnumeration; external rpclib name 'RpcErrorEndEnumeration';
  639. function RpcErrorResetEnumeration; external rpclib name 'RpcErrorResetEnumeration';
  640. function RpcErrorGetNumberOfRecords; external rpclib name 'RpcErrorGetNumberOfRecords';
  641. function RpcErrorSaveErrorInfo; external rpclib name 'RpcErrorSaveErrorInfo';
  642. function RpcErrorLoadErrorInfo; external rpclib name 'RpcErrorLoadErrorInfo';
  643. function RpcErrorAddRecord; external rpclib name 'RpcErrorAddRecord';
  644. procedure RpcErrorClearInformation; external rpclib name 'RpcErrorClearInformation';
  645. function RpcGetAuthorizationContextForClient; external rpclib name 'RpcGetAuthorizationContextForClient';
  646. function RpcFreeAuthorizationContext; external rpclib name 'RpcFreeAuthorizationContext';
  647. function RpcSsContextLockExclusive; external rpclib name 'RpcSsContextLockExclusive';
  648. function RpcSsContextLockShared; external rpclib name 'RpcSsContextLockShared';
  649. function RpcServerInqCallAttributesA; external rpclib name 'RpcServerInqCallAttributesA';
  650. function RpcServerInqCallAttributesW; external rpclib name 'RpcServerInqCallAttributesW';
  651. function RpcServerInqCallAttributes; external rpclib name 'RpcServerInqCallAttributes' + AWSuffix;
  652. {$ENDIF DYNAMIC_LINK}
  653. {$ENDIF JWA_INTERFACESECTION}
  654. {$IFNDEF JWA_OMIT_SECTIONS}
  655. end.
  656. {$ENDIF JWA_OMIT_SECTIONS}