From b9113d3faeb686b2b3c94d3b9e68d9bb4cf53de0 Mon Sep 17 00:00:00 2001 From: Robert Dickenson Date: Sun, 5 Jan 2003 10:07:08 +0000 Subject: [PATCH] Moved the beginnings of some toolhelp exports to their own module. svn path=/trunk/; revision=3935 --- reactos/lib/kernel32/makefile | 5 +- reactos/lib/kernel32/misc/stubs.c | 44 +------------ reactos/lib/kernel32/misc/toolhelp.c | 93 ++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 45 deletions(-) create mode 100644 reactos/lib/kernel32/misc/toolhelp.c diff --git a/reactos/lib/kernel32/makefile b/reactos/lib/kernel32/makefile index ad355bf002e..e7ebb837e29 100644 --- a/reactos/lib/kernel32/makefile +++ b/reactos/lib/kernel32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.55 2002/12/08 16:07:18 robd Exp $ +# $Id: makefile,v 1.56 2003/01/05 10:07:07 robd Exp $ PATH_TO_TOP = ../.. @@ -32,7 +32,8 @@ SYNCH_OBJECTS = synch/critical.o synch/event.o synch/intrlck.o synch/mutex.o \ MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o \ misc/dllmain.o misc/comm.o misc/errormsg.o \ - misc/console.o misc/time.o misc/stubs.o misc/ldr.o misc/res.o \ + misc/console.o misc/time.o misc/toolhelp.o \ + misc/stubs.o misc/ldr.o misc/res.o \ misc/debug.o misc/sysinfo.o misc/profile.o \ misc/mbchars.o misc/muldiv.o misc/getname.o diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index d89d099d7c7..82bf81d09d2 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,10 +1,9 @@ -/* $Id: stubs.c,v 1.39 2003/01/04 18:33:18 robd Exp $ +/* $Id: stubs.c,v 1.40 2003/01/05 10:07:08 robd Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. */ #include -#include #define _OLE2NLS_IN_BUILD_ @@ -1024,45 +1023,4 @@ VirtualBufferExceptionHandler ( return 0; } - -BOOL -STDCALL -Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -BOOL -STDCALL -Process32Next(HANDLE hSnapshot, LPPROCESSENTRY32 lppe) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -BOOL -STDCALL -Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -BOOL -STDCALL -Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -HANDLE -STDCALL -CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - /* EOF */ diff --git a/reactos/lib/kernel32/misc/toolhelp.c b/reactos/lib/kernel32/misc/toolhelp.c new file mode 100644 index 00000000000..3f76fa63077 --- /dev/null +++ b/reactos/lib/kernel32/misc/toolhelp.c @@ -0,0 +1,93 @@ +/* $Id: toolhelp.c,v 1.1 2003/01/05 10:07:08 robd Exp $ + * + * KERNEL32.DLL toolhelp functions + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/kernel32/misc/toolhelp.c + * PURPOSE: Toolhelp functions + * PROGRAMMER: Robert Dickenson ( robd@mok.lvcm.com) + * UPDATE HISTORY: + * Created 05 January 2003 + */ + +#include +#include + + +BOOL +STDCALL +Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe) +{ + SetLastError(ERROR_NO_MORE_FILES); + return FALSE; +} + +BOOL +STDCALL +Process32Next(HANDLE hSnapshot, LPPROCESSENTRY32 lppe) +{ + SetLastError(ERROR_NO_MORE_FILES); + return FALSE; +} + +BOOL +STDCALL +Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) +{ + if (!lppe || lppe->dwSize != sizeof(PROCESSENTRY32W)) { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + SetLastError(ERROR_NO_MORE_FILES); + return FALSE; +} + +BOOL +STDCALL +Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) +{ + SetLastError(ERROR_NO_MORE_FILES); + return FALSE; +} + +HANDLE +STDCALL +CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID) +{ + // return open handle to snapshot on success, -1 on failure + // the snapshot handle behavies like an object handle + HANDLE hSnapshot = -1; + + if (dwFlags & TH32CS_INHERIT) { + } +// if (dwFlags & TH32CS_SNAPALL) { // == (TH32CS_SNAPHEAPLIST + TH32CS_SNAPMODULE + TH32CS_SNAPPROCESS + TH32CS_SNAPTHREAD) +// } + if (dwFlags & TH32CS_SNAPHEAPLIST) { + } + if (dwFlags & TH32CS_SNAPMODULE) { + } + if (dwFlags & TH32CS_SNAPPROCESS) { + } + if (dwFlags & TH32CS_SNAPTHREAD) { + } + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + + // caller must use CloseHandle to destroy the returned snapshot handle + return hSnapshot; +} + +BOOL +WINAPI +Toolhelp32ReadProcessMemory(DWORD th32ProcessID, + LPCVOID lpBaseAddress, LPVOID lpBuffer, + DWORD cbRead, LPDWORD lpNumberOfBytesRead) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/* EOF */