ReactOS 0.4.15-dev-8135-g1bc6c90
psfuncs.h
Go to the documentation of this file.
1/******************************************************************************
2 * Process Manager Functions *
3 ******************************************************************************/
5
12
13/*
14 * PEPROCESS
15 * PsGetCurrentProcess(VOID)
16 */
17#define PsGetCurrentProcess IoGetCurrentProcess
18
19#if !defined(_PSGETCURRENTTHREAD_)
20#define _PSGETCURRENTTHREAD_
26{
28}
29#endif /* !_PSGETCURRENTTHREAD_ */
30
33
43
50 _In_ PROCESSINFOCLASS ProcessInformationClass,
51 _Out_ PVOID ProcessInformation,
52 _In_ ULONG ProcessInformationLength,
56
65
72 _In_ HANDLE UniqueThreadId,
75
76#if (NTDDI_VERSION >= NTDDI_WIN2K)
77
80_Post_satisfies_(return <= 0)
86 _Out_ PHANDLE ThreadHandle,
93
100
102$if (_NTDDK_)
103
107NTAPI
111
115NTAPI
117 _In_ PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine);
118
122NTAPI
124 _In_ PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine);
125
127HANDLE
128NTAPI
130
133HANDLE
134NTAPI
136
139NTAPI
144 OUT PUNICODE_STRING CSDVersion OPTIONAL);
146$if (_NTIFS_)
147
151NTAPI
157
161NTAPI
163
167NTAPI
170
175NTAPI
182
186NTAPI
190
193VOID
194NTAPI
198
201VOID
202NTAPI
204
207VOID
208NTAPI
213
216VOID
217NTAPI
222
226NTAPI
230
233HANDLE
234NTAPI
238#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
240#if (NTDDI_VERSION >= NTDDI_WINXP)
242
243$if (_NTDDK_)
246HANDLE
247NTAPI
250
253HANDLE
254NTAPI
257
260NTAPI
263);
264
267NTAPI
269 _In_ PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine);
270
274NTAPI
276 _In_ PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine);
277
281NTAPI
285$if (_NTIFS_)
286
289VOID
290NTAPI
292 _In_ PACCESS_TOKEN PrimaryToken);
293
296VOID
297NTAPI
299 _In_ PACCESS_TOKEN ImpersonationToken);
300
305NTAPI
310
313NTAPI
318#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
320
321$if (_NTDDK_)
322#if (NTDDI_VERSION >= NTDDI_WS03)
324HANDLE
325NTAPI
328#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
329
330#if (NTDDI_VERSION >= NTDDI_WS03SP1)
332PVOID
333NTAPI
335 VOID);
336#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
337
338#if (NTDDI_VERSION >= NTDDI_VISTA)
339
342NTAPI
344 IN BOOLEAN Prefetching);
345
348NTAPI
350
351#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
352
353#if (NTDDI_VERSION >= NTDDI_VISTASP1)
356NTAPI
360#endif /* (NTDDI_VERSION >= NTDDI_VISTASP1) */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
return
Definition: dirsup.c:529
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:43
#define PsGetVersion(a, b, c, d)
Definition: env_spec_w32.h:83
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
PsGetCurrentThreadId
Definition: CrNtStubs.h:8
ULONG BuildNumber
Definition: ros_glue.cpp:6
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_Must_inspect_result_ _In_ LONGLONG _In_ LONGLONG Amount
Definition: fsrtlfuncs.h:551
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define KeGetCurrentThread
Definition: hal.h:55
#define _NTIFS_
Definition: ifssupp.h:20
enum _PROCESSINFOCLASS PROCESSINFOCLASS
Definition: loader.c:63
VOID(NTAPI * PLOAD_IMAGE_NOTIFY_ROUTINE)(_In_ PUNICODE_STRING FullImageName, _In_ HANDLE ProcessId, _In_ PIMAGE_INFO ImageInfo)
Definition: pstypes.h:220
VOID(NTAPI * PCREATE_PROCESS_NOTIFY_ROUTINE)(_In_ HANDLE ParentId, _In_ HANDLE ProcessId, _In_ BOOLEAN Create)
Definition: pstypes.h:160
VOID(NTAPI * PCREATE_PROCESS_NOTIFY_ROUTINE_EX)(_Inout_ PEPROCESS Process, _In_ HANDLE ProcessId, _Inout_opt_ PPS_CREATE_NOTIFY_INFO CreateInfo)
Definition: pstypes.h:183
VOID(NTAPI * PCREATE_THREAD_NOTIFY_ROUTINE)(_In_ HANDLE ProcessId, _In_ HANDLE ThreadId, _In_ BOOLEAN Create)
Definition: pstypes.h:189
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
enum _SECURITY_IMPERSONATION_LEVEL * PSECURITY_IMPERSONATION_LEVEL
NTKERNELAPI VOID NTAPI PsRevertToSelf(VOID)
Definition: security.c:556
#define PsDereferencePrimaryToken(T)
Definition: imports.h:301
#define PsDereferenceImpersonationToken(T)
Definition: imports.h:298
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _Outptr_
Definition: ms_sal.h:427
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _When_(expr, annos)
Definition: ms_sal.h:254
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Post_satisfies_(cond)
Definition: ms_sal.h:588
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
Definition: iofuncs.h:727
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
_In_ NTSTATUS ExitStatus
Definition: psfuncs.h:867
NTKERNELAPI HANDLE NTAPI PsGetThreadId(_In_ PETHREAD Thread)
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI NtOpenProcess(_Out_ PHANDLE ProcessHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_opt_ PCLIENT_ID ClientId)
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
NTKERNELAPI PEPROCESS NTAPI PsGetThreadProcess(_In_ PETHREAD Thread)
NTKERNELAPI NTSTATUS NTAPI PsChargeProcessPoolQuota(_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount)
Charges the process' quota pool. The type of quota to be charged depends upon the PoolType parameter.
Definition: quota.c:872
NTKERNELAPI VOID NTAPI PsReturnPoolQuota(_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount)
Returns the pool quota that the process was taking up.
Definition: quota.c:907
NTKERNELAPI VOID NTAPI PsChargePoolQuota(_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount)
Charges the pool quota of a given process. The kind of pool quota to charge is determined by the Pool...
Definition: quota.c:775
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define NTSYSCALLAPI
Definition: ntbasedef.h:204
#define _NTDDK_
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1145
NTSTATUS NTAPI PsLookupProcessByProcessId(IN HANDLE ProcessId, OUT PEPROCESS *Process)
Definition: process.c:919
LONGLONG NTAPI PsGetProcessCreateTimeQuadPart(PEPROCESS Process)
Definition: process.c:1023
HANDLE NTAPI PsGetProcessId(PEPROCESS Process)
Definition: process.c:1063
LARGE_INTEGER NTAPI PsGetProcessExitTime(VOID)
Definition: process.c:1013
NTSTATUS NTAPI PsAssignImpersonationToken(IN PETHREAD Thread, IN HANDLE TokenHandle)
Definition: security.c:502
BOOLEAN NTAPI PsDisableImpersonation(IN PETHREAD Thread, OUT PSE_IMPERSONATION_STATE ImpersonationState)
Definition: security.c:937
VOID NTAPI PsRestoreImpersonation(IN PETHREAD Thread, IN PSE_IMPERSONATION_STATE ImpersonationState)
Definition: security.c:987
PACCESS_TOKEN NTAPI PsReferencePrimaryToken(PEPROCESS Process)
Definition: security.c:440
PACCESS_TOKEN NTAPI PsReferenceImpersonationToken(IN PETHREAD Thread, OUT PBOOLEAN CopyOnOpen, OUT PBOOLEAN EffectiveOnly, OUT PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Definition: security.c:871
NTSTATUS NTAPI PsImpersonateClient(IN PETHREAD Thread, IN PACCESS_TOKEN Token, IN BOOLEAN CopyOnOpen, IN BOOLEAN EffectiveOnly, IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Definition: security.c:610
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
NTSTATUS NTAPI PsLookupThreadByThreadId(IN HANDLE ThreadId, OUT PETHREAD *Thread)
Definition: thread.c:643
NTSTATUS NTAPI PsWrapApcWow64Thread(IN OUT PVOID *ApcContext, IN OUT PVOID *ApcRoutine)
Definition: thread.c:932
HANDLE NTAPI PsGetThreadProcessId(IN PETHREAD Thread)
Definition: thread.c:745
BOOLEAN NTAPI PsIsThreadTerminating(IN PETHREAD Thread)
Definition: thread.c:868
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI PsSetLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:176
NTSTATUS NTAPI PsSetCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:260
NTSTATUS NTAPI PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, IN BOOLEAN Remove)
Definition: psnotify.c:33
NTSTATUS NTAPI PsRemoveLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:127
#define __kernel_entry
Definition: specstrings.h:355
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
INT POOL_TYPE
Definition: typedefs.h:78
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
#define FORCEINLINE
Definition: wdftypes.h:67
#define _WDMDDK_
Definition: wdm.template.h:26
#define NTKERNELAPI
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151
KSTART_ROUTINE * PKSTART_ROUTINE
Definition: ketypes.h:499
_Out_ PBOOLEAN CopyOnOpen
Definition: psfuncs.h:154
_Out_ PBOOLEAN _Out_ PBOOLEAN EffectiveOnly
Definition: psfuncs.h:155
_Inout_ PSE_IMPERSONATION_STATE ImpersonationState
Definition: psfuncs.h:189
NTKERNELAPI PVOID NTAPI PsGetCurrentThreadTeb(VOID)
Definition: thread.c:785
NTKERNELAPI BOOLEAN NTAPI PsIsSystemThread(_In_ PETHREAD Thread)
NTKERNELAPI HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
NTKERNELAPI BOOLEAN NTAPI PsSetCurrentThreadPrefetching(IN BOOLEAN Prefetching)
NTKERNELAPI NTSTATUS NTAPI PsSetCreateProcessNotifyRoutineEx(IN PCREATE_PROCESS_NOTIFY_ROUTINE_EX NotifyRoutine, IN BOOLEAN Remove)
NTKERNELAPI BOOLEAN NTAPI PsIsCurrentThreadPrefetching(VOID)
$endif(_WDMDDK_) $if(_NTDDK_) __kernel_entry NTSYSCALLAPI NTSTATUS NTAPI NtOpenProcess(_Out_ PHANDLE ProcessHandle
Definition: ke.h:202
_Inout_ PVOID * ApcRoutine
Definition: psfuncs.h:11
_In_ BOOLEAN Remove
Definition: psfuncs.h:110
_Out_ PBOOLEAN _Out_ PBOOLEAN _Out_ PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: psfuncs.h:156
NTKERNELAPI NTSTATUS NTAPI PsRemoveCreateThreadNotifyRoutine(_In_ PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
$if(_WDMDDK_) NTKERNELAPI NTSTATUS NTAPI PsWrapApcWow64Thread(_Inout_ PVOID *ApcContext
Definition: ke.h:1
_In_ ULONG _In_opt_ POBJECT_ATTRIBUTES _In_opt_ HANDLE _Out_opt_ PCLIENT_ID _In_ PKSTART_ROUTINE StartRoutine
Definition: psfuncs.h:91