ReactOS  0.4.14-dev-998-g623dd26
epsapi.h
Go to the documentation of this file.
1 /*
2  * epsapi.h
3  *
4  * Process Status Helper API, native interface
5  *
6  * This file is part of the ReactOS Operating System.
7  *
8  * Contributors:
9  * Created by KJK::Hyperion <noog@libero.it>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #ifndef __EPSAPI_H_INCLUDED__
24 #define __EPSAPI_H_INCLUDED__
25 
26 /* TYPES */
29 
32 
35 
39 
40 /* CONSTANTS */
41 #define FAILED_WITH_STATUS DEFINE_DBG_MSG("%s() failed, status 0x%08X")
42 
43 /* PROTOTYPES */
44 /* Processes and threads */
45 /* enumeration */
48  IN OUT PVOID ProcessCallbackContext,
50  IN OUT PVOID ThreadCallbackContext);
51 
55 
59 
60 /* capturing & walking */
63 
66  IN PPROC_ENUM_ROUTINE ProcessCallback,
67  IN OUT PVOID ProcessCallbackContext,
69  IN OUT PVOID ThreadCallbackContext);
70 
75 
80 
83 
86 
89 
92 
93 /* System modules */
94 /* enumeration */
98 
99 /* capturing & walking */
102 
107 
110 
112 PsaWalkNextSystemModule(IN PRTL_PROCESS_MODULES CurrentSystemModule);
113 
114 /* Process modules */
119 
120 /* Miscellaneous */
121 VOID NTAPI
122 PsaFreeCapture(IN PVOID Capture);
123 
124 /* The user must define these functions. They are called by PSAPI to allocate
125  memory. This allows PSAPI to be called from any environment */
126 void *PsaiMalloc(SIZE_T size);
127 void *PsaiRealloc(void *ptr, SIZE_T size);
128 void PsaiFree(void *ptr);
129 
130 /* MACROS */
131 #define DEFINE_DBG_MSG(__str__) "PSAPI: " __str__ "\n"
132 
133 #endif /* __EPSAPI_H_INCLUDED__ */
void * PsaiMalloc(SIZE_T size)
Definition: ctm.c:101
#define IN
Definition: typedefs.h:39
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:55
PSYSTEM_PROCESS_INFORMATION FASTCALL PsaWalkNextProcess(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess)
Definition: processes.c:244
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS(NTAPI * PPROC_ENUM_ROUTINE)(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess, IN OUT PVOID CallbackContext)
Definition: epsapi.h:27
NTSTATUS(NTAPI * PSYSMOD_ENUM_ROUTINE)(IN PRTL_PROCESS_MODULE_INFORMATION CurrentModule, IN OUT PVOID CallbackContext)
Definition: epsapi.h:33
#define FASTCALL
Definition: nt_native.h:50
void * PsaiRealloc(void *ptr, SIZE_T size)
Definition: ctm.c:102
NTSTATUS NTAPI PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, IN PPROC_ENUM_ROUTINE ProcessCallback, IN OUT PVOID ProcessCallbackContext, IN PTHREAD_ENUM_ROUTINE ThreadCallback, IN OUT PVOID ThreadCallbackContext)
Definition: processes.c:94
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI PsaFreeCapture(IN PVOID Capture)
Definition: processes.c:188
static PVOID ptr
Definition: dispmode.c:27
NTSTATUS NTAPI PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESS_INFORMATION *ProcessesAndThreads)
Definition: processes.c:38
NTSTATUS NTAPI PsaCaptureSystemModules(OUT PRTL_PROCESS_MODULES *SystemModules)
Definition: drivers.c:61
NTSTATUS NTAPI PsaEnumerateProcessesAndThreads(IN PPROC_ENUM_ROUTINE ProcessCallback, IN OUT PVOID ProcessCallbackContext, IN PTHREAD_ENUM_ROUTINE ThreadCallback, IN OUT PVOID ThreadCallbackContext)
Definition: processes.c:153
NTSTATUS NTAPI PsaWalkProcesses(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, IN PPROC_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: processes.c:194
NTSTATUS NTAPI PsaWalkThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, IN PTHREAD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: processes.c:206
PLOADER_MODULE CurrentModule
Definition: mboot.c:66
ULONG CurrentProcess
Definition: shell.c:125
GLsizeiptr size
Definition: glext.h:5919
PSYSTEM_THREAD_INFORMATION FASTCALL PsaWalkFirstThread(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess)
Definition: processes.c:257
NTSTATUS NTAPI PsaEnumerateProcesses(IN PPROC_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: processes.c:218
NTSTATUS(NTAPI * PPROCMOD_ENUM_ROUTINE)(IN HANDLE ProcessHandle, IN PLDR_DATA_TABLE_ENTRY CurrentModule, IN OUT PVOID CallbackContext)
Definition: epsapi.h:36
NTSTATUS NTAPI PsaEnumerateProcessModules(IN HANDLE ProcessHandle, IN PPROCMOD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: modules.c:30
#define NTSTATUS
Definition: precomp.h:20
Definition: btrfs_drv.h:1853
PRTL_PROCESS_MODULE_INFORMATION FASTCALL PsaWalkNextSystemModule(IN PRTL_PROCESS_MODULES CurrentSystemModule)
Definition: drivers.c:183
ULONG_PTR SIZE_T
Definition: typedefs.h:79
PRTL_PROCESS_MODULE_INFORMATION FASTCALL PsaWalkFirstSystemModule(IN PRTL_PROCESS_MODULES SystemModules)
Definition: drivers.c:177
NTSTATUS NTAPI PsaEnumerateThreads(IN PTHREAD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: processes.c:228
void PsaiFree(void *ptr)
Definition: ctm.c:103
#define OUT
Definition: typedefs.h:40
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
PSYSTEM_PROCESS_INFORMATION FASTCALL PsaWalkFirstProcess(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads)
Definition: processes.c:238
LPFNPSPCALLBACK Callback
Definition: desk.c:112
NTSTATUS NTAPI PsaWalkSystemModules(IN PRTL_PROCESS_MODULES SystemModules, IN PSYSMOD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: drivers.c:154
PSYSTEM_THREAD_INFORMATION FASTCALL PsaWalkNextThread(IN PSYSTEM_THREAD_INFORMATION CurrentThread)
Definition: processes.c:268
NTSTATUS NTAPI PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext)
Definition: drivers.c:21
NTSTATUS(NTAPI * PTHREAD_ENUM_ROUTINE)(IN PSYSTEM_THREAD_INFORMATION CurrentThread, IN OUT PVOID CallbackContext)
Definition: epsapi.h:30