Fix remaining System Process information structure issues and fix
compilation
Modified: trunk/reactos/apps/utils/ps/ps.c
Modified: trunk/reactos/lib/epsapi/enum/processes.c
Modified: trunk/reactos/lib/ws2_32/include/ws2_32.h
Modified: trunk/reactos/lib/ws2_32/misc/dllmain.c
Modified: trunk/reactos/subsys/csrss/win32csr/desktopbg.c
Modified: trunk/reactos/subsys/csrss/win32csr/guiconsole.c
Modified: trunk/reactos/subsys/csrss/win32csr/tuiconsole.c
_____
Modified: trunk/reactos/apps/utils/ps/ps.c
--- trunk/reactos/apps/utils/ps/ps.c 2005-04-18 17:48:01 UTC (rev
14675)
+++ trunk/reactos/apps/utils/ps/ps.c 2005-04-18 18:24:06 UTC (rev
14676)
@@ -110,8 +110,8 @@
DWORD r;
ANSI_STRING astring;
HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE);
- PSYSTEM_PROCESSES SystemProcesses = NULL;
- PSYSTEM_PROCESSES CurrentProcess;
+ PSYSTEM_PROCESS_INFORMATION SystemProcesses = NULL;
+ PSYSTEM_PROCESS_INFORMATION CurrentProcess;
ULONG BufferSize, ReturnSize;
NTSTATUS Status;
char buf[256];
@@ -140,7 +140,7 @@
/* For every process print the information. */
CurrentProcess = SystemProcesses;
- while (CurrentProcess->NextEntryDelta != 0)
+ while (CurrentProcess->NextEntryOffset != 0)
{
int hour, hour1, thour, thour1;
unsigned char minute, minute1, tmin, tmin1;
@@ -159,53 +159,53 @@
minute1 = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL;
seconds1 = (ptime.QuadPart / 10000000LL) % 60LL;
- RtlUnicodeStringToAnsiString(&astring,
&CurrentProcess->ProcessName, TRUE);
+ RtlUnicodeStringToAnsiString(&astring,
&CurrentProcess->ImageName, TRUE);
wsprintf(buf,"P%8d %8d %3d:%02d:%02d %3d:%02d:%02d ProcName:
%s\n",
- CurrentProcess->ProcessId,
CurrentProcess->InheritedFromProcessId,
+ CurrentProcess->UniqueProcessId,
CurrentProcess->InheritedFromUniqueProcessId,
hour, minute, seconds, hour1, minute1, seconds1,
astring.Buffer);
WriteFile(stdout, buf, lstrlen(buf), &r, NULL);
RtlFreeAnsiString(&astring);
- for (ti = 0; ti < CurrentProcess->ThreadCount; ti++)
+ for (ti = 0; ti < CurrentProcess->NumberOfThreads; ti++)
{
struct status *statt;
struct waitres *waitt;
char szWindowName[30] = {" "};
- ptime = CurrentProcess->Threads[ti].KernelTime;
+ ptime = CurrentProcess->TH[ti].KernelTime;
thour = (ptime.QuadPart / (10000000LL * 3600LL));
tmin = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL;
tsec = (ptime.QuadPart / 10000000LL) % 60LL;
- ptime = CurrentProcess->Threads[ti].UserTime;
+ ptime = CurrentProcess->TH[ti].UserTime;
thour1 = (ptime.QuadPart / (10000000LL * 3600LL));
tmin1 = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL;
tsec1 = (ptime.QuadPart / 10000000LL) % 60LL;
statt = thread_stat;
- while (statt->state !=
CurrentProcess->Threads[ti].State && statt->state >= 0)
+ while (statt->state !=
CurrentProcess->TH[ti].ThreadState && statt->state >= 0)
statt++;
waitt = waitreason;
- while (waitt->state !=
CurrentProcess->Threads[ti].WaitReason && waitt->state >= 0)
+ while (waitt->state !=
CurrentProcess->TH[ti].WaitReason && waitt->state >= 0)
waitt++;
wsprintf (buf1,
"t% %8d %3d:%02d:%02d %3d:%02d:%02d
%s %s\n",
-
CurrentProcess->Threads[ti].ClientId.UniqueThread,
+ CurrentProcess->TH[ti].ClientId.UniqueThread,
thour, tmin, tsec, thour1, tmin1, tsec1,
statt->desc , waitt->desc);
WriteFile(stdout, buf1, lstrlen(buf1), &r, NULL);
-
EnumThreadWindows((DWORD)CurrentProcess->Threads[ti].ClientId.UniqueThre
ad,
+
EnumThreadWindows((DWORD)CurrentProcess->TH[ti].ClientId.UniqueThread,
(ENUMWINDOWSPROC) EnumThreadProc,
(LPARAM)(LPTSTR) szWindowName );
}
- CurrentProcess =
(PSYSTEM_PROCESSES)((ULONG_PTR)CurrentProcess +
- CurrentProcess->NextEntryDelta);
+ CurrentProcess =
(PSYSTEM_PROCESS_INFORMATION)((ULONG_PTR)CurrentProcess +
+ CurrentProcess->NextEntryOffset);
}
return (0);
}
_____
Modified: trunk/reactos/lib/epsapi/enum/processes.c
--- trunk/reactos/lib/epsapi/enum/processes.c 2005-04-18 17:48:01 UTC
(rev 14675)
+++ trunk/reactos/lib/epsapi/enum/processes.c 2005-04-18 18:24:06 UTC
(rev 14676)
@@ -38,9 +38,9 @@
#include <epsapi.h>
NTSTATUS NTAPI
-PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESSES
*ProcessesAndThreads)
+PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESS_INFORMATION
*ProcessesAndThreads)
{
- PSYSTEM_PROCESSES pInfoBuffer = NULL;
+ PSYSTEM_PROCESS_INFORMATION pInfoBuffer = NULL;
SIZE_T nSize = 0x8000;
NTSTATUS Status;
@@ -94,7 +94,7 @@
}
NTSTATUS NTAPI
-PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESSES ProcessesAndThreads,
+PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESS_INFORMATION
ProcessesAndThreads,
IN PPROC_ENUM_ROUTINE ProcessCallback,
IN OUT PVOID ProcessCallbackContext,
IN PTHREAD_ENUM_ROUTINE ThreadCallback,
@@ -128,11 +128,11 @@
if(ThreadCallback)
{
ULONG i;
- PSYSTEM_THREADS pCurThread;
+ PSYSTEM_THREAD_INFORMATION pCurThread;
/* scan the current process's thread list */
for(i = 0, pCurThread = PsaWalkFirstThread(ProcessesAndThreads);
- i < ProcessesAndThreads->ThreadCount;
+ i < ProcessesAndThreads->NumberOfThreads;
i++, pCurThread = PsaWalkNextThread(pCurThread))
{
Status = ThreadCallback(pCurThread, ThreadCallbackContext);
@@ -158,7 +158,7 @@
IN PTHREAD_ENUM_ROUTINE ThreadCallback,
IN OUT PVOID ThreadCallbackContext)
{
- PSYSTEM_PROCESSES pInfoBuffer;
+ PSYSTEM_PROCESS_INFORMATION pInfoBuffer;
NTSTATUS Status;
if(ProcessCallback == NULL && ThreadCallback == NULL)
@@ -194,7 +194,7 @@
}
NTSTATUS NTAPI
-PsaWalkProcesses(IN PSYSTEM_PROCESSES ProcessesAndThreads,
+PsaWalkProcesses(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads,
IN PPROC_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext)
{
@@ -206,7 +206,7 @@
}
NTSTATUS NTAPI
-PsaWalkThreads(IN PSYSTEM_PROCESSES ProcessesAndThreads,
+PsaWalkThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads,
IN PTHREAD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext)
{
@@ -237,42 +237,42 @@
CallbackContext);
}
-PSYSTEM_PROCESSES FASTCALL
-PsaWalkFirstProcess(IN PSYSTEM_PROCESSES ProcessesAndThreads)
+PSYSTEM_PROCESS_INFORMATION FASTCALL
+PsaWalkFirstProcess(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads)
{
return ProcessesAndThreads;
}
-PSYSTEM_PROCESSES FASTCALL
-PsaWalkNextProcess(IN PSYSTEM_PROCESSES CurrentProcess)
+PSYSTEM_PROCESS_INFORMATION FASTCALL
+PsaWalkNextProcess(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess)
{
- if(CurrentProcess->NextEntryDelta == 0)
+ if(CurrentProcess->NextEntryOffset == 0)
{
return NULL;
}
else
{
- return (PSYSTEM_PROCESSES)((ULONG_PTR)CurrentProcess +
CurrentProcess->NextEntryDelta);
+ return (PSYSTEM_PROCESS_INFORMATION)((ULONG_PTR)CurrentProcess +
CurrentProcess->NextEntryOffset);
}
}
-PSYSTEM_THREADS FASTCALL
-PsaWalkFirstThread(IN PSYSTEM_PROCESSES CurrentProcess)
+PSYSTEM_THREAD_INFORMATION FASTCALL
+PsaWalkFirstThread(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess)
{
static SIZE_T nOffsetOfThreads = 0;
/* get the offset of the Threads field */
- nOffsetOfThreads = offsetof(SYSTEM_PROCESSES, Threads);
+ nOffsetOfThreads = offsetof(SYSTEM_PROCESS_INFORMATION, TH);
- return (PSYSTEM_THREADS)((ULONG_PTR)CurrentProcess +
nOffsetOfThreads);
+ return (PSYSTEM_THREAD_INFORMATION)((ULONG_PTR)CurrentProcess +
nOffsetOfThreads);
}
-PSYSTEM_THREADS FASTCALL
-PsaWalkNextThread(IN PSYSTEM_THREADS CurrentThread)
+PSYSTEM_THREAD_INFORMATION FASTCALL
+PsaWalkNextThread(IN PSYSTEM_THREAD_INFORMATION CurrentThread)
{
- return (PSYSTEM_THREADS)((ULONG_PTR)CurrentThread +
- (offsetof(SYSTEM_PROCESSES, Threads[1]) -
- offsetof(SYSTEM_PROCESSES, Threads[0])));
+ return (PSYSTEM_THREAD_INFORMATION)((ULONG_PTR)CurrentThread +
+ (offsetof(SYSTEM_PROCESS_INFORMATION, TH[1])
-
+ offsetof(SYSTEM_PROCESS_INFORMATION,
TH[0])));
}
/* EOF */
_____
Modified: trunk/reactos/lib/ws2_32/include/ws2_32.h
--- trunk/reactos/lib/ws2_32/include/ws2_32.h 2005-04-18 17:48:01 UTC
(rev 14675)
+++ trunk/reactos/lib/ws2_32/include/ws2_32.h 2005-04-18 18:24:06 UTC
(rev 14676)
@@ -27,7 +27,7 @@
#define EXPORT STDCALL
extern HANDLE GlobalHeap;
-extern BOOL Initialized; /* TRUE if WSAStartup() has been
successfully called */
+extern BOOL WsaInitialized; /* TRUE if WSAStartup() has been
successfully called */
extern WSPUPCALLTABLE UpcallTable;
#define WS2_INTERNAL_MAX_ALIAS 16
@@ -59,9 +59,9 @@
/* Macros */
-#define WSAINITIALIZED (Initialized)
+#define WSAINITIALIZED (WsaInitialized)
-#define WSASETINITIALIZED (Initialized = TRUE)
+#define WSASETINITIALIZED (WsaInitialized = TRUE)
/* ws2_32 internal Functions */
void check_hostent(struct hostent **he);
_____
Modified: trunk/reactos/lib/ws2_32/misc/dllmain.c
--- trunk/reactos/lib/ws2_32/misc/dllmain.c 2005-04-18 17:48:01 UTC
(rev 14675)
+++ trunk/reactos/lib/ws2_32/misc/dllmain.c 2005-04-18 18:24:06 UTC
(rev 14676)
@@ -28,7 +28,7 @@
HANDLE GlobalHeap;
-BOOL Initialized = FALSE; /* TRUE if WSAStartup() has been
successfully called */
+BOOL WsaInitialized = FALSE; /* TRUE if WSAStartup() has been
successfully called */
WSPUPCALLTABLE UpcallTable;
_____
Modified: trunk/reactos/subsys/csrss/win32csr/desktopbg.c
--- trunk/reactos/subsys/csrss/win32csr/desktopbg.c 2005-04-18
17:48:01 UTC (rev 14675)
+++ trunk/reactos/subsys/csrss/win32csr/desktopbg.c 2005-04-18
18:24:06 UTC (rev 14676)
@@ -53,7 +53,7 @@
};
} PRIVATE_NOTIFY_DESKTOP, *PPRIVATE_NOTIFY_DESKTOP;
-static BOOL Initialized = FALSE;
+static BOOL BgInitialized = FALSE;
static HWND VisibleDesktopWindow = NULL;
static LRESULT CALLBACK
@@ -220,9 +220,9 @@
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) -
LPC_MESSAGE_BASE_SIZE;
- if (! Initialized)
+ if (! BgInitialized)
{
- Initialized = TRUE;
+ BgInitialized = TRUE;
if (! DtbgInit())
{
return Reply->Status = STATUS_UNSUCCESSFUL;
_____
Modified: trunk/reactos/subsys/csrss/win32csr/guiconsole.c
--- trunk/reactos/subsys/csrss/win32csr/guiconsole.c 2005-04-18
17:48:01 UTC (rev 14675)
+++ trunk/reactos/subsys/csrss/win32csr/guiconsole.c 2005-04-18
18:24:06 UTC (rev 14676)
@@ -45,7 +45,7 @@
#define CURSOR_BLINK_TIME 500
-static BOOL Initialized = FALSE;
+static BOOL ConsInitialized = FALSE;
static HWND NotifyWnd;
/* FUNCTIONS
*****************************************************************/
@@ -975,12 +975,12 @@
HANDLE GraphicsStartupEvent;
HANDLE ThreadHandle;
- if (! Initialized)
+ if (! ConsInitialized)
{
- Initialized = TRUE;
+ ConsInitialized = TRUE;
if (! GuiInit())
{
- Initialized = FALSE;
+ ConsInitialized = FALSE;
return STATUS_UNSUCCESSFUL;
}
}
_____
Modified: trunk/reactos/subsys/csrss/win32csr/tuiconsole.c
--- trunk/reactos/subsys/csrss/win32csr/tuiconsole.c 2005-04-18
17:48:01 UTC (rev 14675)
+++ trunk/reactos/subsys/csrss/win32csr/tuiconsole.c 2005-04-18
18:24:06 UTC (rev 14676)
@@ -22,7 +22,7 @@
static HANDLE ConsoleDeviceHandle;
static PCSRSS_CONSOLE ActiveConsole;
-static BOOL Initialized = FALSE;
+static BOOL ConsInitialized = FALSE;
static BOOL FASTCALL
TuiInit(VOID)
@@ -234,12 +234,12 @@
NTSTATUS FASTCALL
TuiInitConsole(PCSRSS_CONSOLE Console)
{
- if (! Initialized)
+ if (! ConsInitialized)
{
- Initialized = TRUE;
+ ConsInitialized = TRUE;
if (! TuiInit())
{
- Initialized = FALSE;
+ ConsInitialized = FALSE;
return STATUS_UNSUCCESSFUL;
}
}