mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Use W32API for NTOSKRNL.
svn path=/trunk/; revision=16053
This commit is contained in:
parent
ff246534c9
commit
52f8761d3a
60 changed files with 194 additions and 225 deletions
|
@ -17,11 +17,13 @@ NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING, PCUNICODE_STRING, BOOLEA
|
|||
#endif
|
||||
|
||||
#ifdef USE_ROS_CC_AND_FS
|
||||
#ifndef __INCLUDE_DDK_NTIFS_H
|
||||
NTSTATUS STDCALL CcRosInitializeFileCache(PFILE_OBJECT, ULONG);
|
||||
NTSTATUS STDCALL CcRosReleaseFileCache(PFILE_OBJECT);
|
||||
#define FSCTL_ROS_QUERY_LCN_MAPPING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
typedef struct _ROS_QUERY_LCN_MAPPING { LARGE_INTEGER LcnDiskOffset; } ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
/* FIXME: NDK Headers */
|
||||
#include <ntos/types.h>
|
||||
#include <ntos/haltypes.h>
|
||||
#include <ntos/halfuncs.h>
|
||||
#include <roskrnl.h>
|
||||
|
||||
/* Internal Kernel Headers */
|
||||
//#include <internal/mm.h>
|
||||
|
|
|
@ -136,10 +136,6 @@ HalSetRealTimeClock(PTIME_FIELDS Time);
|
|||
HalSetTimeIncrement
|
||||
*/
|
||||
|
||||
BOOLEAN STDCALL
|
||||
HalStartNextProcessor(ULONG Unknown1,
|
||||
ULONG Unknown2);
|
||||
|
||||
/*
|
||||
HalStartProfileInterrupt
|
||||
*/
|
||||
|
|
|
@ -128,14 +128,6 @@ typedef struct _KEVENT
|
|||
DISPATCHER_HEADER Header;
|
||||
} KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
|
||||
|
||||
typedef struct _KEVENT_PAIR
|
||||
{
|
||||
CSHORT Type;
|
||||
CSHORT Size;
|
||||
KEVENT LowEvent;
|
||||
KEVENT HighEvent;
|
||||
} KEVENT_PAIR, *PKEVENT_PAIR;
|
||||
|
||||
typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
|
||||
|
||||
typedef struct _KDEVICE_QUEUE
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
#ifndef __INCLUDE_DDK_NTIFS_H
|
||||
#define __INCLUDE_DDK_NTIFS_H
|
||||
|
||||
#ifdef __USE_W32API
|
||||
|
||||
#include_next <ddk/ntifs.h>
|
||||
|
||||
NTSTATUS STDCALL
|
||||
CcRosInitializeFileCache (PFILE_OBJECT FileObject,
|
||||
ULONG CacheSegmentSize);
|
||||
NTSTATUS STDCALL
|
||||
CcRosReleaseFileCache (PFILE_OBJECT FileObject);
|
||||
|
||||
#else /* __USE_W32API */
|
||||
|
||||
#ifndef __INCLUDE_DDK_NTIFS_H
|
||||
#define __INCLUDE_DDK_NTIFS_H
|
||||
#include <ddk/cctypes.h>
|
||||
#include <ddk/ccfuncs.h>
|
||||
|
||||
#include <ddk/fstypes.h>
|
||||
#include <ddk/fsfuncs.h>
|
||||
|
||||
#endif
|
||||
|
||||
NTSTATUS STDCALL
|
||||
CcRosInitializeFileCache (PFILE_OBJECT FileObject,
|
||||
|
@ -27,13 +29,4 @@ typedef struct _ROS_QUERY_LCN_MAPPING
|
|||
LARGE_INTEGER LcnDiskOffset;
|
||||
} ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
|
||||
|
||||
#include <ddk/cctypes.h>
|
||||
|
||||
#include <ddk/ccfuncs.h>
|
||||
|
||||
#include <ddk/fstypes.h>
|
||||
#include <ddk/fsfuncs.h>
|
||||
|
||||
#endif /* __INCLUDE_DDK_NTIFS_H */
|
||||
|
||||
#endif /* __USE_W32API */
|
||||
|
|
|
@ -90,6 +90,10 @@ HalSystemVectorDispatchEntry(ULONG Unknown1,
|
|||
ULONG Unknown2,
|
||||
ULONG Unknown3);
|
||||
|
||||
BOOLEAN STDCALL
|
||||
HalStartNextProcessor(ULONG Unknown1,
|
||||
ULONG Unknown2);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
IoAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
|
||||
|
|
|
@ -119,5 +119,18 @@ typedef struct _KEXCEPTION_FRAME {
|
|||
ULONG64 Return;
|
||||
} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
|
||||
|
||||
typedef struct _KEVENT_PAIR
|
||||
{
|
||||
CSHORT Type;
|
||||
CSHORT Size;
|
||||
KEVENT LowEvent;
|
||||
KEVENT HighEvent;
|
||||
} KEVENT_PAIR, *PKEVENT_PAIR;
|
||||
|
||||
typedef struct _RUNDOWN_DESCRIPTOR {
|
||||
ULONG_PTR References;
|
||||
KEVENT RundownEvent;
|
||||
} RUNDOWN_DESCRIPTOR, *PRUNDOWN_DESCRIPTOR;
|
||||
|
||||
#endif /* __INCLUDE_NTOS_KRNLTYPES_H */
|
||||
|
||||
|
|
|
@ -424,9 +424,9 @@ typedef enum _REG_NOTIFY_CLASS
|
|||
} REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
|
||||
|
||||
/* Registry Callback Function */
|
||||
typedef NTSTATUS (*PEX_CALLBACK_FUNCTION ) (
|
||||
typedef NTSTATUS (STDCALL *PEX_CALLBACK_FUNCTION ) (
|
||||
IN PVOID CallbackContext,
|
||||
IN REG_NOTIFY_CLASS Argument1,
|
||||
IN PVOID Argument1,
|
||||
IN PVOID Argument2
|
||||
);
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1,
|
|||
ExReleaseFastMutex(&CmiCallbackLock);
|
||||
|
||||
Status = CurrentCallback->Function(CurrentCallback->Context,
|
||||
Argument1,
|
||||
(PVOID)Argument1,
|
||||
Argument2);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
|
|
@ -398,8 +398,6 @@ CmiCreateNewRegFile(HANDLE FileHandle)
|
|||
|
||||
ExFreePool(Buffer);
|
||||
|
||||
ASSERTMSG(NT_SUCCESS(Status), ("Status: 0x%X\n", Status));
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return(Status);
|
||||
|
@ -688,9 +686,8 @@ CmiImportHiveBins(PREGISTRY_HIVE Hive,
|
|||
return STATUS_REGISTRY_CORRUPT;
|
||||
}
|
||||
|
||||
ASSERTMSG((Bin->BinSize % REG_BLOCK_SIZE) == 0,
|
||||
("Bin size (0x%.08x) must be multiple of 4K\n",
|
||||
Bin->BinSize));
|
||||
ASSERTMSG("Bin size must be multiple of 4K\n",
|
||||
(Bin->BinSize % REG_BLOCK_SIZE) == 0);
|
||||
|
||||
/* Allocate the hive block */
|
||||
Hive->BlockList[BlockIndex].Bin = ExAllocatePool (PagedPool,
|
||||
|
|
|
@ -248,8 +248,8 @@ ExecuteRuntimeAsserts(VOID)
|
|||
ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME, orig_ebp) == TF_ORIG_EBP);
|
||||
ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
|
||||
ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
|
||||
ASSERT(FIELD_OFFSET(KPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
|
||||
ASSERT(FIELD_OFFSET(KPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
|
||||
ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
|
||||
ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
|
||||
ASSERT(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0);
|
||||
ASSERT(FIELD_OFFSET(KTSS, Eflags) == KTSS_EFLAGS);
|
||||
ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE);
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
#ifndef MUTANT_INCREMENT
|
||||
#define MUTANT_INCREMENT 1
|
||||
#endif
|
||||
|
||||
POBJECT_TYPE ExMutantObjectType = NULL;
|
||||
|
||||
static GENERIC_MAPPING ExpMutantMapping = {
|
||||
|
|
|
@ -415,9 +415,9 @@ QSI_DEF(SystemPerformanceInformation)
|
|||
|
||||
Spi->IdleTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL;
|
||||
|
||||
Spi->ReadTransferCount.QuadPart = IoReadTransferCount;
|
||||
Spi->WriteTransferCount.QuadPart = IoWriteTransferCount;
|
||||
Spi->OtherTransferCount.QuadPart = IoOtherTransferCount;
|
||||
Spi->ReadTransferCount = IoReadTransferCount;
|
||||
Spi->WriteTransferCount = IoWriteTransferCount;
|
||||
Spi->OtherTransferCount = IoOtherTransferCount;
|
||||
Spi->ReadOperationCount = IoReadOperationCount;
|
||||
Spi->WriteOperationCount = IoWriteOperationCount;
|
||||
Spi->OtherOperationCount = IoOtherOperationCount;
|
||||
|
@ -984,6 +984,9 @@ QSI_DEF(SystemFileCacheInformation)
|
|||
* ReqSize = sizeof (SYSTEM_CACHE_INFORMATION);
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
RtlZeroMemory(Sci, sizeof(SYSTEM_CACHE_INFORMATION));
|
||||
|
||||
/* Return the Byte size not the page size. */
|
||||
Sci->CurrentSize =
|
||||
MiMemoryConsumers[MC_CACHE].PagesUsed * PAGE_SIZE;
|
||||
|
@ -993,8 +996,6 @@ QSI_DEF(SystemFileCacheInformation)
|
|||
Sci->PageFaultCount = 0; /* FIXME */
|
||||
Sci->MinimumWorkingSet = 0; /* FIXME */
|
||||
Sci->MaximumWorkingSet = 0; /* FIXME */
|
||||
Sci->TransitionSharedPages = 0; /* FIXME */
|
||||
Sci->TransitionSharedPagesPeak = 0; /* FIXME */
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
extern ULONG CcFastReadNotPossible;
|
||||
extern ULONG CcFastReadResourceMiss;
|
||||
extern ULONG CcFastReadWait;
|
||||
extern ULONG CcFastReadNoWait;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
|
|
@ -1372,7 +1372,7 @@ FsRtlReleaseFile(
|
|||
if ((FcbHeader = (PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)) {
|
||||
|
||||
/* Use a Resource Release */
|
||||
ExReleaseResource(FcbHeader->Resource);
|
||||
ExReleaseResourceLite(FcbHeader->Resource);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -609,11 +609,11 @@ FsRtlpCopyName(
|
|||
|
||||
if (Unicode)
|
||||
{
|
||||
memcpy(CurrentEntry->Name, RelativeName->Buffer, RelativeName->Length);
|
||||
memcpy(CurrentEntry->FileName, RelativeName->Buffer, RelativeName->Length);
|
||||
if (StreamName)
|
||||
{
|
||||
CurrentEntry->Name[RelativeName->Length/sizeof(WCHAR)] = ':';
|
||||
memcpy(&CurrentEntry ->Name[(RelativeName->Length/sizeof(WCHAR))+1],
|
||||
CurrentEntry->FileName[RelativeName->Length/sizeof(WCHAR)] = ':';
|
||||
memcpy(&CurrentEntry->FileName[(RelativeName->Length/sizeof(WCHAR))+1],
|
||||
StreamName->Buffer,
|
||||
StreamName->Length);
|
||||
}
|
||||
|
@ -741,7 +741,7 @@ FsRtlNotifyFullReportChange (
|
|||
(StreamName ? ((StreamName->Length * sizeof(WCHAR)) + sizeof(WCHAR)) : 0);
|
||||
}
|
||||
|
||||
RecordLen = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, Name) + NameLenU;
|
||||
RecordLen = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, FileName) + NameLenU;
|
||||
|
||||
if ((Irp = FsRtlpGetNextIrp(NotifyEntry)))
|
||||
{
|
||||
|
@ -770,7 +770,7 @@ FsRtlNotifyFullReportChange (
|
|||
if (CurrentEntry)
|
||||
{
|
||||
CurrentEntry->Action = Action;
|
||||
CurrentEntry->NameLength = NameLenU;
|
||||
CurrentEntry->FileNameLength = NameLenU;
|
||||
CurrentEntry->NextEntryOffset = 0;
|
||||
|
||||
FsRtlpCopyName(
|
||||
|
@ -816,7 +816,7 @@ FsRtlNotifyFullReportChange (
|
|||
CurrentEntry = (PFILE_NOTIFY_INFORMATION)NotifyEntry->Buffer;
|
||||
|
||||
CurrentEntry->Action = Action;
|
||||
CurrentEntry->NameLength = NameLenU;
|
||||
CurrentEntry->FileNameLength = NameLenU;
|
||||
CurrentEntry->NextEntryOffset = 0;
|
||||
|
||||
FsRtlpCopyName(CurrentEntry,
|
||||
|
@ -937,10 +937,10 @@ FsRtlNotifyReportChange (
|
|||
VOID
|
||||
STDCALL
|
||||
FsRtlNotifyUninitializeSync (
|
||||
IN PNOTIFY_SYNC NotifySync
|
||||
IN PNOTIFY_SYNC *NotifySync
|
||||
)
|
||||
{
|
||||
ExFreePool (NotifySync);
|
||||
ExFreePool (*NotifySync);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_CC_H
|
||||
#define __INCLUDE_INTERNAL_CC_H
|
||||
|
||||
/* $Id$ */
|
||||
#include <ddk/ntifs.h>
|
||||
#include <reactos/bugcodes.h>
|
||||
|
||||
typedef struct _BCB
|
||||
{
|
||||
LIST_ENTRY BcbSegmentListHead;
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#ifndef __INTERNAL_DEBUG
|
||||
#define __INTERNAL_DEBUG
|
||||
|
||||
#include <internal/ntoskrnl.h>
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1300)
|
||||
/* TODO: Verify which version the MS compiler learned the __FUNCTION__ macro */
|
||||
#define __FUNCTION__ "<unknown>"
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
|
||||
#define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
|
||||
|
||||
#define NTOS_MODE_KERNEL
|
||||
#include <ntos.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
wmCenter = 0,
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
#ifndef __INCLUDE_INTERNAL_IFS_H
|
||||
#define __INCLUDE_INTERNAL_IFS_H
|
||||
/* $Id$ */
|
||||
|
||||
#include <ddk/ntifs.h>
|
||||
#include <ntos.h>
|
||||
|
||||
/* Look for "FSrt" in mem view */
|
||||
#define IFS_POOL_TAG 0x74725346
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_IO_H
|
||||
#define __NTOSKRNL_INCLUDE_INTERNAL_IO_H
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/ob.h>
|
||||
#include <internal/module.h>
|
||||
|
||||
|
||||
#ifndef __USE_W32API
|
||||
#define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16)
|
||||
#endif
|
||||
|
@ -333,8 +328,6 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT
|
|||
|
||||
|
||||
extern PDEVICE_NODE IopRootDeviceNode;
|
||||
extern ULONG IoOtherOperationCount;
|
||||
extern ULONGLONG IoOtherTransferCount;
|
||||
|
||||
VOID
|
||||
PnpInit(VOID);
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
|
||||
#define __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
|
||||
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ldr.h>
|
||||
#include <ntdll/ldr.h>
|
||||
|
||||
struct _KD_DISPATCH_TABLE;
|
||||
#define KdPrintEx(_x_) DbgPrintEx _x_
|
||||
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
#ifndef NTOSKRNL_KDB_H
|
||||
#define NTOSKRNL_KDB_H
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#define NTOS_MODE_KERNEL
|
||||
#include <ntos.h>
|
||||
|
||||
#include <internal/ke.h>
|
||||
|
||||
/* DEFINES *******************************************************************/
|
||||
|
||||
#define TAG_KDBG (('K' << 24) | ('D' << 16) | ('B' << 8) | 'G')
|
||||
|
|
|
@ -6,16 +6,12 @@
|
|||
#ifndef __INCLUDE_INTERNAL_KD_BOCHS_H
|
||||
#define __INCLUDE_INTERNAL_KD_BOCHS_H
|
||||
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ldr.h>
|
||||
#include <ntdll/ldr.h>
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KdpBochsInit(struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||
ULONG BootPhase);
|
||||
VOID
|
||||
STDCALL
|
||||
KdpBochsDebugPrint(IN PCH Message);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KdpBochsDebugPrint(IN PCH Message);
|
||||
|
||||
#endif /* __INCLUDE_INTERNAL_KD_BOCHS_H */
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_KD_GDB_H
|
||||
#define __INCLUDE_INTERNAL_KD_GDB_H
|
||||
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ldr.h>
|
||||
#include <ntdll/ldr.h>
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KdpGdbStubInit(struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||
|
|
|
@ -22,11 +22,6 @@
|
|||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#ifndef __ASM__
|
||||
#include <ddk/ntifs.h>
|
||||
#include <stdarg.h>
|
||||
#endif /* not __ASM__ */
|
||||
|
||||
#include "arch/ke.h"
|
||||
|
||||
/* INTERNAL KERNEL TYPES ****************************************************/
|
||||
|
@ -38,10 +33,6 @@
|
|||
typedef struct _KPROCESS *PKPROCESS;
|
||||
typedef struct _DISPATCHER_HEADER *PDISPATCHER_HEADER;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct _KEVENT_PAIR *PKEVENT_PAIR;
|
||||
|
||||
#endif /* __USE_W32API */
|
||||
|
||||
typedef struct _HARDWARE_PTE_X86 {
|
||||
|
@ -222,7 +213,7 @@ typedef struct _KPROCESS
|
|||
/* INTERNAL KERNEL FUNCTIONS ************************************************/
|
||||
|
||||
#ifdef __USE_W32API
|
||||
struct _KPROCESS* KeGetCurrentProcess(VOID);
|
||||
struct _KPROCESS* STDCALL KeGetCurrentProcess(VOID);
|
||||
VOID KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_LDR_H
|
||||
#define __INCLUDE_INTERNAL_LDR_H
|
||||
|
||||
#include <pe.h>
|
||||
#include <internal/io.h>
|
||||
#include <internal/module.h>
|
||||
|
||||
#define KERNEL_MODULE_NAME L"ntoskrnl.exe"
|
||||
#define HAL_MODULE_NAME L"hal.dll"
|
||||
#define DRIVER_ROOT_NAME L"\\Driver\\"
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_MM_H
|
||||
#define __INCLUDE_INTERNAL_MM_H
|
||||
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/arch/mm.h>
|
||||
|
||||
/* TYPES *********************************************************************/
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
|
||||
#ifndef __MODULE_H
|
||||
#define __MODULE_H
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <roscfg.h>
|
||||
#include <pe.h>
|
||||
#include <reactos/rossym.h>
|
||||
|
||||
typedef struct _MODULE_TEXT_SECTION
|
||||
{
|
||||
ULONG Base;
|
||||
|
|
|
@ -7,12 +7,6 @@
|
|||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <stdarg.h>
|
||||
#define NTOS_MODE_KERNEL
|
||||
#include <ntos.h>
|
||||
|
||||
#include "internal/ke.h"
|
||||
|
||||
/*
|
||||
* Use these to place a function in a specific section of the executable
|
||||
*/
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
#ifndef __INCLUDE_INTERNAL_OBJMGR_H
|
||||
#define __INCLUDE_INTERNAL_OBJMGR_H
|
||||
|
||||
#define NTOS_MODE_KERNEL
|
||||
#include <ntos.h>
|
||||
|
||||
#define TAG_OBJECT_TYPE TAG('O', 'b', 'j', 'T')
|
||||
|
||||
struct _EPROCESS;
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_PO_H
|
||||
#define __NTOSKRNL_INCLUDE_INTERNAL_PO_H
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/io.h>
|
||||
|
||||
extern PDEVICE_NODE PopSystemPowerDeviceNode;
|
||||
|
||||
VOID
|
||||
|
|
|
@ -41,10 +41,6 @@ struct _EJOB;
|
|||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <internal/mm.h>
|
||||
#include <internal/ke.h>
|
||||
#include <napi/teb.h>
|
||||
|
||||
extern LCID PsDefaultThreadLocaleId;
|
||||
extern LCID PsDefaultSystemLocaleId;
|
||||
|
||||
|
@ -187,7 +183,7 @@ typedef struct _ETHREAD *PETHREAD;
|
|||
* KERNEL VERSION: 5.2
|
||||
* DOCUMENTATION: http://reactos.com/wiki/index.php/EPROCESS
|
||||
*/
|
||||
struct _EPROCESS
|
||||
typedef struct _EPROCESS
|
||||
{
|
||||
KPROCESS Pcb; /* 000 */
|
||||
EX_PUSH_LOCK ProcessLock; /* 078 */
|
||||
|
@ -317,7 +313,7 @@ struct _EPROCESS
|
|||
|
||||
/* FIXME MOVE TO AVL TREES */
|
||||
MADDRESS_SPACE AddressSpace; /* 28C */
|
||||
};
|
||||
} EPROCESS;
|
||||
#include <poppack.h>
|
||||
|
||||
#define PROCESS_STATE_TERMINATED (1)
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <internal/ke.h>
|
||||
|
||||
typedef struct _KV86M_TRAP_FRAME
|
||||
{
|
||||
KTRAP_FRAME Tf;
|
||||
|
|
|
@ -1,34 +1,39 @@
|
|||
#ifndef __INCLUDE_NTOSKRNL_H
|
||||
#define __INCLUDE_NTOSKRNL_H
|
||||
|
||||
#define __NO_CTYPE_INLINES
|
||||
#define NTKERNELAPI
|
||||
|
||||
/* include the ntoskrnl config.h file */
|
||||
#include "config.h"
|
||||
|
||||
#include <roskrnl.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/ntifs.h>
|
||||
#include <ddk/wdmguid.h>
|
||||
|
||||
#undef IO_TYPE_FILE
|
||||
#define IO_TYPE_FILE 0x0F5L /* Temp Hack */
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <reactos/version.h>
|
||||
#include <reactos/resource.h>
|
||||
#include <reactos/bugcodes.h>
|
||||
#include <reactos/rossym.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <wchar.h>
|
||||
#include <roskrnl.h>
|
||||
#include <ntos/minmax.h>
|
||||
#include <ntos/synch.h>
|
||||
#include <ntos/keyboard.h>
|
||||
#include <ntos/ntdef.h>
|
||||
#include <ntos/ldrtypes.h>
|
||||
#include <ntos/ntpnp.h>
|
||||
#include <ddk/ldrfuncs.h>
|
||||
#include <rosrtl/minmax.h>
|
||||
#include <rosrtl/string.h>
|
||||
#include <ddk/halfuncs.h>
|
||||
#include <ddk/kefuncs.h>
|
||||
#include <ddk/pnptypes.h>
|
||||
#include <ddk/pnpfuncs.h>
|
||||
#include <ddk/wdmguid.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <pseh.h>
|
||||
#include <internal/ctype.h>
|
||||
|
@ -41,12 +46,11 @@
|
|||
#include <internal/handle.h>
|
||||
#include <internal/pool.h>
|
||||
#include <internal/ob.h>
|
||||
#include <internal/ps.h>
|
||||
#include <internal/mm.h>
|
||||
#include <internal/ps.h>
|
||||
#include <internal/cc.h>
|
||||
#include <internal/io.h>
|
||||
#include <internal/po.h>
|
||||
#include <internal/ob.h>
|
||||
#include <internal/se.h>
|
||||
#include <internal/ldr.h>
|
||||
#include <internal/kd.h>
|
||||
|
|
|
@ -84,7 +84,6 @@ HAL_DISPATCH EXPORTED HalDispatchTable =
|
|||
(pHalMirrorVerify) NULL //HalMirrorVerify;
|
||||
};
|
||||
|
||||
|
||||
HAL_PRIVATE_DISPATCH EXPORTED HalPrivateDispatchTable =
|
||||
{
|
||||
HAL_PRIVATE_DISPATCH_VERSION
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* FIXME: Header mess */
|
||||
#undef CreateMailslot
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
extern GENERIC_MAPPING IopFileMapping;
|
||||
|
@ -1351,7 +1354,7 @@ NtCancelIoFile(IN HANDLE FileHandle,
|
|||
BOOLEAN OurIrpsInList = FALSE;
|
||||
LARGE_INTEGER Interval;
|
||||
|
||||
if ((ULONG_PTR)IoStatusBlock >= MmUserProbeAddress &&
|
||||
if ((ULONG_PTR)IoStatusBlock >= (ULONG_PTR)MmUserProbeAddress &&
|
||||
KeGetPreviousMode() == UserMode)
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
|
||||
|
@ -2877,7 +2880,7 @@ NtSetInformationFile(HANDLE FileHandle,
|
|||
else
|
||||
{
|
||||
/* Reference the Port */
|
||||
Status = ObReferenceObjectByHandle(CompletionInfo->IoCompletionHandle,
|
||||
Status = ObReferenceObjectByHandle(CompletionInfo->Port,
|
||||
IO_COMPLETION_MODIFY_STATE,
|
||||
IoCompletionType,
|
||||
PreviousMode,
|
||||
|
@ -2891,7 +2894,7 @@ NtSetInformationFile(HANDLE FileHandle,
|
|||
TAG('I', 'o', 'C', 'p'));
|
||||
|
||||
/* Set the Data */
|
||||
Context->Key = CompletionInfo->CompletionKey;
|
||||
Context->Key = CompletionInfo->Key;
|
||||
Context->Port = Queue;
|
||||
FileObject->CompletionContext = Context;
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL;
|
||||
POBJECT_TYPE EXPORTED IoFileObjectType = NULL;
|
||||
extern POBJECT_TYPE IoControllerObjectType;
|
||||
ULONG EXPORTED IoReadOperationCount = 0;
|
||||
ULONGLONG EXPORTED IoReadTransferCount = 0;
|
||||
ULONG EXPORTED IoWriteOperationCount = 0;
|
||||
ULONGLONG EXPORTED IoWriteTransferCount = 0;
|
||||
ULONG IoOtherOperationCount = 0;
|
||||
ULONGLONG IoOtherTransferCount = 0;
|
||||
KSPIN_LOCK EXPORTED IoStatisticsLock = 0;
|
||||
ULONG EXPORTED IoReadOperationCount = 0;
|
||||
LARGE_INTEGER EXPORTED IoReadTransferCount = {{0, 0}};
|
||||
ULONG EXPORTED IoWriteOperationCount = 0;
|
||||
LARGE_INTEGER EXPORTED IoWriteTransferCount = {{0, 0}};
|
||||
ULONG IoOtherOperationCount = 0;
|
||||
LARGE_INTEGER IoOtherTransferCount = {{0, 0}};
|
||||
KSPIN_LOCK EXPORTED IoStatisticsLock = 0;
|
||||
|
||||
GENERIC_MAPPING IopFileMapping = {
|
||||
FILE_GENERIC_READ,
|
||||
|
@ -36,6 +36,7 @@ static KSPIN_LOCK CancelSpinLock;
|
|||
extern LIST_ENTRY ShutdownListHead;
|
||||
extern KSPIN_LOCK ShutdownListLock;
|
||||
extern NPAGED_LOOKASIDE_LIST IoCompletionPacketLookaside;
|
||||
extern POBJECT_TYPE IoAdapterObjectType;
|
||||
NPAGED_LOOKASIDE_LIST IoLargeIrpLookaside;
|
||||
NPAGED_LOOKASIDE_LIST IoSmallIrpLookaside;
|
||||
|
||||
|
|
|
@ -1033,6 +1033,7 @@ IoCallDriver (PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
#undef IoCompleteRequest
|
||||
VOID
|
||||
STDCALL
|
||||
IoCompleteRequest(PIRP Irp,
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* FIXME: Header mess */
|
||||
#undef DeviceCapabilities
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
PDEVICE_NODE IopRootDeviceNode;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
/* GLOBALS *******************************************************************/
|
||||
|
||||
static CONFIGURATION_INFORMATION
|
||||
SystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE};
|
||||
_SystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE};
|
||||
|
||||
/* API Parameters to Pass in IopQueryBusDescription */
|
||||
typedef struct IO_QUERY {
|
||||
|
@ -659,7 +659,7 @@ IopQueryBusDescription(
|
|||
PCONFIGURATION_INFORMATION STDCALL
|
||||
IoGetConfigurationInformation(VOID)
|
||||
{
|
||||
return(&SystemConfigurationInformation);
|
||||
return(&_SystemConfigurationInformation);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1422,7 +1422,7 @@ KdbpCmdGdtLdtIdt(ULONG Argc, PCHAR Argv[])
|
|||
STATIC BOOLEAN
|
||||
KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
|
||||
{
|
||||
PKPCR Pcr = KeGetCurrentKPCR();
|
||||
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
|
||||
|
||||
KdbpPrint("Current PCR is at 0x%08x.\n", (INT)Pcr);
|
||||
KdbpPrint(" Tib.ExceptionList: 0x%08x\n"
|
||||
|
@ -1446,7 +1446,6 @@ KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
|
|||
" MinorVersion: 0x%04x\n"
|
||||
" SetMember: 0x%08x\n"
|
||||
" StallScaleFactor: 0x%08x\n"
|
||||
" DebugActive: 0x%02x\n"
|
||||
" Number: 0x%02x\n"
|
||||
" L2CacheAssociativity: 0x%02x\n"
|
||||
" VdmAlert: 0x%08x\n"
|
||||
|
@ -1457,7 +1456,7 @@ KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
|
|||
Pcr->Tib.Self, Pcr->Self, Pcr->Prcb, Pcr->Irql, Pcr->IRR, Pcr->IrrActive,
|
||||
Pcr->IDR, Pcr->KdVersionBlock, Pcr->IDT, Pcr->GDT, Pcr->TSS,
|
||||
Pcr->MajorVersion, Pcr->MinorVersion, Pcr->SetMember, Pcr->StallScaleFactor,
|
||||
Pcr->DebugActive, Pcr->Number, Pcr->L2CacheAssociativity,
|
||||
Pcr->Number, Pcr->L2CacheAssociativity,
|
||||
Pcr->VdmAlert, Pcr->L2CacheSize, Pcr->InterruptMode);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -9,10 +9,7 @@
|
|||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <roscfg.h>
|
||||
#include <ntoskrnl.h>
|
||||
#include <reactos/rossym.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
|
|
@ -37,7 +37,7 @@ Ki386GetCpuId(VOID)
|
|||
ULONG OrigFlags, Flags, FinalFlags;
|
||||
ULONG MaxCpuidLevel;
|
||||
ULONG Dummy, Eax, Ecx, Edx;
|
||||
PKPCR Pcr = KeGetCurrentKPCR();
|
||||
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
|
||||
|
||||
Ke386CpuidFlags2 = Ke386CpuidExFlags = 0;
|
||||
Ke386CacheAlignment = 32;
|
||||
|
@ -166,11 +166,11 @@ KePrepareForApplicationProcessorInit(ULONG Id)
|
|||
{
|
||||
DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
|
||||
PFN_TYPE PrcPfn;
|
||||
PKPCR Pcr;
|
||||
PKPCR BootPcr;
|
||||
PKIPCR Pcr;
|
||||
PKIPCR BootPcr;
|
||||
|
||||
BootPcr = (PKPCR)KPCR_BASE;
|
||||
Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
|
||||
BootPcr = (PKIPCR)KPCR_BASE;
|
||||
Pcr = (PKIPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
|
||||
|
||||
MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &PrcPfn);
|
||||
MmCreateVirtualMappingForKernel((PVOID)Pcr,
|
||||
|
@ -183,7 +183,7 @@ KePrepareForApplicationProcessorInit(ULONG Id)
|
|||
memset(Pcr, 0, PAGE_SIZE);
|
||||
Pcr->Number = Id;
|
||||
Pcr->Tib.Self = &Pcr->Tib;
|
||||
Pcr->Self = Pcr;
|
||||
Pcr->Self = (PKPCR)Pcr;
|
||||
Pcr->Prcb = &Pcr->PrcbData;
|
||||
Pcr->Irql = SYNCH_LEVEL;
|
||||
|
||||
|
@ -200,7 +200,7 @@ VOID
|
|||
KeApplicationProcessorInit(VOID)
|
||||
{
|
||||
ULONG Offset;
|
||||
PKPCR Pcr;
|
||||
PKIPCR Pcr;
|
||||
|
||||
DPRINT("KeApplicationProcessorInit()\n");
|
||||
|
||||
|
@ -212,12 +212,12 @@ KeApplicationProcessorInit(VOID)
|
|||
|
||||
|
||||
Offset = InterlockedIncrementUL(&PcrsAllocated) - 1;
|
||||
Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
|
||||
Pcr = (PKIPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
|
||||
|
||||
/*
|
||||
* Initialize the GDT
|
||||
*/
|
||||
KiInitializeGdt(Pcr);
|
||||
KiInitializeGdt((PKPCR)Pcr);
|
||||
|
||||
/* Get processor information. */
|
||||
Ki386GetCpuId();
|
||||
|
@ -261,7 +261,7 @@ KeApplicationProcessorInit(VOID)
|
|||
VOID INIT_FUNCTION
|
||||
KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
|
||||
{
|
||||
PKPCR KPCR;
|
||||
PKIPCR KPCR;
|
||||
BOOLEAN Pae = FALSE;
|
||||
BOOLEAN NoExecute = FALSE;
|
||||
PCHAR p1, p2;
|
||||
|
@ -274,12 +274,12 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
|
|||
* called, so we use a predefined page in low memory
|
||||
*/
|
||||
|
||||
KPCR = (PKPCR)KPCR_BASE;
|
||||
KPCR = (PKIPCR)KPCR_BASE;
|
||||
memset(KPCR, 0, PAGE_SIZE);
|
||||
KPCR->Self = KPCR;
|
||||
KPCR->Self = (PKPCR)KPCR;
|
||||
KPCR->Prcb = &KPCR->PrcbData;
|
||||
KPCR->Irql = SYNCH_LEVEL;
|
||||
KPCR->Tib.Self = &KPCR->Tib;
|
||||
KPCR->Tib.Self = &KPCR->Tib;
|
||||
KPCR->GDT = KiBootGdt;
|
||||
KPCR->IDT = (PUSHORT)KiIdt;
|
||||
KPCR->TSS = &KiBootTss;
|
||||
|
@ -391,7 +391,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
|
|||
VOID INIT_FUNCTION
|
||||
KeInit2(VOID)
|
||||
{
|
||||
PKPCR Pcr = KeGetCurrentKPCR();
|
||||
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
|
||||
|
||||
KiInitializeBugCheck();
|
||||
KeInitializeDispatcher();
|
||||
|
@ -454,7 +454,7 @@ KeInit2(VOID)
|
|||
VOID INIT_FUNCTION
|
||||
Ki386SetProcessorFeatures(VOID)
|
||||
{
|
||||
PKPCR Pcr = KeGetCurrentKPCR();
|
||||
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
UNICODE_STRING KeyName;
|
||||
UNICODE_STRING ValueName;
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
#ifndef MUTANT_INCREMENT
|
||||
#define MUTANT_INCREMENT 1
|
||||
#endif
|
||||
|
||||
#define THREAD_ALERT_INCREMENT 2
|
||||
|
||||
extern EX_WORK_QUEUE ExWorkerQueue[MaximumWorkQueue];
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
#error __ELF_WORD_SIZE must be defined
|
||||
#endif
|
||||
|
||||
#ifndef MAXULONG
|
||||
#define MAXULONG ((ULONG)(~1))
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
|
||||
/* TODO: Intsafe should be made into a library, as it's generally useful */
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
#define __ELF_WORD_SIZE 32
|
||||
#include "elf.inc.h"
|
||||
|
||||
#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM little-endian
|
||||
#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
|
||||
#define IMAGE_FILE_MACHINE_ALPHA64 0x0284 // Alpha AXP, full 64-bit support
|
||||
#define IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian
|
||||
|
||||
extern NTSTATUS NTAPI Elf64FmtCreateSection
|
||||
(
|
||||
IN CONST VOID * FileHeader,
|
||||
|
|
|
@ -482,7 +482,7 @@ MmSetAddressRangeModified (
|
|||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTKERNELAPI
|
||||
STDCALL
|
||||
MmGetSystemRoutineAddress (
|
||||
IN PUNICODE_STRING SystemRoutineName
|
||||
)
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
|
||||
#include <reactos/exeformat.h>
|
||||
|
||||
#ifndef MAXULONG
|
||||
#define MAXULONG ((ULONG)(~1))
|
||||
#endif
|
||||
|
||||
static ULONG SectionCharacteristicsToProtect[16] =
|
||||
{
|
||||
PAGE_NOACCESS, /* 0 = NONE */
|
||||
|
|
|
@ -2561,7 +2561,6 @@ ExeFmtpReadFile(IN PVOID File,
|
|||
KEBUGCHECK(STATUS_INVALID_PARAMETER_5);
|
||||
}
|
||||
|
||||
ASSERT(PAGE_SIZE <= MAXULONG);
|
||||
AdjustOffset = PAGE_ROUND_DOWN(FileOffset.u.LowPart);
|
||||
OffsetAdjustment = FileOffset.u.LowPart - AdjustOffset;
|
||||
FileOffset.u.LowPart = AdjustOffset;
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<define name="_SEH_NO_NATIVE_NLG" />
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="__NTOSKRNL__" />
|
||||
<define name="_NTOSKRNL_" />
|
||||
<define name="__NO_CTYPE_INLINES" />
|
||||
<define name="__USE_W32API" />
|
||||
<include base="kjs">include</include>
|
||||
<include base="ntoskrnl">include</include>
|
||||
<library>csq</library>
|
||||
|
|
|
@ -362,8 +362,8 @@ NtDuplicateObject (IN HANDLE SourceProcessHandle,
|
|||
IN HANDLE TargetProcessHandle,
|
||||
OUT PHANDLE TargetHandle OPTIONAL,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN BOOLEAN InheritHandle,
|
||||
ULONG Options)
|
||||
IN ULONG InheritHandle,
|
||||
IN ULONG Options)
|
||||
/*
|
||||
* FUNCTION: Copies a handle from one process space to another
|
||||
* ARGUMENTS:
|
||||
|
|
|
@ -1272,7 +1272,7 @@ NtQueryInformationThread (IN HANDLE ThreadHandle,
|
|||
* 0. So do the conversion here:
|
||||
* -Gunnar */
|
||||
u.TBI.ExitStatus = (Thread->ExitStatus == 0) ? STATUS_PENDING : Thread->ExitStatus;
|
||||
u.TBI.TebBaseAddress = Thread->Tcb.Teb;
|
||||
u.TBI.TebBaseAddress = (PVOID)Thread->Tcb.Teb;
|
||||
u.TBI.ClientId = Thread->Cid;
|
||||
u.TBI.AffinityMask = Thread->Tcb.Affinity;
|
||||
u.TBI.Priority = Thread->Tcb.Priority;
|
||||
|
|
|
@ -22,7 +22,7 @@ VOID
|
|||
STDCALL
|
||||
PsChargePoolQuota(IN PEPROCESS Process,
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG_PTR Amount)
|
||||
IN ULONG Amount)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
|
@ -67,7 +67,7 @@ NTSTATUS
|
|||
STDCALL
|
||||
PsChargeProcessPoolQuota(IN PEPROCESS Process,
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG_PTR Amount)
|
||||
IN ULONG Amount)
|
||||
{
|
||||
PEPROCESS_QUOTA_BLOCK QuotaBlock;
|
||||
ULONG NewUsageSize;
|
||||
|
|
|
@ -346,7 +346,7 @@ PsRevertThreadToSelf(IN PETHREAD Thread)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
PsImpersonateClient(IN PETHREAD Thread,
|
||||
IN PACCESS_TOKEN Token,
|
||||
|
@ -367,7 +367,7 @@ PsImpersonateClient(IN PETHREAD Thread,
|
|||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
if (Thread->ImpersonationInfo == NULL) {
|
||||
|
@ -387,6 +387,8 @@ PsImpersonateClient(IN PETHREAD Thread,
|
|||
KernelMode);
|
||||
|
||||
Thread->ActiveImpersonationInfo = TRUE;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,10 +10,7 @@
|
|||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ntos.h>
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ob.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ntoskrnl.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
|
|
@ -21,34 +21,6 @@ extern ULONG NtMajorVersion;
|
|||
extern ULONG NtMinorVersion;
|
||||
extern ULONG NtOSCSDVersion;
|
||||
|
||||
/* header hell made me do this...sorry */
|
||||
typedef struct _OSVERSIONINFOW {
|
||||
DWORD dwOSVersionInfoSize;
|
||||
DWORD dwMajorVersion;
|
||||
DWORD dwMinorVersion;
|
||||
DWORD dwBuildNumber;
|
||||
DWORD dwPlatformId;
|
||||
WCHAR szCSDVersion[ 128 ];
|
||||
} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
|
||||
|
||||
typedef struct _OSVERSIONINFOEXW {
|
||||
DWORD dwOSVersionInfoSize;
|
||||
DWORD dwMajorVersion;
|
||||
DWORD dwMinorVersion;
|
||||
DWORD dwBuildNumber;
|
||||
DWORD dwPlatformId;
|
||||
WCHAR szCSDVersion[ 128 ];
|
||||
WORD wServicePackMajor;
|
||||
WORD wServicePackMinor;
|
||||
WORD wSuiteMask;
|
||||
BYTE wProductType;
|
||||
BYTE wReserved;
|
||||
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
|
||||
|
||||
#ifndef VER_PLATFORM_WIN32_NT
|
||||
#define VER_PLATFORM_WIN32_NT (2)
|
||||
#endif
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -49,7 +49,7 @@ SeCreateAccessState(PACCESS_STATE AccessState,
|
|||
/* Set Access State Data */
|
||||
AccessState->AuxData = AuxData;
|
||||
AccessState->RemainingDesiredAccess = AccessMask;
|
||||
AccessState->OriginallyDesiredAccess = AccessMask;
|
||||
AccessState->OriginalDesiredAccess = AccessMask;
|
||||
ExpAllocateLocallyUniqueId(&AccessState->OperationID);
|
||||
|
||||
/* Get the Token to use */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
#include <win32k/win32k.h>
|
||||
#include <csrss/csrss.h>
|
||||
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/mm.h>
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ob.h>
|
||||
#include <internal/safe.h>
|
||||
#include <internal/ps.h>
|
||||
|
|
|
@ -3529,6 +3529,14 @@ ObReferenceObjectByName (
|
|||
OUT PVOID *Object
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PsAssignImpersonationToken (
|
||||
IN PETHREAD Thread,
|
||||
IN HANDLE Token
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -3538,6 +3546,15 @@ PsChargePoolQuota (
|
|||
IN ULONG Amount
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PsChargeProcessPoolQuota (
|
||||
IN PEPROCESS Process,
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG_PTR Amount
|
||||
);
|
||||
|
||||
#define PsDereferenceImpersonationToken(T) \
|
||||
{if (ARGUMENT_PRESENT(T)) { \
|
||||
(ObDereferenceObject((T))); \
|
||||
|
@ -3548,6 +3565,14 @@ PsChargePoolQuota (
|
|||
|
||||
#define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
|
||||
|
||||
NTKERNELAPI
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
PsDisableImpersonation(
|
||||
IN PETHREAD Thread,
|
||||
IN PSE_IMPERSONATION_STATE ImpersonationState
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
LARGE_INTEGER
|
||||
NTAPI
|
||||
|
@ -3555,6 +3580,17 @@ PsGetProcessExitTime (
|
|||
VOID
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PsImpersonateClient(
|
||||
IN PETHREAD Thread,
|
||||
IN PACCESS_TOKEN Token,
|
||||
IN BOOLEAN CopyOnOpen,
|
||||
IN BOOLEAN EffectiveOnly,
|
||||
IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
|
@ -3611,6 +3647,14 @@ PsReferencePrimaryToken (
|
|||
IN PEPROCESS Process
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PsRestoreImpersonation(
|
||||
IN PETHREAD Thread,
|
||||
IN PSE_IMPERSONATION_STATE ImpersonationState
|
||||
);
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
|
|
Loading…
Reference in a new issue