Moved the beginnings of some toolhelp exports to their own module.
authorRobert Dickenson <robd@reactos.org>
Sun, 5 Jan 2003 10:07:08 +0000 (10:07 +0000)
committerRobert Dickenson <robd@reactos.org>
Sun, 5 Jan 2003 10:07:08 +0000 (10:07 +0000)
svn path=/trunk/; revision=3935

reactos/lib/kernel32/makefile
reactos/lib/kernel32/misc/stubs.c
reactos/lib/kernel32/misc/toolhelp.c [new file with mode: 0644]

index ad355bf..e7ebb83 100644 (file)
@@ -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
 
index d89d099..82bf81d 100644 (file)
@@ -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 <windows.h>
-#include <tlhelp32.h>
 
 #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 (file)
index 0000000..3f76fa6
--- /dev/null
@@ -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 <windows.h>
+#include <tlhelp32.h>
+
+
+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 */