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.

102 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. kulookup.c
  5. Abstract:
  6. The module implements the code necessary to lookup user mode entry points
  7. in the system DLL for exception dispatching and APC delivery.
  8. Author:
  9. David N. Cutler (davec) 8-Oct-90
  10. Revision History:
  11. --*/
  12. #include "psp.h"
  13. #pragma alloc_text(INIT, PspLookupKernelUserEntryPoints)
  14. NTSTATUS
  15. PspLookupKernelUserEntryPoints (
  16. VOID
  17. )
  18. /*++
  19. Routine Description:
  20. The function locates the address of the exception dispatch and user APC
  21. delivery routine in the system DLL and stores the respective addresses
  22. in the PCR.
  23. Arguments:
  24. None.
  25. Return Value:
  26. NTSTATUS
  27. --*/
  28. {
  29. NTSTATUS Status;
  30. PSZ EntryName;
  31. //
  32. // Lookup the user mode "trampoline" code for exception dispatching
  33. //
  34. EntryName = "KiUserExceptionDispatcher";
  35. Status = PspLookupSystemDllEntryPoint(EntryName,
  36. (PVOID *)&KeUserExceptionDispatcher);
  37. if (NT_SUCCESS(Status) == FALSE) {
  38. KdPrint(("Ps: Cannot find user exception dispatcher address\n"));
  39. return Status;
  40. }
  41. //
  42. // Lookup the user mode "trampoline" code for APC dispatching
  43. //
  44. EntryName = "KiUserApcDispatcher";
  45. Status = PspLookupSystemDllEntryPoint(EntryName,
  46. (PVOID *)&KeUserApcDispatcher);
  47. if (NT_SUCCESS(Status) == FALSE) {
  48. KdPrint(("Ps: Cannot find user apc dispatcher address\n"));
  49. return Status;
  50. }
  51. //
  52. // Lookup the user mode "trampoline" code for callback dispatching.
  53. //
  54. EntryName = "KiUserCallbackDispatcher";
  55. Status = PspLookupSystemDllEntryPoint(EntryName,
  56. (PVOID *)&KeUserCallbackDispatcher);
  57. if (NT_SUCCESS(Status) == FALSE) {
  58. KdPrint(("Ps: Cannot find user callback dispatcher address\n"));
  59. return Status;
  60. }
  61. //
  62. // Lookup the user mode "trampoline" code for raising a usermode exception
  63. //
  64. EntryName = "KiRaiseUserExceptionDispatcher";
  65. Status = PspLookupSystemDllEntryPoint(EntryName,
  66. (PVOID *)&KeRaiseUserExceptionDispatcher);
  67. if (NT_SUCCESS(Status) == FALSE) {
  68. KdPrint(("Ps: Cannot find raise user exception dispatcher address\n"));
  69. return Status;
  70. }
  71. return Status;
  72. }