PATCH: dosmem access via ReadProcessMemory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 )
     {

Attachment: pgp00152.pgp
Description: PGP signature


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux