Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

821 lines
16 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntamd64.w
  5. Abstract:
  6. User mode visible AMD64 specific structures and constants.
  7. Author:
  8. David N. Cutler (davec) 4-May-2000
  9. Revision History:
  10. --*/
  11. #ifndef _NTAMD64_
  12. #define _NTAMD64_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. // begin_ntddk begin_wdm begin_nthal begin_winnt begin_ntminiport begin_wx86
  20. #if defined(_AMD64_)
  21. // end_ntddk end_wdm end_nthal end_winnt end_ntminiport end_wx86
  22. //
  23. // ?? Values put in ExceptionRecord.ExceptionInformation[0]
  24. // ?? First parameter is always in ExceptionInformation[1],
  25. // ?? Second parameter is always in ExceptionInformation[2]
  26. //
  27. #define BREAKPOINT_BREAK 0
  28. #define BREAKPOINT_PRINT 1
  29. #define BREAKPOINT_PROMPT 2
  30. #define BREAKPOINT_LOAD_SYMBOLS 3
  31. #define BREAKPOINT_UNLOAD_SYMBOLS 4
  32. #define BREAKPOINT_COMMAND_STRING 5
  33. //
  34. // Define AMD64 specific control space.
  35. //
  36. typedef enum _DEBUG_CONTROL_SPACE_ITEM {
  37. DEBUG_CONTROL_SPACE_PCR,
  38. DEBUG_CONTROL_SPACE_PRCB,
  39. DEBUG_CONTROL_SPACE_KSPECIAL,
  40. DEBUG_CONTROL_SPACE_THREAD,
  41. DEBUG_CONTROL_SPACE_MAXIMUM
  42. } DEBUG_CONTROL_SPACE_ITEM;
  43. //
  44. // Define Address of User Shared Data.
  45. //
  46. #define MM_SHARED_USER_DATA_VA 0x7FFE0000
  47. #define USER_SHARED_DATA ((KUSER_SHARED_DATA * const)MM_SHARED_USER_DATA_VA)
  48. //
  49. // Define address of the WOW64 reserved compatibility area.
  50. //
  51. #define WOW64_COMPATIBILITY_AREA_ADDRESS (MM_SHARED_USER_DATA_VA - 0x1000000)
  52. //
  53. // Define address of the system-wide csrss shared section.
  54. //
  55. #define CSR_SYSTEM_SHARED_ADDRESS (WOW64_COMPATIBILITY_AREA_ADDRESS)
  56. // begin_winnt begin_ntddk begin_wdm begin_nthal begin_ntndis begin_ntosp
  57. #if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS)
  58. //
  59. // Define function to get the caller's EFLAGs value.
  60. //
  61. #define GetCallersEflags() __getcallerseflags()
  62. unsigned __int32
  63. __getcallerseflags (
  64. VOID
  65. );
  66. #pragma intrinsic(__getcallerseflags)
  67. //
  68. // Define function to read the value of the time stamp counter
  69. //
  70. #define ReadTimeStampCounter() __rdtsc()
  71. ULONG64
  72. __rdtsc (
  73. VOID
  74. );
  75. #pragma intrinsic(__rdtsc)
  76. //
  77. // Define functions to move strings or bytes, words, dwords, and qwords.
  78. //
  79. VOID
  80. __movsb (
  81. IN PUCHAR Destination,
  82. IN PUCHAR Source,
  83. IN ULONG Count
  84. );
  85. VOID
  86. __movsw (
  87. IN PUSHORT Destination,
  88. IN PUSHORT Source,
  89. IN ULONG Count
  90. );
  91. VOID
  92. __movsd (
  93. IN PULONG Destination,
  94. IN PULONG Source,
  95. IN ULONG Count
  96. );
  97. VOID
  98. __movsq (
  99. IN PULONGLONG Destination,
  100. IN PULONGLONG Source,
  101. IN ULONG Count
  102. );
  103. #pragma intrinsic(__movsb)
  104. #pragma intrinsic(__movsw)
  105. #pragma intrinsic(__movsd)
  106. #pragma intrinsic(__movsq)
  107. //
  108. // Define functions to capture the high 64-bits of a 128-bit multiply.
  109. //
  110. #define MultiplyHigh __mulh
  111. #define UnsignedMultiplyHigh __umulh
  112. LONGLONG
  113. MultiplyHigh (
  114. IN LONGLONG Multiplier,
  115. IN LONGLONG Multiplicand
  116. );
  117. ULONGLONG
  118. UnsignedMultiplyHigh (
  119. IN ULONGLONG Multiplier,
  120. IN ULONGLONG Multiplicand
  121. );
  122. #pragma intrinsic(__mulh)
  123. #pragma intrinsic(__umulh)
  124. //
  125. // Define functions to read and write the uer TEB and the system PCR/PRCB.
  126. //
  127. UCHAR
  128. __readgsbyte (
  129. IN ULONG Offset
  130. );
  131. USHORT
  132. __readgsword (
  133. IN ULONG Offset
  134. );
  135. ULONG
  136. __readgsdword (
  137. IN ULONG Offset
  138. );
  139. ULONG64
  140. __readgsqword (
  141. IN ULONG Offset
  142. );
  143. VOID
  144. __writegsbyte (
  145. IN ULONG Offset,
  146. IN UCHAR Data
  147. );
  148. VOID
  149. __writegsword (
  150. IN ULONG Offset,
  151. IN USHORT Data
  152. );
  153. VOID
  154. __writegsdword (
  155. IN ULONG Offset,
  156. IN ULONG Data
  157. );
  158. VOID
  159. __writegsqword (
  160. IN ULONG Offset,
  161. IN ULONG64 Data
  162. );
  163. #pragma intrinsic(__readgsbyte)
  164. #pragma intrinsic(__readgsword)
  165. #pragma intrinsic(__readgsdword)
  166. #pragma intrinsic(__readgsqword)
  167. #pragma intrinsic(__writegsbyte)
  168. #pragma intrinsic(__writegsword)
  169. #pragma intrinsic(__writegsdword)
  170. #pragma intrinsic(__writegsqword)
  171. #endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS)
  172. // end_winnt end_ntddk end_wdm end_nthal end_ntndis end_ntosp
  173. // begin_ntddk begin_nthal
  174. //
  175. // Size of kernel mode stack.
  176. //
  177. #define KERNEL_STACK_SIZE 0x5000
  178. //
  179. // Define size of large kernel mode stack for callbacks.
  180. //
  181. #define KERNEL_LARGE_STACK_SIZE 0xf000
  182. //
  183. // Define number of pages to initialize in a large kernel stack.
  184. //
  185. #define KERNEL_LARGE_STACK_COMMIT 0x5000
  186. //
  187. // Define the size of the stack used for processing an MCA exception.
  188. //
  189. #define KERNEL_MCA_EXCEPTION_STACK_SIZE 0x2000
  190. // end_ntddk end_nthal
  191. #define DOUBLE_FAULT_STACK_SIZE 0x2000
  192. // begin_nthal
  193. //
  194. // Define stack alignment and rounding values.
  195. //
  196. #define STACK_ALIGN (16UI64)
  197. #define STACK_ROUND (STACK_ALIGN - 1)
  198. //
  199. // Define constants for system IDTs
  200. //
  201. #define MAXIMUM_IDTVECTOR 0xff
  202. #define MAXIMUM_PRIMARY_VECTOR 0xff
  203. #define PRIMARY_VECTOR_BASE 0x30 // 0-2f are AMD64 trap vectors
  204. // begin_winnt begin_ntddk begin_wx86
  205. //
  206. // The following flags control the contents of the CONTEXT structure.
  207. //
  208. #if !defined(RC_INVOKED)
  209. #define CONTEXT_AMD64 0x100000
  210. // end_wx86
  211. #define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
  212. #define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
  213. #define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
  214. #define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
  215. #define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
  216. #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
  217. // begin_wx86
  218. #endif // !defined(RC_INVOKED)
  219. //
  220. // Define 128-bit 16-byte aligned xmm register type.
  221. //
  222. typedef struct DECLSPEC_ALIGN(16) _M128 {
  223. ULONGLONG Low;
  224. LONGLONG High;
  225. } M128, *PM128;
  226. //
  227. // Format of data for fnsave/frstor instructions.
  228. //
  229. // This structure is used to store the legacy floating point state.
  230. //
  231. typedef struct _LEGACY_SAVE_AREA {
  232. USHORT ControlWord;
  233. USHORT Reserved0;
  234. USHORT StatusWord;
  235. USHORT Reserved1;
  236. USHORT TagWord;
  237. USHORT Reserved2;
  238. ULONG ErrorOffset;
  239. USHORT ErrorSelector;
  240. USHORT ErrorOpcode;
  241. ULONG DataOffset;
  242. USHORT DataSelector;
  243. USHORT Reserved3;
  244. UCHAR FloatRegisters[8 * 10];
  245. } LEGACY_SAVE_AREA, *PLEGACY_SAVE_AREA;
  246. #define LEGACY_SAVE_AREA_LENGTH ((sizeof(LEGACY_SAVE_AREA) + 15) & ~15)
  247. //
  248. // Context Frame
  249. //
  250. // This frame has a several purposes: 1) it is used as an argument to
  251. // NtContinue, 2) is is used to constuct a call frame for APC delivery,
  252. // and 3) it is used in the user level thread creation routines.
  253. //
  254. //
  255. // The flags field within this record controls the contents of a CONTEXT
  256. // record.
  257. //
  258. // If the context record is used as an input parameter, then for each
  259. // portion of the context record controlled by a flag whose value is
  260. // set, it is assumed that that portion of the context record contains
  261. // valid context. If the context record is being used to modify a threads
  262. // context, then only that portion of the threads context is modified.
  263. //
  264. // If the context record is used as an output parameter to capture the
  265. // context of a thread, then only those portions of the thread's context
  266. // corresponding to set flags will be returned.
  267. //
  268. // CONTEXT_CONTROL specifies SegSs, Rsp, SegCs, Rip, and EFlags.
  269. //
  270. // CONTEXT_INTEGER specifies Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, and R8-R15.
  271. //
  272. // CONTEXT_SEGMENTS specifies SegDs, SegEs, SegFs, and SegGs.
  273. //
  274. // CONTEXT_DEBUG_REGISTERS specifies Dr0-Dr3 and Dr6-Dr7.
  275. //
  276. // CONTEXT_MMX_REGISTERS specifies the floating point and extended registers
  277. // Mm0/St0-Mm7/St7 and Xmm0-Xmm15).
  278. //
  279. typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
  280. //
  281. // Register parameter home addresses.
  282. //
  283. ULONG64 P1Home;
  284. ULONG64 P2Home;
  285. ULONG64 P3Home;
  286. ULONG64 P4Home;
  287. ULONG64 P5Home;
  288. ULONG64 P6Home;
  289. //
  290. // Control flags.
  291. //
  292. ULONG ContextFlags;
  293. ULONG MxCsr;
  294. //
  295. // Segment Registers and processor flags.
  296. //
  297. USHORT SegCs;
  298. USHORT SegDs;
  299. USHORT SegEs;
  300. USHORT SegFs;
  301. USHORT SegGs;
  302. USHORT SegSs;
  303. ULONG EFlags;
  304. //
  305. // Debug registers
  306. //
  307. ULONG64 Dr0;
  308. ULONG64 Dr1;
  309. ULONG64 Dr2;
  310. ULONG64 Dr3;
  311. ULONG64 Dr6;
  312. ULONG64 Dr7;
  313. //
  314. // Integer registers.
  315. //
  316. ULONG64 Rax;
  317. ULONG64 Rcx;
  318. ULONG64 Rdx;
  319. ULONG64 Rbx;
  320. ULONG64 Rsp;
  321. ULONG64 Rbp;
  322. ULONG64 Rsi;
  323. ULONG64 Rdi;
  324. ULONG64 R8;
  325. ULONG64 R9;
  326. ULONG64 R10;
  327. ULONG64 R11;
  328. ULONG64 R12;
  329. ULONG64 R13;
  330. ULONG64 R14;
  331. ULONG64 R15;
  332. //
  333. // Program counter.
  334. //
  335. ULONG64 Rip;
  336. //
  337. // MMX/floating point state.
  338. //
  339. M128 Xmm0;
  340. M128 Xmm1;
  341. M128 Xmm2;
  342. M128 Xmm3;
  343. M128 Xmm4;
  344. M128 Xmm5;
  345. M128 Xmm6;
  346. M128 Xmm7;
  347. M128 Xmm8;
  348. M128 Xmm9;
  349. M128 Xmm10;
  350. M128 Xmm11;
  351. M128 Xmm12;
  352. M128 Xmm13;
  353. M128 Xmm14;
  354. M128 Xmm15;
  355. //
  356. // Legacy floating point state.
  357. //
  358. LEGACY_SAVE_AREA FltSave;
  359. ULONG Fill;
  360. } CONTEXT, *PCONTEXT;
  361. // end_ntddk end_nthal end_winnt end_wx86
  362. #define CONTEXT_TO_PROGRAM_COUNTER(Context) ((Context)->Rip)
  363. #define PROGRAM_COUNTER_TO_CONTEXT(Context, ProgramCounter) \
  364. ((Context)->Rip = (ProgramCounter))
  365. #define CONTEXT_ALIGN STACK_ALIGN
  366. #define CONTEXT_LENGTH ((sizeof(CONTEXT) + STACK_ROUND) & ~STACK_ROUND)
  367. //
  368. // Nonvolatile context pointer record.
  369. //
  370. typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
  371. union {
  372. PM128 FloatingContext[16];
  373. struct {
  374. PM128 Xmm0;
  375. PM128 Xmm1;
  376. PM128 Xmm2;
  377. PM128 Xmm3;
  378. PM128 Xmm4;
  379. PM128 Xmm5;
  380. PM128 Xmm6;
  381. PM128 Xmm7;
  382. PM128 Xmm8;
  383. PM128 Xmm9;
  384. PM128 Xmm10;
  385. PM128 Xmm11;
  386. PM128 Xmm12;
  387. PM128 Xmm13;
  388. PM128 Xmm14;
  389. PM128 Xmm15;
  390. };
  391. };
  392. union {
  393. PULONG64 IntegerContext[16];
  394. struct {
  395. PULONG64 Rax;
  396. PULONG64 Rcx;
  397. PULONG64 Rdx;
  398. PULONG64 Rbx;
  399. PULONG64 Rsp;
  400. PULONG64 Rbp;
  401. PULONG64 Rsi;
  402. PULONG64 Rdi;
  403. PULONG64 R8;
  404. PULONG64 R9;
  405. PULONG64 R10;
  406. PULONG64 R11;
  407. PULONG64 R12;
  408. PULONG64 R13;
  409. PULONG64 R14;
  410. PULONG64 R15;
  411. };
  412. };
  413. } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
  414. // begin_wx86 begin_nthal
  415. //
  416. // GDT selector numbers.
  417. //
  418. #define KGDT64_NULL (0 * 16) // NULL descriptor
  419. #define KGDT64_R0_CODE (1 * 16) // kernel mode 64-bit code
  420. #define KGDT64_R0_DATA (1 * 16) + 8 // kernel mode 64-bit data (stack)
  421. #define KGDT64_R3_CMCODE (2 * 16) // user mode 32-bit code
  422. #define KGDT64_R3_DATA (2 * 16) + 8 // user mode 32-bit data
  423. #define KGDT64_R3_CODE (3 * 16) // user mode 64-bit code
  424. #define KGDT64_SYS_TSS (4 * 16) // kernel mode system task state
  425. #define KGDT64_R3_CMTEB (5 * 16) // user mode 32-bit TEB
  426. #define KGDT64_LAST (6 * 16)
  427. #define KGDT_NUMBER KGDT_LAST
  428. // end_wx86 end_nthal
  429. // begin_winnt begin_ntddk begin_wdm begin_nthal
  430. #endif // _AMD64_
  431. // end_winnt end_ntddk end_wdm end_nthal
  432. //
  433. // Define AMD64 exception handling structures and function prototypes.
  434. //
  435. // Define unwind operation codes.
  436. //
  437. typedef enum _UNWIND_OP_CODES {
  438. UWOP_PUSH_NONVOL = 0,
  439. UWOP_ALLOC_LARGE,
  440. UWOP_ALLOC_SMALL,
  441. UWOP_SET_FPREG,
  442. UWOP_SAVE_NONVOL,
  443. UWOP_SAVE_NONVOL_FAR,
  444. UWOP_SAVE_XMM,
  445. UWOP_SAVE_XMM_FAR,
  446. UWOP_SAVE_XMM128,
  447. UWOP_SAVE_XMM128_FAR,
  448. UWOP_PUSH_MACHFRAME
  449. } UNWIND_OP_CODES, *PUNWIND_OP_CODES;
  450. //
  451. // Define unwind code structure.
  452. //
  453. typedef union _UNWIND_CODE {
  454. struct {
  455. UCHAR CodeOffset;
  456. UCHAR UnwindOp : 4;
  457. UCHAR OpInfo : 4;
  458. };
  459. USHORT FrameOffset;
  460. } UNWIND_CODE, *PUNWIND_CODE;
  461. //
  462. // Define unwind information flags.
  463. //
  464. #define UNW_FLAG_NHANDLER 0x0
  465. #define UNW_FLAG_EHANDLER 0x1
  466. #define UNW_FLAG_UHANDLER 0x2
  467. #define UNW_FLAG_CHAININFO 0x4
  468. //
  469. // Define unwind information structure.
  470. //
  471. typedef struct _UNWIND_INFO {
  472. UCHAR Version : 3;
  473. UCHAR Flags : 5;
  474. UCHAR SizeOfProlog;
  475. UCHAR CountOfCodes;
  476. UCHAR FrameRegister : 4;
  477. UCHAR FrameOffset : 4;
  478. UNWIND_CODE UnwindCode[1];
  479. //
  480. // The unwind codes are followed by an optional DWORD aligned field that
  481. // contains the exception handler address or the address of chained unwind
  482. // information. If an exception handler address is specified, then it is
  483. // followed by the language specified exception handler data.
  484. //
  485. // union {
  486. // ULONG ExceptionHandler;
  487. // ULONG FunctionEntry;
  488. // };
  489. //
  490. // ULONG ExceptionData[];
  491. //
  492. } UNWIND_INFO, *PUNWIND_INFO;
  493. //
  494. // Define function table entry - a function table entry is generated for
  495. // each frame function.
  496. //
  497. typedef struct _RUNTIME_FUNCTION {
  498. ULONG BeginAddress;
  499. ULONG EndAddress;
  500. ULONG UnwindData;
  501. } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
  502. //
  503. // Scope table structure definition.
  504. //
  505. typedef struct _SCOPE_TABLE {
  506. ULONG Count;
  507. struct
  508. {
  509. ULONG BeginAddress;
  510. ULONG EndAddress;
  511. ULONG HandlerAddress;
  512. ULONG JumpTarget;
  513. } ScopeRecord[1];
  514. } SCOPE_TABLE, *PSCOPE_TABLE;
  515. //
  516. // Define dynamic function table entry.
  517. //
  518. typedef enum _FUNCTION_TABLE_TYPE {
  519. RF_SORTED,
  520. RF_UNSORTED,
  521. RF_CALLBACK
  522. } FUNCTION_TABLE_TYPE;
  523. typedef
  524. PRUNTIME_FUNCTION
  525. (*PGET_RUNTIME_FUNCTION_CALLBACK) (
  526. IN ULONG64 ControlPc,
  527. IN PVOID Context
  528. );
  529. typedef struct _DYNAMIC_FUNCTION_TABLE {
  530. LIST_ENTRY ListEntry;
  531. PRUNTIME_FUNCTION FunctionTable;
  532. LARGE_INTEGER TimeStamp;
  533. ULONG64 MinimumAddress;
  534. ULONG64 MaximumAddress;
  535. ULONG64 BaseAddress;
  536. PGET_RUNTIME_FUNCTION_CALLBACK Callback;
  537. PVOID Context;
  538. PWSTR OutOfProcessCallbackDll;
  539. FUNCTION_TABLE_TYPE Type;
  540. ULONG EntryCount;
  541. } DYNAMIC_FUNCTION_TABLE, *PDYNAMIC_FUNCTION_TABLE;
  542. #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME \
  543. "OutOfProcessFunctionTableCallback"
  544. typedef
  545. NTSTATUS
  546. (*POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK) (
  547. IN HANDLE Process,
  548. IN PVOID TableAddress,
  549. OUT PULONG Entries,
  550. OUT PRUNTIME_FUNCTION* Functions
  551. );
  552. //
  553. // Define unwind history table structure.
  554. //
  555. #define UNWIND_HISTORY_TABLE_SIZE 12
  556. typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
  557. ULONG64 ImageBase;
  558. PRUNTIME_FUNCTION FunctionEntry;
  559. } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
  560. #define UNWIND_HISTORY_TABLE_NONE 0
  561. #define UNWIND_HISTORY_TABLE_GLOBAL 1
  562. #define UNWIND_HISTORY_TABLE_LOCAL 2
  563. typedef struct _UNWIND_HISTORY_TABLE {
  564. ULONG Count;
  565. UCHAR Search;
  566. ULONG64 LowAddress;
  567. ULONG64 HighAddress;
  568. UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
  569. } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
  570. //
  571. // Define exception dispatch context structure.
  572. //
  573. typedef struct _DISPATCHER_CONTEXT {
  574. ULONG64 ControlPc;
  575. ULONG64 ImageBase;
  576. PRUNTIME_FUNCTION FunctionEntry;
  577. ULONG64 EstablisherFrame;
  578. ULONG64 TargetIp;
  579. PCONTEXT ContextRecord;
  580. PEXCEPTION_ROUTINE LanguageHandler;
  581. PVOID HandlerData;
  582. PUNWIND_HISTORY_TABLE HistoryTable;
  583. } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
  584. //
  585. // Define runtime exception handling prototypes.
  586. //
  587. VOID
  588. RtlRestoreContext (
  589. IN PCONTEXT ContextRecord,
  590. IN struct _EXCEPTION_RECORD *ExceptionRecord OPTIONAL
  591. );
  592. VOID
  593. RtlInitializeHistoryTable (
  594. VOID
  595. );
  596. PRUNTIME_FUNCTION
  597. RtlLookupFunctionEntry (
  598. IN ULONG64 ControlPc,
  599. OUT PULONG64 ImageBase,
  600. IN OUT PUNWIND_HISTORY_TABLE HistoryTable OPTIONAL
  601. );
  602. PLIST_ENTRY
  603. RtlGetFunctionTableListHead (
  604. VOID
  605. );
  606. BOOLEAN
  607. RtlAddFunctionTable (
  608. IN PRUNTIME_FUNCTION FunctionTable,
  609. IN ULONG EntryCount,
  610. IN ULONG64 BaseAddress
  611. );
  612. BOOLEAN
  613. RtlInstallFunctionTableCallback (
  614. IN ULONG64 TableIdentifier,
  615. IN ULONG64 BaseAddress,
  616. IN ULONG Length,
  617. IN PGET_RUNTIME_FUNCTION_CALLBACK Callback,
  618. IN PVOID Context,
  619. IN PCWSTR OutOfProcessCallbackDll OPTIONAL
  620. );
  621. BOOLEAN
  622. RtlDeleteFunctionTable (
  623. IN PRUNTIME_FUNCTION FunctionTable
  624. );
  625. PEXCEPTION_ROUTINE
  626. RtlVirtualUnwind (
  627. IN ULONG HandlerType,
  628. IN ULONG64 ImageBase,
  629. IN ULONG64 ControlPc,
  630. IN PRUNTIME_FUNCTION FunctionEntry,
  631. IN OUT PCONTEXT ContextRecord,
  632. OUT PVOID *HandlerData,
  633. OUT PULONG64 EstablisherFrame,
  634. IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL
  635. );
  636. //
  637. // Define exception filter and termination handler function types.
  638. //
  639. typedef
  640. LONG
  641. (*PEXCEPTION_FILTER) (
  642. struct _EXCEPTION_POINTERS *ExceptionPointers,
  643. PVOID EstablisherFrame
  644. );
  645. typedef
  646. VOID
  647. (*PTERMINATION_HANDLER) (
  648. BOOLEAN AbnormalTermination,
  649. PVOID EstablisherFrame
  650. );
  651. //
  652. // Additional information supplied in QuerySectionInformation for images.
  653. //
  654. #define SECTION_ADDITIONAL_INFO_USED 0
  655. #ifdef __cplusplus
  656. }
  657. #endif
  658. #endif // _NTAMD64_