diff --git a/reactos/Makefile b/reactos/Makefile index 3c41f51894f..536f564dce7 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -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 diff --git a/reactos/lib/psapi/enum/.cvsignore b/reactos/lib/epsapi/enum/.cvsignore similarity index 100% rename from reactos/lib/psapi/enum/.cvsignore rename to reactos/lib/epsapi/enum/.cvsignore diff --git a/reactos/lib/psapi/enum/drivers.c b/reactos/lib/epsapi/enum/drivers.c similarity index 97% rename from reactos/lib/psapi/enum/drivers.c rename to reactos/lib/epsapi/enum/drivers.c index 853a26d4916..a083cc2791c 100644 --- a/reactos/lib/psapi/enum/drivers.c +++ b/reactos/lib/epsapi/enum/drivers.c @@ -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 +#define NTOS_MODE_USER +#include #define NDEBUG #include +#include + NTSTATUS NTAPI PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback, IN OUT PVOID CallbackContext) diff --git a/reactos/lib/psapi/enum/modules.c b/reactos/lib/epsapi/enum/modules.c similarity index 97% rename from reactos/lib/psapi/enum/modules.c rename to reactos/lib/epsapi/enum/modules.c index 7509dc42ece..a1549bf8323 100644 --- a/reactos/lib/psapi/enum/modules.c +++ b/reactos/lib/epsapi/enum/modules.c @@ -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 #define NDEBUG #include +#include + NTSTATUS NTAPI PsaEnumerateProcessModules(IN HANDLE ProcessHandle, IN PPROCMOD_ENUM_ROUTINE Callback, diff --git a/reactos/lib/psapi/enum/processes.c b/reactos/lib/epsapi/enum/processes.c similarity index 98% rename from reactos/lib/psapi/enum/processes.c rename to reactos/lib/epsapi/enum/processes.c index 39474223a43..bde7b3f4be7 100644 --- a/reactos/lib/psapi/enum/processes.c +++ b/reactos/lib/epsapi/enum/processes.c @@ -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 #include +#include + +#include NTSTATUS NTAPI PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESSES *ProcessesAndThreads) diff --git a/reactos/lib/epsapi/makefile b/reactos/lib/epsapi/makefile new file mode 100644 index 00000000000..8d6abceb791 --- /dev/null +++ b/reactos/lib/epsapi/makefile @@ -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 + diff --git a/reactos/lib/psapi/internal.h b/reactos/lib/psapi/internal.h index 86eb724c8bc..6e62e3c0088 100644 --- a/reactos/lib/psapi/internal.h +++ b/reactos/lib/psapi/internal.h @@ -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 */ diff --git a/reactos/lib/psapi/makefile b/reactos/lib/psapi/makefile index 3e458932871..35facb945d8 100644 --- a/reactos/lib/psapi/makefile +++ b/reactos/lib/psapi/makefile @@ -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 \ diff --git a/reactos/lib/psapi/precomp.h b/reactos/lib/psapi/precomp.h index ff4cd43e4ba..551dc305239 100644 --- a/reactos/lib/psapi/precomp.h +++ b/reactos/lib/psapi/precomp.h @@ -1,6 +1,7 @@ #define NTOS_MODE_USER #include #include +#include #include #include "internal.h" #include