|
ReactOS 0.4.17-dev-806-gffa4164
|
#include "ps_x.h"
Go to the source code of this file.
Classes | |
| struct | _GET_SET_CTX_CONTEXT |
Macros | |
| #define | _PS_DEBUG_ 0x00 |
| #define | PS_THREAD_DEBUG 0x01 |
| #define | PS_PROCESS_DEBUG 0x02 |
| #define | PS_SECURITY_DEBUG 0x04 |
| #define | PS_JOB_DEBUG 0x08 |
| #define | PS_NOTIFICATIONS_DEBUG 0x10 |
| #define | PS_WIN32K_DEBUG 0x20 |
| #define | PS_STATE_DEBUG 0x40 |
| #define | PS_QUOTA_DEBUG 0x80 |
| #define | PS_KILL_DEBUG 0x100 |
| #define | PS_REF_DEBUG 0x200 |
| #define | PSTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__) |
| #define | PSREFTRACE(x) |
| #define | PSP_MAX_CREATE_THREAD_NOTIFY 8 |
| #define | PSP_MAX_LOAD_IMAGE_NOTIFY 8 |
| #define | PSP_MAX_CREATE_PROCESS_NOTIFY 8 |
| #define | PSP_JOB_SCHEDULING_CLASS_DEFAULT 5 |
| #define | PSP_JOB_SCHEDULING_CLASSES 10 |
| #define | PSP_JOB_BASIC_LIMIT_VALID_FLAGS |
| #define | PSP_JOB_EXTENDED_LIMIT_VALID_FLAGS |
| #define | PSP_NON_PAGED_POOL_QUOTA_THRESHOLD 0x10000 |
| #define | PSP_PAGED_POOL_QUOTA_THRESHOLD 0x80000 |
| #define | PSP_JOB_NOT_REALLY_ACTIVE 0x00000001 |
| #define | PSP_JOB_ACCOUNTING_FOLDED 0x00000002 |
| #define | PSP_JOB_CLOSE_DONE 0x00000001 |
| #define | PSP_JOB_TERMINATING 0x00000080 |
Typedefs | |
| typedef struct _GET_SET_CTX_CONTEXT | GET_SET_CTX_CONTEXT |
| typedef struct _GET_SET_CTX_CONTEXT * | PGET_SET_CTX_CONTEXT |
| typedef NTSTATUS(NTAPI * | PJOB_ENUMERATOR_CALLBACK) (_In_ PEPROCESS Process, _In_opt_ PVOID Context) |
| #define PSP_JOB_BASIC_LIMIT_VALID_FLAGS |
| #define PSP_JOB_EXTENDED_LIMIT_VALID_FLAGS |
| typedef struct _GET_SET_CTX_CONTEXT * PGET_SET_CTX_CONTEXT |
Definition at line 439 of file apphelp.c.
Referenced by IoInitSystem().
Definition at line 465 of file apphelp.c.
Referenced by PopGracefulShutdown().
Definition at line 235 of file process.c.
Referenced by PspInitPhase0(), and SSI_DEF().
Charges the process page file quota. The function is used internally by the kernel.
| [in] | Process | The process which page file quota is to be charged. |
| [in] | Amount | The amount of page file quota to charge. |
Definition at line 738 of file quota.c.
| PEPROCESS_QUOTA_BLOCK NTAPI PsChargeSharedPoolQuota | ( | _In_ PEPROCESS | Process, |
| _In_ SIZE_T | AmountToChargePaged, | ||
| _In_ SIZE_T | AmountToChargeNonPaged | ||
| ) |
Charges the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota charges handling of objects.
| [in] | Process | The process which quotas are to be charged within its quota block. |
| [in] | AmountToChargePaged | The amount of paged quotas quotas to be charged. |
| [in] | AmountToChargeNonPaged | The amount of non paged quotas to be charged. |
Definition at line 674 of file quota.c.
Referenced by ObpChargeQuotaForObject().
| VOID NTAPI PsExitSpecialApc | ( | PKAPC | Apc, |
| PKNORMAL_ROUTINE * | NormalRoutine, | ||
| PVOID * | NormalContext, | ||
| PVOID * | SystemArgument1, | ||
| PVOID * | SystemArgument2 | ||
| ) |
Referenced by KiInsertQueueApc().
Definition at line 128 of file process.c.
Referenced by DbgkpCloseObject(), ExpDebuggerWorker(), ExpQuerySystemProcessInformation(), PopGracefulShutdown(), PsChangeQuantumTable(), and PspShutdownProcessManager().
Definition at line 75 of file process.c.
Referenced by DbgkpPostFakeThreadMessages(), DbgkpSetProcessDebugObject(), ExSwapinWorkerThreads(), NtSetInformationThread(), NtTerminateProcess(), PspTerminateProcess(), PsResumeProcess(), and PsSuspendProcess().
| BOOLEAN NTAPI PsInitSystem | ( | IN PLOADER_PARAMETER_BLOCK | LoaderBlock | ) |
Definition at line 533 of file psmgr.c.
Referenced by ExpInitializeExecutive(), and Phase1InitializationDiscard().
Definition at line 187 of file psmgr.c.
Referenced by IoInitSystem().
Definition at line 471 of file security.c.
Referenced by NtOpenProcessTokenEx().
Assigns a process to a job object.
| [in] | Process | Pointer to the process to be assigned to the job. |
| [in] | Job | Pointer to the job object to which the process is to be assigned. |
Definition at line 432 of file job.c.
Referenced by NtAssignProcessToJobObject(), and PspCreateProcess().
| VOID NTAPI PspCloseJob | ( | _In_ PEPROCESS | Process, |
| _In_ PVOID | ObjectBody, | ||
| _In_ ACCESS_MASK | GrantedAccess, | ||
| _In_ ULONG_PTR | ProcessHandleCount, | ||
| _In_ ULONG_PTR | SystemHandleCount | ||
| ) |
Handles the closing of a job object.
| [in] | Process | Unused. |
| [in] | ObjectBody | A pointer to the job object being closed. |
| [in] | GrantedAccess | Unused. |
| [in] | ProcessHandleCount | Unused. |
| [in] | SystemHandleCount | The number of system handles currently open for the job object. |
Definition at line 845 of file job.c.
Referenced by PspInitPhase0().
| 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 at line 347 of file process.c.
Referenced by NtCreateProcessEx(), PsCreateSystemProcess(), and PspInitPhase0().
Deletes the specified job object and cleans up associated resources.
| [in] | ObjectBody | A pointer to the job object to be deleted. |
Definition at line 909 of file job.c.
Referenced by PspInitPhase0().
Definition at line 253 of file kill.c.
Referenced by PspInitPhase0().
Definition at line 30 of file security.c.
Referenced by PspDeleteProcess().
Definition at line 402 of file kill.c.
Referenced by PspInitPhase0().
Definition at line 46 of file security.c.
Referenced by PspDeleteThread().
| VOID NTAPI PspDereferenceQuotaBlock | ( | _In_opt_ PEPROCESS | Process, |
| _In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock | ||
| ) |
De-references a quota block when quotas have been returned back because of an object de-allocation or when a process gets destroyed. If the last instance that held up the block gets de-referenced the function will perform a cleanup against that block and it'll free the quota block from memory.
| [in] | Process | A pointer to a process that de-references the quota block. |
| [in] | QuotaBlock | A pointer to a quota block that is to be de-referenced. This block can come from a process that references it or an object. |
Definition at line 553 of file quota.c.
Referenced by PspDeleteProcess(), and PsReturnSharedPoolQuota().
| NTSTATUS NTAPI PspEnumerateProcessesInJob | ( | _In_ PEJOB | Job, |
| _In_ PJOB_ENUMERATOR_CALLBACK | Callback, | ||
| _In_opt_ PVOID | Context | ||
| ) |
Enumerates all processes currently associated with the specified job object and invokes a callback for each process.
| [in] | Job | A pointer to the job object whose processes are to be enumerated. |
| [in] | Callback | A pointer to the callback invoked for each referenced process. |
| [in,optional] | Context An optional context pointer passed to the callback. |
The callback is invoked without the job lock held.
Definition at line 290 of file job.c.
Referenced by PspTerminateJobObject().
Definition at line 1094 of file kill.c.
Referenced by PspDeleteProcess(), and PspExitThread().
Handles the exit of a process from the specified job object.
| [in] | Process | A pointer to the process that is exiting the job. |
Definition at line 659 of file job.c.
Referenced by PspExitThread().
Definition at line 469 of file kill.c.
Referenced by PsExitSpecialApc(), and PspTerminateThreadByPointer().
| VOID NTAPI PspGetOrSetContextKernelRoutine | ( | IN PKAPC | Apc, |
| IN OUT PKNORMAL_ROUTINE * | NormalRoutine, | ||
| IN OUT PVOID * | NormalContext, | ||
| IN OUT PVOID * | SystemArgument1, | ||
| IN OUT PVOID * | SystemArgument2 | ||
| ) |
Definition at line 38 of file psctx.c.
Referenced by PsGetContextThread(), and PsSetContextThread().
Referenced by PspCreateProcess().
Definition at line 128 of file job.c.
Referenced by PspInitPhase0().
Definition at line 71 of file security.c.
Referenced by PspCreateProcess().
| NTSTATUS NTAPI PspInvokeW32JobCallout | ( | _In_ PEJOB | Job, |
| _In_ PSW32JOBCALLOUTTYPE | CalloutType, | ||
| _In_opt_ PVOID | Data | ||
| ) |
Invokes the win32k job callout, if win32k has registered one.
| [in] | Job | A pointer to the job object the callout applies to. |
| [in] | CalloutType | The operation win32k is being asked to perform. |
| [in,optional] | Data Class specific data. For PsW32JobCalloutSetInformation this is the new UI restrictions class, for PsW32JobCalloutAddProcess the W32PROCESS of the process being added to the job. |
Definition at line 1637 of file job.c.
Referenced by PspAssignProcessToJob(), PspDeleteJob(), and PspSetJobUIRestrictions().
Definition at line 1087 of file kill.c.
Referenced by MmpPageOutPhysicalAddress().
| NTSTATUS NTAPI PspMapSystemDll | ( | IN PEPROCESS | Process, |
| OUT PVOID * | DllBase, | ||
| IN BOOLEAN | UseLargePages | ||
| ) |
Referenced by PspCreateProcess().
Definition at line 167 of file kill.c.
Referenced by PspInitPhase0().
Removes a process from its assigned job.
| [in] | Process | A pointer to the process being removed from its assigned job. |
Definition at line 609 of file job.c.
Referenced by PspDeleteProcess().
| NTSTATUS NTAPI PspSendJobMessageLocked | ( | _In_ PEJOB | Job, |
| _In_ ULONG | Message, | ||
| _In_opt_ PVOID | CompletionValue, | ||
| _In_ BOOLEAN | Quota | ||
| ) |
Queues a message to a job's completion port.
| [in] | Job | A pointer to the job receiving the notification. |
| [in] | Message | The job notification message (JOB_OBJECT_MSG_*). |
| [in,optional] | CompletionValue The message specific completion value. | |
| [in] | Quota | Specifies whether the completion packet is charged as quota. |
Definition at line 397 of file job.c.
Referenced by PspAssignProcessToJob(), PspAssociateCompletionPortCallback(), PspExitProcess(), PspExitProcessFromJob(), PspRemoveProcessFromJob(), and PspTerminateProcessCallback().
| NTSTATUS NTAPI PspSetPrimaryToken | ( | IN PEPROCESS | Process, |
| IN HANDLE TokenHandle | OPTIONAL, | ||
| IN PACCESS_TOKEN Token | OPTIONAL | ||
| ) |
Definition at line 215 of file security.c.
Referenced by NtSetInformationProcess().
| NTSTATUS NTAPI PspSetQuotaLimits | ( | _In_ PEPROCESS | Process, |
| _In_ ULONG | Unused, | ||
| _In_ PVOID | QuotaLimits, | ||
| _In_ ULONG | QuotaLimitsLength, | ||
| _In_ KPROCESSOR_MODE | PreviousMode | ||
| ) |
This function adjusts the working set limits of a process and sets up new quota limits when necessary. The function is used when the caller requests to set up new working set sizes.
| [in] | Process | The process which quota limits or working set sizes are to be changed. |
| [in] | Unused | This parameter is unused. |
| [in] | QuotaLimits | An arbitrary pointer that points to a quota limits structure, needed to determine on setting up new working set sizes. |
| [in] | QuotaLimitsLength | The length of QuotaLimits buffer, which size is expressed in bytes. |
| [in] | PreviousMode | The processor level access mode. |
Definition at line 1045 of file quota.c.
Referenced by NtSetInformationProcess().
Definition at line 135 of file kill.c.
| VOID NTAPI PspSystemThreadStartup | ( | PKSTART_ROUTINE | StartRoutine, |
| PVOID | StartContext | ||
| ) |
| NTSTATUS NTAPI PspTerminateThreadByPointer | ( | IN PETHREAD | Thread, |
| IN NTSTATUS | ExitStatus, | ||
| IN BOOLEAN | bSelf | ||
| ) |
Definition at line 1007 of file kill.c.
Referenced by NtTerminateProcess(), NtTerminateThread(), PspSystemThreadStartup(), PspTerminateProcess(), PspUserThreadStartup(), and PsTerminateSystemThread().
| PACCESS_TOKEN NTAPI PsReferenceEffectiveToken | ( | IN PETHREAD | Thread, |
| OUT IN PTOKEN_TYPE | TokenType, | ||
| OUT PBOOLEAN | EffectiveOnly, | ||
| OUT PSECURITY_IMPERSONATION_LEVEL | ImpersonationLevel | ||
| ) |
Definition at line 802 of file security.c.
Referenced by SeCreateClientSecurity().
| NTSTATUS NTAPI PsReferenceProcessFilePointer | ( | _In_ PEPROCESS | Process, |
| _Outptr_ PFILE_OBJECT * | FileObject | ||
| ) |
Definition at line 24 of file query.c.
Referenced by NtQueryInformationProcess(), and SeLocateProcessImageName().
Definition at line 32 of file state.c.
Referenced by DbgkpPostFakeThreadMessages(), DbgkpWakeTarget(), and NtResumeThread().
Returns the page file quota that the process was taking up. The function is used exclusively by the kernel.
| [in] | Process | The process which pagefile quota is to be returned. |
| [in] | Amount | The amount of quotas to return from a process. |
Definition at line 993 of file quota.c.
| VOID NTAPI PsReturnSharedPoolQuota | ( | _In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock, |
| _In_ SIZE_T | AmountToReturnPaged, | ||
| _In_ SIZE_T | AmountToReturnNonPaged | ||
| ) |
Returns the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota returns handling of objects.
| [in] | QuotaBlock | The quota block which quotas are to be returned. |
| [in] | AmountToReturnPaged | The amount of paged quotas quotas to be returned. |
| [in] | AmountToReturnNonPaged | The amount of non paged quotas to be returned. |
Definition at line 621 of file quota.c.
Referenced by ObpDeallocateObject().
Definition at line 48 of file state.c.
Referenced by DbgkpPostFakeThreadMessages(), NtSuspendThread(), and PsSuspendProcess().
Definition at line 126 of file kill.c.
Referenced by DbgkpCloseObject(), ExpDebuggerWorker(), NtAssignProcessToJobObject(), PspAssignProcessToJob(), and PspTerminateProcessCallback().
| POBJECT_TYPE _PsProcessType |
|
extern |
|
extern |
Definition at line 22 of file process.c.
Referenced by KdbpCmdProc(), PsGetNextProcess(), PspCreateProcess(), and PspInitPhase0().
|
extern |
Definition at line 20 of file locale.c.
Referenced by CmGetSystemControlValues(), MiSessionCreateInternal(), NtQueryDefaultLocale(), and NtSetDefaultLocale().
|
extern |
Definition at line 24 of file locale.c.
Referenced by _IRQL_requires_max_(), CmGetSystemControlValues(), MmCreateTeb(), and MmGetSessionLocaleId().
|
extern |
Definition at line 51 of file psmgr.c.
Referenced by ExpQuerySystemProcessInformation(), MmInitSystem(), PopGracefulShutdown(), PspInitPhase0(), PspShutdownProcessManager(), and QSI_DEF().
|
extern |
Definition at line 18 of file psnotify.c.
Referenced by DbgkCreateThread(), MmLoadSystemImage(), and PsSetLoadImageNotifyRoutine().
|
extern |
Definition at line 23 of file job.c.
Referenced by PspInitPhase0(), and TestObjectTypes().
|
extern |
Definition at line 21 of file sysldr.c.
Referenced by IopInitializeBuiltinDriver(), KdbpSymFindModule(), KdbSymInit(), KdInitSystem(), KiInitModuleList(), KiPcToFileHeader(), MiBuildImportsForBootDrivers(), MiFindInitializationCode(), MiInitializeLoadedModuleList(), MiLookupDataTableEntry(), MiProcessLoaderEntry(), MiResolveImageReferences(), MiSnapThunk(), MmGetSystemRoutineAddress(), MmInitSystem(), MmLoadSystemImage(), and QSI_DEF().
|
extern |
Definition at line 24 of file sysldr.c.
Referenced by MiFindInitializationCode(), MiInitializeLoadedModuleList(), MiProcessLoaderEntry(), MmGetSystemRoutineAddress(), MmInitSystem(), and QSI_DEF().
|
extern |
Definition at line 23 of file sysldr.c.
Referenced by KdbpSymFindModule(), KdbSymInit(), MiInitializeLoadedModuleList(), MiProcessLoaderEntry(), and RtlPcToFileHeader().
|
extern |
Definition at line 45 of file psmgr.c.
Referenced by DbgkCreateThread(), and PsLocateSystemDll().
|
extern |
Definition at line 25 of file sysldr.c.
Referenced by KdInitSystem(), and MiInitializeLoadedModuleList().
|
extern |
Definition at line 23 of file process.c.
Referenced by PsGetNextProcess(), PspCreateProcess(), PspDeleteProcess(), and PspInitPhase0().
|
extern |
Definition at line 17 of file security.c.
Referenced by PspInitializeProcessSecurity(), and PspInitPhase0().
|
extern |
Definition at line 48 of file psmgr.c.
Referenced by PsLookupProcessByProcessId(), PsLookupProcessThreadByCid(), PsLookupThreadByThreadId(), PspCreateProcess(), PspCreateThread(), PspDeleteProcess(), PspDeleteThread(), and PspInitPhase0().
|
extern |
Definition at line 16 of file quota.c.
Referenced by NtQueryInformationProcess(), PsInitializeQuotaSystem(), PspChargeProcessQuotaSpecifiedPool(), PspDereferenceQuotaBlock(), PspInheritQuota(), PspReturnProcessQuotaSpecifiedPool(), and PspSetQuotaLimits().
|
extern |
Definition at line 44 of file job.c.
Referenced by PspInitPhase0().
|
extern |
Definition at line 30 of file job.c.
Referenced by PsChangeQuantumTable(), and PspComputeQuantumAndPriority().
|
extern |
Definition at line 24 of file psnotify.c.
Referenced by PspRunLegoRoutine(), and PsSetLegoNotifyRoutine().
|
extern |
Definition at line 23 of file psnotify.c.
Referenced by PspInitPhase0(), PspRunLoadImageNotifyRoutines(), PsRemoveLoadImageNotifyRoutine(), and PsSetLoadImageNotifyRoutine().
|
extern |
Definition at line 22 of file psnotify.c.
Referenced by PspInitPhase0(), PspRunCreateProcessNotifyRoutines(), and PsSetCreateProcessNotifyRoutine().
| ULONG PspProcessNotifyRoutineCount |
Definition at line 553 of file ps.h.
Referenced by PspRunCreateProcessNotifyRoutines().
|
extern |
|
extern |
Definition at line 20 of file kill.c.
Referenced by KeTerminateThread(), and PspInitPhase0().
|
extern |
|
extern |
Definition at line 28 of file process.c.
Referenced by KiDeferredReadyThread(), PsChangeQuantumTable(), and PspComputeQuantumAndPriority().
|
extern |
Definition at line 41 of file psmgr.c.
Referenced by CODE_SEG(), DbgkCreateThread(), PsLocateSystemDll(), and PspUserThreadStartup().
|
extern |
Definition at line 43 of file psmgr.c.
Referenced by PspInitializeSystemDll(), and PspUserThreadStartup().
|
extern |
Definition at line 21 of file psnotify.c.
Referenced by PspInitPhase0(), PspRunCreateThreadNotifyRoutines(), PsRemoveCreateThreadNotifyRoutine(), and PsSetCreateThreadNotifyRoutine().
|
extern |
Definition at line 19 of file psnotify.c.
Referenced by PspRunCreateThreadNotifyRoutines(), PsRemoveCreateThreadNotifyRoutine(), and PsSetCreateThreadNotifyRoutine().
|
extern |
Definition at line 28 of file job.c.
Referenced by PsChangeQuantumTable(), and PspComputeQuantumAndPriority().
|
extern |
Definition at line 20 of file win32.c.
Referenced by PsEstablishWin32Callouts(), and PspInvokeW32JobCallout().
|
extern |
Definition at line 18 of file win32.c.
Referenced by PsConvertToGuiThread(), PsEstablishWin32Callouts(), and PspExitThread().
|
extern |
Definition at line 19 of file win32.c.
Referenced by PsConvertToGuiThread(), PsEstablishWin32Callouts(), and PspExitThread().
|
extern |
Definition at line 27 of file process.c.
Referenced by PspInitPhase0().
|
extern |