changed syscall tables. now it mimics NT style.

it has a SSDT a SSPT, a KeServiceDescriptorTable and a
KeServiceDescriptorTableShadow. modified the code
inside the int2e_handler() to use the new syscall tables.

svn path=/trunk/; revision=959
This commit is contained in:
Hernan Ochoa 2000-01-23 15:17:06 +00:00
parent 65a742ceaa
commit 55bb357489

View file

@ -1,4 +1,4 @@
/* $Id: usercall.c,v 1.4 1999/12/18 17:48:22 dwelch Exp $
/* $Id: usercall.c,v 1.5 2000/01/23 15:17:06 hochoa Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -24,6 +24,9 @@
extern SERVICE_TABLE _SystemServiceTable[];
extern KE_SERVICE_DESCRIPTOR_TABLE_ENTRY KeServiceDescriptorTable;
extern KE_SERVICE_DESCRIPTOR_TABLE_ENTRY KeServiceDescriptorTableShadow[];
/* The service dispatcher will take the service number passed in
* by the user mode process, logical and it with ServiceNumberMask
* and compare the resulting value with ServiceNumberValue. If the
@ -129,6 +132,25 @@ ULONG KiAfterSystemCallHook(ULONG NtStatus, PCONTEXT Context)
return(NtStatus);
}
// This function should be used by win32k.sys to add its own user32/gdi32 services
// SSDTIndex is 0 based
// SyscallsCountTable its not used at the moment
NTSTATUS KeAddSystemServiceTable( int SSDTindex, PSSDT pSSDT, PSSPT pSSPT, ULONG* SyscallsCountTable )
{
// TODO: We could improve these checks to see if the pointers point to valid memory and so on...
// but we're in kernel mode, this function can get called only from kernel mode, so, why bother?
if(pSSDT == NULL || pSSPT == NULL || SSDTindex != 1)
return STATUS_UNSUCCESSFUL;
// We update the KeServiceDescriptorTableShadow
KeServiceDescriptorTableShadow[SSDTindex].pSSDT = pSSDT;
KeServiceDescriptorTableShadow[SSDTindex].pSSPT = pSSPT;
return STATUS_SUCCESS;
}
void interrupt_handler2e(void);
__asm__("\n\t.global _interrupt_handler2e\n\t"
"_interrupt_handler2e:\n\t"
@ -176,7 +198,8 @@ void interrupt_handler2e(void);
/* FIXME: chech to see if SS is valid/inrange */
/* Allocate room for argument list from kernel stack */
"movl %es:__SystemServiceTable(,%eax,8),%ecx\n\t"
"movl %es:_MainSSPT(,%eax,4), %ecx\n\t"
//"movl %es:__SystemServiceTable(,%eax,8),%ecx\n\t"
"subl %ecx,%esp\n\t"
/* Copy the arguments from the user stack to the kernel stack */
@ -192,7 +215,8 @@ void interrupt_handler2e(void);
"popl %eax\n\t"
/* Make the system service call */
"movl %ds:__SystemServiceTable+4(,%eax,8),%eax\n\t"
//"movl %ds:__SystemServiceTable+4(,%eax,8),%eax\n\t"
"movl %ds:_MainSSDT(,%eax,4),%eax\n\t"
"call *%eax\n\t"
/* Deallocate the kernel stack frame */