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.

122 lines
2.9 KiB

  1. ;++
  2. ;
  3. ; Copyright (c) 1989 - 1999, Microsoft Corporation
  4. ;
  5. ; Module Name:
  6. ;
  7. ; sysstubs.asm
  8. ;
  9. ; Abstract:
  10. ;
  11. ; This module implements the system service dispatch stub procedures.
  12. ;
  13. ; Author:
  14. ;
  15. ; Shie-Lin Tzong (shielint) 6-Feb-1990
  16. ;
  17. ; Environment:
  18. ;
  19. ; User or kernel mode.
  20. ;
  21. ; Revision History:
  22. ;
  23. ; Peter Johnston (peterj) 27-Nov-1999
  24. ; Use Fast System call mechanism.
  25. ;
  26. ;--
  27. include ks386.inc
  28. include callconv.inc
  29. .386
  30. STUBS_BEGIN1 macro t
  31. TITLE t
  32. endm
  33. STUBS_BEGIN2 macro t
  34. endm
  35. STUBS_BEGIN3 macro t
  36. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  37. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  38. endm
  39. STUBS_BEGIN4 macro t
  40. endm
  41. STUBS_BEGIN5 macro t
  42. align 4
  43. endm
  44. STUBS_BEGIN6 macro t
  45. endm
  46. STUBS_BEGIN7 macro t
  47. endm
  48. STUBS_BEGIN8 macro t
  49. endm
  50. STUBS_END macro t
  51. _TEXT ENDS
  52. end
  53. endm
  54. SYSSTUBS_ENTRY1 macro ServiceNumber, Name, NumArgs
  55. cPublicProc _Zw&Name,NumArgs
  56. .FPO ( 0, NumArgs, 0, 0, 0, 0 )
  57. extrn _KiSystemService:PROC
  58. mov eax, ServiceNumber ; (eax) = service number
  59. lea edx, [esp]+4 ; (edx) -> arguments
  60. pushfd ; EFLAGS to trap frame
  61. push KGDT_R0_CODE ; CS to trap frame
  62. call _KiSystemService ; EIP to trap frame and enter handler
  63. stdRET _Zw&Name
  64. stdENDP _Zw&Name
  65. endm
  66. SYSSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  67. endm
  68. SYSSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  69. endm
  70. SYSSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  71. endm
  72. SYSSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  73. endm
  74. SYSSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  75. endm
  76. SYSSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  77. endm
  78. SYSSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  79. endm
  80. USRSTUBS_ENTRY1 macro ServiceNumber, Name, NumArgs
  81. cPublicProc _Zw&Name, NumArgs
  82. PUBLICP _Nt&Name, NumArgs
  83. LABELP _Nt&Name, NumArgs
  84. .FPO ( 0, NumArgs, 0, 0, 0, 0 )
  85. mov eax, ServiceNumber ; (eax) = service number
  86. mov edx, MM_SHARED_USER_DATA_VA+UsSystemCall
  87. call edx
  88. stdRET _Zw&Name
  89. stdENDP _Zw&Name
  90. endm
  91. USRSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  92. endm
  93. USRSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  94. endm
  95. USRSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  96. endm
  97. USRSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  98. endm
  99. USRSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  100. endm
  101. USRSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  102. endm
  103. USRSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  104. endm
  105. STUBS_BEGIN1 <"System Service Stub Procedures">
  106. STUBS_BEGIN2 <"System Service Stub Procedures">
  107. STUBS_BEGIN3 <"System Service Stub Procedures">
  108. STUBS_BEGIN4 <"System Service Stub Procedures">
  109. STUBS_BEGIN5 <"System Service Stub Procedures">
  110. STUBS_BEGIN6 <"System Service Stub Procedures">
  111. STUBS_BEGIN7 <"System Service Stub Procedures">
  112. STUBS_BEGIN8 <"System Service Stub Procedures">