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