At 11:44 AM 4/29/00 -0400, you wrote:
>Try reverting the CVS commit and trying the original patch I sent - the original
>patch checks to ensure that the pe section offsets are on pagesize bounds, and
>if not avoids the FILE_dommap call and just copies the section instead. Alexandre
>modified the patch to always rely on FILE_dommap, counting on the pagesize failure
>handling code there to do the copying.
>
Thanks, I'll do it. What I tried so far is this :
@@ -672,15 +672,10 @@
TRACE("%s: mmaping section %s at %p off %lx\n",
filename, pe_sec->Name, (void*)RVA(pe_sec->VirtualAddress),
pe_sec->PointerToRawData);
- if (FILE_dommap( unix_handle, (void*)RVA(pe_sec->VirtualAddress),
- 0, min(pe_sec->Misc.VirtualSize, pe_sec->SizeOfRawData),
- 0, pe_sec->PointerToRawData, PROT_EXEC | PROT_WRITE |
PROT_READ,
- MAP_PRIVATE | MAP_FIXED ) !=
(void*)RVA(pe_sec->VirtualAddress))
- {
- /* We failed to map to the right place (huh?) */
- ERR_(win32)( "Critical Error: failed to map PE section to necessary
address.\n");
- goto error;
- }
+ if(!(pe_sec->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
+ memcpy((char*)RVA(pe_sec->VirtualAddress),
+ (char*)(hModule + pe_sec->PointerToRawData),
+ pe_sec->SizeOfRawData);
}
/* Perform base relocation, if necessary */
this fixes the problem, but also it removes your optimization I guess :-)
>I'm not sure why this would be failing, though it's possible it might be because
>FILE_dommap() is trying to use mmap to reserve the destination address range a
>second time - it was already reserved by the loader in PE_LoadImage().
>
>I just tried my April 18th CVS tree (with my version of the patch) agains WordViewer,
>and it seems to come up fine (but won't open any files). Oddly, when I tried
>WordViewer
>against the current CVS, it comes up to the splash screen, but dies there with a
>critical section deadlock. Is this what you're seeing?
No, an access violation after the splash; your problem may be different; Ms software
is very picky about what it finds in the registry...My wine registry is known good (at
least to make start the WW97 monster)
With the change I posted, I can open files again.
Gerard