Build epsapi with NDK
Modified: trunk/reactos/include/epsapi.h
Modified: trunk/reactos/include/ndk/zwtypes.h
Modified: trunk/reactos/lib/epsapi/enum/drivers.c
Modified: trunk/reactos/lib/epsapi/enum/modules.c
Modified: trunk/reactos/lib/epsapi/enum/processes.c
_____
Modified: trunk/reactos/include/epsapi.h
--- trunk/reactos/include/epsapi.h 2005-06-20 19:05:25 UTC (rev
16163)
+++ trunk/reactos/include/epsapi.h 2005-06-20 19:14:08 UTC (rev
16164)
@@ -26,8 +26,8 @@
#define __EPSAPI_H_INCLUDED__
/* INCLUDES */
-#define NTOS_MODE_USER
-#include <ntos.h>
+#include <ntdll/rtl.h>
+#include <ntdll/ldr.h> /* FIXME: USE LDR_DATA_TABLE_ENTRY */
/* OBJECTS */
_____
Modified: trunk/reactos/include/ndk/zwtypes.h
--- trunk/reactos/include/ndk/zwtypes.h 2005-06-20 19:05:25 UTC (rev
16163)
+++ trunk/reactos/include/ndk/zwtypes.h 2005-06-20 19:14:08 UTC (rev
16164)
@@ -464,7 +464,8 @@
} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
/* Class 1 */
-typedef struct _SYSTEM_PROCESSOR_INFORMATION {
+typedef struct _SYSTEM_PROCESSOR_INFORMATION
+{
USHORT ProcessorArchitecture;
USHORT ProcessorLevel;
USHORT ProcessorRevision;
@@ -552,7 +553,8 @@
} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
/* Class 3 */
-typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
+typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
+{
LARGE_INTEGER BootTime;
LARGE_INTEGER CurrentTime;
LARGE_INTEGER TimeZoneBias;
@@ -633,7 +635,8 @@
} SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
/* Class 7 */
-typedef struct _SYSTEM_DEVICE_INFORMATION {
+typedef struct _SYSTEM_DEVICE_INFORMATION
+{
ULONG NumberOfDisks;
ULONG NumberOfFloppies;
ULONG NumberOfCdRoms;
_____
Modified: trunk/reactos/lib/epsapi/enum/drivers.c
--- trunk/reactos/lib/epsapi/enum/drivers.c 2005-06-20 19:05:25 UTC
(rev 16163)
+++ trunk/reactos/lib/epsapi/enum/drivers.c 2005-06-20 19:14:08 UTC
(rev 16164)
@@ -14,9 +14,9 @@
* and improve reusability
*/
-#include <stddef.h>
+#include <windows.h>
#define NTOS_MODE_USER
-#include <ntos.h>
+#include <ndk/ntndk.h>
#define NDEBUG
#include <debug.h>
@@ -188,8 +188,8 @@
PsaWalkNextSystemModule(IN PSYSTEM_MODULE_INFORMATION
CurrentSystemModule)
{
return
(PSYSTEM_MODULE_INFORMATION_ENTRY)((ULONG_PTR)CurrentSystemModule +
-
(offsetof(SYSTEM_MODULE_INFORMATION, Module[1]) -
-
offsetof(SYSTEM_MODULE_INFORMATION, Module[0])));
+
(FIELD_OFFSET(SYSTEM_MODULE_INFORMATION, Module[1]) -
+
FIELD_OFFSET(SYSTEM_MODULE_INFORMATION, Module[0])));
}
/* EOF */
_____
Modified: trunk/reactos/lib/epsapi/enum/modules.c
--- trunk/reactos/lib/epsapi/enum/modules.c 2005-06-20 19:05:25 UTC
(rev 16163)
+++ trunk/reactos/lib/epsapi/enum/modules.c 2005-06-20 19:14:08 UTC
(rev 16164)
@@ -18,9 +18,9 @@
* isolated in its own library to clear the
confusion
* and improve reusability
*/
-
+#include <windows.h>
#define NTOS_MODE_USER
-#include <ntos.h>
+#include <ndk/ntndk.h>
#define NDEBUG
#include <debug.h>
_____
Modified: trunk/reactos/lib/epsapi/enum/processes.c
--- trunk/reactos/lib/epsapi/enum/processes.c 2005-06-20 19:05:25 UTC
(rev 16163)
+++ trunk/reactos/lib/epsapi/enum/processes.c 2005-06-20 19:14:08 UTC
(rev 16164)
@@ -31,12 +31,15 @@
* and improve reusability
*/
-#include <ddk/ntddk.h>
-#include <debug.h>
-#include <stddef.h>
+#include <windows.h>
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
#include <epsapi.h>
+#define NDEBUG
+#include <debug.h>
+
NTSTATUS NTAPI
PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESS_INFORMATION
*ProcessesAndThreads)
{
@@ -74,7 +77,7 @@
pInfoBuffer = pTmp;
/* query the information */
- Status =
NtQuerySystemInformation(SystemProcessesAndThreadsInformation,
+ Status = NtQuerySystemInformation(SystemProcessInformation,
pInfoBuffer,
nSize,
NULL);
@@ -262,7 +265,7 @@
static SIZE_T nOffsetOfThreads = 0;
/* get the offset of the Threads field */
- nOffsetOfThreads = offsetof(SYSTEM_PROCESS_INFORMATION, TH);
+ nOffsetOfThreads = FIELD_OFFSET(SYSTEM_PROCESS_INFORMATION, TH);
return (PSYSTEM_THREAD_INFORMATION)((ULONG_PTR)CurrentProcess +
nOffsetOfThreads);
}
@@ -271,8 +274,8 @@
PsaWalkNextThread(IN PSYSTEM_THREAD_INFORMATION CurrentThread)
{
return (PSYSTEM_THREAD_INFORMATION)((ULONG_PTR)CurrentThread +
- (offsetof(SYSTEM_PROCESS_INFORMATION, TH[1])
-
- offsetof(SYSTEM_PROCESS_INFORMATION,
TH[0])));
+ (FIELD_OFFSET(SYSTEM_PROCESS_INFORMATION,
TH[1]) -
+ FIELD_OFFSET(SYSTEM_PROCESS_INFORMATION,
TH[0])));
}
/* EOF */