PATCH: dosmem access via ReadProcessMemory

Marcus Meissner meissner at suse.de
Tue Jun 24 07:39:05 CDT 2003


Hi,

An EEPROM programmer from BP Microsystems uses ReadProcessMemory to access
the BIOS data segment (to find out parallel ports).

This patch adds support for this kind of access to ReadProcessMemory.

Ciao, Marcus

Changelog:
	Make it possible to access DOS memory using ReadProcessMemory().

Index: scheduler/process.c
===================================================================
RCS file: /home/wine/wine/scheduler/process.c,v
retrieving revision 1.222
diff -u -r1.222 process.c
--- scheduler/process.c	21 Jun 2003 02:07:10 -0000	1.222
+++ scheduler/process.c	24 Jun 2003 12:36:35 -0000
@@ -48,6 +48,7 @@
 #include "options.h"
 #include "wine/debug.h"
 #include "../kernel/kernel_private.h"
+#include "miscemu.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(process);
 WINE_DECLARE_DEBUG_CHANNEL(server);
@@ -1767,6 +1768,19 @@
                                SIZE_T *bytes_read )
 {
     DWORD res;
+    
+    if ((process == GetCurrentProcess()) && (addr < 0x1000)) {
+    	/* Some stupid EEPROM programming tool (BPWin from BP Microsystems) does
+	 * this to find out the parallel port addresses from the BIOS DATA segment.
+	 */
+    	LPVOID dosptr;
+
+	DOSMEM_Init(TRUE);
+	dosptr = DOSMEM_MapDosToLinear(addr);
+	memcpy(buffer, dosptr, size);
+	*bytes_read = size;
+	return TRUE;
+    }
 
     SERVER_START_REQ( read_process_memory )
     {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030624/606ee84e/attachment.pgp


More information about the wine-patches mailing list