Leaked source code of windows server 2003
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.

101 lines
3.2 KiB

  1. //++
  2. //
  3. // Copyright (c) 1985 - 2000, 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. //--
  24. #include <nt.h>
  25. #include <ntrtl.h>
  26. #include <nturtl.h>
  27. #include <windows.h>
  28. #include <ntexapi.h>
  29. #define ARGS0
  30. #define ARGS1 int a1
  31. #define ARGS2 ARGS1, int a2
  32. #define ARGS3 ARGS2, int a3
  33. #define ARGS4 ARGS3, int a4
  34. #define ARGS5 ARGS4, int a5
  35. #define ARGS6 ARGS5, int a6
  36. #define ARGS7 ARGS6, int a7
  37. #define ARGS8 ARGS7, int a8
  38. #define ARGS9 ARGS8, int a9
  39. #define ARGS10 ARGS9, int a10
  40. #define ARGS11 ARGS10, int a11
  41. #define ARGS12 ARGS11, int a12
  42. #define ARGS13 ARGS12, int a13
  43. #define ARGS14 ARGS13, int a14
  44. #define ARGS15 ARGS14, int a15
  45. #define ARGS16 ARGS15, int a16
  46. #define ARGS17 ARGS16, int a17
  47. #define ARGS18 ARGS17, int a18
  48. #define ARGS19 ARGS18, int a19
  49. #define STUBS_BEGIN1( t )
  50. #define STUBS_BEGIN2( t )
  51. #define STUBS_BEGIN3( t )
  52. #define STUBS_BEGIN4( t )
  53. #define STUBS_BEGIN5( t )
  54. #define STUBS_BEGIN6( t )
  55. #define STUBS_BEGIN7( t )
  56. #define STUBS_BEGIN8( t )
  57. #define STUBS_END
  58. //
  59. // enum is the closest thing C will do to defining a constant and the built
  60. // in assembler has apoplexy over the FIELD_OFFSET macro.
  61. //
  62. enum {
  63. call_func = ((FIELD_OFFSET(KUSER_SHARED_DATA,SystemCall)+MM_SHARED_USER_DATA_VA))
  64. };
  65. #define SYSSTUBS_ENTRY1( ServiceNumber, Name, NumArgs )
  66. #define SYSSTUBS_ENTRY2( ServiceNumber, Name, NumArgs )
  67. #define SYSSTUBS_ENTRY3( ServiceNumber, Name, NumArgs )
  68. #define SYSSTUBS_ENTRY4( ServiceNumber, Name, NumArgs )
  69. #define SYSSTUBS_ENTRY5( ServiceNumber, Name, NumArgs )
  70. #define SYSSTUBS_ENTRY6( ServiceNumber, Name, NumArgs )
  71. #define SYSSTUBS_ENTRY7( ServiceNumber, Name, NumArgs )
  72. #define SYSSTUBS_ENTRY8( ServiceNumber, Name, NumArgs )
  73. #define USRSTUBS_ENTRY1( ServiceNumber, Name, NumArgs ) void __declspec(naked) Nt##Name(ARGS##NumArgs)
  74. #define USRSTUBS_ENTRY2( ServiceNumber, Name, NumArgs ) {
  75. #define USRSTUBS_ENTRY3( ServiceNumber, Name, NumArgs ) __asm mov eax, 1000h + ServiceNumber
  76. #define USRSTUBS_ENTRY4( ServiceNumber, Name, NumArgs ) __asm mov edx, call_func
  77. #define USRSTUBS_ENTRY5( ServiceNumber, Name, NumArgs ) __asm call edx
  78. #define USRSTUBS_ENTRY6( ServiceNumber, Name, NumArgs ) __asm ret NumArgs*4
  79. #define USRSTUBS_ENTRY7( ServiceNumber, Name, NumArgs ) }
  80. #define USRSTUBS_ENTRY8( ServiceNumber, Name, NumArgs )
  81. #define DECLARE_DISPATCH_COUNT( ServiceCount, ArgsCount ) const long gDispatchTableValues = MAKELONG(ServiceCount, ArgsCount);
  82. STUBS_BEGIN1( "System Service Stub Procedures" )
  83. STUBS_BEGIN2( "System Service Stub Procedures" )
  84. STUBS_BEGIN3( "System Service Stub Procedures" )
  85. STUBS_BEGIN4( "System Service Stub Procedures" )
  86. STUBS_BEGIN5( "System Service Stub Procedures" )
  87. STUBS_BEGIN6( "System Service Stub Procedures" )
  88. STUBS_BEGIN7( "System Service Stub Procedures" )
  89. STUBS_BEGIN8( "System Service Stub Procedures" )