|
|
//++ // // Copyright (c) 1985 - 2000, Microsoft Corporation // // Module Name: // // sysstubs.asm // // Abstract: // // This module implements the system service dispatch stub procedures. // // Author: // // Shie-Lin Tzong (shielint) 6-Feb-1990 // // Environment: // // User or kernel mode. // // Revision History: // //--
#include <nt.h> #include <ntrtl.h> #include <nturtl.h> #include <windows.h> #include <ntexapi.h>
#define ARGS0 #define ARGS1 int a1 #define ARGS2 ARGS1, int a2 #define ARGS3 ARGS2, int a3 #define ARGS4 ARGS3, int a4 #define ARGS5 ARGS4, int a5 #define ARGS6 ARGS5, int a6 #define ARGS7 ARGS6, int a7 #define ARGS8 ARGS7, int a8 #define ARGS9 ARGS8, int a9 #define ARGS10 ARGS9, int a10 #define ARGS11 ARGS10, int a11 #define ARGS12 ARGS11, int a12 #define ARGS13 ARGS12, int a13 #define ARGS14 ARGS13, int a14 #define ARGS15 ARGS14, int a15 #define ARGS16 ARGS15, int a16 #define ARGS17 ARGS16, int a17 #define ARGS18 ARGS17, int a18 #define ARGS19 ARGS18, int a19
#define STUBS_BEGIN1( t ) #define STUBS_BEGIN2( t ) #define STUBS_BEGIN3( t ) #define STUBS_BEGIN4( t ) #define STUBS_BEGIN5( t ) #define STUBS_BEGIN6( t ) #define STUBS_BEGIN7( t ) #define STUBS_BEGIN8( t )
#define STUBS_END
// // enum is the closest thing C will do to defining a constant and the built // in assembler has apoplexy over the FIELD_OFFSET macro. //
enum { call_func = ((FIELD_OFFSET(KUSER_SHARED_DATA,SystemCall)+MM_SHARED_USER_DATA_VA)) };
#define SYSSTUBS_ENTRY1( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY2( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY3( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY4( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY5( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY6( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY7( ServiceNumber, Name, NumArgs ) #define SYSSTUBS_ENTRY8( ServiceNumber, Name, NumArgs )
#define USRSTUBS_ENTRY1( ServiceNumber, Name, NumArgs ) void __declspec(naked) Nt##Name(ARGS##NumArgs) #define USRSTUBS_ENTRY2( ServiceNumber, Name, NumArgs ) { #define USRSTUBS_ENTRY3( ServiceNumber, Name, NumArgs ) __asm mov eax, 1000h + ServiceNumber #define USRSTUBS_ENTRY4( ServiceNumber, Name, NumArgs ) __asm mov edx, call_func #define USRSTUBS_ENTRY5( ServiceNumber, Name, NumArgs ) __asm call edx #define USRSTUBS_ENTRY6( ServiceNumber, Name, NumArgs ) __asm ret NumArgs*4 #define USRSTUBS_ENTRY7( ServiceNumber, Name, NumArgs ) } #define USRSTUBS_ENTRY8( ServiceNumber, Name, NumArgs )
#define DECLARE_DISPATCH_COUNT( ServiceCount, ArgsCount ) const long gDispatchTableValues = MAKELONG(ServiceCount, ArgsCount);
STUBS_BEGIN1( "System Service Stub Procedures" ) STUBS_BEGIN2( "System Service Stub Procedures" ) STUBS_BEGIN3( "System Service Stub Procedures" ) STUBS_BEGIN4( "System Service Stub Procedures" ) STUBS_BEGIN5( "System Service Stub Procedures" ) STUBS_BEGIN6( "System Service Stub Procedures" ) STUBS_BEGIN7( "System Service Stub Procedures" ) STUBS_BEGIN8( "System Service Stub Procedures" )
|