ReactOS 0.4.16-dev-289-g096a551
ps_x.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PspPrioritySeparationFromMask(Mask)    ((Mask) & 3)
 
#define PspQuantumTypeFromMask(Mask)    ((Mask) & 12)
 
#define PspQuantumLengthFromMask(Mask)    ((Mask) & 48)
 
#define PspSetCrossThreadFlag(Thread, Flag)    InterlockedOr((PLONG)&Thread->CrossThreadFlags, Flag)
 
#define PspClearCrossThreadFlag(Thread, Flag)    InterlockedAnd((PLONG)&Thread->CrossThreadFlags, ~Flag)
 
#define PspSetProcessFlag(Process, Flag)    InterlockedOr((PLONG)&Process->Flags, Flag)
 
#define PspClearProcessFlag(Process, Flag)    InterlockedAnd((PLONG)&Process->Flags, ~Flag)
 

Functions

FORCEINLINE VOID PspRunCreateThreadNotifyRoutines (IN PETHREAD CurrentThread, IN BOOLEAN Create)
 
FORCEINLINE VOID PspRunCreateProcessNotifyRoutines (IN PEPROCESS CurrentProcess, IN BOOLEAN Create)
 
FORCEINLINE VOID PspRunLoadImageNotifyRoutines (PUNICODE_STRING FullImageName, HANDLE ProcessId, PIMAGE_INFO ImageInfo)
 
FORCEINLINE VOID PspRunLegoRoutine (IN PKTHREAD Thread)
 
FORCEINLINE VOID PspLockProcessSecurityShared (IN PEPROCESS Process)
 
FORCEINLINE VOID PspUnlockProcessSecurityShared (IN PEPROCESS Process)
 
FORCEINLINE VOID PspLockProcessSecurityExclusive (IN PEPROCESS Process)
 
FORCEINLINE VOID PspUnlockProcessSecurityExclusive (IN PEPROCESS Process)
 
FORCEINLINE VOID PspLockThreadSecurityShared (IN PETHREAD Thread)
 
FORCEINLINE VOID PspUnlockThreadSecurityShared (IN PETHREAD Thread)
 
FORCEINLINE VOID PspLockThreadSecurityExclusive (IN PETHREAD Thread)
 
FORCEINLINE VOID PspUnlockThreadSecurityExclusive (IN PETHREAD Thread)
 
FORCEINLINE PEPROCESS _PsGetCurrentProcess (VOID)
 

Macro Definition Documentation

◆ PspClearCrossThreadFlag

#define PspClearCrossThreadFlag (   Thread,
  Flag 
)     InterlockedAnd((PLONG)&Thread->CrossThreadFlags, ~Flag)

Definition at line 27 of file ps_x.h.

◆ PspClearProcessFlag

#define PspClearProcessFlag (   Process,
  Flag 
)     InterlockedAnd((PLONG)&Process->Flags, ~Flag)

Definition at line 35 of file ps_x.h.

◆ PspPrioritySeparationFromMask

#define PspPrioritySeparationFromMask (   Mask)     ((Mask) & 3)

Definition at line 13 of file ps_x.h.

◆ PspQuantumLengthFromMask

#define PspQuantumLengthFromMask (   Mask)     ((Mask) & 48)

Definition at line 19 of file ps_x.h.

◆ PspQuantumTypeFromMask

#define PspQuantumTypeFromMask (   Mask)     ((Mask) & 12)

Definition at line 16 of file ps_x.h.

◆ PspSetCrossThreadFlag

#define PspSetCrossThreadFlag (   Thread,
  Flag 
)     InterlockedOr((PLONG)&Thread->CrossThreadFlags, Flag)

Definition at line 25 of file ps_x.h.

◆ PspSetProcessFlag

#define PspSetProcessFlag (   Process,
  Flag 
)     InterlockedOr((PLONG)&Process->Flags, Flag)

Definition at line 33 of file ps_x.h.

Function Documentation

◆ _PsGetCurrentProcess()

FORCEINLINE PEPROCESS _PsGetCurrentProcess ( VOID  )

Definition at line 199 of file ps_x.h.

200{
201 /* Get the current process */
202 return (PEPROCESS)KeGetCurrentThread()->ApcState.Process;
203}
#define KeGetCurrentThread
Definition: hal.h:55

◆ PspLockProcessSecurityExclusive()

FORCEINLINE VOID PspLockProcessSecurityExclusive ( IN PEPROCESS  Process)

Definition at line 133 of file ps_x.h.

134{
135 /* Enter a Critical Region */
137
138 /* Lock the Process */
139 ExAcquirePushLockExclusive(&Process->ProcessLock);
140}
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1036
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define KeEnterCriticalRegion()
Definition: ke_x.h:88

Referenced by PspAssignPrimaryToken().

◆ PspLockProcessSecurityShared()

FORCEINLINE VOID PspLockProcessSecurityShared ( IN PEPROCESS  Process)

Definition at line 111 of file ps_x.h.

112{
113 /* Enter a Critical Region */
115
116 /* Lock the Process */
117 ExAcquirePushLockShared(&Process->ProcessLock);
118}
FORCEINLINE VOID ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1105

Referenced by PsReferenceEffectiveToken(), and PsReferencePrimaryToken().

◆ PspLockThreadSecurityExclusive()

FORCEINLINE VOID PspLockThreadSecurityExclusive ( IN PETHREAD  Thread)

Definition at line 177 of file ps_x.h.

178{
179 /* Enter a Critical Region */
181
182 /* Lock the Thread */
184}
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
EX_PUSH_LOCK ThreadLock
Definition: pstypes.h:1161

Referenced by PsDisableImpersonation(), PsImpersonateClient(), PsRestoreImpersonation(), and PsRevertThreadToSelf().

◆ PspLockThreadSecurityShared()

FORCEINLINE VOID PspLockThreadSecurityShared ( IN PETHREAD  Thread)

Definition at line 155 of file ps_x.h.

156{
157 /* Enter a Critical Region */
159
160 /* Lock the Thread */
162}

Referenced by PsReferenceImpersonationToken().

◆ PspRunCreateProcessNotifyRoutines()

FORCEINLINE VOID PspRunCreateProcessNotifyRoutines ( IN PEPROCESS  CurrentProcess,
IN BOOLEAN  Create 
)

Definition at line 62 of file ps_x.h.

64{
65 ULONG i;
66
67 /* Check if we have registered routines */
69 {
70 /* Loop callbacks */
71 for (i = 0; i < PSP_MAX_CREATE_PROCESS_NOTIFY; i++)
72 {
73 /* Do the callback */
75 CurrentProcess->InheritedFromUniqueProcessId,
76 CurrentProcess->UniqueProcessId,
78 }
79 }
80}
@ Create
Definition: registry.c:563
FORCEINLINE VOID ExDoCallBack(IN OUT PEX_CALLBACK Callback, IN PVOID Context, IN PVOID Argument1, IN PVOID Argument2)
Definition: ex.h:553
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
#define PSP_MAX_CREATE_PROCESS_NOTIFY
Definition: ps.h:66
ULONG PspProcessNotifyRoutineCount
Definition: ps.h:463
EX_CALLBACK PspProcessNotifyRoutine[PSP_MAX_CREATE_PROCESS_NOTIFY]
Definition: psnotify.c:22
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59

Referenced by PspCreateProcess(), and PspExitProcess().

◆ PspRunCreateThreadNotifyRoutines()

FORCEINLINE VOID PspRunCreateThreadNotifyRoutines ( IN PETHREAD  CurrentThread,
IN BOOLEAN  Create 
)

Definition at line 40 of file ps_x.h.

42{
43 ULONG i;
44
45 /* Check if we have registered routines */
47 {
48 /* Loop callbacks */
49 for (i = 0; i < PSP_MAX_CREATE_THREAD_NOTIFY; i++)
50 {
51 /* Do the callback */
53 CurrentThread->Cid.UniqueProcess,
54 CurrentThread->Cid.UniqueThread,
56 }
57 }
58}
EX_CALLBACK PspThreadNotifyRoutine[PSP_MAX_CREATE_THREAD_NOTIFY]
Definition: psnotify.c:21
ULONG PspThreadNotifyRoutineCount
Definition: psnotify.c:19
#define PSP_MAX_CREATE_THREAD_NOTIFY
Definition: ps.h:64

Referenced by PspCreateThread(), and PspExitThread().

◆ PspRunLegoRoutine()

FORCEINLINE VOID PspRunLegoRoutine ( IN PKTHREAD  Thread)

Definition at line 103 of file ps_x.h.

104{
105 /* Call it */
107}
PLEGO_NOTIFY_ROUTINE PspLegoNotifyRoutine
Definition: psnotify.c:24

Referenced by PspExitThread().

◆ PspRunLoadImageNotifyRoutines()

FORCEINLINE VOID PspRunLoadImageNotifyRoutines ( PUNICODE_STRING  FullImageName,
HANDLE  ProcessId,
PIMAGE_INFO  ImageInfo 
)

Definition at line 84 of file ps_x.h.

87{
88 ULONG i;
89
90 /* Loop the notify routines */
91 for (i = 0; i < PSP_MAX_LOAD_IMAGE_NOTIFY; ++ i)
92 {
93 /* Do the callback */
95 FullImageName,
97 ImageInfo);
98 }
99}
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
EX_CALLBACK PspLoadImageNotifyRoutine[PSP_MAX_LOAD_IMAGE_NOTIFY]
Definition: psnotify.c:23
#define PSP_MAX_LOAD_IMAGE_NOTIFY
Definition: ps.h:65

Referenced by DbgkCreateThread(), and MmLoadSystemImage().

◆ PspUnlockProcessSecurityExclusive()

FORCEINLINE VOID PspUnlockProcessSecurityExclusive ( IN PEPROCESS  Process)

Definition at line 144 of file ps_x.h.

145{
146 /* Unlock the Process */
147 ExReleasePushLockExclusive(&Process->ProcessLock);
148
149 /* Leave Critical Region */
151}
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1252
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119

Referenced by PspAssignPrimaryToken().

◆ PspUnlockProcessSecurityShared()

FORCEINLINE VOID PspUnlockProcessSecurityShared ( IN PEPROCESS  Process)

Definition at line 122 of file ps_x.h.

123{
124 /* Unlock the Process */
125 ExReleasePushLockShared(&Process->ProcessLock);
126
127 /* Leave Critical Region */
129}
FORCEINLINE VOID ExReleasePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1213

Referenced by PsReferenceEffectiveToken(), and PsReferencePrimaryToken().

◆ PspUnlockThreadSecurityExclusive()

FORCEINLINE VOID PspUnlockThreadSecurityExclusive ( IN PETHREAD  Thread)

Definition at line 188 of file ps_x.h.

189{
190 /* Unlock the Process */
192
193 /* Leave Critical Thread */
195}

Referenced by PsDisableImpersonation(), PsImpersonateClient(), PsRestoreImpersonation(), and PsRevertThreadToSelf().

◆ PspUnlockThreadSecurityShared()

FORCEINLINE VOID PspUnlockThreadSecurityShared ( IN PETHREAD  Thread)

Definition at line 166 of file ps_x.h.

167{
168 /* Unlock the Thread */
170
171 /* Leave Critical Region */
173}

Referenced by PsReferenceImpersonationToken().