mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:25:45 +00:00
[NDK/NTOSKRNL]: Use correct flags. Spotted by Thomas Fabber.
svn path=/trunk/; revision=59640
This commit is contained in:
parent
110bbab440
commit
6c25276f31
2 changed files with 18 additions and 23 deletions
|
@ -89,11 +89,17 @@ extern POBJECT_TYPE NTSYSAPI PsJobType;
|
||||||
//
|
//
|
||||||
// Flags for NtCreateProcessEx
|
// Flags for NtCreateProcessEx
|
||||||
//
|
//
|
||||||
#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
|
#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
|
||||||
#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
|
#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
|
||||||
#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
|
#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
|
||||||
#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
|
#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
|
// Process priority classes
|
||||||
|
@ -106,18 +112,6 @@ extern POBJECT_TYPE NTSYSAPI PsJobType;
|
||||||
#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 5
|
#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 5
|
||||||
#define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL 6
|
#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
|
// Process base priorities
|
||||||
//
|
//
|
||||||
|
|
|
@ -369,7 +369,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
"ProcessHandle: %p Parent: %p\n", ProcessHandle, ParentProcess);
|
"ProcessHandle: %p Parent: %p\n", ProcessHandle, ParentProcess);
|
||||||
|
|
||||||
/* Validate flags */
|
/* 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 */
|
/* Check for parent */
|
||||||
if (ParentProcess)
|
if (ParentProcess)
|
||||||
|
@ -508,7 +508,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
Process->DebugPort = DebugObject;
|
Process->DebugPort = DebugObject;
|
||||||
|
|
||||||
/* Check if the caller doesn't want the debug stuff inherited */
|
/* 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 */
|
/* Set the process flag */
|
||||||
InterlockedOr((PLONG)&Process->Flags, PSF_NO_DEBUG_INHERIT_BIT);
|
InterlockedOr((PLONG)&Process->Flags, PSF_NO_DEBUG_INHERIT_BIT);
|
||||||
|
@ -595,7 +595,8 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize object manager for the process */
|
/* 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);
|
Process);
|
||||||
if (!NT_SUCCESS(Status)) goto CleanupWithRef;
|
if (!NT_SUCCESS(Status)) goto CleanupWithRef;
|
||||||
}
|
}
|
||||||
|
@ -643,7 +644,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This is the initial system process */
|
/* This is the initial system process */
|
||||||
Flags &= ~PS_LARGE_PAGES;
|
Flags &= ~PROCESS_CREATE_FLAGS_LARGE_PAGES;
|
||||||
Status = MmInitializeProcessAddressSpace(Process,
|
Status = MmInitializeProcessAddressSpace(Process,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1347,9 +1348,9 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
"Parent: %p Attributes: %p\n", ParentProcess, ObjectAttributes);
|
"Parent: %p Attributes: %p\n", ParentProcess, ObjectAttributes);
|
||||||
|
|
||||||
/* Set new-style flags */
|
/* Set new-style flags */
|
||||||
if ((ULONG)SectionHandle & 1) Flags = PS_REQUEST_BREAKAWAY;
|
if ((ULONG)SectionHandle & 1) Flags |= PROCESS_CREATE_FLAGS_BREAKAWAY;
|
||||||
if ((ULONG)DebugPort & 1) Flags |= PS_NO_DEBUG_INHERIT;
|
if ((ULONG)DebugPort & 1) Flags |= PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT;
|
||||||
if (InheritObjectTable) Flags |= PS_INHERIT_HANDLES;
|
if (InheritObjectTable) Flags |= PROCESS_CREATE_FLAGS_INHERIT_HANDLES;
|
||||||
|
|
||||||
/* Call the new API */
|
/* Call the new API */
|
||||||
return NtCreateProcessEx(ProcessHandle,
|
return NtCreateProcessEx(ProcessHandle,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue