ReactOS  0.4.13-dev-455-g28ed234
psmgr.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for psmgr.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

INIT_FUNCTION USHORT NTAPI NameToOrdinal (IN PCHAR Name, IN PVOID DllBase, IN ULONG NumberOfNames, IN PULONG NameTable, IN PUSHORT OrdinalTable)
 
INIT_FUNCTION NTSTATUS NTAPI LookupEntryPoint (IN PVOID DllBase, IN PCHAR Name, OUT PVOID *EntryPoint)
 
INIT_FUNCTION NTSTATUS NTAPI PspLookupSystemDllEntryPoint (IN PCHAR Name, IN PVOID *EntryPoint)
 
INIT_FUNCTION NTSTATUS NTAPI PspLookupKernelUserEntryPoints (VOID)
 
NTSTATUS NTAPI PspMapSystemDll (IN PEPROCESS Process, IN PVOID *DllBase, IN BOOLEAN UseLargePages)
 
INIT_FUNCTION NTSTATUS NTAPI PsLocateSystemDll (VOID)
 
INIT_FUNCTION NTSTATUS NTAPI PspInitializeSystemDll (VOID)
 
INIT_FUNCTION BOOLEAN NTAPI PspInitPhase1 (VOID)
 
INIT_FUNCTION BOOLEAN NTAPI PspInitPhase0 (IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 
INIT_FUNCTION BOOLEAN NTAPI PsInitSystem (IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 
BOOLEAN NTAPI PsGetVersion (OUT PULONG MajorVersion OPTIONAL, OUT PULONG MinorVersion OPTIONAL, OUT PULONG BuildNumber OPTIONAL, OUT PUNICODE_STRING CSDVersion OPTIONAL)
 

Variables

ULONG ExpInitializationPhase
 
PVOID KeUserPopEntrySListEnd
 
PVOID KeUserPopEntrySListFault
 
PVOID KeUserPopEntrySListResume
 
GENERIC_MAPPING PspProcessMapping
 
GENERIC_MAPPING PspThreadMapping
 
PVOID PspSystemDllBase
 
PVOID PspSystemDllSection
 
PVOID PspSystemDllEntryPoint
 
UNICODE_STRING PsNtDllPathName
 
PHANDLE_TABLE PspCidTable
 
PEPROCESS PsInitialSystemProcess = NULL
 
PEPROCESS PsIdleProcess = NULL
 
HANDLE PspInitialSystemProcessHandle = NULL
 
ULONG PsMinimumWorkingSet
 
ULONG PsMaximumWorkingSet
 
struct {
   LIST_ENTRY   List
 
   KGUARDED_MUTEX   Lock
 
PspWorkingSetChangeHead
 
ULONG PspDefaultPagedLimit
 
ULONG PspDefaultNonPagedLimit
 
ULONG PspDefaultPagefileLimit
 
BOOLEAN PspDoingGiveBacks
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file psmgr.c.

Function Documentation

◆ LookupEntryPoint()

INIT_FUNCTION NTSTATUS NTAPI LookupEntryPoint ( IN PVOID  DllBase,
IN PCHAR  Name,
OUT PVOID EntryPoint 
)

Definition at line 111 of file psmgr.c.

114 {
115  PULONG NameTable;
116  PUSHORT OrdinalTable;
117  PIMAGE_EXPORT_DIRECTORY ExportDirectory;
118  ULONG ExportSize;
119  CHAR Buffer[64];
120  USHORT Ordinal;
121  PULONG ExportTable;
122 
123  /* Get the export directory */
124  ExportDirectory = RtlImageDirectoryEntryToData(DllBase,
125  TRUE,
127  &ExportSize);
128 
129  /* Validate the name and copy it */
130  if (strlen(Name) > sizeof(Buffer) - 2) return STATUS_INVALID_PARAMETER;
131  strcpy(Buffer, Name);
132 
133  /* Setup name tables */
134  NameTable = (PULONG)((ULONG_PTR)DllBase +
135  ExportDirectory->AddressOfNames);
136  OrdinalTable = (PUSHORT)((ULONG_PTR)DllBase +
137  ExportDirectory->AddressOfNameOrdinals);
138 
139  /* Get the ordinal */
140  Ordinal = NameToOrdinal(Buffer,
141  DllBase,
142  ExportDirectory->NumberOfNames,
143  NameTable,
144  OrdinalTable);
145 
146  /* Make sure the ordinal is valid */
147  if (Ordinal >= ExportDirectory->NumberOfFunctions)
148  {
149  /* It's not, fail */
151  }
152 
153  /* Resolve the address and write it */
154  ExportTable = (PULONG)((ULONG_PTR)DllBase +
155  ExportDirectory->AddressOfFunctions);
156  *EntryPoint = (PVOID)((ULONG_PTR)DllBase + ExportTable[Ordinal]);
157  return STATUS_SUCCESS;
158 }
INIT_FUNCTION USHORT NTAPI NameToOrdinal(IN PCHAR Name, IN PVOID DllBase, IN ULONG NumberOfNames, IN PULONG NameTable, IN PUSHORT OrdinalTable)
Definition: psmgr.c:68
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
char CHAR
Definition: xmlstorage.h:175
DWORD AddressOfNameOrdinals
Definition: compat.h:155
uint32_t ULONG_PTR
Definition: typedefs.h:63
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
#define RtlImageDirectoryEntryToData
Definition: compat.h:460
#define IMAGE_DIRECTORY_ENTRY_EXPORT
Definition: compat.h:140
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
#define STATUS_PROCEDURE_NOT_FOUND
Definition: ntstatus.h:344
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2777
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by PspLookupSystemDllEntryPoint().

◆ NameToOrdinal()

INIT_FUNCTION USHORT NTAPI NameToOrdinal ( IN PCHAR  Name,
IN PVOID  DllBase,
IN ULONG  NumberOfNames,
IN PULONG  NameTable,
IN PUSHORT  OrdinalTable 
)

Definition at line 68 of file psmgr.c.

73 {
74  ULONG Mid;
75  LONG Ret;
76 
77  /* Fail if no names */
78  if (!NumberOfNames) return -1;
79 
80  /* Do binary search */
81  Mid = NumberOfNames >> 1;
82  Ret = strcmp(Name, (PCHAR)((ULONG_PTR)DllBase + NameTable[Mid]));
83 
84  /* Check if we found it */
85  if (!Ret) return OrdinalTable[Mid];
86 
87  /* We didn't. Check if we only had one name to check */
88  if (NumberOfNames == 1) return -1;
89 
90  /* Check if we should look up or down */
91  if (Ret < 0)
92  {
93  /* Loop down */
94  NumberOfNames = Mid;
95  }
96  else
97  {
98  /* Look up, update tables */
99  NameTable = &NameTable[Mid + 1];
100  OrdinalTable = &OrdinalTable[Mid + 1];
101  NumberOfNames -= (Mid - 1);
102  }
103 
104  /* Call us recursively */
105  return NameToOrdinal(Name, DllBase, NumberOfNames, NameTable, OrdinalTable);
106 }
INIT_FUNCTION USHORT NTAPI NameToOrdinal(IN PCHAR Name, IN PVOID DllBase, IN ULONG NumberOfNames, IN PULONG NameTable, IN PUSHORT OrdinalTable)
Definition: psmgr.c:68
signed char * PCHAR
Definition: retypes.h:7
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by LookupEntryPoint().

◆ PsGetVersion()

BOOLEAN NTAPI PsGetVersion ( OUT PULONG MajorVersion  OPTIONAL,
OUT PULONG MinorVersion  OPTIONAL,
OUT PULONG BuildNumber  OPTIONAL,
OUT PUNICODE_STRING CSDVersion  OPTIONAL 
)

Definition at line 658 of file psmgr.c.

662 {
665  if (BuildNumber ) *BuildNumber = NtBuildNumber & 0x3FFF;
666 
667  if (CSDVersion)
668  {
669  CSDVersion->Length = CmCSDVersionString.Length;
670  CSDVersion->MaximumLength = CmCSDVersionString.MaximumLength;
671  CSDVersion->Buffer = CmCSDVersionString.Buffer;
672  }
673 
674  /* Return TRUE if this is a Checked Build */
675  return (NtBuildNumber >> 28) == 0xC;
676 }
ULONG MinorVersion
Definition: ros_glue.cpp:5
ULONG MajorVersion
Definition: ros_glue.cpp:4
USHORT MaximumLength
Definition: env_spec_w32.h:370
ULONG NtMajorVersion
Definition: init.c:42
ULONG NtMinorVersion
Definition: init.c:43
ULONG NtBuildNumber
Definition: init.c:47
UNICODE_STRING CmCSDVersionString
Definition: init.c:59
ULONG BuildNumber
Definition: ros_glue.cpp:6

◆ PsInitSystem()

INIT_FUNCTION BOOLEAN NTAPI PsInitSystem ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 624 of file psmgr.c.

625 {
626  /* Check the initialization phase */
627  switch (ExpInitializationPhase)
628  {
629  case 0:
630 
631  /* Do Phase 0 */
632  return PspInitPhase0(LoaderBlock);
633 
634  case 1:
635 
636  /* Do Phase 1 */
637  return PspInitPhase1();
638 
639  default:
640 
641  /* Don't know any other phase! Bugcheck! */
642  KeBugCheckEx(UNEXPECTED_INITIALIZATION_CALL,
643  1,
645  0,
646  0);
647  return FALSE;
648  }
649 }
INIT_FUNCTION BOOLEAN NTAPI PspInitPhase1(VOID)
Definition: psmgr.c:396
INIT_FUNCTION BOOLEAN NTAPI PspInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: psmgr.c:406
ULONG ExpInitializationPhase
Definition: init.c:65
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107

Referenced by ExpInitializeExecutive(), and Phase1InitializationDiscard().

◆ PsLocateSystemDll()

INIT_FUNCTION NTSTATUS NTAPI PsLocateSystemDll ( VOID  )

Definition at line 279 of file psmgr.c.

280 {
283  HANDLE FileHandle, SectionHandle;
285  ULONG_PTR HardErrorParameters;
286  ULONG HardErrorResponse;
287 
288  /* Locate and open NTDLL to determine ImageBase and LdrStartup */
291  0,
292  NULL,
293  NULL);
297  &IoStatusBlock,
299  0);
300  if (!NT_SUCCESS(Status))
301  {
302  /* Failed, bugcheck */
303  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 2, 0, 0);
304  }
305 
306  /* Check if the image is valid */
309  {
310  /* Raise a hard error */
311  HardErrorParameters = (ULONG_PTR)&PsNtDllPathName;
313  1,
314  1,
315  &HardErrorParameters,
316  OptionOk,
317  &HardErrorResponse);
318  return Status;
319  }
320 
321  /* Create a section for NTDLL */
322  Status = ZwCreateSection(&SectionHandle,
324  NULL,
325  NULL,
326  PAGE_EXECUTE,
327  SEC_IMAGE,
328  FileHandle);
330  if (!NT_SUCCESS(Status))
331  {
332  /* Failed, bugcheck */
333  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 3, 0, 0);
334  }
335 
336  /* Reference the Section */
337  Status = ObReferenceObjectByHandle(SectionHandle,
340  KernelMode,
342  NULL);
343  ZwClose(SectionHandle);
344  if (!NT_SUCCESS(Status))
345  {
346  /* Failed, bugcheck */
347  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 4, 0, 0);
348  }
349 
350  /* Map it */
352  if (!NT_SUCCESS(Status))
353  {
354  /* Failed, bugcheck */
355  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 5, 0, 0);
356  }
357 
358  /* Return status */
359  return Status;
360 }
#define FILE_READ_ACCESS
Definition: nt_native.h:610
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define TRUE
Definition: types.h:120
UNICODE_STRING PsNtDllPathName
Definition: psmgr.c:45
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:553
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_SHARE_READ
Definition: compat.h:125
uint32_t ULONG_PTR
Definition: typedefs.h:63
HANDLE FileHandle
Definition: stats.c:38
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1293
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
PVOID PspSystemDllBase
Definition: psmgr.c:41
#define PsGetCurrentProcess
Definition: psfuncs.h:17
smooth NULL
Definition: ftsmooth.c:416
#define PAGE_EXECUTE
Definition: nt_native.h:1306
#define STATUS_IMAGE_CHECKSUM_MISMATCH
Definition: ntstatus.h:663
NTSTATUS NTAPI MmCheckSystemImage(IN HANDLE ImageHandle, IN BOOLEAN PurgeSection)
Definition: sysldr.c:2643
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
POBJECT_TYPE MmSectionObjectType
Definition: section.c:136
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
Status
Definition: gdiplustypes.h:24
PVOID PspSystemDllSection
Definition: psmgr.c:42
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
#define SEC_IMAGE
Definition: mmtypes.h:96
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSTATUS NTAPI PspMapSystemDll(IN PEPROCESS Process, IN PVOID *DllBase, IN BOOLEAN UseLargePages)
Definition: psmgr.c:245
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107

Referenced by IoInitSystem().

◆ PspInitializeSystemDll()

INIT_FUNCTION NTSTATUS NTAPI PspInitializeSystemDll ( VOID  )

Definition at line 365 of file psmgr.c.

366 {
368 
369  /* Get user-mode startup thunk */
370  Status = PspLookupSystemDllEntryPoint("LdrInitializeThunk",
372  if (!NT_SUCCESS(Status))
373  {
374  /* Failed, bugcheck */
375  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 7, 0, 0);
376  }
377 
378  /* Get all the other entrypoints */
380  if (!NT_SUCCESS(Status))
381  {
382  /* Failed, bugcheck */
383  KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 8, 0, 0);
384  }
385 
386  /* Let KD know we are done */
388 
389  /* Return status */
390  return Status;
391 }
LONG NTSTATUS
Definition: precomp.h:26
INIT_FUNCTION NTSTATUS NTAPI PspLookupKernelUserEntryPoints(VOID)
Definition: psmgr.c:173
VOID NTAPI KdUpdateDataBlock(VOID)
Definition: kdmain.c:273
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID PspSystemDllEntryPoint
Definition: psmgr.c:43
INIT_FUNCTION NTSTATUS NTAPI PspLookupSystemDllEntryPoint(IN PCHAR Name, IN PVOID *EntryPoint)
Definition: psmgr.c:163
Status
Definition: gdiplustypes.h:24
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107

Referenced by PspInitPhase1().

◆ PspInitPhase0()

INIT_FUNCTION BOOLEAN NTAPI PspInitPhase0 ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 406 of file psmgr.c.

407 {
410  HANDLE SysThreadHandle;
411  PETHREAD SysThread;
412  MM_SYSTEMSIZE SystemSize;
414  OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
415  ULONG i;
416 
417  /* Get the system size */
418  SystemSize = MmQuerySystemSize();
419 
420  /* Setup some memory options */
422  switch (SystemSize)
423  {
424  /* Medimum systems */
425  case MmMediumSystem:
426 
427  /* Increase the WS sizes a bit */
428  PsMinimumWorkingSet += 10;
429  PsMaximumWorkingSet += 100;
430 
431  /* Large systems */
432  case MmLargeSystem:
433 
434  /* Increase the WS sizes a bit more */
435  PsMinimumWorkingSet += 30;
436  PsMaximumWorkingSet += 300;
437 
438  /* Small and other systems */
439  default:
440  break;
441  }
442 
443  /* Setup callbacks */
444  for (i = 0; i < PSP_MAX_CREATE_THREAD_NOTIFY; i++)
445  {
447  }
448  for (i = 0; i < PSP_MAX_CREATE_PROCESS_NOTIFY; i++)
449  {
451  }
452  for (i = 0; i < PSP_MAX_LOAD_IMAGE_NOTIFY; i++)
453  {
455  }
456 
457  /* Setup the quantum table */
459 
460  /* Set quota settings */
464  {
465  /* Enable give-backs */
467  }
468  else
469  {
470  /* Disable them */
472  }
473 
474  /* Now multiply limits by 1MB */
475  PspDefaultPagedLimit <<= 20;
478 
479  /* Initialize the Active Process List */
482 
483  /* Get the idle process */
485 
486  /* Setup the locks */
489 
490  /* Initialize the thread list */
492 
493  /* Clear kernel time */
495 
496  /* Initialize Object Initializer */
497  RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer));
498  ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
499  ObjectTypeInitializer.InvalidAttributes = OBJ_PERMANENT |
500  OBJ_EXCLUSIVE |
501  OBJ_OPENIF;
502  ObjectTypeInitializer.PoolType = NonPagedPool;
503  ObjectTypeInitializer.SecurityRequired = TRUE;
504 
505  /* Initialize the Process type */
506  RtlInitUnicodeString(&Name, L"Process");
507  ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(EPROCESS);
508  ObjectTypeInitializer.GenericMapping = PspProcessMapping;
509  ObjectTypeInitializer.ValidAccessMask = PROCESS_ALL_ACCESS;
510  ObjectTypeInitializer.DeleteProcedure = PspDeleteProcess;
511  ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &PsProcessType);
512 
513  /* Initialize the Thread type */
514  RtlInitUnicodeString(&Name, L"Thread");
515  ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
516  ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(ETHREAD);
517  ObjectTypeInitializer.GenericMapping = PspThreadMapping;
518  ObjectTypeInitializer.ValidAccessMask = THREAD_ALL_ACCESS;
519  ObjectTypeInitializer.DeleteProcedure = PspDeleteThread;
520  ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &PsThreadType);
521 
522  /* Initialize the Job type */
523  RtlInitUnicodeString(&Name, L"Job");
524  ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
525  ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(EJOB);
526  ObjectTypeInitializer.GenericMapping = PspJobMapping;
527  ObjectTypeInitializer.InvalidAttributes = 0;
528  ObjectTypeInitializer.ValidAccessMask = JOB_OBJECT_ALL_ACCESS;
529  ObjectTypeInitializer.DeleteProcedure = PspDeleteJob;
530  ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &PsJobType);
531 
532  /* Initialize job structures external to this file */
534 
535  /* Initialize the Working Set data */
538 
539  /* Create the CID Handle table */
541  if (!PspCidTable) return FALSE;
542 
543  /* FIXME: Initialize LDT/VDM support */
544 
545  /* Setup the reaper */
547 
548  /* Set the boot access token */
550 
551  /* Setup default object attributes */
553  NULL,
554  0,
555  NULL,
556  NULL);
557 
558  /* Create the Initial System Process */
562  0,
563  FALSE,
564  0,
565  0,
566  0,
567  FALSE);
568  if (!NT_SUCCESS(Status)) return FALSE;
569 
570  /* Get a reference to it */
572  0,
574  KernelMode,
576  NULL);
577 
578  /* Copy the process names */
581 
582  /* Allocate a structure for the audit name */
585  sizeof(OBJECT_NAME_INFORMATION),
586  TAG_SEPA);
588  {
589  /* Allocation failed */
590  return FALSE;
591  }
592 
593  /* Zero it */
595  SeAuditProcessCreationInfo.ImageFileName,
596  sizeof(OBJECT_NAME_INFORMATION));
597 
598  /* Setup the system initialization thread */
599  Status = PsCreateSystemThread(&SysThreadHandle,
602  0,
603  NULL,
605  LoaderBlock);
606  if (!NT_SUCCESS(Status)) return FALSE;
607 
608  /* Create a handle to it */
609  ObReferenceObjectByHandle(SysThreadHandle,
610  0,
611  PsThreadType,
612  KernelMode,
613  (PVOID*)&SysThread,
614  NULL);
615  ObCloseHandle(SysThreadHandle, KernelMode);
616 
617  /* Return success */
618  return TRUE;
619 }
ULONG_PTR Value
Definition: extypes.h:465
ULONG PsMaximumWorkingSet
Definition: psmgr.c:54
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define PSP_MAX_CREATE_PROCESS_NOTIFY
Definition: ps.h:66
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
Definition: oblife.c:1048
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define TRUE
Definition: types.h:120
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
POBJECT_TYPE PsJobType
Definition: job.c:20
VOID NTAPI PspDeleteThread(IN PVOID ObjectBody)
Definition: kill.c:390
POBJECT_NAME_INFORMATION ImageFileName
Definition: setypes.h:145
VOID NTAPI ExInitializeCallBack(IN OUT PEX_CALLBACK Callback)
Definition: callback.c:46
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI PspReapRoutine(IN PVOID Context)
Definition: kill.c:170
ULONG PsRawPrioritySeparation
Definition: process.c:27
VOID NTAPI PspDeleteJob(IN PVOID ObjectBody)
#define OBJ_PERMANENT
Definition: winternl.h:226
PTOKEN PspBootAccessToken
Definition: security.c:17
LIST_ENTRY PsActiveProcessHead
Definition: process.c:22
NTKERNELAPI VOID FASTCALL ExInitializeRundownProtection(_Out_ PEX_RUNDOWN_REF RunRef)
ULONG PspDefaultPagefileLimit
Definition: psmgr.c:60
VOID NTAPI Phase1Initialization(IN PVOID Context)
Definition: init.c:2016
enum _MM_SYSTEM_SIZE MM_SYSTEMSIZE
WORK_QUEUE_ITEM PspReaperWorkItem
Definition: kill.c:20
#define OBJ_OPENIF
Definition: winternl.h:229
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
PEPROCESS PsInitialSystemProcess
Definition: psmgr.c:50
NTSTATUS NTAPI PspCreateProcess(OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN HANDLE ParentProcess OPTIONAL, IN ULONG Flags, IN HANDLE SectionHandle OPTIONAL, IN HANDLE DebugPort OPTIONAL, IN HANDLE ExceptionPort OPTIONAL, IN BOOLEAN InJob)
Definition: process.c:347
EX_CALLBACK PspProcessNotifyRoutine[PSP_MAX_CREATE_PROCESS_NOTIFY]
Definition: psnotify.c:22
struct NameRec_ * Name
Definition: cdprocs.h:464
#define PsGetCurrentProcess
Definition: psfuncs.h:17
smooth NULL
Definition: ftsmooth.c:416
GENERIC_MAPPING PspThreadMapping
Definition: psmgr.c:32
#define OBJ_EXCLUSIVE
Definition: winternl.h:227
VOID NTAPI PsChangeQuantumTable(IN BOOLEAN Immediate, IN ULONG PrioritySeparation)
Definition: process.c:235
struct @1753 PspWorkingSetChangeHead
LIST_ENTRY ThreadListHead
Definition: pstypes.h:1260
#define PSP_MAX_CREATE_THREAD_NOTIFY
Definition: ps.h:64
SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo
Definition: pstypes.h:1286
#define PSP_MAX_LOAD_IMAGE_NOTIFY
Definition: ps.h:65
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
EX_FAST_REF Token
Definition: pstypes.h:1218
GENERIC_MAPPING PspJobMapping
Definition: job.c:41
struct _EPROCESS EPROCESS
MM_SYSTEMSIZE NTAPI MmQuerySystemSize(VOID)
Definition: mmsup.c:257
ULONG PspDefaultPagedLimit
Definition: psmgr.c:60
PHANDLE_TABLE NTAPI ExCreateHandleTable(IN PEPROCESS Process OPTIONAL)
Definition: handle.c:765
EX_CALLBACK PspThreadNotifyRoutine[PSP_MAX_CREATE_THREAD_NOTIFY]
Definition: psnotify.c:21
HANDLE PspInitialSystemProcessHandle
Definition: psmgr.c:52
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI PspDeleteProcess(IN PVOID ObjectBody)
Definition: kill.c:256
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3376
POBJECT_TYPE PsThreadType
Definition: thread.c:20
static const WCHAR L[]
Definition: oid.c:1250
ULONG PspDefaultNonPagedLimit
Definition: psmgr.c:60
EX_RUNDOWN_REF RundownProtect
Definition: pstypes.h:1197
KPROCESS Pcb
Definition: pstypes.h:1193
Status
Definition: gdiplustypes.h:24
#define MAXULONG
Definition: typedefs.h:250
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:31
GENERIC_MAPPING GenericMapping
Definition: obtypes.h:358
struct _TOKEN * PTOKEN
struct _ETHREAD ETHREAD
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
KGUARDED_MUTEX PspActiveProcessMutex
Definition: process.c:23
GENERIC_MAPPING PspProcessMapping
Definition: psmgr.c:21
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
ULONG KernelTime
Definition: ketypes.h:1992
#define JOB_OBJECT_ALL_ACCESS
Definition: pstypes.h:197
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
CHAR ImageFileName[16]
Definition: pstypes.h:1257
unsigned int ULONG
Definition: retypes.h:1
INIT_FUNCTION VOID NTAPI PspInitializeJobStructures(VOID)
Definition: job.c:111
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define MAX_FAST_REFS
Definition: ex.h:128
PHANDLE_TABLE PspCidTable
Definition: psmgr.c:48
struct _EJOB EJOB
EX_PUSH_LOCK ProcessLock
Definition: pstypes.h:1194
#define TAG_SEPA
Definition: tag.h:189
ULONG PsMinimumWorkingSet
Definition: psmgr.c:54
OB_DELETE_METHOD DeleteProcedure
Definition: obtypes.h:369
PEPROCESS PsIdleProcess
Definition: psmgr.c:51
POBJECT_TYPE PsProcessType
Definition: process.c:20
ULONG DefaultNonPagedPoolCharge
Definition: obtypes.h:365
EX_CALLBACK PspLoadImageNotifyRoutine[PSP_MAX_LOAD_IMAGE_NOTIFY]
Definition: psnotify.c:23
ULONG_PTR Value
Definition: extypes.h:424
BOOLEAN PspDoingGiveBacks
Definition: psmgr.c:61

Referenced by PsInitSystem().

◆ PspInitPhase1()

INIT_FUNCTION BOOLEAN NTAPI PspInitPhase1 ( VOID  )

Definition at line 396 of file psmgr.c.

397 {
398  /* Initialize the System DLL and return status of operation */
399  if (!NT_SUCCESS(PspInitializeSystemDll())) return FALSE;
400  return TRUE;
401 }
#define TRUE
Definition: types.h:120
INIT_FUNCTION NTSTATUS NTAPI PspInitializeSystemDll(VOID)
Definition: psmgr.c:365
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32

Referenced by PsInitSystem().

◆ PspLookupKernelUserEntryPoints()

INIT_FUNCTION NTSTATUS NTAPI PspLookupKernelUserEntryPoints ( VOID  )

Definition at line 173 of file psmgr.c.

174 {
176 
177  /* Get user-mode APC trampoline */
178  Status = PspLookupSystemDllEntryPoint("KiUserApcDispatcher",
180  if (!NT_SUCCESS(Status)) return Status;
181 
182  /* Get user-mode exception dispatcher */
183  Status = PspLookupSystemDllEntryPoint("KiUserExceptionDispatcher",
185  if (!NT_SUCCESS(Status)) return Status;
186 
187  /* Get user-mode callback dispatcher */
188  Status = PspLookupSystemDllEntryPoint("KiUserCallbackDispatcher",
190  if (!NT_SUCCESS(Status)) return Status;
191 
192  /* Get user-mode exception raise trampoline */
193  Status = PspLookupSystemDllEntryPoint("KiRaiseUserExceptionDispatcher",
195  if (!NT_SUCCESS(Status)) return Status;
196 
197  /* Get user-mode SLIST exception functions for page fault rollback race hack */
198  Status = PspLookupSystemDllEntryPoint("ExpInterlockedPopEntrySListEnd",
200  if (!NT_SUCCESS(Status)) { DPRINT1("this not found\n"); return Status; }
201  Status = PspLookupSystemDllEntryPoint("ExpInterlockedPopEntrySListFault",
203  if (!NT_SUCCESS(Status)) { DPRINT1("this not found\n"); return Status; }
204  Status = PspLookupSystemDllEntryPoint("ExpInterlockedPopEntrySListResume",
206  if (!NT_SUCCESS(Status)) { DPRINT1("this not found\n"); return Status; }
207 
208  /* On x86, there are multiple ways to do a system call, find the right stubs */
209 #if defined(_X86_)
210  /* Check if this is a machine that supports SYSENTER */
212  {
213  /* Get user-mode sysenter stub */
214  SharedUserData->SystemCall = (PsNtosImageBase >> (PAGE_SHIFT + 1));
215  Status = PspLookupSystemDllEntryPoint("KiFastSystemCall",
217  SystemCall);
218  if (!NT_SUCCESS(Status)) return Status;
219 
220  /* Get user-mode sysenter return stub */
221  Status = PspLookupSystemDllEntryPoint("KiFastSystemCallRet",
223  SystemCallReturn);
224  if (!NT_SUCCESS(Status)) return Status;
225  }
226  else
227  {
228  /* Get the user-mode interrupt stub */
229  Status = PspLookupSystemDllEntryPoint("KiIntSystemCall",
231  SystemCall);
232  if (!NT_SUCCESS(Status)) return Status;
233  }
234 
235  /* Set the test instruction */
236  SharedUserData->TestRetInstruction = 0xC3;
237 #endif
238 
239  /* Return the status */
240  return Status;
241 }
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
PVOID KeUserApcDispatcher
Definition: ke.h:137
LONG NTSTATUS
Definition: precomp.h:26
ULONG KeFeatureBits
Definition: krnlinit.c:22
PVOID KeUserPopEntrySListResume
Definition: psmgr.c:19
PVOID KeUserPopEntrySListFault
Definition: psmgr.c:18
PVOID KeUserPopEntrySListEnd
Definition: psmgr.c:17
PVOID KeUserCallbackDispatcher
Definition: ke.h:138
PVOID KeRaiseUserExceptionDispatcher
Definition: ke.h:140
ULONG_PTR PsNtosImageBase
Definition: sysldr.c:38
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define KF_FAST_SYSCALL
Definition: ketypes.h:155
PVOID KeUserExceptionDispatcher
Definition: ke.h:139
#define SharedUserData
INIT_FUNCTION NTSTATUS NTAPI PspLookupSystemDllEntryPoint(IN PCHAR Name, IN PVOID *EntryPoint)
Definition: psmgr.c:163
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8

Referenced by PspInitializeSystemDll().

◆ PspLookupSystemDllEntryPoint()

INIT_FUNCTION NTSTATUS NTAPI PspLookupSystemDllEntryPoint ( IN PCHAR  Name,
IN PVOID EntryPoint 
)

Definition at line 163 of file psmgr.c.

165 {
166  /* Call the LDR Routine */
167  return LookupEntryPoint(PspSystemDllBase, Name, EntryPoint);
168 }
PVOID PspSystemDllBase
Definition: psmgr.c:41
INIT_FUNCTION NTSTATUS NTAPI LookupEntryPoint(IN PVOID DllBase, IN PCHAR Name, OUT PVOID *EntryPoint)
Definition: psmgr.c:111

Referenced by PspInitializeSystemDll(), and PspLookupKernelUserEntryPoints().

◆ PspMapSystemDll()

NTSTATUS NTAPI PspMapSystemDll ( IN PEPROCESS  Process,
IN PVOID DllBase,
IN BOOLEAN  UseLargePages 
)

Definition at line 245 of file psmgr.c.

248 {
250  LARGE_INTEGER Offset = {{0, 0}};
251  SIZE_T ViewSize = 0;
252  PVOID ImageBase = 0;
253 
254  /* Map the System DLL */
256  Process,
257  (PVOID*)&ImageBase,
258  0,
259  0,
260  &Offset,
261  &ViewSize,
262  ViewShare,
263  0,
265  if (Status != STATUS_SUCCESS)
266  {
267  /* Normalize status code */
269  }
270 
271  /* Write the image base and return status */
272  if (DllBase) *DllBase = ImageBase;
273  return Status;
274 }
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
Definition: section.c:4499
Status
Definition: gdiplustypes.h:24
PVOID PspSystemDllSection
Definition: psmgr.c:42
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:404
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:247
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define PAGE_READWRITE
Definition: nt_native.h:1304

Referenced by PsLocateSystemDll().

Variable Documentation

◆ ExpInitializationPhase

ULONG ExpInitializationPhase

Definition at line 65 of file init.c.

Referenced by PsInitSystem().

◆ KeUserPopEntrySListEnd

PVOID KeUserPopEntrySListEnd

Definition at line 17 of file psmgr.c.

Referenced by PspLookupKernelUserEntryPoints().

◆ KeUserPopEntrySListFault

PVOID KeUserPopEntrySListFault

Definition at line 18 of file psmgr.c.

Referenced by KiTrap0EHandler(), and PspLookupKernelUserEntryPoints().

◆ KeUserPopEntrySListResume

PVOID KeUserPopEntrySListResume

Definition at line 19 of file psmgr.c.

Referenced by KiTrap0EHandler(), and PspLookupKernelUserEntryPoints().

◆ List

LIST_ENTRY List

Definition at line 57 of file psmgr.c.

Referenced by AcpiRsDecodeBitmask(), AcpiRsEncodeBitmask(), AddDiskToList(), AddEntriesFromInfSection(), AddMemoryDescriptor(), AddNTOSInstallation(), AddProvider(), AppendGenericListEntry(), ApphelpCacheDump(), ApphelpCacheUpdateEntry(), ApphelpCacheWrite(), AssignDriveLetters(), BadBlockQueryRoutine(), BlGetBootOptionBoolean(), BlGetBootOptionDevice(), BlGetBootOptionGuid(), BlGetBootOptionGuidList(), BlGetBootOptionInteger(), BlGetBootOptionString(), BlMmMapPhysicalAddressEx(), BlpGetBootOptionIntegerList(), BlRemoveBootOption(), CachedGetUserFromSid(), CcPostWorkQueue(), CenterCurrentListItem(), CheckActiveSystemPartition(), ClassInitializeEx(), ClassInsertCScanList(), ClasspInitializeCScanList(), ClasspStartNextSweep(), ClassRemoveCScanList(), CmpAddToLeaf(), CmpSplitLeaf(), co_IntPaintWindows(), co_IntSendActivateMessages(), co_UserDestroyWindow(), co_WinPosSearchChildren(), ConsolepFindResolution(), CreateComputerTypeList(), CreateDisplayDriverList(), CreateExtendedPartition(), CreateFileSystemList(), CreateGenericList(), CreateKeyboardDriverList(), CreateKeyboardLayoutList(), CreateLanguageList(), CreateLogicalPartition(), CreateNTOSInstallationsList(), CreatePartitionList(), CreatePrimaryPartition(), DceEmptyCache(), DceFreeClassDCE(), DceFreeThreadDCE(), DceFreeWindowDCE(), DceGetDceFromDC(), DceReleaseDC(), DceResetActiveDCEs(), DeletePartition(), DestroyFileSystemList(), DestroyGenericList(), DestroyPartitionList(), Dns_PtrArrayToOffsetArray(), DrawFileSystemList(), DrawGenericList(), DrawGenericListCurrentItem(), DrawListEntries(), DrawPartitionList(), DrawScrollBarGenericList(), EnumThemeProc(), EnumThemeStyles(), ExecuteFor(), ExInitializeSystemLookasideList(), ExpWorkerThreadEntryPoint(), Ext2bhReaperThread(), Ext2BuildExtents(), Ext2CountExtents(), Ext2DestroyExtentChain(), Ext2FcbReaperThread(), Ext2FirstUnusedMcb(), Ext2IsHandleCountZero(), Ext2JointExtents(), Ext2McbReaperThread(), Ext2MountVolume(), Ext2PurgeVolume(), Ext2WriteVolume(), FatPrefetchPages(), FFSAllocateMcb(), FFSIsHandleCountZero(), FFSSearchMcbTree(), FindExistingNTOSInstall(), FindNTOSInstallations(), CListIterator< Item >::First(), FixList(), ForDir(), ForF(), ForLoop(), ForRecursive(), FsRtlWorkerThread(), GenericListKeyPress(), GetCurrentListEntry(), GetDeviceCount(), GetDiskByBiosNumber(), GetDiskByNumber(), GetDiskBySCSI(), GetDiskBySignature(), CDFParser::GetDiskName(), CDFParser::GetDiskNumber(), GetDiskOrPartition(), GetFileSystemByName(), GetFirstListEntry(), GetNextPartition(), GetNextUncheckedPartition(), GetNextUnformattedPartition(), GetNumberOfListEntries(), GetPrevPartition(), HalpQueryAcpiResourceRequirements(), InitBadBlocks(), InitGenericComboList(), InitGenericListUi(), InitGenericListView(), InitializeFileSystemList(), InitPartitionListUi(), InsertDiskRegion(), IntChildWindowFromPointEx(), IntClientShutdown(), IntDeactivateWindow(), IntFindWindow(), IntRealChildWindowFromPoint(), IntVideoPortMapMemory(), IntVideoPortPnPStartDevice(), IntVideoPortUnmapMemory(), IntWindowFromDC(), IntWinListChildren(), IntWinListOwnedPopups(), IoAllocateIrp(), IoFreeIrp(), IopFreeMiniPacket(), IoSetIoCompletion(), CListIterator< Item >::IsDone(), KdRegisterDebuggerDataBlock(), LoadClassicColorSchemes(), LoadSchemeSizes(), MiAllocatePoolPages(), MiscGetBootOption(), MmMdInitializeListHead(), MmPapAllocatePagesInRange(), NdisIPnPStartDevice(), NpCancelWaiter(), NpCheckForNotify(), NpCommonRead(), NpCommonSetInformation(), NpCommonWrite(), NpCompleteStalledWrites(), NpCreateClientEnd(), NpCreateExistingNamedPipe(), NpCreateNewNamedPipe(), NpDisconnect(), NpGetNextRealDataQueueEntry(), NpListen(), NpPeek(), NpReadDataQueue(), NpRemoveDataQueueEntry(), NpSetClosingPipeState(), NpSetConnectedPipeState(), NpSetDisconnectedPipeState(), NpSetListeningPipeState(), NpSetPipeInfo(), NpTransceive(), NpWriteDataQueue(), NtUserBuildHwndList(), NtUserFindWindowEx(), NtUserMessageCall(), ObpAllocateObjectCreateInfoBuffer(), ObpFreeCapturedAttributes(), ParseFor(), ParseRedirection(), PciDebugPrintIoResReqList(), PciFindNextSecondaryExtension(), PcipLinkSecondaryExtension(), PcNewResourceList(), PcNewResourceSublist(), PdoQueryResourceRequirements(), PdoQueryResources(), PerfDataUninitialize(), PnpDetermineResourceListSize(), PopProcessShutDownLists(), PrintDiskData(), ProcessComputerFiles(), ProcessDisplayRegistry(), ProcessKeyboardLayoutRegistry(), ProcessLocaleRegistry(), RfsdAllocateMcb(), RfsdIsHandleCountZero(), RfsdSearchMcbTree(), RtlInterlockedPushListSList(), RxpWorkerThreadDispatcher(), RxSpinUpRequestsDispatcher(), ScrollDownFileSystemList(), ScrollDownGenericList(), ScrollToPositionGenericList(), ScrollUpFileSystemList(), ScrollUpGenericList(), ScsiPortInitialize(), SelectPartition(), SetCurrentListEntry(), CDFParser::SetDiskName(), CDFParser::SetDiskNumber(), SetDiskSignature(), SetMountedDeviceValues(), SmpFindRegistryValue(), StreamClassStartDevice(), TcpipAllocateFromNPagedLookasideList(), UpdateDiskSignatures(), UpdateHwDiskNumbers(), USB2_RebalanceEndpoint(), USBPORT_DpcHandler(), USBPORT_FindMiniPort(), USBPORT_FlushAbortList(), USBPORT_FlushAllEndpoints(), USBPORT_FlushPendingTransfers(), USBPORT_IsrDpcHandler(), USBPORT_MapTransfer(), USBPORT_SplitBulkInterruptTransfer(), USBPORT_SplitTransfer(), UserGetDCEx(), UserPostMessage(), UserRegisterClass(), UserRegisterUserApiHook(), UserReleaseDC(), UserSendNotifyMessage(), WCacheCheckLimitsR(), WCacheCheckLimitsRAM(), WCacheCheckLimitsRW(), WCacheDiscardBlocks__(), WCacheFlushAllRAM(), WCacheFlushAllRW(), WCacheFlushBlocksRAM(), WCacheFlushBlocksRW(), WCacheGetSortedListIndex(), WCacheInsertItemToList(), WCacheInsertRangeToList(), WCachePurgeAllR(), WCachePurgeAllRAM(), WCachePurgeAllRW(), WCacheRemoveItemFromList(), WCacheRemoveRangeFromList(), WCacheSyncReloc__(), WinPosDoOwnedPopups(), WorkItemRoutine(), WritePartitionsToDisk(), WsNcUpdateNamespaceList(), and WsTcUpdateProtocolList().

◆ Lock

Definition at line 58 of file psmgr.c.

◆ PsIdleProcess

PEPROCESS PsIdleProcess = NULL

◆ PsInitialSystemProcess

◆ PsMaximumWorkingSet

ULONG PsMaximumWorkingSet

Definition at line 54 of file psmgr.c.

Referenced by PspCreateProcess(), and PspInitPhase0().

◆ PsMinimumWorkingSet

ULONG PsMinimumWorkingSet

Definition at line 54 of file psmgr.c.

Referenced by PspCreateProcess(), and PspInitPhase0().

◆ PsNtDllPathName

UNICODE_STRING PsNtDllPathName
Initial value:
=
RTL_CONSTANT_STRING(L"\\SystemRoot\\System32\\ntdll.dll")
static const WCHAR L[]
Definition: oid.c:1250
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Definition at line 45 of file psmgr.c.

Referenced by DbgkCreateThread(), and PsLocateSystemDll().

◆ PspCidTable

◆ PspDefaultNonPagedLimit

ULONG PspDefaultNonPagedLimit

Definition at line 60 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspDefaultPagedLimit

ULONG PspDefaultPagedLimit

Definition at line 60 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspDefaultPagefileLimit

ULONG PspDefaultPagefileLimit

Definition at line 60 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspDoingGiveBacks

BOOLEAN PspDoingGiveBacks

Definition at line 61 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspInitialSystemProcessHandle

HANDLE PspInitialSystemProcessHandle = NULL

Definition at line 52 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspProcessMapping

GENERIC_MAPPING PspProcessMapping
Initial value:
=
{
}
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
#define STANDARD_RIGHTS_WRITE
Definition: nt_native.h:66
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:158
#define STANDARD_RIGHTS_EXECUTE
Definition: nt_native.h:67
#define PROCESS_SUSPEND_RESUME
Definition: pstypes.h:159
#define PROCESS_CREATE_THREAD
Definition: pstypes.h:150
#define PROCESS_DUP_HANDLE
#define PROCESS_SET_QUOTA
Definition: pstypes.h:156
#define PROCESS_VM_WRITE
Definition: pstypes.h:154
#define PROCESS_CREATE_PROCESS
Definition: pstypes.h:155
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
#define SYNCHRONIZE
Definition: nt_native.h:61
#define PROCESS_TERMINATE
Definition: pstypes.h:149
#define PROCESS_VM_READ
Definition: pstypes.h:153
#define PROCESS_VM_OPERATION
Definition: pstypes.h:152
#define PROCESS_SET_INFORMATION
Definition: pstypes.h:157

Definition at line 21 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspSystemDllBase

PVOID PspSystemDllBase

◆ PspSystemDllEntryPoint

PVOID PspSystemDllEntryPoint

Definition at line 43 of file psmgr.c.

Referenced by PspInitializeSystemDll(), and PspUserThreadStartup().

◆ PspSystemDllSection

PVOID PspSystemDllSection

Definition at line 42 of file psmgr.c.

Referenced by PsLocateSystemDll(), and PspMapSystemDll().

◆ PspThreadMapping

GENERIC_MAPPING PspThreadMapping
Initial value:
=
{
}
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define STANDARD_RIGHTS_WRITE
Definition: nt_native.h:66
#define THREAD_ALERT
#define THREAD_SET_INFORMATION
Definition: nt_native.h:1337
#define STANDARD_RIGHTS_EXECUTE
Definition: nt_native.h:67
#define THREAD_SET_CONTEXT
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
#define SYNCHRONIZE
Definition: nt_native.h:61
#define THREAD_SUSPEND_RESUME
#define THREAD_TERMINATE
Definition: nt_native.h:1336
#define THREAD_GET_CONTEXT
#define THREAD_QUERY_INFORMATION
Definition: pstypes.h:141

Definition at line 32 of file psmgr.c.

Referenced by PspInitPhase0().

◆ PspWorkingSetChangeHead

struct { ... } PspWorkingSetChangeHead

Referenced by PspInitPhase0().