From add30b1c69ea668dd6fba7d88f3dfb4670ba23d0 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 13 Jul 2011 11:58:32 +0000 Subject: [PATCH] * Sync with recent trunk (r52669). svn path=/branches/GSoC_2011/ThemesSupport/; revision=52670 --- base/setup/usetup/bootsup.c | 2 + dll/ntdll/ldr/ldrpe.c | 2 +- drivers/filesystems/npfs/create.c | 3 +- drivers/network/tcpip/tcpip/main.c | 4 +- lib/drivers/ip/network/receive.c | 3 + lib/drivers/ip/transport/tcp/accept.c | 38 +++++++----- lib/drivers/ip/transport/tcp/tcp.c | 77 +++++++++++++++--------- ntoskrnl/include/internal/mm.h | 4 -- ntoskrnl/io/iomgr/driver.c | 49 ++++++--------- ntoskrnl/kdbg/kdb_symbols.cmake.c | 63 +------------------ ntoskrnl/ke/i386/trap.s | 2 + ntoskrnl/mm/anonmem.c | 83 -------------------------- subsystems/win32/win32k/include/napi.h | 4 +- 13 files changed, 107 insertions(+), 227 deletions(-) diff --git a/base/setup/usetup/bootsup.c b/base/setup/usetup/bootsup.c index 3f6c8a77b9b..a079cc3b5c4 100644 --- a/base/setup/usetup/bootsup.c +++ b/base/setup/usetup/bootsup.c @@ -494,11 +494,13 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath, L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS"); #if DBG +#ifndef _WINKD_ /* ReactOS_KdSerial */ CreateFreeLoaderEntry(IniCache, IniSection, L"ReactOS_KdSerial", L"\"ReactOS (RosDbg)\"", L"Windows2003", ArcPath, L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /KDSERIAL"); +#endif /* ReactOS_LogFile */ CreateFreeLoaderEntry(IniCache, IniSection, diff --git a/dll/ntdll/ldr/ldrpe.c b/dll/ntdll/ldr/ldrpe.c index a223a163e36..40fda59dd20 100644 --- a/dll/ntdll/ldr/ldrpe.c +++ b/dll/ntdll/ldr/ldrpe.c @@ -681,9 +681,9 @@ LdrpWalkImportDescriptor(IN LPWSTR DllPath OPTIONAL, DPRINT("LdrpWalkImportDescriptor('%S' %x)\n", DllPath, LdrEntry); /* Set up the Act Ctx */ + RtlZeroMemory(&ActCtx, sizeof(ActCtx)); ActCtx.Size = sizeof(ActCtx); ActCtx.Format = RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER; - RtlZeroMemory(&ActCtx.Frame, sizeof(ActCtx)); /* Check if we have a manifest prober routine */ if (LdrpManifestProberRoutine) diff --git a/drivers/filesystems/npfs/create.c b/drivers/filesystems/npfs/create.c index 42bcacc07c8..a05c56902b9 100644 --- a/drivers/filesystems/npfs/create.c +++ b/drivers/filesystems/npfs/create.c @@ -984,7 +984,8 @@ NpfsClose(PDEVICE_OBJECT DeviceObject, /* Disconnect the pipes */ if (Ccb->OtherSide) { - ASSERT(Ccb->OtherSide->OtherSide == Ccb); + /* FIXME: Timo wants it rewritten */ + /*ASSERT(Ccb->OtherSide->OtherSide == Ccb);*/ NpfsCcbSetOtherSide(Ccb->OtherSide, NULL); NpfsCcbSetOtherSide(Ccb, NULL); } diff --git a/drivers/network/tcpip/tcpip/main.c b/drivers/network/tcpip/tcpip/main.c index ced3628e5d0..53f60bf4b9f 100644 --- a/drivers/network/tcpip/tcpip/main.c +++ b/drivers/network/tcpip/tcpip/main.c @@ -662,14 +662,14 @@ DriverEntry( EntityMax = MAX_TDI_ENTITIES; /* Allocate NDIS packet descriptors */ - NdisAllocatePacketPool(&NdisStatus, &GlobalPacketPool, 100, sizeof(PACKET_CONTEXT)); + NdisAllocatePacketPoolEx(&NdisStatus, &GlobalPacketPool, 500, 1500, sizeof(PACKET_CONTEXT)); if (NdisStatus != NDIS_STATUS_SUCCESS) { TiUnload(DriverObject); return STATUS_INSUFFICIENT_RESOURCES; } /* Allocate NDIS buffer descriptors */ - NdisAllocateBufferPool(&NdisStatus, &GlobalBufferPool, 100); + NdisAllocateBufferPool(&NdisStatus, &GlobalBufferPool, 2000); if (NdisStatus != NDIS_STATUS_SUCCESS) { TiUnload(DriverObject); return STATUS_INSUFFICIENT_RESOURCES; diff --git a/lib/drivers/ip/network/receive.c b/lib/drivers/ip/network/receive.c index a7908ef6460..47520685c58 100644 --- a/lib/drivers/ip/network/receive.c +++ b/lib/drivers/ip/network/receive.c @@ -293,6 +293,9 @@ VOID ProcessFragment( TI_DbgPrint(DEBUG_IP, ("Continueing assembly.\n")); /* We have a reassembly structure */ TcpipAcquireSpinLock(&IPDR->Lock, &OldIrql); + + /* Reset the timeout since we received a fragment */ + IPDR->TimeoutCount = 0; } else { TI_DbgPrint(DEBUG_IP, ("Starting new assembly.\n")); diff --git a/lib/drivers/ip/transport/tcp/accept.c b/lib/drivers/ip/transport/tcp/accept.c index 2454657d009..fde2711e0e5 100644 --- a/lib/drivers/ip/transport/tcp/accept.c +++ b/lib/drivers/ip/transport/tcp/accept.c @@ -78,25 +78,36 @@ NTSTATUS TCPListen( PCONNECTION_ENDPOINT Connection, UINT Backlog ) { TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext %x\n", Connection->SocketContext)); - AddressToBind.sin_family = AF_INET; - memcpy( &AddressToBind.sin_addr, - &Connection->AddressFile->Address.Address.IPv4Address, - sizeof(AddressToBind.sin_addr) ); - AddressToBind.sin_port = Connection->AddressFile->Port; - - TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr, AddressToBind.sin_port)); + if (Connection->AddressFile->Port) + { + AddressToBind.sin_family = AF_INET; + memcpy( &AddressToBind.sin_addr, + &Connection->AddressFile->Address.Address.IPv4Address, + sizeof(AddressToBind.sin_addr) ); + AddressToBind.sin_port = Connection->AddressFile->Port; + TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr, AddressToBind.sin_port)); + + /* Perform an explicit bind */ + Status = TCPTranslateError(OskitTCPBind(Connection->SocketContext, + &AddressToBind, + sizeof(AddressToBind))); + } + else + { + /* An implicit bind will be performed */ + Status = STATUS_SUCCESS; + } - Status = TCPTranslateError( OskitTCPBind( Connection->SocketContext, - &AddressToBind, - sizeof(AddressToBind) ) ); + if (NT_SUCCESS(Status)) + Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext, Backlog ) ); + if (NT_SUCCESS(Status)) { /* Check if we had an unspecified port */ if (!Connection->AddressFile->Port) { /* We did, so we need to copy back the port */ - Status = TCPGetSockAddress(Connection, (PTRANSPORT_ADDRESS)&LocalAddress, FALSE); - if (NT_SUCCESS(Status)) + if (NT_SUCCESS(TCPGetSockAddress(Connection, (PTRANSPORT_ADDRESS)&LocalAddress, FALSE))) { /* Allocate the port in the port bitmap */ Connection->AddressFile->Port = TCPAllocatePort(LocalAddress.Address[0].Address[0].sin_port); @@ -107,9 +118,6 @@ NTSTATUS TCPListen( PCONNECTION_ENDPOINT Connection, UINT Backlog ) { } } - if (NT_SUCCESS(Status)) - Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext, Backlog ) ); - UnlockObject(Connection, OldIrql); TI_DbgPrint(DEBUG_TCP,("TCPListen finished %x\n", Status)); diff --git a/lib/drivers/ip/transport/tcp/tcp.c b/lib/drivers/ip/transport/tcp/tcp.c index 7fac6251c58..7b25adb6317 100644 --- a/lib/drivers/ip/transport/tcp/tcp.c +++ b/lib/drivers/ip/transport/tcp/tcp.c @@ -723,7 +723,7 @@ NTSTATUS TCPConnect USHORT RemotePort; TA_IP_ADDRESS LocalAddress; PTDI_BUCKET Bucket; - PNEIGHBOR_CACHE_ENTRY NCE; + PNEIGHBOR_CACHE_ENTRY NCE = NULL; KIRQL OldIrql; TI_DbgPrint(DEBUG_TCP,("TCPConnect: Called\n")); @@ -762,37 +762,36 @@ NTSTATUS TCPConnect UnlockObject(Connection, OldIrql); return STATUS_NETWORK_UNREACHABLE; } + } - AddressToBind.sin_addr.s_addr = NCE->Interface->Unicast.Address.IPv4Address; + if (Connection->AddressFile->Port) + { + /* See if we had an unspecified bind address */ + if (NCE) + { + /* We did, so use the interface unicast address associated with the route */ + AddressToBind.sin_addr.s_addr = NCE->Interface->Unicast.Address.IPv4Address; + } + else + { + /* Bind address was explicit so use it */ + AddressToBind.sin_addr.s_addr = Connection->AddressFile->Address.Address.IPv4Address; + } + + AddressToBind.sin_port = Connection->AddressFile->Port; + + /* Perform an explicit bind */ + Status = TCPTranslateError(OskitTCPBind(Connection->SocketContext, + &AddressToBind, + sizeof(AddressToBind))); } else { - AddressToBind.sin_addr.s_addr = Connection->AddressFile->Address.Address.IPv4Address; + /* An implicit bind will be performed */ + Status = STATUS_SUCCESS; } - - AddressToBind.sin_port = Connection->AddressFile->Port; - - Status = TCPTranslateError - ( OskitTCPBind( Connection->SocketContext, - &AddressToBind, - sizeof(AddressToBind) ) ); - if (NT_SUCCESS(Status)) { - /* Check if we had an unspecified port */ - if (!Connection->AddressFile->Port) - { - /* We did, so we need to copy back the port */ - Status = TCPGetSockAddress(Connection, (PTRANSPORT_ADDRESS)&LocalAddress, FALSE); - if (NT_SUCCESS(Status)) - { - /* Allocate the port in the port bitmap */ - Connection->AddressFile->Port = TCPAllocatePort(LocalAddress.Address[0].Address[0].sin_port); - - /* This should never fail */ - ASSERT(Connection->AddressFile->Port != 0xFFFF); - } - } - + if (NT_SUCCESS(Status)) { if (NT_SUCCESS(Status)) { memcpy( &AddressToConnect.sin_addr, @@ -804,7 +803,31 @@ NTSTATUS TCPConnect ( OskitTCPConnect( Connection->SocketContext, &AddressToConnect, sizeof(AddressToConnect) ) ); - + + if (NT_SUCCESS(Status)) + { + /* Check if we had an unspecified port */ + if (!Connection->AddressFile->Port) + { + /* We did, so we need to copy back the port */ + if (NT_SUCCESS(TCPGetSockAddress(Connection, (PTRANSPORT_ADDRESS)&LocalAddress, FALSE))) + { + /* Allocate the port in the port bitmap */ + Connection->AddressFile->Port = TCPAllocatePort(LocalAddress.Address[0].Address[0].sin_port); + + /* This should never fail */ + ASSERT(Connection->AddressFile->Port != 0xFFFF); + } + } + + /* Check if the address was unspecified */ + if (AddrIsUnspecified(&Connection->AddressFile->Address)) + { + /* It is, so store the address of the outgoing NIC */ + Connection->AddressFile->Address = NCE->Interface->Unicast; + } + } + if (Status == STATUS_PENDING) { Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); diff --git a/ntoskrnl/include/internal/mm.h b/ntoskrnl/include/internal/mm.h index eec33616a54..a704e2ae005 100644 --- a/ntoskrnl/include/internal/mm.h +++ b/ntoskrnl/include/internal/mm.h @@ -1119,10 +1119,6 @@ BOOLEAN NTAPI MmIsDirtyPageRmap(PFN_NUMBER Page); -NTSTATUS -NTAPI -MmWritePagePhysicalAddress(PFN_NUMBER Page); - NTSTATUS NTAPI MmPageOutPhysicalAddress(PFN_NUMBER Page); diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index 79b4ab73391..a95aee9e22a 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -850,7 +850,6 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); return(Status); } - DeviceNode->ServiceName = ServiceName; /* * Initialize the driver @@ -1834,8 +1833,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) cur--; } - IopDisplayLoadingMessage(&ServiceName); - /* * Get service type. */ @@ -1882,21 +1879,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) DPRINT("FullImagePath: '%wZ'\n", &ImagePath); DPRINT("Type: %lx\n", Type); - /* - * Create device node - */ - - /* Use IopRootDeviceNode for now */ - Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); - - if (!NT_SUCCESS(Status)) - { - DPRINT("IopCreateDeviceNode() failed (Status %lx)\n", Status); - LoadParams->Status = Status; - (VOID)KeSetEvent(&LoadParams->Event, 0, FALSE); - return; - } - /* Get existing DriverObject pointer (in case the driver has already been loaded and initialized) */ Status = IopGetDriverObject( @@ -1916,23 +1898,29 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) if (!NT_SUCCESS(Status) && Status != STATUS_IMAGE_ALREADY_LOADED) { DPRINT("MmLoadSystemImage() failed (Status %lx)\n", Status); - IopFreeDeviceNode(DeviceNode); LoadParams->Status = Status; (VOID)KeSetEvent(&LoadParams->Event, 0, FALSE); return; } - /* - * Set a service name for the device node - */ - - RtlCreateUnicodeString(&DeviceNode->ServiceName, ServiceName.Buffer); - /* * Initialize the driver module if it's loaded for the first time */ if (Status != STATUS_IMAGE_ALREADY_LOADED) { + Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); + + if (!NT_SUCCESS(Status)) + { + DPRINT("IopCreateDeviceNode() failed (Status %lx)\n", Status); + MmUnloadSystemImage(ModuleObject); + LoadParams->Status = Status; + (VOID)KeSetEvent(&LoadParams->Event, 0, FALSE); + return; + } + + IopDisplayLoadingMessage(&DeviceNode->ServiceName); + Status = IopInitializeDriverModule( DeviceNode, ModuleObject, @@ -1950,11 +1938,11 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) (VOID)KeSetEvent(&LoadParams->Event, 0, FALSE); return; } + + /* Initialize and start device */ + IopInitializeDevice(DeviceNode, DriverObject); + Status = IopStartDevice(DeviceNode); } - - /* Initialize and start device */ - IopInitializeDevice(DeviceNode, DriverObject); - Status = IopStartDevice(DeviceNode); } else { @@ -1962,9 +1950,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) /* IopGetDriverObject references the DriverObject, so dereference it */ ObDereferenceObject(DriverObject); - - /* Free device node since driver loading failed */ - IopFreeDeviceNode(DeviceNode); } /* Pass status to the caller and signal the event */ diff --git a/ntoskrnl/kdbg/kdb_symbols.cmake.c b/ntoskrnl/kdbg/kdb_symbols.cmake.c index 3d4778bc63a..98890094139 100644 --- a/ntoskrnl/kdbg/kdb_symbols.cmake.c +++ b/ntoskrnl/kdbg/kdb_symbols.cmake.c @@ -18,8 +18,6 @@ /* GLOBALS ******************************************************************/ -#define CURRENT_PROCESS ((HANDLE)~0) - typedef struct _IMAGE_SYMBOL_INFO_CACHE { LIST_ENTRY ListEntry; @@ -637,69 +635,14 @@ KdbDebugPrint( /* Nothing here */ } -typedef struct { - PMDL Mdl; - SIZE_T Size; - PVOID OriginalMapping; -} KdbpMallocHeader; - -static PVOID KdbpSymAllocMem(ULONG_PTR Size) +static PVOID KdbpSymAllocMem(ULONG_PTR size) { - KdbpMallocHeader *Hdr; - if (Size < PAGE_SIZE) - { - PVOID Result = ExAllocatePoolWithTag(NonPagedPool, Size + sizeof(KdbpMallocHeader), 'RSYM'); - if (!Result) return NULL; - Hdr = (KdbpMallocHeader*)Result; - Hdr->Mdl = NULL; - Hdr->Size = Size; - return &Hdr[1]; - } - else - { - PVOID Base = NULL; - SIZE_T RegionSize = Size + sizeof(KdbpMallocHeader); - NTSTATUS Status = NtAllocateVirtualMemory - (CURRENT_PROCESS, &Base, 0, &RegionSize, MEM_COMMIT, PAGE_READWRITE); - if (!NT_SUCCESS(Status)) return NULL; - Hdr = (KdbpMallocHeader*)Base; - Hdr->Mdl = IoAllocateMdl(Base, RegionSize, FALSE, FALSE, NULL); - if (!Hdr->Mdl) { - NtFreeVirtualMemory(CURRENT_PROCESS, &Base, &RegionSize, MEM_RELEASE); - return NULL; - } - Hdr->Size = RegionSize; - Hdr->OriginalMapping = Base; - MmProbeAndLockPages(Hdr->Mdl, KernelMode, IoModifyAccess); - KdbpMallocHeader *MappedHdr = (KdbpMallocHeader*)MmMapLockedPages(Hdr->Mdl, KernelMode); - if (!MappedHdr) { - MmUnlockPages(Hdr->Mdl); - IoFreeMdl(Hdr->Mdl); - NtFreeVirtualMemory(CURRENT_PROCESS, &Base, &RegionSize, MEM_RELEASE); - return NULL; - } - return &MappedHdr[1]; - } + return ExAllocatePoolWithTag(NonPagedPool, size, 'RSYM'); } static VOID KdbpSymFreeMem(PVOID Area) { - PCHAR HdrPtr = ((PCHAR)Area) - sizeof(KdbpMallocHeader); - KdbpMallocHeader *Hdr = (KdbpMallocHeader*)HdrPtr; - if (Hdr->Size < PAGE_SIZE) - { - ExFreePool(Hdr); - } - else - { - PMDL Mdl = Hdr->Mdl; - PVOID BaseAddress = Hdr->OriginalMapping; - SIZE_T RegionSize = Hdr->Size; - MmUnmapLockedPages(Hdr, Mdl); - MmUnlockPages(Mdl); - NtFreeVirtualMemory(CURRENT_PROCESS, &BaseAddress, &RegionSize, MEM_RELEASE); - IoFreeMdl(Mdl); - } + return ExFreePool(Area); } static BOOLEAN KdbpSymReadMem(PVOID FileContext, PVOID TargetDebug, PVOID SourceMem, ULONG Size) diff --git a/ntoskrnl/ke/i386/trap.s b/ntoskrnl/ke/i386/trap.s index 73d1cbcf71d..9955e6daff5 100644 --- a/ntoskrnl/ke/i386/trap.s +++ b/ntoskrnl/ke/i386/trap.s @@ -32,6 +32,8 @@ EXTERN _KiTrap02:PROC .data ASSUME nothing +.align 16 + PUBLIC _KiIdt _KiIdt: /* This is the Software Interrupt Table that we handle in this file: */ diff --git a/ntoskrnl/mm/anonmem.c b/ntoskrnl/mm/anonmem.c index 766a8fc17c2..70211e5fb72 100644 --- a/ntoskrnl/mm/anonmem.c +++ b/ntoskrnl/mm/anonmem.c @@ -48,89 +48,6 @@ /* FUNCTIONS *****************************************************************/ -NTSTATUS -NTAPI -MmWritePageVirtualMemory(PMMSUPPORT AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID Address, - PMM_PAGEOP PageOp) -{ - SWAPENTRY SwapEntry; - PFN_NUMBER Page; - NTSTATUS Status; - PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); - - /* - * Check for paging out from a deleted virtual memory area. - */ - if (MemoryArea->DeleteInProgress) - { - PageOp->Status = STATUS_UNSUCCESSFUL; - KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); - MmReleasePageOp(PageOp); - return(STATUS_UNSUCCESSFUL); - } - - Page = MmGetPfnForProcess(Process, Address); - - /* - * Get that the page actually is dirty. - */ - if (!MmIsDirtyPage(Process, Address)) - { - PageOp->Status = STATUS_SUCCESS; - KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); - MmReleasePageOp(PageOp); - return(STATUS_SUCCESS); - } - - /* - * Speculatively set the mapping to clean. - */ - MmSetCleanPage(Process, Address); - - /* - * If necessary, allocate an entry in the paging file for this page - */ - SwapEntry = MmGetSavedSwapEntryPage(Page); - if (SwapEntry == 0) - { - SwapEntry = MmAllocSwapPage(); - if (SwapEntry == 0) - { - MmSetDirtyPage(Process, Address); - PageOp->Status = STATUS_PAGEFILE_QUOTA_EXCEEDED; - KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); - MmReleasePageOp(PageOp); - return(STATUS_PAGEFILE_QUOTA_EXCEEDED); - } - } - - /* - * Write the page to the pagefile - */ - Status = MmWriteToSwapPage(SwapEntry, Page); - if (!NT_SUCCESS(Status)) - { - DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n", - Status); - MmSetDirtyPage(Process, Address); - PageOp->Status = STATUS_UNSUCCESSFUL; - KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); - MmReleasePageOp(PageOp); - return(STATUS_UNSUCCESSFUL); - } - - /* - * Otherwise we have succeeded. - */ - MmSetSavedSwapEntryPage(Page, SwapEntry); - PageOp->Status = STATUS_SUCCESS; - KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); - MmReleasePageOp(PageOp); - return(STATUS_SUCCESS); -} - NTSTATUS NTAPI MmPageOutVirtualMemory(PMMSUPPORT AddressSpace, diff --git a/subsystems/win32/win32k/include/napi.h b/subsystems/win32/win32k/include/napi.h index 9ae543bc76a..58319329f60 100644 --- a/subsystems/win32/win32k/include/napi.h +++ b/subsystems/win32/win32k/include/napi.h @@ -16,7 +16,7 @@ UCHAR Win32kSSPT[] = { #include "w32ksvc.h" }; -#define MIN_SYSCALL_NUMBER 0 +#define MIN_SYSCALL_NUMBER 0x1000 #define NUMBER_OF_SYSCALLS (sizeof(Win32kSSPT) / sizeof(Win32kSSPT[0])) -#define MAX_SYSCALL_NUMBER (NUMBER_OF_SYSCALLS - 1) +#define MAX_SYSCALL_NUMBER 0x1000 + (NUMBER_OF_SYSCALLS - 1) ULONG Win32kNumberOfSysCalls = NUMBER_OF_SYSCALLS; -- 2.17.1