Hello,
The patch: http://www.winehq.org/hypermail/wine-cvs/2003/11/0011.html
Fixed type and protection values returned by NtQueryVirtualMemory to be closer to what Windows does. Allow using MEM_SYSTEM without MEM_RESERVE to avoid 64k alignment. Use pread instead of lseek+read when faking mmap
Made what the "Hot potatoes" program installer doesn't work. http://web.uvic.ca/hrd/halfbaked/winhotpot60_beta.zip
Now when you run the installer, it says in a dialog: "Access violation at address 0040C54A. Write of address 00400000"
The problem happens in this line of the patch:
- if (!(view = VIRTUAL_CreateView( ptr, total_size, 0, VPROT_COMMITTED|VPROT_READ, hmapping ))) + if (!(view = VIRTUAL_CreateView( ptr, total_size, 0, + VPROT_COMMITTED | VPROT_READ | VPROT_WRITE | + VPROT_EXEC | VPROT_WRITECOPY | VPROT_IMAGE, hmapping )))
It works fine, if you remove the flags VPROT_WRITE and VPROT_WRITECOPY.
Relay log, from the working version:
0009:Call comctl32.InitCommonControls() ret=00406879 0009:Ret comctl32.InitCommonControls() retval=401cba82 ret=00406879 0009:Call user32.GetSystemMetrics(0000002a) ret=0040688e 0009:Ret user32.GetSystemMetrics() retval=00000000 ret=0040688e 0009:Call kernel32.GetSystemInfo(407afe74) ret=0040c567 0009:Ret kernel32.GetSystemInfo() retval=00000000 ret=0040c567 0009:Call kernel32.VirtualQuery(00400000,407afe98,0000001c) ret=0040c572 0009:Ret kernel32.VirtualQuery() retval=0000001c ret=0040c572 0009:Call kernel32.VirtualProtect(00400000,00001000,00000040,407afe70) ret=0040c5b3 0009:Ret kernel32.VirtualProtect() retval=00000001 ret=0040c5b3 0009:Call kernel32.VirtualProtect(00400000,00001000,00000002,407afe70) ret=0040c5e5 0009:Ret kernel32.VirtualProtect() retval=00000001 ret=0040c5e5 0009:Call kernel32.VirtualQuery(00401000,407afe98,0000001c) ret=0040c5f5
Relay log, from the non working version:
0009:Call comctl32.InitCommonControls() ret=00406879 0009:Ret comctl32.InitCommonControls() retval=401cb9c6 ret=00406879 0009:Call user32.GetSystemMetrics(0000002a) ret=0040688e 0009:Ret user32.GetSystemMetrics() retval=00000000 ret=0040688e 0009:Call kernel32.GetSystemInfo(4069fe74) ret=0040c567 0009:Ret kernel32.GetSystemInfo() retval=00000000 ret=0040c567 0009:Call kernel32.VirtualQuery(00400000,4069fe98,0000001c) ret=0040c572 0009:Ret kernel32.VirtualQuery() retval=0000001c ret=0040c572 0009:Call user32.LoadStringA(00400000,0000ffa6,4069f604,00000400) ret=00404ef6
Here is starting to load the message error. Before of this point the 2 relay logs, was very similar (vimdiff was a great help :)
Thanks, Regards, Carlos.
Carlos Lozano clozano@andago.com writes:
The problem happens in this line of the patch:
- if (!(view = VIRTUAL_CreateView( ptr, total_size, 0, VPROT_COMMITTED|VPROT_READ, hmapping )))
- if (!(view = VIRTUAL_CreateView( ptr, total_size, 0,
VPROT_COMMITTED | VPROT_READ | VPROT_WRITE |
VPROT_EXEC | VPROT_WRITECOPY | VPROT_IMAGE, hmapping )))
It works fine, if you remove the flags VPROT_WRITE and VPROT_WRITECOPY.
This should fix it:
Index: dlls/ntdll/virtual.c =================================================================== RCS file: /opt/cvs-commit/wine/dlls/ntdll/virtual.c,v retrieving revision 1.17 diff -u -p -r1.17 virtual.c --- dlls/ntdll/virtual.c 4 Nov 2003 04:50:19 -0000 1.17 +++ dlls/ntdll/virtual.c 11 Nov 2003 19:41:18 -0000 @@ -738,6 +738,7 @@ static NTSTATUS map_image( HANDLE hmappi
/* set the image protections */
+ VIRTUAL_SetProt( view, ptr, header_size, VPROT_COMMITTED | VPROT_READ ); sec = (IMAGE_SECTION_HEADER*)((char *)&nt->OptionalHeader+nt->FileHeader.SizeOfOptionalHeader); for (i = 0; i < nt->FileHeader.NumberOfSections; i++, sec++) {
El mar, 11 de nov de 2003, a las 11:48, Alexandre Julliard escribio:
This should fix it:
[...]
Yes, it is fixed :)), well done :)
Thanks, Regards, Carlos.