2010-02-09 18:14:58 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* FILE: ntoskrnl/include/ntoskrnl.h
|
|
|
|
* PURPOSE: Main Kernel Header
|
|
|
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
|
|
|
*/
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
#ifndef _NTOSKRNL_PCH
|
|
|
|
#define _NTOSKRNL_PCH
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
|
|
|
/* ARM Bringup Hack */
|
|
|
|
#ifdef _M_ARM
|
|
|
|
#define DbgPrint DbgPrintEarly
|
|
|
|
#endif
|
|
|
|
|
2010-07-15 00:24:38 +00:00
|
|
|
/* WDK hacks */
|
|
|
|
#ifdef _M_AMD64
|
|
|
|
#define IoAllocateAdapterChannel _IoAllocateAdapterChannel
|
|
|
|
#define KeGetCurrentThread _KeGetCurrentThread
|
2011-06-06 19:08:39 +00:00
|
|
|
#define RtlFillMemoryUlong _RtlFillMemoryUlong
|
2010-07-15 00:24:38 +00:00
|
|
|
#endif
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
/* Version Data */
|
|
|
|
#undef __MSVCRT__
|
|
|
|
#include <psdk/ntverp.h>
|
|
|
|
|
|
|
|
/* DDK/IFS/NDK Headers */
|
|
|
|
#define _REALLY_GET_CALLERS_CALLER
|
|
|
|
#include <excpt.h>
|
|
|
|
#include <ntdef.h>
|
|
|
|
#include <ntifs.h>
|
|
|
|
#include <wdmguid.h>
|
2019-10-21 16:28:40 +00:00
|
|
|
#include <diskguid.h>
|
2010-02-09 18:14:58 +00:00
|
|
|
#include <arc/arc.h>
|
2012-01-31 18:18:46 +00:00
|
|
|
#include <mountmgr.h>
|
2010-02-09 18:14:58 +00:00
|
|
|
#undef NTHALAPI
|
|
|
|
#define NTHALAPI __declspec(dllimport)
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ndk/asm.h>
|
|
|
|
#include <ndk/cctypes.h>
|
|
|
|
#include <ndk/cmfuncs.h>
|
|
|
|
#include <ndk/dbgkfuncs.h>
|
|
|
|
#include <ndk/exfuncs.h>
|
|
|
|
#include <ndk/halfuncs.h>
|
|
|
|
#include <ndk/inbvfuncs.h>
|
|
|
|
#include <ndk/iofuncs.h>
|
|
|
|
#include <ndk/kdfuncs.h>
|
|
|
|
#include <ndk/kefuncs.h>
|
|
|
|
#include <ndk/ldrfuncs.h>
|
|
|
|
#include <ndk/lpcfuncs.h>
|
|
|
|
#include <ndk/mmfuncs.h>
|
2015-08-18 20:40:17 +00:00
|
|
|
#include <ndk/muptypes.h>
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ndk/obfuncs.h>
|
|
|
|
#include <ndk/pofuncs.h>
|
|
|
|
#include <ndk/psfuncs.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/sefuncs.h>
|
|
|
|
#include <ndk/vftypes.h>
|
2022-03-08 04:35:43 +00:00
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
#undef TEXT
|
|
|
|
#define TEXT(s) L##s
|
2022-03-08 04:35:43 +00:00
|
|
|
|
|
|
|
#define _IN_KERNEL_
|
2010-02-09 18:14:58 +00:00
|
|
|
#include <regstr.h>
|
2022-03-08 04:35:43 +00:00
|
|
|
|
2011-03-25 21:49:03 +00:00
|
|
|
#include <ntstrsafe.h>
|
2011-07-24 17:14:58 +00:00
|
|
|
#include <ntpoapi.h>
|
2020-12-29 15:43:03 +00:00
|
|
|
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS
|
2018-09-15 10:27:08 +00:00
|
|
|
#include <ntintsafe.h>
|
2020-12-29 15:43:03 +00:00
|
|
|
#undef ENABLE_INTSAFE_SIGNED_FUNCTIONS
|
2010-02-09 18:14:58 +00:00
|
|
|
|
|
|
|
/* C Headers */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
|
|
|
|
/* SEH support with PSEH */
|
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
|
|
|
/* SetupLDR Support */
|
|
|
|
#include <arc/setupblk.h>
|
|
|
|
|
|
|
|
/* KD Support */
|
|
|
|
#define NOEXTAPI
|
|
|
|
#include <windbgkd.h>
|
|
|
|
#include <wdbgexts.h>
|
2023-03-21 17:42:29 +00:00
|
|
|
#include <kddll.h>
|
2020-03-07 10:39:37 +00:00
|
|
|
#ifdef KDBG
|
2023-03-21 17:42:29 +00:00
|
|
|
/* Define new names for these exports also present in KDBG */
|
2023-03-21 17:42:29 +00:00
|
|
|
#define KdD0Transition KdbgD0Transition
|
|
|
|
#define KdD3Transition KdbgD3Transition
|
|
|
|
#define KdSave KdbgSave
|
|
|
|
#define KdRestore KdbgRestore
|
2023-03-21 17:42:29 +00:00
|
|
|
#define KdSendPacket KdbgSendPacket
|
|
|
|
#define KdReceivePacket KdbgReceivePacket
|
|
|
|
/* And reload the definitions with these new names */
|
|
|
|
#undef _KDDLL_
|
|
|
|
#include <kddll.h>
|
2020-03-07 10:39:37 +00:00
|
|
|
#endif
|
2020-04-09 17:47:01 +00:00
|
|
|
#ifdef __ROS_ROSSYM__
|
2010-02-09 18:14:58 +00:00
|
|
|
#include <reactos/rossym.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PNP GUIDs */
|
|
|
|
#include <umpnpmgr/sysguid.h>
|
|
|
|
|
2015-10-26 21:03:40 +00:00
|
|
|
/* SRM header */
|
|
|
|
#include <srmp.h>
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
#define ExRaiseStatus RtlRaiseStatus
|
2011-09-07 13:58:34 +00:00
|
|
|
|
2019-01-18 21:11:43 +00:00
|
|
|
/* Also defined in fltkernel.h, but we don't want the entire header */
|
|
|
|
#ifndef Add2Ptr
|
|
|
|
#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
|
|
|
|
#endif
|
|
|
|
#ifndef PtrOffset
|
|
|
|
#define PtrOffset(B,O) ((ULONG)((ULONG_PTR)(O) - (ULONG_PTR)(B)))
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 07:18:16 +00:00
|
|
|
/* MAX_PATH is a Win32 concept, it doesn't belong in the kernel */
|
|
|
|
#define MAX_WIN32_PATH 260
|
|
|
|
C_ASSERT(MAX_WIN32_PATH == MAX_PATH);
|
|
|
|
#undef MAX_PATH
|
|
|
|
|
2011-09-07 13:58:34 +00:00
|
|
|
/* Internal Headers */
|
|
|
|
#include "config.h"
|
2020-10-17 16:09:11 +00:00
|
|
|
#include "internal/ntoskrnl.h"
|
2011-09-07 13:58:34 +00:00
|
|
|
|
|
|
|
#include <reactos/probe.h>
|
|
|
|
#include "internal/probe.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
[NTOS:PS] Enable alignment probing for thread/process information classes
In addition to that, here are some stuff done in this commit whilst testing:
- ICIF_QUERY_SIZE_VARIABLE and friends were badly misused, they should be used only when an information class whose information length size is dyanmic and not fixed. By removing such flags from erroneous classes, this fixes the STATUS_INFO_LENGTH_MISMATCH testcases.
- Use CHAR instead of UCHAR for classes that do not need alignment probing, as every other class in the table do, for the sake of consistency.
- ProcessEnableAlignmentFaultFixup uses BOOLEAN as type size, not CHAR. This fixes a testcase failure on ROS.
- Check for information length size before proceeding further on querying the process' cookie information.
- ProcessHandleTracing wants an alignment of a ULONG, not CHAR.
- Move PROCESS_LDT_INFORMATION and PROCESS_LDT_SIZE outside of NTOS_MODE_USER macro case. This fixes a compilation issue when enabling the alignment probing. My mistake of having them inside NTOS_MODE_USER case, sorry.
- On functions like NtQueryInformationThread and the Process equivalent, complete probing is not done at the beginning of the function, complete probing including if the buffer is writable alongside with datatype misalignment check that is. Instead such check is done on each information class case basis. With that said, we have to explicitly tell DefaultQueryInfoBufferCheck if we want a complete probing or not initially.
2021-05-03 13:46:35 +00:00
|
|
|
/* Internal Ps alignment probing header */
|
|
|
|
#include "internal/ps_i.h"
|
|
|
|
|
2021-05-11 15:13:14 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
# pragma section("INITDATA", read,write,discard)
|
|
|
|
#endif
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
#endif /* _NTOSKRNL_PCH */
|