[Bug 24963] Okad2 crashes on startup (LoadImage of OEM cursor with LR_LOADFROMFILE flag set)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Jan 25 14:00:37 CST 2014


http://bugs.winehq.org/show_bug.cgi?id=24963

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net
            Summary|Okad2: Unhandled page fault |Okad2 crashes on startup
                   |at address 0x00007f8a       |(LoadImage of OEM cursor
                   |during startup              |with LR_LOADFROMFILE flag
                   |                            |set)

--- Comment #6 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

--- quote ---
After using a PE editor on user32_crosstest.exe to change the required OS
version, image version, and subsystem version to match Okad2's values, running
that executable through the test bot showed that LoadImageA succeeds for the
given parameters on all platforms except Win98.
--- quote ---

many older apps relying on old/broken Win32 API behaviour can be safely
identified by looking at NT optional header 'MajorSubsystemVersion' field (and
possibly 'MinorSubsystemVersion' if needed).

Wine already makes use of this in some places to work around broken behaviour.

Dump of 'Okad2-41-pd.exe' PE header with 'LordPE' tool:

--- snip ---
...
->Optional Header
   Magic:                        0x010B  (HDR32_MAGIC)
   MajorLinkerVersion:           0x02
   MinorLinkerVersion:           0x32  -> 2.50
   SizeOfCode:                   0x00000200
   SizeOfInitializedData:        0x00000400
   SizeOfUninitializedData:      0x00000200
   AddressOfEntryPoint:          0x00001000
   BaseOfCode:                   0x00001000
   BaseOfData:                   0x00002000
   ImageBase:                    0x10000000
   SectionAlignment:             0x00001000
   FileAlignment:                0x00000200
   MajorOperatingSystemVersion:  0x0001
   MinorOperatingSystemVersion:  0x0000  -> 1.00
   MajorImageVersion:            0x0001
   MinorImageVersion:            0x0061  -> 1.97
   MajorSubsystemVersion:        0x0003
   MinorSubsystemVersion:        0x000A  -> 3.10
   Win32VersionValue:            0x00000000
   SizeOfImage:                  0x20000000
   SizeOfHeaders:                0x00000400
   CheckSum:                     0x00000000
   Subsystem:                    0x0003  (WINDOWS_CUI)
   DllCharacteristics:           0x0000
   SizeOfStackReserve:           0x00100000
   SizeOfStackCommit:            0x00001000
   SizeOfHeapReserve:            0x00100000
   SizeOfHeapCommit:             0x00001000
   LoaderFlags:                  0x00000000
   NumberOfRvaAndSizes:          0x00000010
...
--- snip ---

The app has MajorSubsystemVersion.MinorSubsystemVersion set to '3.10'.

A compatibility workaround for those old apps can be implemented by using
GetProcessVersion() and check for '< 0x400' condition.

--- snip ---
0012FF44  00000000  ; hInst = NULL
0012FF48  00007F8A  ; Name = OCR_APPSTARTING
0012FF4C  00000002  ; Type = IMAGE_CURSOR
0012FF50  00000000  ; DesiredX = 0
0012FF54  00000000  ; DesiredY = 0
0012FF58  00000050  ; Flags = LR_LOADFROMFILE|LR_DEFAULTSIZE
--- snip ---

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list