Author: ion
Date: Sun Aug 4 19:28:37 2013
New Revision: 59640
URL:
http://svn.reactos.org/svn/reactos?rev=59640&view=rev
Log:
[NDK/NTOSKRNL]: Use correct flags. Spotted by Thomas Fabber.
Modified:
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/ntoskrnl/ps/process.c
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Sun Aug 4 19:28:37 2013
@@ -89,11 +89,17 @@
//
// Flags for NtCreateProcessEx
//
-#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
-#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
-#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
+#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
+#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
+#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
-#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
+#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
+#define PROCESS_CREATE_FLAGS_ALL_LARGE_PAGE_FLAGS PROCESS_CREATE_FLAGS_LARGE_PAGES
+#define PROCESS_CREATE_FLAGS_LEGAL_MASK (PROCESS_CREATE_FLAGS_BREAKAWAY | \
+
PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT | \
+ PROCESS_CREATE_FLAGS_INHERIT_HANDLES
| \
+
PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE | \
+
PROCESS_CREATE_FLAGS_ALL_LARGE_PAGE_FLAGS)
//
// Process priority classes
@@ -105,18 +111,6 @@
#define PROCESS_PRIORITY_CLASS_REALTIME 4
#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 5
#define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL 6
-
-//
-// NtCreateProcessEx flags
-//
-#define PS_REQUEST_BREAKAWAY 1
-#define PS_NO_DEBUG_INHERIT 2
-#define PS_INHERIT_HANDLES 4
-#define PS_LARGE_PAGES 8
-#define PS_ALL_FLAGS (PS_REQUEST_BREAKAWAY | \
- PS_NO_DEBUG_INHERIT | \
- PS_INHERIT_HANDLES | \
- PS_LARGE_PAGES)
//
// Process base priorities
Modified: trunk/reactos/ntoskrnl/ps/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] Sun Aug 4 19:28:37 2013
@@ -369,7 +369,7 @@
"ProcessHandle: %p Parent: %p\n", ProcessHandle, ParentProcess);
/* Validate flags */
- if (Flags & ~PS_ALL_FLAGS) return STATUS_INVALID_PARAMETER;
+ if (Flags & ~PROCESS_CREATE_FLAGS_LEGAL_MASK) return STATUS_INVALID_PARAMETER;
/* Check for parent */
if (ParentProcess)
@@ -508,7 +508,7 @@
Process->DebugPort = DebugObject;
/* Check if the caller doesn't want the debug stuff inherited */
- if (Flags & PS_NO_DEBUG_INHERIT)
+ if (Flags & PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT)
{
/* Set the process flag */
InterlockedOr((PLONG)&Process->Flags, PSF_NO_DEBUG_INHERIT_BIT);
@@ -595,7 +595,8 @@
}
/* Initialize object manager for the process */
- Status = ObInitProcess(Flags & PS_INHERIT_HANDLES ? Parent : NULL,
+ Status = ObInitProcess(Flags & PROCESS_CREATE_FLAGS_INHERIT_HANDLES ?
+ Parent : NULL,
Process);
if (!NT_SUCCESS(Status)) goto CleanupWithRef;
}
@@ -643,7 +644,7 @@
else
{
/* This is the initial system process */
- Flags &= ~PS_LARGE_PAGES;
+ Flags &= ~PROCESS_CREATE_FLAGS_LARGE_PAGES;
Status = MmInitializeProcessAddressSpace(Process,
NULL,
NULL,
@@ -1347,9 +1348,9 @@
"Parent: %p Attributes: %p\n", ParentProcess, ObjectAttributes);
/* Set new-style flags */
- if ((ULONG)SectionHandle & 1) Flags = PS_REQUEST_BREAKAWAY;
- if ((ULONG)DebugPort & 1) Flags |= PS_NO_DEBUG_INHERIT;
- if (InheritObjectTable) Flags |= PS_INHERIT_HANDLES;
+ if ((ULONG)SectionHandle & 1) Flags |= PROCESS_CREATE_FLAGS_BREAKAWAY;
+ if ((ULONG)DebugPort & 1) Flags |= PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT;
+ if (InheritObjectTable) Flags |= PROCESS_CREATE_FLAGS_INHERIT_HANDLES;
/* Call the new API */
return NtCreateProcessEx(ProcessHandle,