separate epsapi as per kjk's request again, sorry for that.

svn path=/trunk/; revision=11591
This commit is contained in:
Thomas Bluemel 2004-11-08 00:34:46 +00:00
parent 93c256ba7e
commit 762aaad968
9 changed files with 42 additions and 125 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.257 2004/11/03 22:42:59 weiden Exp $
# $Id: Makefile,v 1.258 2004/11/08 00:34:45 weiden Exp $
#
# Global makefile
#
@ -38,7 +38,7 @@ BUS = acpi isapnp pci
LIB_FSLIB = vfatlib
# Static libraries
LIB_STATIC = string rosrtl uuid libwine zlib rtl tgetopt pseh adns
LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns
# Keyboard layout libraries
DLLS_KBD = kbddv kbdfr kbdgr kbdse kbduk kbdus

View file

@ -1,4 +1,4 @@
/* $Id: drivers.c,v 1.3 2004/11/03 22:43:00 weiden Exp $
/* $Id: drivers.c,v 1.4 2004/11/08 00:34:45 weiden Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
@ -14,11 +14,15 @@
* and improve reusability
*/
#include "precomp.h"
#include <stddef.h>
#define NTOS_MODE_USER
#include <ntos.h>
#define NDEBUG
#include <debug.h>
#include <epsapi.h>
NTSTATUS NTAPI
PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext)

View file

@ -1,4 +1,4 @@
/* $Id: modules.c,v 1.1 2004/11/03 22:43:00 weiden Exp $
/* $Id: modules.c,v 1.4 2004/11/08 00:34:46 weiden Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
@ -19,11 +19,14 @@
* and improve reusability
*/
#include "precomp.h"
#define NTOS_MODE_USER
#include <ntos.h>
#define NDEBUG
#include <debug.h>
#include <epsapi.h>
NTSTATUS NTAPI
PsaEnumerateProcessModules(IN HANDLE ProcessHandle,
IN PPROCMOD_ENUM_ROUTINE Callback,

View file

@ -1,4 +1,4 @@
/* $Id: processes.c,v 1.1 2004/11/03 22:43:00 weiden Exp $
/* $Id: processes.c,v 1.3 2004/11/08 00:34:46 weiden Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
@ -31,10 +31,11 @@
* and improve reusability
*/
#include "precomp.h"
#define NDEBUG
#include <ddk/ntddk.h>
#include <debug.h>
#include <stddef.h>
#include <epsapi.h>
NTSTATUS NTAPI
PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESSES *ProcessesAndThreads)

View file

@ -0,0 +1,20 @@
# $Id: makefile,v 1.5 2004/11/08 00:34:46 weiden Exp $
PATH_TO_TOP = ../..
TARGET_TYPE = library
TARGET_NAME = epsapi
# require os code to explicitly request A/W version of structs/functions
TARGET_CFLAGS += -D_DISABLE_TIDENTS -Werror -Wall
TARGET_OBJECTS = \
enum/drivers.o \
enum/modules.o \
enum/processes.o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -1,4 +1,4 @@
/* $Id: internal.h,v 1.1 2004/11/03 22:42:59 weiden Exp $
/* $Id: internal.h,v 1.2 2004/11/08 00:34:45 weiden Exp $
*/
/*
* epsapi.h
@ -30,115 +30,6 @@
((void)SetLastError(RtlNtStatusToDosError(__S__)))
#endif /* SetLastErrorByStatus */
/* OBJECTS */
/* TYPES */
typedef NTSTATUS (NTAPI *PPROC_ENUM_ROUTINE)(IN PSYSTEM_PROCESSES CurrentProcess,
IN OUT PVOID CallbackContext);
typedef NTSTATUS (NTAPI *PTHREAD_ENUM_ROUTINE)(IN PSYSTEM_THREADS CurrentThread,
IN OUT PVOID CallbackContext);
typedef NTSTATUS (NTAPI *PSYSMOD_ENUM_ROUTINE)(IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
IN OUT PVOID CallbackContext);
typedef NTSTATUS (NTAPI *PPROCMOD_ENUM_ROUTINE)(IN HANDLE ProcessHandle,
IN PLDR_MODULE CurrentModule,
IN OUT PVOID CallbackContext);
/* CONSTANTS */
#define FAILED_WITH_STATUS DEFINE_DBG_MSG("%s() failed, status 0x%08X")
/* PROTOTYPES */
/* Processes and threads */
/* enumeration */
NTSTATUS NTAPI
PsaEnumerateProcessesAndThreads(IN PPROC_ENUM_ROUTINE ProcessCallback,
IN OUT PVOID ProcessCallbackContext,
IN PTHREAD_ENUM_ROUTINE ThreadCallback,
IN OUT PVOID ThreadCallbackContext);
NTSTATUS NTAPI
PsaEnumerateProcesses(IN PPROC_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
NTSTATUS NTAPI
PsaEnumerateThreads(IN PTHREAD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
/* capturing & walking */
NTSTATUS NTAPI
PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESSES * ProcessesAndThreads);
NTSTATUS NTAPI
PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESSES ProcessesAndThreads,
IN PPROC_ENUM_ROUTINE ProcessCallback,
IN OUT PVOID ProcessCallbackContext,
IN PTHREAD_ENUM_ROUTINE ThreadCallback,
IN OUT PVOID ThreadCallbackContext);
NTSTATUS NTAPI
PsaWalkProcesses(IN PSYSTEM_PROCESSES ProcessesAndThreads,
IN PPROC_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
NTSTATUS NTAPI
PsaWalkThreads(IN PSYSTEM_PROCESSES ProcessesAndThreads,
IN PTHREAD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
PSYSTEM_PROCESSES FASTCALL
PsaWalkFirstProcess(IN PSYSTEM_PROCESSES ProcessesAndThreads);
PSYSTEM_PROCESSES FASTCALL
PsaWalkNextProcess(IN PSYSTEM_PROCESSES CurrentProcess);
PSYSTEM_THREADS FASTCALL
PsaWalkFirstThread(IN PSYSTEM_PROCESSES CurrentProcess);
PSYSTEM_THREADS FASTCALL
PsaWalkNextThread(IN PSYSTEM_THREADS CurrentThread);
/* System modules */
/* enumeration */
NTSTATUS NTAPI
PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
/* capturing & walking */
NTSTATUS NTAPI
PsaCaptureSystemModules(OUT PSYSTEM_MODULE_INFORMATION * SystemModules);
NTSTATUS NTAPI
PsaWalkSystemModules(IN PSYSTEM_MODULE_INFORMATION SystemModules,
IN PSYSMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
PSYSTEM_MODULE_INFORMATION_ENTRY FASTCALL
PsaWalkFirstSystemModule(IN PSYSTEM_MODULE_INFORMATION SystemModules);
PSYSTEM_MODULE_INFORMATION_ENTRY FASTCALL
PsaWalkNextSystemModule(IN PSYSTEM_MODULE_INFORMATION CurrentSystemModule);
/* Process modules */
NTSTATUS NTAPI
PsaEnumerateProcessModules(IN HANDLE ProcessHandle,
IN PPROCMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext);
/* Miscellaneous */
VOID NTAPI
PsaFreeCapture(IN PVOID Capture);
/* The user must define these functions. They are called by PSAPI to allocate
memory. This allows PSAPI to be called from any environment */
void *PsaiMalloc(SIZE_T size);
void *PsaiRealloc(void *ptr, SIZE_T size);
void PsaiFree(void *ptr);
/* MACROS */
#define DEFINE_DBG_MSG(__str__) "PSAPI: " __str__ "\n"
#endif /* __INTERNAL_PSAPI_H_INCLUDED__ */
/* EOF */

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.13 2004/11/04 22:14:41 weiden Exp $
# $Id: makefile,v 1.14 2004/11/08 00:34:45 weiden Exp $
PATH_TO_TOP = ../..
@ -6,7 +6,7 @@ TARGET_TYPE = dynlink
TARGET_NAME = psapi
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_SDKLIBS = epsapi.a ntdll.a kernel32.a
TARGET_CFLAGS = -I./include -Wall -Werror
@ -20,9 +20,6 @@ TARGET_BASE = $(TARGET_BASE_LIB_PSAPI)
TARGET_PCH = precomp.h
TARGET_OBJECTS = \
enum/drivers.o \
enum/modules.o \
enum/processes.o \
misc/dllmain.o \
misc/malloc.o \
misc/stubs.o \

View file

@ -1,6 +1,7 @@
#define NTOS_MODE_USER
#include <windows.h>
#include <psapi.h>
#include <epsapi.h>
#include <ntos.h>
#include "internal.h"
#include <stddef.h>