mirror of
https://github.com/reactos/reactos.git
synced 2025-05-13 22:30:21 +00:00
- More MSVC fixes:
Additions or changes to headers: FSRTL_PER_FILEOBJECT_CONTEXT, FsRtlAreNamesEqual uses CONST buffers, KiIpiGenericCall + PKPIP_BROADCAST_WORKER, MmPageEntireDriver returns PVOID, Obf(De)referenceObject return LONG_PTR, KeGetPreviousMode is ExGetPreviousMode. KeGetCurrentPrcb is reimplemented in inline, MAX_PATH exposed to drivers. - Changes: STATIC->static. static __inline ->FORCEINLINE. STDCALL -> NTAPI (Some). WORD/DWORD/BYTE -> NT Types. - Kernel bugs fixed: Some string concatenations were broken, some functions had wrong return values. svn path=/trunk/; revision=23941
This commit is contained in:
parent
17e434d5bd
commit
dd25974e25
59 changed files with 357 additions and 313 deletions
|
@ -28,6 +28,8 @@
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NTKERNELAPI
|
||||||
|
|
||||||
#include "ntddk.h"
|
#include "ntddk.h"
|
||||||
|
|
||||||
#define _NTIFS_INCLUDED_
|
#define _NTIFS_INCLUDED_
|
||||||
|
@ -43,14 +45,6 @@ extern "C" {
|
||||||
#define NTSYSAPI
|
#define NTSYSAPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NTKERNELAPI
|
|
||||||
#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined (_NTIFS_) || defined(_NTHAL_)
|
|
||||||
#define NTKERNELAPI DECLSPEC_IMPORT
|
|
||||||
#else
|
|
||||||
#define NTKERNELAPI
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "csq.h"
|
#include "csq.h"
|
||||||
|
|
||||||
typedef struct _SE_EXPORTS *PSE_EXPORTS;
|
typedef struct _SE_EXPORTS *PSE_EXPORTS;
|
||||||
|
@ -1220,6 +1214,13 @@ typedef struct _FSRTL_PER_STREAM_CONTEXT {
|
||||||
PFREE_FUNCTION FreeCallback;
|
PFREE_FUNCTION FreeCallback;
|
||||||
} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT;
|
} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT;
|
||||||
|
|
||||||
|
typedef struct _FSRTL_PER_FILEOBJECT_CONTEXT
|
||||||
|
{
|
||||||
|
LIST_ENTRY Links;
|
||||||
|
PVOID OwnerId;
|
||||||
|
PVOID InstanceId;
|
||||||
|
} FSRTL_PER_FILEOBJECT_CONTEXT, *PFSRTL_PER_FILEOBJECT_CONTEXT;
|
||||||
|
|
||||||
#endif /* (VER_PRODUCTBUILD >= 2600) */
|
#endif /* (VER_PRODUCTBUILD >= 2600) */
|
||||||
|
|
||||||
typedef struct _BASE_MCB
|
typedef struct _BASE_MCB
|
||||||
|
@ -2298,10 +2299,10 @@ NTKERNELAPI
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlAreNamesEqual (
|
FsRtlAreNamesEqual (
|
||||||
IN PUNICODE_STRING Name1,
|
IN PCUNICODE_STRING Name1,
|
||||||
IN PUNICODE_STRING Name2,
|
IN PCUNICODE_STRING Name2,
|
||||||
IN BOOLEAN IgnoreCase,
|
IN BOOLEAN IgnoreCase,
|
||||||
IN PWCHAR UpcaseTable OPTIONAL
|
IN PCWCH UpcaseTable OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
#define FsRtlAreThereCurrentFileLocks(FL) ( \
|
#define FsRtlAreThereCurrentFileLocks(FL) ( \
|
||||||
|
|
|
@ -40,11 +40,8 @@ extern "C" {
|
||||||
#define DDKCDECLAPI __cdecl
|
#define DDKCDECLAPI __cdecl
|
||||||
|
|
||||||
/* FIXME: REMOVE THIS UNCOMPATIBLE CRUFT!!! */
|
/* FIXME: REMOVE THIS UNCOMPATIBLE CRUFT!!! */
|
||||||
#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined (_NTIFS_) || defined(_NTHAL_)
|
|
||||||
#define NTKERNELAPI DECLSPEC_IMPORT
|
|
||||||
#else
|
|
||||||
#define NTKERNELAPI
|
#define NTKERNELAPI
|
||||||
#endif
|
|
||||||
#ifndef NTOSAPI
|
#ifndef NTOSAPI
|
||||||
#define NTOSAPI NTKERNELAPI
|
#define NTOSAPI NTKERNELAPI
|
||||||
#endif
|
#endif
|
||||||
|
@ -8983,6 +8980,20 @@ KeWaitForSingleObject(
|
||||||
IN BOOLEAN Alertable,
|
IN BOOLEAN Alertable,
|
||||||
IN PLARGE_INTEGER Timeout OPTIONAL);
|
IN PLARGE_INTEGER Timeout OPTIONAL);
|
||||||
|
|
||||||
|
typedef
|
||||||
|
ULONG_PTR
|
||||||
|
(*NTAPI PKIPI_BROADCAST_WORKER)(
|
||||||
|
IN ULONG_PTR Argument
|
||||||
|
);
|
||||||
|
|
||||||
|
NTKERNELAPI
|
||||||
|
ULONG_PTR
|
||||||
|
NTAPI
|
||||||
|
KeIpiGenericCall(
|
||||||
|
IN PKIPI_BROADCAST_WORKER BroadcastFunction,
|
||||||
|
IN ULONG_PTR Context
|
||||||
|
);
|
||||||
|
|
||||||
#if defined(_X86_)
|
#if defined(_X86_)
|
||||||
|
|
||||||
NTHALAPI
|
NTHALAPI
|
||||||
|
@ -9378,7 +9389,7 @@ MmMapLockedPages(
|
||||||
IN KPROCESSOR_MODE AccessMode);
|
IN KPROCESSOR_MODE AccessMode);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
VOID
|
PVOID
|
||||||
DDKAPI
|
DDKAPI
|
||||||
MmPageEntireDriver(
|
MmPageEntireDriver(
|
||||||
IN PVOID AddressWithinSection);
|
IN PVOID AddressWithinSection);
|
||||||
|
@ -9536,7 +9547,7 @@ ObDereferenceSecurityDescriptor(
|
||||||
ULONG Count);
|
ULONG Count);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
VOID
|
LONG_PTR
|
||||||
DDKFASTAPI
|
DDKFASTAPI
|
||||||
ObfDereferenceObject(
|
ObfDereferenceObject(
|
||||||
IN PVOID Object);
|
IN PVOID Object);
|
||||||
|
@ -9568,7 +9579,7 @@ ObInsertObject(
|
||||||
OUT PHANDLE Handle);
|
OUT PHANDLE Handle);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
VOID
|
LONG_PTR
|
||||||
DDKFASTAPI
|
DDKFASTAPI
|
||||||
ObfReferenceObject(
|
ObfReferenceObject(
|
||||||
IN PVOID Object);
|
IN PVOID Object);
|
||||||
|
|
|
@ -109,9 +109,18 @@ Author:
|
||||||
//
|
//
|
||||||
// Macro to get current KPRCB
|
// Macro to get current KPRCB
|
||||||
//
|
//
|
||||||
#ifndef _REACTOS_ // fixme
|
#ifndef __GNUC__ // fixme
|
||||||
#define KeGetCurrentPrcb() \
|
FORCEINLINE
|
||||||
(PKPRCB)__readfsdword(KPCR_PRCB);
|
struct _KPRCB *
|
||||||
|
KeGetCurrentPrcb(VOID)
|
||||||
|
{
|
||||||
|
return (struct _KPRCB *)(ULONG_PTR)__readfsdword(FIELD_OFFSET(KPCR, Prcb));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Macro to get current previous mode
|
||||||
|
//
|
||||||
|
#define KeGetPreviousMode ExGetPreviousMode
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -28,44 +28,44 @@ Author:
|
||||||
//
|
//
|
||||||
// Maximum Atom Length
|
// Maximum Atom Length
|
||||||
//
|
//
|
||||||
#define RTL_MAXIMUM_ATOM_LENGTH 255
|
#define RTL_MAXIMUM_ATOM_LENGTH 255
|
||||||
|
|
||||||
//
|
//
|
||||||
// Process Parameters Flags
|
// Process Parameters Flags
|
||||||
//
|
//
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED 0x01
|
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED 0x01
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER 0x02
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER 0x02
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x04
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x04
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x08
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x08
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
|
#define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
|
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS 0x100
|
#define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS 0x100
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1 0x200
|
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1 0x200
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2 0x400
|
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2 0x400
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH 0x1000
|
#define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH 0x1000
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
|
#define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
|
||||||
#define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
|
#define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
|
||||||
|
|
||||||
//
|
//
|
||||||
// Exception Flags
|
// Exception Flags
|
||||||
//
|
//
|
||||||
#define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
|
#define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
|
||||||
#define EXCEPTION_UNWINDING 0x02
|
#define EXCEPTION_UNWINDING 0x02
|
||||||
#define EXCEPTION_EXIT_UNWIND 0x04
|
#define EXCEPTION_EXIT_UNWIND 0x04
|
||||||
#define EXCEPTION_STACK_INVALID 0x08
|
#define EXCEPTION_STACK_INVALID 0x08
|
||||||
#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING + EXCEPTION_EXIT_UNWIND)
|
#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING + EXCEPTION_EXIT_UNWIND)
|
||||||
#define EXCEPTION_NESTED_CALL 0x10
|
#define EXCEPTION_NESTED_CALL 0x10
|
||||||
#define EXCEPTION_TARGET_UNWIND 0x20
|
#define EXCEPTION_TARGET_UNWIND 0x20
|
||||||
#define EXCEPTION_COLLIDED_UNWIND 0x20
|
#define EXCEPTION_COLLIDED_UNWIND 0x20
|
||||||
|
|
||||||
//
|
//
|
||||||
// Range and Range List Flags
|
// Range and Range List Flags
|
||||||
//
|
//
|
||||||
#define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
|
#define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
|
||||||
#define RTL_RANGE_LIST_ADD_SHARED 0x00000002
|
#define RTL_RANGE_LIST_ADD_SHARED 0x00000002
|
||||||
|
|
||||||
#define RTL_RANGE_SHARED 0x01
|
#define RTL_RANGE_SHARED 0x01
|
||||||
#define RTL_RANGE_CONFLICT 0x02
|
#define RTL_RANGE_CONFLICT 0x02
|
||||||
|
|
||||||
//
|
//
|
||||||
// Activation Context Frame Flags
|
// Activation Context Frame Flags
|
||||||
|
@ -145,53 +145,58 @@ C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
|
||||||
//
|
//
|
||||||
// Registry Keys
|
// Registry Keys
|
||||||
//
|
//
|
||||||
#define RTL_REGISTRY_ABSOLUTE 0
|
#define RTL_REGISTRY_ABSOLUTE 0
|
||||||
#define RTL_REGISTRY_SERVICES 1
|
#define RTL_REGISTRY_SERVICES 1
|
||||||
#define RTL_REGISTRY_CONTROL 2
|
#define RTL_REGISTRY_CONTROL 2
|
||||||
#define RTL_REGISTRY_WINDOWS_NT 3
|
#define RTL_REGISTRY_WINDOWS_NT 3
|
||||||
#define RTL_REGISTRY_DEVICEMAP 4
|
#define RTL_REGISTRY_DEVICEMAP 4
|
||||||
#define RTL_REGISTRY_USER 5
|
#define RTL_REGISTRY_USER 5
|
||||||
#define RTL_REGISTRY_MAXIMUM 6
|
#define RTL_REGISTRY_MAXIMUM 6
|
||||||
#define RTL_REGISTRY_HANDLE 0x40000000
|
#define RTL_REGISTRY_HANDLE 0x40000000
|
||||||
#define RTL_REGISTRY_OPTIONAL 0x80000000
|
#define RTL_REGISTRY_OPTIONAL 0x80000000
|
||||||
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
|
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
|
||||||
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
|
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
|
||||||
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
|
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
|
||||||
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
|
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
|
||||||
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
|
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
|
||||||
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020
|
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020
|
||||||
#define RTL_QUERY_REGISTRY_DELETE 0x00000040
|
#define RTL_QUERY_REGISTRY_DELETE 0x00000040
|
||||||
|
|
||||||
//
|
//
|
||||||
// Versioning
|
// Versioning
|
||||||
//
|
//
|
||||||
#define VER_MINORVERSION 0x0000001
|
#define VER_MINORVERSION 0x0000001
|
||||||
#define VER_MAJORVERSION 0x0000002
|
#define VER_MAJORVERSION 0x0000002
|
||||||
#define VER_BUILDNUMBER 0x0000004
|
#define VER_BUILDNUMBER 0x0000004
|
||||||
#define VER_PLATFORMID 0x0000008
|
#define VER_PLATFORMID 0x0000008
|
||||||
#define VER_SERVICEPACKMINOR 0x0000010
|
#define VER_SERVICEPACKMINOR 0x0000010
|
||||||
#define VER_SERVICEPACKMAJOR 0x0000020
|
#define VER_SERVICEPACKMAJOR 0x0000020
|
||||||
#define VER_SUITENAME 0x0000040
|
#define VER_SUITENAME 0x0000040
|
||||||
#define VER_PRODUCT_TYPE 0x0000080
|
#define VER_PRODUCT_TYPE 0x0000080
|
||||||
#define VER_PLATFORM_WIN32s 0
|
#define VER_PLATFORM_WIN32s 0
|
||||||
#define VER_PLATFORM_WIN32_WINDOWS 1
|
#define VER_PLATFORM_WIN32_WINDOWS 1
|
||||||
#define VER_PLATFORM_WIN32_NT 2
|
#define VER_PLATFORM_WIN32_NT 2
|
||||||
#define VER_EQUAL 1
|
#define VER_EQUAL 1
|
||||||
#define VER_GREATER 2
|
#define VER_GREATER 2
|
||||||
#define VER_GREATER_EQUAL 3
|
#define VER_GREATER_EQUAL 3
|
||||||
#define VER_LESS 4
|
#define VER_LESS 4
|
||||||
#define VER_LESS_EQUAL 5
|
#define VER_LESS_EQUAL 5
|
||||||
#define VER_AND 6
|
#define VER_AND 6
|
||||||
#define VER_OR 7
|
#define VER_OR 7
|
||||||
#define VER_CONDITION_MASK 7
|
#define VER_CONDITION_MASK 7
|
||||||
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
||||||
|
|
||||||
//
|
//
|
||||||
// Timezone IDs
|
// Timezone IDs
|
||||||
//
|
//
|
||||||
#define TIME_ZONE_ID_UNKNOWN 0
|
#define TIME_ZONE_ID_UNKNOWN 0
|
||||||
#define TIME_ZONE_ID_STANDARD 1
|
#define TIME_ZONE_ID_STANDARD 1
|
||||||
#define TIME_ZONE_ID_DAYLIGHT 2
|
#define TIME_ZONE_ID_DAYLIGHT 2
|
||||||
|
|
||||||
|
//
|
||||||
|
// Maximum Path Length
|
||||||
|
//
|
||||||
|
#define MAX_PATH 260
|
||||||
|
|
||||||
//
|
//
|
||||||
// RTL Lock Type (Critical Section or Resource)
|
// RTL Lock Type (Critical Section or Resource)
|
||||||
|
|
|
@ -1,47 +1,47 @@
|
||||||
#ifndef __REACTOS_LDR_H
|
#ifndef __REACTOS_LDR_H
|
||||||
#define __REACTOS_LDR_H
|
#define __REACTOS_LDR_H
|
||||||
|
|
||||||
#define MB_FLAGS_MEM_INFO (0x1)
|
#define MB_FLAGS_MEM_INFO (0x1)
|
||||||
#define MB_FLAGS_BOOT_DEVICE (0x2)
|
#define MB_FLAGS_BOOT_DEVICE (0x2)
|
||||||
#define MB_FLAGS_COMMAND_LINE (0x4)
|
#define MB_FLAGS_COMMAND_LINE (0x4)
|
||||||
#define MB_FLAGS_MODULE_INFO (0x8)
|
#define MB_FLAGS_MODULE_INFO (0x8)
|
||||||
#define MB_FLAGS_AOUT_SYMS (0x10)
|
#define MB_FLAGS_AOUT_SYMS (0x10)
|
||||||
#define MB_FLAGS_ELF_SYMS (0x20)
|
#define MB_FLAGS_ELF_SYMS (0x20)
|
||||||
#define MB_FLAGS_MMAP_INFO (0x40)
|
#define MB_FLAGS_MMAP_INFO (0x40)
|
||||||
#define MB_FLAGS_DRIVES_INFO (0x80)
|
#define MB_FLAGS_DRIVES_INFO (0x80)
|
||||||
#define MB_FLAGS_CONFIG_TABLE (0x100)
|
#define MB_FLAGS_CONFIG_TABLE (0x100)
|
||||||
#define MB_FLAGS_BOOT_LOADER_NAME (0x200)
|
#define MB_FLAGS_BOOT_LOADER_NAME (0x200)
|
||||||
#define MB_FLAGS_APM_TABLE (0x400)
|
#define MB_FLAGS_APM_TABLE (0x400)
|
||||||
#define MB_FLAGS_GRAPHICS_TABLE (0x800)
|
#define MB_FLAGS_GRAPHICS_TABLE (0x800)
|
||||||
#define MB_FLAGS_ACPI_TABLE (0x1000)
|
#define MB_FLAGS_ACPI_TABLE (0x1000)
|
||||||
|
|
||||||
typedef struct _LOADER_MODULE
|
typedef struct _LOADER_MODULE
|
||||||
{
|
{
|
||||||
ULONG ModStart;
|
ULONG ModStart;
|
||||||
ULONG ModEnd;
|
ULONG ModEnd;
|
||||||
ULONG String;
|
ULONG String;
|
||||||
ULONG Reserved;
|
ULONG Reserved;
|
||||||
} LOADER_MODULE, *PLOADER_MODULE;
|
} LOADER_MODULE, *PLOADER_MODULE;
|
||||||
|
|
||||||
typedef struct _ROS_LOADER_PARAMETER_BLOCK
|
typedef struct _ROS_LOADER_PARAMETER_BLOCK
|
||||||
{
|
{
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
ULONG MemLower;
|
ULONG MemLower;
|
||||||
ULONG MemHigher;
|
ULONG MemHigher;
|
||||||
ULONG BootDevice;
|
ULONG BootDevice;
|
||||||
ULONG CommandLine;
|
ULONG CommandLine;
|
||||||
ULONG ModsCount;
|
ULONG ModsCount;
|
||||||
ULONG ModsAddr;
|
ULONG ModsAddr;
|
||||||
UCHAR Syms[12];
|
UCHAR Syms[12];
|
||||||
ULONG MmapLength;
|
ULONG MmapLength;
|
||||||
ULONG MmapAddr;
|
ULONG MmapAddr;
|
||||||
ULONG DrivesCount;
|
ULONG DrivesCount;
|
||||||
ULONG DrivesAddr;
|
ULONG DrivesAddr;
|
||||||
ULONG ConfigTable;
|
ULONG ConfigTable;
|
||||||
ULONG BootLoaderName;
|
ULONG BootLoaderName;
|
||||||
ULONG PageDirectoryStart;
|
ULONG PageDirectoryStart;
|
||||||
ULONG PageDirectoryEnd;
|
ULONG PageDirectoryEnd;
|
||||||
ULONG KernelBase;
|
ULONG KernelBase;
|
||||||
} ROS_LOADER_PARAMETER_BLOCK, *PROS_LOADER_PARAMETER_BLOCK;
|
} ROS_LOADER_PARAMETER_BLOCK, *PROS_LOADER_PARAMETER_BLOCK;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -556,7 +556,7 @@ CcRosUnmapCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty)
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STATIC
|
NTSTATUS static
|
||||||
CcRosCreateCacheSegment(PBCB Bcb,
|
CcRosCreateCacheSegment(PBCB Bcb,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PCACHE_SEGMENT* CacheSeg)
|
PCACHE_SEGMENT* CacheSeg)
|
||||||
|
@ -863,7 +863,7 @@ CcRosRequestCacheSegment(PBCB Bcb,
|
||||||
}
|
}
|
||||||
#ifdef CACHE_BITMAP
|
#ifdef CACHE_BITMAP
|
||||||
#else
|
#else
|
||||||
STATIC VOID
|
static VOID
|
||||||
CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
|
PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
|
||||||
{
|
{
|
||||||
|
|
|
@ -803,7 +803,7 @@ NTSTATUS
|
||||||
CmiRemoveKeyFromList(PKEY_OBJECT KeyToRemove)
|
CmiRemoveKeyFromList(PKEY_OBJECT KeyToRemove)
|
||||||
{
|
{
|
||||||
PKEY_OBJECT ParentKey;
|
PKEY_OBJECT ParentKey;
|
||||||
DWORD Index;
|
ULONG Index;
|
||||||
|
|
||||||
ParentKey = KeyToRemove->ParentKey;
|
ParentKey = KeyToRemove->ParentKey;
|
||||||
/* FIXME: If list maintained in alphabetic order, use dichotomic search */
|
/* FIXME: If list maintained in alphabetic order, use dichotomic search */
|
||||||
|
|
|
@ -177,7 +177,7 @@ KeInitInterrupts (VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID
|
static VOID
|
||||||
KeIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
|
KeIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
|
||||||
PKTRAP_FRAME TrapFrame)
|
PKTRAP_FRAME TrapFrame)
|
||||||
{
|
{
|
||||||
|
@ -198,7 +198,7 @@ KeIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
|
||||||
TrapFrame->EFlags = IrqTrapFrame->Eflags;
|
TrapFrame->EFlags = IrqTrapFrame->Eflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID
|
static VOID
|
||||||
KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame,
|
KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame,
|
||||||
PKIRQ_TRAPFRAME IrqTrapFrame)
|
PKIRQ_TRAPFRAME IrqTrapFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,7 +142,7 @@ ExSystemExceptionFilter(VOID)
|
||||||
* Optional string parameter (can be only one per error code)
|
* Optional string parameter (can be only one per error code)
|
||||||
*
|
*
|
||||||
* @param Parameters
|
* @param Parameters
|
||||||
* Array of DWORD parameters for use in error message string
|
* Array of ULONG parameters for use in error message string
|
||||||
*
|
*
|
||||||
* @param ValidResponseOptions
|
* @param ValidResponseOptions
|
||||||
* See HARDERROR_RESPONSE_OPTION for possible values description
|
* See HARDERROR_RESPONSE_OPTION for possible values description
|
||||||
|
@ -193,7 +193,7 @@ ExRaiseHardError(IN NTSTATUS ErrorStatus,
|
||||||
* Optional string parameter (can be only one per error code)
|
* Optional string parameter (can be only one per error code)
|
||||||
*
|
*
|
||||||
* @param Parameters
|
* @param Parameters
|
||||||
* Array of DWORD parameters for use in error message string
|
* Array of ULONG parameters for use in error message string
|
||||||
*
|
*
|
||||||
* @param ValidResponseOptions
|
* @param ValidResponseOptions
|
||||||
* See HARDERROR_RESPONSE_OPTION for possible values description
|
* See HARDERROR_RESPONSE_OPTION for possible values description
|
||||||
|
|
|
@ -229,7 +229,7 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
|
||||||
/* Initialize the system registry location */
|
/* Initialize the system registry location */
|
||||||
RtlInitUnicodeString(&KeyName,
|
RtlInitUnicodeString(&KeyName,
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet"
|
L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
"\\Control\\Nls\\Language");
|
L"\\Control\\Nls\\Language");
|
||||||
RtlInitUnicodeString(&ValueName, L"Default");
|
RtlInitUnicodeString(&ValueName, L"Default");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ FsRtlRemovePerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
|
||||||
*/
|
*/
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlInsertPerFileObjectContext(IN PFSRTL_ADVANCED_FCB_HEADER PerFileObjectContext,
|
FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||||
IN PVOID /* PFSRTL_PER_FILE_OBJECT_CONTEXT*/ Ptr)
|
IN PFSRTL_PER_FILEOBJECT_CONTEXT Ptr)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -60,7 +60,7 @@ FsRtlInsertPerFileObjectContext(IN PFSRTL_ADVANCED_FCB_HEADER PerFileObjectConte
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
PVOID /* PFSRTL_PER_FILE_OBJECT_CONTEXT*/
|
PFSRTL_PER_FILEOBJECT_CONTEXT
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlRemovePerFileObjectContext(IN PFSRTL_ADVANCED_FCB_HEADER PerFileObjectContext,
|
FsRtlRemovePerFileObjectContext(IN PFSRTL_ADVANCED_FCB_HEADER PerFileObjectContext,
|
||||||
IN PVOID OwnerId OPTIONAL,
|
IN PVOID OwnerId OPTIONAL,
|
||||||
|
|
|
@ -353,7 +353,7 @@ FsRtlpFastUnlockAllByKey(
|
||||||
IN PFILE_LOCK FileLock,
|
IN PFILE_LOCK FileLock,
|
||||||
IN PFILE_OBJECT FileObject,
|
IN PFILE_OBJECT FileObject,
|
||||||
IN PEPROCESS Process,
|
IN PEPROCESS Process,
|
||||||
IN DWORD Key,
|
IN ULONG Key,
|
||||||
IN BOOLEAN UseKey,
|
IN BOOLEAN UseKey,
|
||||||
IN PVOID Context OPTIONAL
|
IN PVOID Context OPTIONAL
|
||||||
)
|
)
|
||||||
|
|
|
@ -179,10 +179,10 @@ PUCHAR FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
|
||||||
*--*/
|
*--*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlAreNamesEqual(IN PUNICODE_STRING Name1,
|
FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1,
|
||||||
IN PUNICODE_STRING Name2,
|
IN PCUNICODE_STRING Name2,
|
||||||
IN BOOLEAN IgnoreCase,
|
IN BOOLEAN IgnoreCase,
|
||||||
IN PWCHAR UpcaseTable OPTIONAL)
|
IN PCWCH UpcaseTable OPTIONAL)
|
||||||
{
|
{
|
||||||
UNICODE_STRING UpcaseName1;
|
UNICODE_STRING UpcaseName1;
|
||||||
UNICODE_STRING UpcaseName2;
|
UNICODE_STRING UpcaseName2;
|
||||||
|
|
|
@ -107,6 +107,7 @@ FsRtlAllocatePoolWithQuota(IN POOL_TYPE PoolType,
|
||||||
* @remarks None
|
* @remarks None
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
|
#undef FsRtlAllocatePoolWithQuotaTag
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType,
|
FsRtlAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType,
|
||||||
|
@ -147,6 +148,7 @@ FsRtlAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType,
|
||||||
* @remarks None
|
* @remarks None
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
|
#undef FsRtlAllocatePoolWithTag
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType,
|
FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType,
|
||||||
|
|
|
@ -117,7 +117,7 @@ FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
|
||||||
* @remarks None.
|
* @remarks None.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
BOOLEAN
|
LOGICAL
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlIsPagingFile(IN PFILE_OBJECT FileObject)
|
FsRtlIsPagingFile(IN PFILE_OBJECT FileObject)
|
||||||
{
|
{
|
||||||
|
@ -293,9 +293,9 @@ FsRtlPostStackOverflow(IN PVOID Context,
|
||||||
*--*/
|
*--*/
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlSyncVolumes(DWORD Unknown0,
|
FsRtlSyncVolumes(ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2)
|
ULONG Unknown2)
|
||||||
{
|
{
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,13 @@ HalReleaseDisplayOwnership(VOID);
|
||||||
/* DATA **********************************************************************/
|
/* DATA **********************************************************************/
|
||||||
|
|
||||||
static HANDLE BootVidDevice = NULL;
|
static HANDLE BootVidDevice = NULL;
|
||||||
static BOOL BootVidDriverInstalled = FALSE;
|
static BOOLEAN BootVidDriverInstalled = FALSE;
|
||||||
static NTBOOTVID_FUNCTION_TABLE BootVidFunctionTable;
|
static NTBOOTVID_FUNCTION_TABLE BootVidFunctionTable;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STATIC
|
static
|
||||||
InbvCheckBootVid(VOID)
|
InbvCheckBootVid(VOID)
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
|
|
@ -198,7 +198,7 @@ CcTryToInitializeFileCache(PFILE_OBJECT FileObject);
|
||||||
*/
|
*/
|
||||||
#define KEBUGCHECKCC \
|
#define KEBUGCHECKCC \
|
||||||
KEBUGCHECKEX(CACHE_MANAGER, \
|
KEBUGCHECKEX(CACHE_MANAGER, \
|
||||||
(*(DWORD*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \
|
(*(ULONG*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \
|
||||||
(__LINE__ & 0xFFFF), 0, 0, 0)
|
(__LINE__ & 0xFFFF), 0, 0, 0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -105,8 +105,13 @@
|
||||||
|
|
||||||
#else /* DBG */
|
#else /* DBG */
|
||||||
|
|
||||||
|
#ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
|
||||||
#define CPRINT(args...)
|
#define CPRINT(args...)
|
||||||
#define DPRINT1(args...)
|
#define DPRINT1(args...)
|
||||||
|
#else
|
||||||
|
#define CPRINT
|
||||||
|
#define DPRINT1
|
||||||
|
#endif
|
||||||
#ifndef __USE_W32API
|
#ifndef __USE_W32API
|
||||||
#define assert(x)
|
#define assert(x)
|
||||||
#define ASSERT(x)
|
#define ASSERT(x)
|
||||||
|
|
|
@ -29,6 +29,12 @@ extern POBJECT_TYPE ExEventPairObjectType;
|
||||||
#define ExReleaseResourceLock(l, i) KeReleaseSpinLock(l, i);
|
#define ExReleaseResourceLock(l, i) KeReleaseSpinLock(l, i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ExAcquireRundownProtection _ExAcquireRundownProtection
|
||||||
|
#define ExReleaseRundownProtection _ExReleaseRundownProtection
|
||||||
|
#define ExInitializeRundownProtection _ExInitializeRundownProtection
|
||||||
|
#define ExWaitForRundownProtectionRelease _ExWaitForRundownProtectionRelease
|
||||||
|
#define ExRundownCompleted _ExRundownCompleted
|
||||||
|
|
||||||
/* INITIALIZATION FUNCTIONS *************************************************/
|
/* INITIALIZATION FUNCTIONS *************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -290,7 +296,7 @@ static __inline _SEH_FILTER(_SEH_ExSystemExceptionFilter)
|
||||||
*--*/
|
*--*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
_ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
{
|
{
|
||||||
ULONG_PTR Value, NewValue, OldValue;
|
ULONG_PTR Value, NewValue, OldValue;
|
||||||
|
|
||||||
|
@ -331,7 +337,7 @@ ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
*--*/
|
*--*/
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
_ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
{
|
{
|
||||||
ULONG_PTR Value, NewValue, OldValue;
|
ULONG_PTR Value, NewValue, OldValue;
|
||||||
|
|
||||||
|
@ -374,7 +380,7 @@ ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
*--*/
|
*--*/
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
_ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
{
|
{
|
||||||
/* Set the count to zero */
|
/* Set the count to zero */
|
||||||
RunRef->Count = 0;
|
RunRef->Count = 0;
|
||||||
|
@ -398,7 +404,7 @@ ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef)
|
||||||
*--*/
|
*--*/
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef)
|
_ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef)
|
||||||
{
|
{
|
||||||
ULONG_PTR Value;
|
ULONG_PTR Value;
|
||||||
|
|
||||||
|
@ -428,7 +434,7 @@ ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef)
|
||||||
*--*/
|
*--*/
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
ExRundownCompleted(IN PEX_RUNDOWN_REF RunRef)
|
_ExRundownCompleted(IN PEX_RUNDOWN_REF RunRef)
|
||||||
{
|
{
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
ASSERT((RunRef->Count & EX_RUNDOWN_ACTIVE) != 0);
|
ASSERT((RunRef->Count & EX_RUNDOWN_ACTIVE) != 0);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "i386/v86m.h"
|
#include "i386/v86m.h"
|
||||||
#include "ob.h"
|
#include "ob.h"
|
||||||
#include "mm.h"
|
#include "mm.h"
|
||||||
#include "ex.h"
|
#include "ex2.h"
|
||||||
#include "ps.h"
|
#include "ps.h"
|
||||||
#include "cc.h"
|
#include "cc.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@ PMmProbeAndLockPages(
|
||||||
LOCK_OPERATION Operation
|
LOCK_OPERATION Operation
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef VOID
|
typedef LONG_PTR
|
||||||
FASTCALL
|
FASTCALL
|
||||||
PObDereferenceObject(PVOID Object);
|
PObDereferenceObject(PVOID Object);
|
||||||
|
|
||||||
|
|
|
@ -9,17 +9,13 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
/* We are the Kernel */
|
/* We are the Kernel */
|
||||||
#define NTKERNELAPI
|
|
||||||
#define _NTSYSTEM_
|
#define _NTSYSTEM_
|
||||||
|
|
||||||
/* DDK/IFS/NDK Headers */
|
/* DDK/IFS/NDK Headers */
|
||||||
#ifdef __GNUC__
|
|
||||||
#include <ntddk.h>
|
|
||||||
#endif
|
|
||||||
#include <ntifs.h>
|
#include <ntifs.h>
|
||||||
#include <wdmguid.h>
|
#include <wdmguid.h>
|
||||||
#include <arc/arc.h>
|
#include <arc/arc.h>
|
||||||
#include <ndk/ntndk.h>
|
#include <ntndk.h>
|
||||||
#undef TEXT
|
#undef TEXT
|
||||||
#define TEXT(s) L##s
|
#define TEXT(s) L##s
|
||||||
#include <regstr.h>
|
#include <regstr.h>
|
||||||
|
|
|
@ -53,7 +53,7 @@ IopCheckCdromDevices(PULONG DeviceNumber);
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
STATIC
|
static
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
|
@ -94,7 +94,7 @@ DiskQueryRoutine(PWSTR ValueName,
|
||||||
|
|
||||||
#define ROOT_NAME L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter"
|
#define ROOT_NAME L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter"
|
||||||
|
|
||||||
STATIC VOID INIT_FUNCTION
|
static VOID INIT_FUNCTION
|
||||||
IopEnumerateBiosDisks(PLIST_ENTRY ListHead)
|
IopEnumerateBiosDisks(PLIST_ENTRY ListHead)
|
||||||
{
|
{
|
||||||
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
|
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
|
||||||
|
@ -178,7 +178,7 @@ IopEnumerateBiosDisks(PLIST_ENTRY ListHead)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID INIT_FUNCTION
|
static VOID INIT_FUNCTION
|
||||||
IopEnumerateDisks(PLIST_ENTRY ListHead)
|
IopEnumerateDisks(PLIST_ENTRY ListHead)
|
||||||
{
|
{
|
||||||
ULONG i, k;
|
ULONG i, k;
|
||||||
|
@ -321,7 +321,7 @@ IopEnumerateDisks(PLIST_ENTRY ListHead)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC NTSTATUS INIT_FUNCTION
|
static NTSTATUS INIT_FUNCTION
|
||||||
IopAssignArcNamesToDisk(PDEVICE_OBJECT DeviceObject, ULONG RDisk, ULONG DiskNumber)
|
IopAssignArcNamesToDisk(PDEVICE_OBJECT DeviceObject, ULONG RDisk, ULONG DiskNumber)
|
||||||
{
|
{
|
||||||
WCHAR DeviceNameBuffer[80];
|
WCHAR DeviceNameBuffer[80];
|
||||||
|
|
|
@ -1376,15 +1376,15 @@ IoStartNextPacketByKey(IN PDEVICE_OBJECT DeviceObject,
|
||||||
if (DeviceExtension->StartIoFlags & DOE_SIO_DEFERRED)
|
if (DeviceExtension->StartIoFlags & DOE_SIO_DEFERRED)
|
||||||
{
|
{
|
||||||
/* Call our internal function to handle the defered case */
|
/* Call our internal function to handle the defered case */
|
||||||
return IopStartNextPacketByKeyEx(DeviceObject,
|
IopStartNextPacketByKeyEx(DeviceObject,
|
||||||
Key,
|
Key,
|
||||||
DOE_SIO_WITH_KEY |
|
DOE_SIO_WITH_KEY |
|
||||||
(Cancelable) ? DOE_SIO_CANCELABLE : 0);
|
(Cancelable) ? DOE_SIO_CANCELABLE : 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Call the normal routine */
|
/* Call the normal routine */
|
||||||
return IopStartNextPacketByKey(DeviceObject, Cancelable, Key);
|
IopStartNextPacketByKey(DeviceObject, Cancelable, Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1405,15 +1405,15 @@ IoStartNextPacket(IN PDEVICE_OBJECT DeviceObject,
|
||||||
if (DeviceExtension->StartIoFlags & DOE_SIO_DEFERRED)
|
if (DeviceExtension->StartIoFlags & DOE_SIO_DEFERRED)
|
||||||
{
|
{
|
||||||
/* Call our internal function to handle the defered case */
|
/* Call our internal function to handle the defered case */
|
||||||
return IopStartNextPacketByKeyEx(DeviceObject,
|
IopStartNextPacketByKeyEx(DeviceObject,
|
||||||
0,
|
0,
|
||||||
DOE_SIO_NO_KEY |
|
DOE_SIO_NO_KEY |
|
||||||
(Cancelable) ? DOE_SIO_CANCELABLE : 0);
|
(Cancelable) ? DOE_SIO_CANCELABLE : 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Call the normal routine */
|
/* Call the normal routine */
|
||||||
return IopStartNextPacket(DeviceObject, Cancelable);
|
IopStartNextPacket(DeviceObject, Cancelable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,22 +67,22 @@ IopGetGroupOrderList(PWSTR ValueName,
|
||||||
|
|
||||||
if (ValueType == REG_BINARY &&
|
if (ValueType == REG_BINARY &&
|
||||||
ValueData != NULL &&
|
ValueData != NULL &&
|
||||||
ValueLength >= sizeof(DWORD) &&
|
ValueLength >= sizeof(ULONG) &&
|
||||||
ValueLength >= (*(PULONG)ValueData + 1) * sizeof(DWORD))
|
ValueLength >= (*(PULONG)ValueData + 1) * sizeof(ULONG))
|
||||||
{
|
{
|
||||||
Group = (PSERVICE_GROUP)Context;
|
Group = (PSERVICE_GROUP)Context;
|
||||||
Group->TagCount = ((PULONG)ValueData)[0];
|
Group->TagCount = ((PULONG)ValueData)[0];
|
||||||
if (Group->TagCount > 0)
|
if (Group->TagCount > 0)
|
||||||
{
|
{
|
||||||
if (ValueLength >= (Group->TagCount + 1) * sizeof(DWORD))
|
if (ValueLength >= (Group->TagCount + 1) * sizeof(ULONG))
|
||||||
{
|
{
|
||||||
Group->TagArray = ExAllocatePool(NonPagedPool, Group->TagCount * sizeof(DWORD));
|
Group->TagArray = ExAllocatePool(NonPagedPool, Group->TagCount * sizeof(ULONG));
|
||||||
if (Group->TagArray == NULL)
|
if (Group->TagArray == NULL)
|
||||||
{
|
{
|
||||||
Group->TagCount = 0;
|
Group->TagCount = 0;
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
memcpy(Group->TagArray, (PULONG)ValueData + 1, Group->TagCount * sizeof(DWORD));
|
memcpy(Group->TagArray, (PULONG)ValueData + 1, Group->TagCount * sizeof(ULONG));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ IopQueueTargetDeviceEvent(const GUID *Guid,
|
||||||
PUNICODE_STRING DeviceIds)
|
PUNICODE_STRING DeviceIds)
|
||||||
{
|
{
|
||||||
PPNP_EVENT_ENTRY EventEntry;
|
PPNP_EVENT_ENTRY EventEntry;
|
||||||
DWORD TotalSize;
|
ULONG TotalSize;
|
||||||
|
|
||||||
TotalSize =
|
TotalSize =
|
||||||
FIELD_OFFSET(PLUGPLAY_EVENT_BLOCK, TargetDevice.DeviceIds) +
|
FIELD_OFFSET(PLUGPLAY_EVENT_BLOCK, TargetDevice.DeviceIds) +
|
||||||
|
|
|
@ -2307,7 +2307,7 @@ IopInvalidateDeviceRelations(IN PDEVICE_NODE DeviceNode,
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
PDEVICE_NODE ChildDeviceNode;
|
PDEVICE_NODE ChildDeviceNode;
|
||||||
IO_STACK_LOCATION Stack;
|
IO_STACK_LOCATION Stack;
|
||||||
BOOL BootDrivers;
|
BOOLEAN BootDrivers;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING LinkName;
|
UNICODE_STRING LinkName;
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
|
|
|
@ -49,7 +49,7 @@ STDCALL
|
||||||
KdpBochsInit(PKD_DISPATCH_TABLE DispatchTable,
|
KdpBochsInit(PKD_DISPATCH_TABLE DispatchTable,
|
||||||
ULONG BootPhase)
|
ULONG BootPhase)
|
||||||
{
|
{
|
||||||
BYTE Value;
|
UCHAR Value;
|
||||||
if (!KdpDebugMode.Bochs) return;
|
if (!KdpDebugMode.Bochs) return;
|
||||||
|
|
||||||
if (BootPhase == 0)
|
if (BootPhase == 0)
|
||||||
|
|
|
@ -120,9 +120,9 @@ enum REGISTER_NAMES
|
||||||
|
|
||||||
typedef struct _CPU_REGISTER
|
typedef struct _CPU_REGISTER
|
||||||
{
|
{
|
||||||
DWORD Size;
|
ULONG Size;
|
||||||
DWORD OffsetInTF;
|
ULONG OffsetInTF;
|
||||||
DWORD OffsetInContext;
|
ULONG OffsetInContext;
|
||||||
BOOLEAN SetInContext;
|
BOOLEAN SetInContext;
|
||||||
} CPU_REGISTER, *PCPU_REGISTER;
|
} CPU_REGISTER, *PCPU_REGISTER;
|
||||||
|
|
||||||
|
@ -573,7 +573,7 @@ GspGetRegisters(PCHAR Address,
|
||||||
{
|
{
|
||||||
ULONG_PTR Value;
|
ULONG_PTR Value;
|
||||||
PULONG p;
|
PULONG p;
|
||||||
DWORD i;
|
ULONG i;
|
||||||
PETHREAD Thread;
|
PETHREAD Thread;
|
||||||
ULONG_PTR *KernelStack;
|
ULONG_PTR *KernelStack;
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ GspSetRegistersInTrapFrame(PCHAR Address,
|
||||||
ULONG Value;
|
ULONG Value;
|
||||||
PCHAR Buffer;
|
PCHAR Buffer;
|
||||||
PULONG p;
|
PULONG p;
|
||||||
DWORD i;
|
ULONG i;
|
||||||
|
|
||||||
if (!TrapFrame)
|
if (!TrapFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -147,6 +147,7 @@ KeQueryTimeIncrement(VOID)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
#undef KeQueryTickCount
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
KeQueryTickCount(PLARGE_INTEGER TickCount)
|
KeQueryTickCount(PLARGE_INTEGER TickCount)
|
||||||
|
|
|
@ -81,7 +81,7 @@ KeSetGdtSelector(ULONG Entry,
|
||||||
KeReleaseSpinLock(&GdtLock, oldIrql);
|
KeReleaseSpinLock(&GdtLock, oldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
BOOLEAN PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
||||||
{
|
{
|
||||||
ULONG Base, SegLimit;
|
ULONG Base, SegLimit;
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -117,7 +117,7 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
KiIpiSendPacket(KAFFINITY TargetSet, VOID (STDCALL*WorkerRoutine)(PVOID), PVOID Argument, ULONG Count, BOOLEAN Synchronize)
|
KiIpiSendPacket(KAFFINITY TargetSet, PKIPI_BROADCAST_WORKER WorkerRoutine, ULONG_PTR Argument, ULONG Count, BOOLEAN Synchronize)
|
||||||
{
|
{
|
||||||
KAFFINITY Processor;
|
KAFFINITY Processor;
|
||||||
LONG i;
|
LONG i;
|
||||||
|
@ -155,9 +155,9 @@ KiIpiSendPacket(KAFFINITY TargetSet, VOID (STDCALL*WorkerRoutine)(PVOID), PVOID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
ULONG_PTR
|
||||||
NTAPI
|
NTAPI
|
||||||
KeIpiGenericCall(VOID (STDCALL *Function)(PVOID), PVOID Argument)
|
KeIpiGenericCall(PKIPI_BROADCAST_WORKER Function, ULONG_PTR Argument)
|
||||||
{
|
{
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
KAFFINITY TargetSet;
|
KAFFINITY TargetSet;
|
||||||
|
@ -177,6 +177,7 @@ KeIpiGenericCall(VOID (STDCALL *Function)(PVOID), PVOID Argument)
|
||||||
KeLowerIrql(oldIrql);
|
KeLowerIrql(oldIrql);
|
||||||
|
|
||||||
DPRINT("KeIpiGenericCall on CPU%d done\n", KeGetCurrentProcessorNumber());
|
DPRINT("KeIpiGenericCall on CPU%d done\n", KeGetCurrentProcessorNumber());
|
||||||
|
return 0; // FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ KeFindNextRightSetAffinity(IN UCHAR Number,
|
||||||
return (UCHAR)Result;
|
return (UCHAR)Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
static
|
||||||
VOID
|
VOID
|
||||||
KiRequestReschedule(CCHAR Processor)
|
KiRequestReschedule(CCHAR Processor)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ KiRequestReschedule(CCHAR Processor)
|
||||||
KiIpiSendRequest(1 << Processor, IPI_DPC);
|
KiIpiSendRequest(1 << Processor, IPI_DPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
static
|
||||||
VOID
|
VOID
|
||||||
KiInsertIntoThreadList(KPRIORITY Priority,
|
KiInsertIntoThreadList(KPRIORITY Priority,
|
||||||
PKTHREAD Thread)
|
PKTHREAD Thread)
|
||||||
|
@ -84,7 +84,7 @@ KiInsertIntoThreadList(KPRIORITY Priority,
|
||||||
PriorityListMask |= (1 << Priority);
|
PriorityListMask |= (1 << Priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
static
|
||||||
VOID
|
VOID
|
||||||
KiRemoveFromThreadList(PKTHREAD Thread)
|
KiRemoveFromThreadList(PKTHREAD Thread)
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ KiRemoveFromThreadList(PKTHREAD Thread)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
static
|
||||||
PKTHREAD
|
PKTHREAD
|
||||||
KiScanThreadList(KPRIORITY Priority,
|
KiScanThreadList(KPRIORITY Priority,
|
||||||
KAFFINITY Affinity)
|
KAFFINITY Affinity)
|
||||||
|
|
|
@ -79,7 +79,7 @@ static PVOID
|
||||||
LdrPEGetExportByName (
|
LdrPEGetExportByName (
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
PUCHAR SymbolName,
|
PUCHAR SymbolName,
|
||||||
WORD Hint );
|
USHORT Hint );
|
||||||
|
|
||||||
static PVOID
|
static PVOID
|
||||||
LdrPEFixupForward ( PCHAR ForwardName );
|
LdrPEFixupForward ( PCHAR ForwardName );
|
||||||
|
@ -682,7 +682,7 @@ LdrPEProcessModule(
|
||||||
PLDR_DATA_TABLE_ENTRY *ModuleObject )
|
PLDR_DATA_TABLE_ENTRY *ModuleObject )
|
||||||
{
|
{
|
||||||
unsigned int DriverSize, Idx;
|
unsigned int DriverSize, Idx;
|
||||||
DWORD CurrentSize;
|
ULONG CurrentSize;
|
||||||
PVOID DriverBase;
|
PVOID DriverBase;
|
||||||
PIMAGE_DOS_HEADER PEDosHeader;
|
PIMAGE_DOS_HEADER PEDosHeader;
|
||||||
PIMAGE_NT_HEADERS PENtHeaders;
|
PIMAGE_NT_HEADERS PENtHeaders;
|
||||||
|
@ -1279,11 +1279,11 @@ static PVOID
|
||||||
LdrPEGetExportByName (
|
LdrPEGetExportByName (
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
PUCHAR SymbolName,
|
PUCHAR SymbolName,
|
||||||
WORD Hint )
|
USHORT Hint )
|
||||||
{
|
{
|
||||||
PIMAGE_EXPORT_DIRECTORY ExportDir;
|
PIMAGE_EXPORT_DIRECTORY ExportDir;
|
||||||
PDWORD * ExFunctions;
|
PULONG * ExFunctions;
|
||||||
PDWORD * ExNames;
|
PULONG * ExNames;
|
||||||
USHORT * ExOrdinals;
|
USHORT * ExOrdinals;
|
||||||
PVOID ExName;
|
PVOID ExName;
|
||||||
ULONG Ordinal;
|
ULONG Ordinal;
|
||||||
|
@ -1314,9 +1314,9 @@ LdrPEGetExportByName (
|
||||||
/*
|
/*
|
||||||
* Get header pointers
|
* Get header pointers
|
||||||
*/
|
*/
|
||||||
ExNames = (PDWORD *)RVA(BaseAddress, ExportDir->AddressOfNames);
|
ExNames = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfNames);
|
||||||
ExOrdinals = (USHORT *)RVA(BaseAddress, ExportDir->AddressOfNameOrdinals);
|
ExOrdinals = (USHORT *)RVA(BaseAddress, ExportDir->AddressOfNameOrdinals);
|
||||||
ExFunctions = (PDWORD *)RVA(BaseAddress, ExportDir->AddressOfFunctions);
|
ExFunctions = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the hint first
|
* Check the hint first
|
||||||
|
@ -1399,7 +1399,7 @@ LdrPEGetExportByOrdinal (
|
||||||
{
|
{
|
||||||
PIMAGE_EXPORT_DIRECTORY ExportDir;
|
PIMAGE_EXPORT_DIRECTORY ExportDir;
|
||||||
ULONG ExportDirSize;
|
ULONG ExportDirSize;
|
||||||
PDWORD * ExFunctions;
|
PULONG * ExFunctions;
|
||||||
PVOID Function;
|
PVOID Function;
|
||||||
|
|
||||||
ExportDir = (PIMAGE_EXPORT_DIRECTORY)RtlImageDirectoryEntryToData (
|
ExportDir = (PIMAGE_EXPORT_DIRECTORY)RtlImageDirectoryEntryToData (
|
||||||
|
@ -1408,7 +1408,7 @@ LdrPEGetExportByOrdinal (
|
||||||
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
||||||
&ExportDirSize);
|
&ExportDirSize);
|
||||||
|
|
||||||
ExFunctions = (PDWORD *)RVA(BaseAddress,
|
ExFunctions = (PULONG *)RVA(BaseAddress,
|
||||||
ExportDir->AddressOfFunctions);
|
ExportDir->AddressOfFunctions);
|
||||||
DPRINT("LdrPEGetExportByOrdinal(Ordinal %d) = %x\n",
|
DPRINT("LdrPEGetExportByOrdinal(Ordinal %d) = %x\n",
|
||||||
Ordinal,
|
Ordinal,
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
*
|
*
|
||||||
* RETURN VALUE
|
* RETURN VALUE
|
||||||
*/
|
*/
|
||||||
STATIC NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
LpcpVerifyCreateParameters (IN PHANDLE PortHandle,
|
LpcpVerifyCreateParameters (IN PHANDLE PortHandle,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
IN ULONG MaxConnectInfoLength,
|
IN ULONG MaxConnectInfoLength,
|
||||||
|
|
|
@ -434,7 +434,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
|
MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
ULONG RegionSize,
|
ULONG RegionSize,
|
||||||
|
@ -765,7 +765,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MmFreeVirtualMemoryPage(PVOID Context,
|
MmFreeVirtualMemoryPage(PVOID Context,
|
||||||
MEMORY_AREA* MemoryArea,
|
MEMORY_AREA* MemoryArea,
|
||||||
PVOID Address,
|
PVOID Address,
|
||||||
|
|
|
@ -39,8 +39,7 @@ MmUnlockPagableImageSection(IN PVOID ImageSectionHandle)
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
MmLockPagableSectionByHandle(IN PVOID ImageSectionHandle)
|
MmLockPagableSectionByHandle(IN PVOID ImageSectionHandle)
|
||||||
{
|
{
|
||||||
// MmLockMemoryArea((MEMORY_AREA *)ImageSectionHandle);
|
UNIMPLEMENTED;
|
||||||
DPRINT1("MmLockPagableSectionByHandle is unimplemented\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,15 +74,19 @@ MmLockPagableDataSection(IN PVOID AddressWithinSection)
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
MmUnlockPagableImageSection(IN PVOID ImageSectionHandle)
|
MmUnlockPagableImageSection(IN PVOID ImageSectionHandle)
|
||||||
{}
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
PVOID STDCALL
|
||||||
MmPageEntireDriver(IN PVOID AddressWithinSection)
|
MmPageEntireDriver(IN PVOID AddressWithinSection)
|
||||||
{}
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -91,6 +94,8 @@ MmPageEntireDriver(IN PVOID AddressWithinSection)
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
MmResetDriverPaging(IN PVOID AddressWithinSection)
|
MmResetDriverPaging(IN PVOID AddressWithinSection)
|
||||||
{}
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -172,12 +172,12 @@ static __inline ULONG64 ElfFmtpReadULong64
|
||||||
IN ULONG DataType
|
IN ULONG DataType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PBYTE p;
|
PUCHAR p;
|
||||||
|
|
||||||
if(DataType == ELF_TARG_DATA)
|
if(DataType == ELF_TARG_DATA)
|
||||||
return Input;
|
return Input;
|
||||||
|
|
||||||
p = (PBYTE)&Input;
|
p = (PUCHAR)&Input;
|
||||||
|
|
||||||
switch(DataType)
|
switch(DataType)
|
||||||
{
|
{
|
||||||
|
@ -195,12 +195,12 @@ static __inline ULONG ElfFmtpReadULong
|
||||||
IN ULONG DataType
|
IN ULONG DataType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PBYTE p;
|
PUCHAR p;
|
||||||
|
|
||||||
if(DataType == ELF_TARG_DATA)
|
if(DataType == ELF_TARG_DATA)
|
||||||
return Input;
|
return Input;
|
||||||
|
|
||||||
p = (PBYTE)&Input;
|
p = (PUCHAR)&Input;
|
||||||
|
|
||||||
switch(DataType)
|
switch(DataType)
|
||||||
{
|
{
|
||||||
|
@ -218,12 +218,12 @@ static __inline USHORT ElfFmtpReadUShort
|
||||||
IN ULONG DataType
|
IN ULONG DataType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PBYTE p;
|
PUCHAR p;
|
||||||
|
|
||||||
if(DataType == ELF_TARG_DATA)
|
if(DataType == ELF_TARG_DATA)
|
||||||
return Input;
|
return Input;
|
||||||
|
|
||||||
p = (PBYTE)&Input;
|
p = (PUCHAR)&Input;
|
||||||
|
|
||||||
switch(DataType)
|
switch(DataType)
|
||||||
{
|
{
|
||||||
|
@ -241,12 +241,12 @@ static __inline ULONG64 ElfFmtpSafeReadULong64
|
||||||
IN ULONG DataType
|
IN ULONG DataType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PBYTE p;
|
PUCHAR p;
|
||||||
ULONG64 nSafeInput;
|
ULONG64 nSafeInput;
|
||||||
|
|
||||||
RtlRetrieveUlonglong(&nSafeInput, Input);
|
RtlRetrieveUlonglong(&nSafeInput, Input);
|
||||||
|
|
||||||
p = (PBYTE)&nSafeInput;
|
p = (PUCHAR)&nSafeInput;
|
||||||
|
|
||||||
switch(DataType)
|
switch(DataType)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +264,7 @@ static __inline ULONG ElfFmtpSafeReadULong
|
||||||
IN ULONG DataType
|
IN ULONG DataType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PBYTE p;
|
PUCHAR p;
|
||||||
ULONG nSafeInput;
|
ULONG nSafeInput;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
@ -277,7 +277,7 @@ static __inline ULONG ElfFmtpSafeReadULong
|
||||||
if(DataType == ELF_TARG_DATA)
|
if(DataType == ELF_TARG_DATA)
|
||||||
return nSafeInput;
|
return nSafeInput;
|
||||||
|
|
||||||
p = (PBYTE)&nSafeInput;
|
p = (PUCHAR)&nSafeInput;
|
||||||
|
|
||||||
switch(DataType)
|
switch(DataType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -331,21 +331,21 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
DWORD STDCALL
|
ULONG STDCALL
|
||||||
MmAdjustWorkingSetSize (DWORD Unknown0,
|
MmAdjustWorkingSetSize (ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2)
|
ULONG Unknown2)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DWORD
|
ULONG
|
||||||
STDCALL
|
STDCALL
|
||||||
MmDbgTranslatePhysicalAddress (
|
MmDbgTranslatePhysicalAddress (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1
|
ULONG Unknown1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
|
@ -467,7 +467,7 @@ MmInit3(VOID)
|
||||||
/* FIXME: Read parameters from memory */
|
/* FIXME: Read parameters from memory */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
PFN_TYPE Page, SWAPENTRY SwapEntry,
|
PFN_TYPE Page, SWAPENTRY SwapEntry,
|
||||||
BOOLEAN Dirty)
|
BOOLEAN Dirty)
|
||||||
|
|
|
@ -84,7 +84,7 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
|
||||||
return ((PVOID)Result);
|
return ((PVOID)Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MmFreeNonCachedPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
MmFreeNonCachedPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
PFN_TYPE Page, SWAPENTRY SwapEntry,
|
PFN_TYPE Page, SWAPENTRY SwapEntry,
|
||||||
BOOLEAN Dirty)
|
BOOLEAN Dirty)
|
||||||
|
|
|
@ -95,7 +95,7 @@ typedef struct _HDR_FREE
|
||||||
|
|
||||||
#define HDR_FREE_SIZE ROUND_UP(sizeof(HDR_FREE), MM_POOL_ALIGNMENT)
|
#define HDR_FREE_SIZE ROUND_UP(sizeof(HDR_FREE), MM_POOL_ALIGNMENT)
|
||||||
|
|
||||||
#if defined(NPOOL_REDZONE_CHECK) || #defined(NPOOL_REDZONE_CHECK_FULL)
|
#if defined(NPOOL_REDZONE_CHECK) || defined(NPOOL_REDZONE_CHECK_FULL)
|
||||||
#define HDR_USED_SIZE ROUND_UP(sizeof(HDR_USED) + NPOOL_REDZONE_SIZE, MM_POOL_ALIGNMENT)
|
#define HDR_USED_SIZE ROUND_UP(sizeof(HDR_USED) + NPOOL_REDZONE_SIZE, MM_POOL_ALIGNMENT)
|
||||||
#else
|
#else
|
||||||
#define HDR_USED_SIZE ROUND_UP(sizeof(HDR_USED), MM_POOL_ALIGNMENT)
|
#define HDR_USED_SIZE ROUND_UP(sizeof(HDR_USED), MM_POOL_ALIGNMENT)
|
||||||
|
@ -760,7 +760,7 @@ MiAddToTagHashTable(HDR_USED* block)
|
||||||
#endif /* TAG_STATISTICS_TRACKING */
|
#endif /* TAG_STATISTICS_TRACKING */
|
||||||
|
|
||||||
#if defined(TAG_STATISTICS_TRACKING)
|
#if defined(TAG_STATISTICS_TRACKING)
|
||||||
VOID STATIC
|
VOID static
|
||||||
MiDumpTagStats(ULONG CurrentTag, ULONG CurrentNrBlocks, ULONG CurrentSize)
|
MiDumpTagStats(ULONG CurrentTag, ULONG CurrentNrBlocks, ULONG CurrentSize)
|
||||||
{
|
{
|
||||||
CHAR c1, c2, c3, c4;
|
CHAR c1, c2, c3, c4;
|
||||||
|
@ -1106,7 +1106,7 @@ static void validate_kernel_pool(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
STATIC VOID
|
static VOID
|
||||||
free_pages(HDR_FREE* blk)
|
free_pages(HDR_FREE* blk)
|
||||||
{
|
{
|
||||||
ULONG start;
|
ULONG start;
|
||||||
|
@ -1154,7 +1154,7 @@ add_to_free_list(HDR_FREE* blk)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
HDR_FREE* current;
|
HDR_FREE* current;
|
||||||
BOOL UpdatePrevPtr = FALSE;
|
BOOLEAN UpdatePrevPtr = FALSE;
|
||||||
|
|
||||||
DPRINT("add_to_free_list (%d)\n", blk->hdr.Size);
|
DPRINT("add_to_free_list (%d)\n", blk->hdr.Size);
|
||||||
|
|
||||||
|
@ -1469,10 +1469,10 @@ ExRosQueryNonPagedPoolTag ( PVOID Addr )
|
||||||
#if defined(NPOOL_REDZONE_CHECK) || defined(NPOOL_REDZONE_CHECK_FULL)
|
#if defined(NPOOL_REDZONE_CHECK) || defined(NPOOL_REDZONE_CHECK_FULL)
|
||||||
void check_redzone_header(HDR_USED* hdr)
|
void check_redzone_header(HDR_USED* hdr)
|
||||||
{
|
{
|
||||||
PBYTE LoZone = (PBYTE)((ULONG_PTR)hdr + HDR_USED_SIZE - NPOOL_REDZONE_SIZE);
|
PUCHAR LoZone = (PUCHAR)((ULONG_PTR)hdr + HDR_USED_SIZE - NPOOL_REDZONE_SIZE);
|
||||||
PBYTE HiZone = (PBYTE)((ULONG_PTR)hdr + HDR_USED_SIZE + hdr->UserSize);
|
PUCHAR HiZone = (PUCHAR)((ULONG_PTR)hdr + HDR_USED_SIZE + hdr->UserSize);
|
||||||
BOOL LoOK = TRUE;
|
BOOLEAN LoOK = TRUE;
|
||||||
BOOL HiOK = TRUE;
|
BOOLEAN HiOK = TRUE;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
CHAR c[5];
|
CHAR c[5];
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ MmShowOutOfSpaceMessagePagingFile(VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LARGE_INTEGER STATIC
|
LARGE_INTEGER static
|
||||||
MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER Offset)
|
MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER Offset)
|
||||||
{
|
{
|
||||||
/* Simple binary search */
|
/* Simple binary search */
|
||||||
|
@ -498,7 +498,7 @@ MmAllocSwapPage(VOID)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC PRETRIEVEL_DESCRIPTOR_LIST FASTCALL
|
static PRETRIEVEL_DESCRIPTOR_LIST FASTCALL
|
||||||
MmAllocRetrievelDescriptorList(ULONG Pairs)
|
MmAllocRetrievelDescriptorList(ULONG Pairs)
|
||||||
{
|
{
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
|
@ -551,7 +551,7 @@ MmDumpToPagingFile(ULONG BugCode,
|
||||||
if (!(TrapFrame->EFlags & (1 << 17)))
|
if (!(TrapFrame->EFlags & (1 << 17)))
|
||||||
{
|
{
|
||||||
memcpy(&Headers->TrapFrame, TrapFrame,
|
memcpy(&Headers->TrapFrame, TrapFrame,
|
||||||
sizeof(KTRAP_FRAME) - (4 * sizeof(DWORD)));
|
sizeof(KTRAP_FRAME) - (4 * sizeof(ULONG)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ extern MM_STATS MmStats;
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
STATIC PVOID STDCALL
|
static PVOID STDCALL
|
||||||
EiAllocatePool(POOL_TYPE PoolType,
|
EiAllocatePool(POOL_TYPE PoolType,
|
||||||
ULONG NumberOfBytes,
|
ULONG NumberOfBytes,
|
||||||
ULONG Tag,
|
ULONG Tag,
|
||||||
|
|
|
@ -11,13 +11,9 @@
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#ifdef PPOOL_UMODE_TEST
|
|
||||||
#include "ppool_umode.h"
|
|
||||||
#else//PPOOL_UMODE_TEST
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
#endif//PPOOL_UMODE_TEST
|
|
||||||
|
|
||||||
#if defined (ALLOC_PRAGMA)
|
#if defined (ALLOC_PRAGMA)
|
||||||
#pragma alloc_text(INIT, MmInitializePagedPool)
|
#pragma alloc_text(INIT, MmInitializePagedPool)
|
||||||
|
@ -138,7 +134,7 @@ int main()
|
||||||
char* trash[COUNT];
|
char* trash[COUNT];
|
||||||
int AllocSize[] = { 15, 31, 63, 127, 255, 511, 1023, 2047 };
|
int AllocSize[] = { 15, 31, 63, 127, 255, 511, 1023, 2047 };
|
||||||
const int ALLOCS = sizeof(AllocSize) / sizeof(0[AllocSize]);
|
const int ALLOCS = sizeof(AllocSize) / sizeof(0[AllocSize]);
|
||||||
DWORD dwStart;
|
ULONG dwStart;
|
||||||
|
|
||||||
MmPagedPoolSize = 1*1024*1024;
|
MmPagedPoolSize = 1*1024*1024;
|
||||||
MmPagedPoolBase = malloc ( MmPagedPoolSize );
|
MmPagedPoolBase = malloc ( MmPagedPoolSize );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
InsertAfterEntry(PLIST_ENTRY Previous,
|
InsertAfterEntry(PLIST_ENTRY Previous,
|
||||||
PLIST_ENTRY Entry)
|
PLIST_ENTRY Entry)
|
||||||
/*
|
/*
|
||||||
|
@ -31,7 +31,7 @@ InsertAfterEntry(PLIST_ENTRY Previous,
|
||||||
Previous->Flink = Entry;
|
Previous->Flink = Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
PMM_REGION STATIC
|
PMM_REGION static
|
||||||
MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress,
|
MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress,
|
||||||
PVOID StartAddress, ULONG Length, ULONG NewType,
|
PVOID StartAddress, ULONG Length, ULONG NewType,
|
||||||
ULONG NewProtect, PMADDRESS_SPACE AddressSpace,
|
ULONG NewProtect, PMADDRESS_SPACE AddressSpace,
|
||||||
|
|
|
@ -461,7 +461,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section,
|
||||||
return(SHARE_COUNT_FROM_SSE(Entry) > 0);
|
return(SHARE_COUNT_FROM_SSE(Entry) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea,
|
BOOLEAN MiIsPageFromCache(PMEMORY_AREA MemoryArea,
|
||||||
ULONG SegOffset)
|
ULONG SegOffset)
|
||||||
{
|
{
|
||||||
if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
|
@ -669,7 +669,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
ULONG Attributes;
|
ULONG Attributes;
|
||||||
PMM_PAGEOP PageOp;
|
PMM_PAGEOP PageOp;
|
||||||
PMM_REGION Region;
|
PMM_REGION Region;
|
||||||
BOOL HasSwapEntry;
|
BOOLEAN HasSwapEntry;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There is a window between taking the page fault and locking the
|
* There is a window between taking the page fault and locking the
|
||||||
|
@ -1889,7 +1889,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
ULONG RegionSize,
|
ULONG RegionSize,
|
||||||
|
@ -1900,7 +1900,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
||||||
{
|
{
|
||||||
PMEMORY_AREA MemoryArea;
|
PMEMORY_AREA MemoryArea;
|
||||||
PMM_SECTION_SEGMENT Segment;
|
PMM_SECTION_SEGMENT Segment;
|
||||||
BOOL DoCOW = FALSE;
|
BOOLEAN DoCOW = FALSE;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
|
@ -2011,7 +2011,7 @@ MmQuerySectionView(PMEMORY_AREA MemoryArea,
|
||||||
if (Section->AllocationAttributes & SEC_IMAGE)
|
if (Section->AllocationAttributes & SEC_IMAGE)
|
||||||
{
|
{
|
||||||
Segment = MemoryArea->Data.SectionData.Segment;
|
Segment = MemoryArea->Data.SectionData.Segment;
|
||||||
Info->AllocationBase = (PBYTE)MemoryArea->StartingAddress - Segment->VirtualAddress;
|
Info->AllocationBase = (PUCHAR)MemoryArea->StartingAddress - Segment->VirtualAddress;
|
||||||
Info->Type = MEM_IMAGE;
|
Info->Type = MEM_IMAGE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3500,7 +3500,7 @@ NtOpenSection(PHANDLE SectionHandle,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STATIC
|
NTSTATUS static
|
||||||
MmMapViewOfSegment(PMADDRESS_SPACE AddressSpace,
|
MmMapViewOfSegment(PMADDRESS_SPACE AddressSpace,
|
||||||
PROS_SECTION_OBJECT Section,
|
PROS_SECTION_OBJECT Section,
|
||||||
PMM_SECTION_SEGMENT Segment,
|
PMM_SECTION_SEGMENT Segment,
|
||||||
|
@ -3748,7 +3748,7 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STATIC
|
VOID static
|
||||||
MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
|
PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
|
||||||
{
|
{
|
||||||
|
@ -3855,7 +3855,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC NTSTATUS
|
static NTSTATUS
|
||||||
MmUnmapViewOfSegment(PMADDRESS_SPACE AddressSpace,
|
MmUnmapViewOfSegment(PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID BaseAddress)
|
PVOID BaseAddress)
|
||||||
{
|
{
|
||||||
|
@ -4623,7 +4623,7 @@ MmCanFileBeTruncated (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN STDCALL
|
BOOLEAN STDCALL
|
||||||
MmDisableModifiedWriteOfSection (DWORD Unknown0)
|
MmDisableModifiedWriteOfSection (ULONG Unknown0)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
@ -4763,12 +4763,12 @@ MmUnmapViewInSessionSpace (
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
MmSetBankedSection (DWORD Unknown0,
|
MmSetBankedSection (ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2,
|
ULONG Unknown2,
|
||||||
DWORD Unknown3,
|
ULONG Unknown3,
|
||||||
DWORD Unknown4,
|
ULONG Unknown4,
|
||||||
DWORD Unknown5)
|
ULONG Unknown5)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return (STATUS_NOT_IMPLEMENTED);
|
return (STATUS_NOT_IMPLEMENTED);
|
||||||
|
|
|
@ -104,7 +104,7 @@ NtLockVirtualMemory(HANDLE ProcessHandle,
|
||||||
NumberOfBytesLocked,
|
NumberOfBytesLocked,
|
||||||
ObReferenceObjectByHandle,
|
ObReferenceObjectByHandle,
|
||||||
MmCreateMdl,
|
MmCreateMdl,
|
||||||
ObfDereferenceObject,
|
(PVOID)ObfDereferenceObject,
|
||||||
MmProbeAndLockPages,
|
MmProbeAndLockPages,
|
||||||
ExFreePool);
|
ExFreePool);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<define name="_NTOSKRNL_" />
|
<define name="_NTOSKRNL_" />
|
||||||
<define name="__NO_CTYPE_INLINES" />
|
<define name="__NO_CTYPE_INLINES" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
|
<define name="WIN9X_COMPAT_SPINLOCK" />
|
||||||
<include base="kjs">include</include>
|
<include base="kjs">include</include>
|
||||||
<include base="cmlib">.</include>
|
<include base="cmlib">.</include>
|
||||||
<include base="ntoskrnl">include</include>
|
<include base="ntoskrnl">include</include>
|
||||||
|
|
|
@ -232,7 +232,7 @@ ObpCaptureObjectName(IN OUT PUNICODE_STRING CapturedName,
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
ULONG StringLength, MaximumLength;
|
ULONG StringLength, MaximumLength;
|
||||||
PWCHAR StringBuffer = NULL;
|
PWCHAR StringBuffer = NULL;
|
||||||
UNICODE_STRING LocalName = {}; /* <= GCC 4.0 + Optimizer */
|
UNICODE_STRING LocalName = {0}; /* <= GCC 4.0 + Optimizer */
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Initialize the Input String */
|
/* Initialize the Input String */
|
||||||
|
|
|
@ -267,21 +267,22 @@ ObFastReplaceObject(IN PEX_FAST_REF FastRef,
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS *********************************************************/
|
/* PUBLIC FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
VOID
|
LONG_PTR
|
||||||
FASTCALL
|
FASTCALL
|
||||||
ObfReferenceObject(IN PVOID Object)
|
ObfReferenceObject(IN PVOID Object)
|
||||||
{
|
{
|
||||||
ASSERT(Object);
|
ASSERT(Object);
|
||||||
|
|
||||||
/* Get the header and increment the reference count */
|
/* Get the header and increment the reference count */
|
||||||
InterlockedIncrement(&OBJECT_TO_OBJECT_HEADER(Object)->PointerCount);
|
return InterlockedIncrement(&OBJECT_TO_OBJECT_HEADER(Object)->PointerCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
LONG_PTR
|
||||||
FASTCALL
|
FASTCALL
|
||||||
ObfDereferenceObject(IN PVOID Object)
|
ObfDereferenceObject(IN PVOID Object)
|
||||||
{
|
{
|
||||||
POBJECT_HEADER Header;
|
POBJECT_HEADER Header;
|
||||||
|
LONG_PTR OldCount;
|
||||||
|
|
||||||
/* Extract the object header */
|
/* Extract the object header */
|
||||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||||
|
@ -289,17 +290,18 @@ ObfDereferenceObject(IN PVOID Object)
|
||||||
if (Header->PointerCount < Header->HandleCount)
|
if (Header->PointerCount < Header->HandleCount)
|
||||||
{
|
{
|
||||||
DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name);
|
DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name);
|
||||||
return;
|
return Header->PointerCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether the object can now be deleted. */
|
/* Check whether the object can now be deleted. */
|
||||||
if (!(InterlockedDecrement(&Header->PointerCount)))
|
OldCount = InterlockedDecrement(&Header->PointerCount);
|
||||||
|
if (!OldCount)
|
||||||
{
|
{
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
if (Header->HandleCount)
|
if (Header->HandleCount)
|
||||||
{
|
{
|
||||||
DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name);
|
DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name);
|
||||||
return;
|
return Header->PointerCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we're at PASSIVE */
|
/* Check if we're at PASSIVE */
|
||||||
|
@ -314,6 +316,9 @@ ObfDereferenceObject(IN PVOID Object)
|
||||||
ObpDeferObjectDeletion(Object);
|
ObpDeferObjectDeletion(Object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the old count */
|
||||||
|
return OldCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -356,7 +356,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
|
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
|
||||||
IN HANDLE ParentProcess OPTIONAL,
|
IN HANDLE ParentProcess OPTIONAL,
|
||||||
IN DWORD Flags,
|
IN ULONG Flags,
|
||||||
IN HANDLE SectionHandle OPTIONAL,
|
IN HANDLE SectionHandle OPTIONAL,
|
||||||
IN HANDLE DebugPort OPTIONAL,
|
IN HANDLE DebugPort OPTIONAL,
|
||||||
IN HANDLE ExceptionPort OPTIONAL,
|
IN HANDLE ExceptionPort OPTIONAL,
|
||||||
|
|
|
@ -42,7 +42,7 @@ RtlpGetMode()
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlpAllocateMemory(UINT Bytes,
|
RtlpAllocateMemory(ULONG Bytes,
|
||||||
ULONG Tag)
|
ULONG Tag)
|
||||||
{
|
{
|
||||||
return ExAllocatePoolWithTag(PagedPool,
|
return ExAllocatePoolWithTag(PagedPool,
|
||||||
|
@ -399,7 +399,7 @@ IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( IMAGE_RESOURCE_DIRECTORY *dir,
|
||||||
LPCWSTR name, void *root,
|
LPCWSTR name, void *root,
|
||||||
int want_dir );
|
int want_dir );
|
||||||
IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( IMAGE_RESOURCE_DIRECTORY *dir,
|
IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( IMAGE_RESOURCE_DIRECTORY *dir,
|
||||||
WORD id, void *root, int want_dir );
|
USHORT id, void *root, int want_dir );
|
||||||
IMAGE_RESOURCE_DIRECTORY *find_first_entry( IMAGE_RESOURCE_DIRECTORY *dir,
|
IMAGE_RESOURCE_DIRECTORY *find_first_entry( IMAGE_RESOURCE_DIRECTORY *dir,
|
||||||
void *root, int want_dir );
|
void *root, int want_dir );
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
char* strtok(char *s, const char *delim)
|
char* __cdecl strtok(char *s, const char *delim)
|
||||||
{
|
{
|
||||||
const char *spanp;
|
const char *spanp;
|
||||||
int c, sc;
|
int c, sc;
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL LsaCallAuthenticationPackage (
|
NTSTATUS STDCALL LsaCallAuthenticationPackage (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2,
|
ULONG Unknown2,
|
||||||
DWORD Unknown3,
|
ULONG Unknown3,
|
||||||
DWORD Unknown4,
|
ULONG Unknown4,
|
||||||
DWORD Unknown5,
|
ULONG Unknown5,
|
||||||
DWORD Unknown6
|
ULONG Unknown6
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -34,8 +34,8 @@ NTSTATUS STDCALL LsaCallAuthenticationPackage (
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL LsaDeregisterLogonProcess (
|
NTSTATUS STDCALL LsaDeregisterLogonProcess (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1
|
ULONG Unknown1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -62,20 +62,20 @@ NTSTATUS STDCALL LsaFreeReturnBuffer (PVOID Buffer)
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL LsaLogonUser (
|
NTSTATUS STDCALL LsaLogonUser (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2,
|
ULONG Unknown2,
|
||||||
DWORD Unknown3,
|
ULONG Unknown3,
|
||||||
DWORD Unknown4,
|
ULONG Unknown4,
|
||||||
DWORD Unknown5,
|
ULONG Unknown5,
|
||||||
DWORD Unknown6,
|
ULONG Unknown6,
|
||||||
DWORD Unknown7,
|
ULONG Unknown7,
|
||||||
DWORD Unknown8,
|
ULONG Unknown8,
|
||||||
DWORD Unknown9,
|
ULONG Unknown9,
|
||||||
DWORD Unknown10,
|
ULONG Unknown10,
|
||||||
DWORD Unknown11,
|
ULONG Unknown11,
|
||||||
DWORD Unknown12,
|
ULONG Unknown12,
|
||||||
DWORD Unknown13
|
ULONG Unknown13
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -86,9 +86,9 @@ NTSTATUS STDCALL LsaLogonUser (
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL LsaLookupAuthenticationPackage (
|
NTSTATUS STDCALL LsaLookupAuthenticationPackage (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2
|
ULONG Unknown2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -99,9 +99,9 @@ NTSTATUS STDCALL LsaLookupAuthenticationPackage (
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL LsaRegisterLogonProcess (
|
NTSTATUS STDCALL LsaRegisterLogonProcess (
|
||||||
DWORD Unknown0,
|
ULONG Unknown0,
|
||||||
DWORD Unknown1,
|
ULONG Unknown1,
|
||||||
DWORD Unknown2
|
ULONG Unknown2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
|
|
@ -168,7 +168,7 @@ SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation,
|
||||||
RtlCopyMemory((PVOID)Current,
|
RtlCopyMemory((PVOID)Current,
|
||||||
SeWorldSid,
|
SeWorldSid,
|
||||||
SidSize);
|
SidSize);
|
||||||
SdRel->Owner = (DWORD)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
SdRel->Owner = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
||||||
Current += SidSize;
|
Current += SidSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation,
|
||||||
RtlCopyMemory((PVOID)Current,
|
RtlCopyMemory((PVOID)Current,
|
||||||
SeWorldSid,
|
SeWorldSid,
|
||||||
SidSize);
|
SidSize);
|
||||||
SdRel->Group = (DWORD)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
SdRel->Group = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
||||||
Current += SidSize;
|
Current += SidSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
SdRel->Dacl = (DWORD)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
SdRel->Dacl = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)SdRel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SecurityInformation & SACL_SECURITY_INFORMATION)
|
if (SecurityInformation & SACL_SECURITY_INFORMATION)
|
||||||
|
|
|
@ -2135,9 +2135,9 @@ NtCreateToken(OUT PHANDLE TokenHandle,
|
||||||
PVOID EndMem;
|
PVOID EndMem;
|
||||||
ULONG uLength;
|
ULONG uLength;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
ULONG nTokenPrivileges = 0;
|
|
||||||
LARGE_INTEGER LocalExpirationTime = {};
|
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
|
ULONG nTokenPrivileges = 0;
|
||||||
|
LARGE_INTEGER LocalExpirationTime = {{0}};
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
|
@ -22,8 +22,8 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
VdmpGetVdmTib(OUT PVDM_TIB *VdmTib)
|
VdmpGetVdmTib(OUT PVDM_TIB *VdmTib)
|
||||||
{
|
{
|
||||||
PAGED_CODE();
|
|
||||||
PVDM_TIB Tib;
|
PVDM_TIB Tib;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Assume vailure */
|
/* Assume vailure */
|
||||||
*VdmTib = NULL;
|
*VdmTib = NULL;
|
||||||
|
|
|
@ -56,7 +56,7 @@ KeI386VdmInitialize(VOID)
|
||||||
/* Make sure that there is a WOW key */
|
/* Make sure that there is a WOW key */
|
||||||
RtlInitUnicodeString(&Name,
|
RtlInitUnicodeString(&Name,
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\"
|
L"\\Registry\\Machine\\System\\CurrentControlSet\\"
|
||||||
"Control\\Wow");
|
L"Control\\Wow");
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
|
Loading…
Reference in a new issue