[Bug 23237] Multiple installers using WinZip SFX v2.2 display filenames as garbled characters during extraction process (installer requests 'MS Sans Serif' with SHIFTJIS_CHARSET)(DirectX SDK Nov 2006)

WineHQ Bugzilla wine-bugs at winehq.org
Sat Dec 19 16:55:04 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=23237

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|-unknown                    |gdi32
                URL|http://www.microsoft.com/do |https://web.archive.org/web
                   |wnloads/details.aspx?displa |/20111116070836/http://down
                   |ylang=en&FamilyID=c72d9f1e- |load.microsoft.com/download
                   |53f3-4747-8490-6801d8e8b4ef |/9/e/5/9e5bfc66-a621-4e0d-8
                   |                            |bfe-6688058c3f00/dxsdk_aug2
                   |                            |006.exe
            Summary|DirectX SDK Nov 2006 unzip  |Multiple installers using
                   |progress bar full of        |WinZip SFX v2.2 display
                   |symbols                     |filenames as garbled
                   |                            |characters during
                   |                            |extraction process
                   |                            |(installer requests 'MS
                   |                            |Sans Serif' with
                   |                            |SHIFTJIS_CHARSET)(DirectX
                   |                            |SDK Nov 2006)
                 CC|                            |focht at gmx.net

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

confirming, still present.

Stable download link via Internet Archive:

https://web.archive.org/web/20111116070836/http://download.microsoft.com/download/9/e/5/9e5bfc66-a621-4e0d-8bfe-6688058c3f00/dxsdk_aug2006.exe

Trace log:

--- snip ---
$ WINEDEBUG=+seh,+relay,+edit,+win,+msg,+loaddll,+font wine ./dxsdk.exe
>>log.txt 2>&1
...
00fc:trace:win:WIN_CreateWindowEx "" L"meter" ex=00000204 style=50000000 9,164
327x20 parent=0001006A menu=000000C9 inst=00400000 params=00000000
00fc:trace:win:dump_window_styles style: WS_CHILD WS_VISIBLE
00fc:trace:win:dump_window_styles exstyle: WS_EX_NOPARENTNOTIFY
WS_EX_CLIENTEDGE
00fc:trace:win:WIN_SetWindowLong 0001008C -12 c9 W
...
00fc:trace:win:WIN_CreateWindowEx hwnd 0001008C cs 9,164 327x20
(9,164)-(336,184)
...
00fc:trace:win:WIN_CreateWindowEx created window 0001008C
...
00fc:Call KERNEL32._lcreat(004082c0
"C:\\users\\focht\\Temp\\Include\\d3d.h",00000000) ret=004012da
...
00fc:Ret  KERNEL32._lcreat() retval=00000094 ret=004012da
...
00fc:Call KERNEL32._lwrite(00000094,00168cf0,00000800) ret=00401678
...
00fc:Ret  KERNEL32._lwrite() retval=00000800 ret=00401678
00fc:Call user32.PeekMessageA(0031ea10,00000000,00000000,00000000,00000001)
ret=00401c46
...
00fc:Ret  user32.PeekMessageA() retval=00000000 ret=00401c46
00fc:Call
user32.SendDlgItemMessageA(0001006a,000000c9,00000402,00000000,00000000)
ret=00401623
...
00fc:Call gdi32.GetDeviceCaps(002d008a,0000005a) ret=004020ef
...
00fc:Ret  gdi32.GetDeviceCaps() retval=00000060 ret=004020ef
00fc:Call gdi32.CreateFontIndirectA(0031df10) ret=00402109
...
00fc:trace:font:CreateFontIndirectExW (-8 0 0 0 0 0 0 0 128) L"MS Sans Serif"  
 => 00390050
00fc:Ret  gdi32.CreateFontIndirectA() retval=00390050 ret=00402109
00fc:Call gdi32.DeleteDC(002d008a) ret=00402112
00fc:Call user32.GetDpiForSystem() ret=20b4f81e
00fc:Ret  user32.GetDpiForSystem() retval=00000060 ret=20b4f81e
00fc:trace:font:font_SelectFont L"System", h=16, it=0, weight=700, PandF=22,
charset=0 orient 0 escapement 0
00fc:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000
1.000000
00fc:trace:font:select_font returning cached gdiFont(00159068)
00fc:trace:font:font_SelectFont 0001002E L"System" 16 aa 5
00fc:trace:font:update_font_code_page charset 0 => cp 1252
00fc:Ret  gdi32.DeleteDC() retval=00000001 ret=00402112
00fc:Call gdi32.SelectObject(00080084,00390050) ret=00402120
00fc:trace:font:font_SelectFont L"MS Sans Serif", h=-8, it=0, weight=0,
PandF=00, charset=128 orient 0 escapement 0
00fc:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000
1.000000
00fc:trace:font:select_font returning cached gdiFont(00183290)
00fc:trace:font:get_gasp_flags got flags 0003 for ppem 8
00fc:Call ntdll.RtlFreeHeap(00110000,00000000,00000000) ret=7e96c204
00fc:Ret  ntdll.RtlFreeHeap() retval=7bc23701 ret=7e96c204
00fc:trace:font:font_SelectFont 00390050 L"MS Sans Serif" -8 aa 5
...
00fc:trace:win:GetDCEx (0001008C,002F007B,0x10080): returning 00080084
(updated)
00fc:trace:win:BeginPaint hdc = 00080084 box = ((0,0)-(323,16)), fErase = 0
00fc:Ret  user32.BeginPaint() retval=00080084 ret=00404219
00fc:Call gdi32.CreateDCA(00407a10 "DISPLAY",00000000,00000000,00000000)
ret=004020c6
...
00fc:trace:font:update_font_code_page charset 128 => cp 932
00fc:Ret  gdi32.SelectObject() retval=0001002e ret=00402120
00fc:Call user32.GetSysColor(0000000e) ret=00404234
00fc:Ret  user32.GetSysColor() retval=00ffffff ret=00404234
00fc:Call gdi32.SetBkColor(00080084,00ffffff) ret=00404240
00fc:Ret  gdi32.SetBkColor() retval=00ffffff ret=00404240
...
00fc:Call user32.SetRect(0031e018,00000000,00000000,00000000,00000010)
ret=0040429e
00fc:Ret  user32.SetRect() retval=00000001 ret=0040429e
00fc:Call gdi32.GetTextExtentPoint32A(00080084,00407ab8 "X",00000001,0031e010)
ret=004042b2
00fc:trace:font:FONT_mbtowc mapped "X" -> L"X"
00fc:trace:font:freetype_set_outline_text_metrics font=0x183290
00fc:trace:font:font_GetTextExtentExPoint 00183290, L"X", 1
00fc:trace:font:get_gdi_font_glyph_metrics cached gm: 4, 6, (2,6), 8, 0 abc: 2,
4, 2
00fc:trace:font:GetTextExtentExPointW (00080084, L"X", 0) returning 8x10
00fc:trace:font:GetTextExtentPoint32A (00080084 "X" 1 0031E010): returning 8 x
10
00fc:Ret  gdi32.GetTextExtentPoint32A() retval=00000001 ret=004042b2
...
00fc:Call
gdi32.ExtTextOutA(00080084,000000a1,00000001,00000006,0031e018,0031df6c
"Unzipping d3d.h",0000000f,00000000) ret=004042ee
00fc:trace:font:FONT_mbtowc mapped "Unzipping d3d.h" -> L"Unzipping d3d.h"
00fc:trace:font:ExtTextOutW 00080084, 161, 1, 00001006, (0,0)-(0,16),
L"Unzipping d3d.h", 15, 00000000)
00fc:trace:font:ExtTextOutW align = 6 bkmode = 2 mapmode = 1
00fc:trace:font:freetype_set_outline_text_metrics font=0x183290
00fc:Call user32.GetDpiForSystem() ret=20b2d2d9
00fc:Ret  user32.GetDpiForSystem() retval=00000060 ret=20b2d2d9
00fc:Call user32.GetDpiForSystem() ret=20b2d2d9
00fc:Ret  user32.GetDpiForSystem() retval=00000060 ret=20b2d2d9
00fc:trace:font:GetTextMetricsW text metrics:
    Weight = 400     FirstChar = 0     AveCharWidth = 8
    Italic =   0     LastChar = 65533         MaxCharWidth = 8
    UnderLined = 0     DefaultChar = 1     Overhang = 0
    StruckOut = 0     BreakChar = 2     CharSet = 128
    PitchAndFamily = 27
    --------------------
    InternalLeading = 2
    Ascent = 8
    Descent = 2
    Height = 10
00fc:trace:font:GetTextExtentPointW not bug compatible.
00fc:trace:font:freetype_set_outline_text_metrics font=0x183290
00fc:trace:font:font_GetTextExtentExPoint 00183290, L"Unzipping d3d.h", 15
00fc:trace:font:get_gdi_font_glyph_metrics cached gm: 4, 6, (2,6), 8, 0 abc: 2,
4, 2
...
00fc:trace:font:get_gdi_font_glyph_metrics cached gm: 4, 6, (2,6), 8, 0 abc: 2,
4, 2
00fc:trace:font:GetTextExtentExPointW (00080084, L"Unzipping d3d.h", 0)
returning 114x10
00fc:Ret  gdi32.ExtTextOutA() retval=00000001 ret=004042ee
00fc:Call gdi32.GetBkColor(00080084) ret=00404303
00fc:Ret  gdi32.GetBkColor() retval=006a240a ret=00404303
00fc:Call gdi32.SetTextColor(00080084,006a240a) ret=00404309
00fc:Ret  gdi32.SetTextColor() retval=00ffffff ret=00404309
...
--- snip ---

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/0d0b32ac-a836-4bd2-a112-b6000a1b4fc9

--- quote ---
If you specify a typeface name in the lfFaceName member of the LOGFONT
structure, make sure that the lfCharSet value matches the character set of the
typeface specified in lfFaceName. For example, if you want to select a font
such as MS Mincho, lfCharSet must be set to the predefined value
SHIFTJIS_CHARSET.
--- quote ---

Not sure why 'MS Sans Serif' _and_ lfCharSet = 0x80 = SHIFTJIS_CHARSET (CP932)
are passed to CreateFontIndirectA(). 'MS Sans Serif' doesn't support unicode
hence this doesn't make sense. Looks like an application bug to me.

Changing lfCharSet to 0 or 1 in debugger gets everything properly rendered.

I don't know what Windows will do here. Maybe it uses a fallback (OpenType)
font that supports unicode, for example 'Microsoft Sans Serif'.

ProtectionID scan of bugged inner installer module (copied from %TEMP%):

--- snip ---
Scanning -> Z:\home\focht\Downloads\dxsdk.exe
File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 540380160 (020358C00h)
Byte(s) | Machine: 0x14C (I386)
Compilation TimeStamp : 0x3A5B1B69 -> Tue 09th Jan 2001 14:08:41 (GMT)
[TimeStamp] 0x3A5B1B69 -> Tue 09th Jan 2001 14:08:41 (GMT) | PE Header | - |
Offset: 0x000000D0 | VA: 0x004000D0 | -
[TimeStamp] 0x3A5B1B69 -> Tue 09th Jan 2001 14:08:41 (GMT) | Export | - |
Offset: 0x00005824 | VA: 0x00406A24 | -
[LoadConfig] CodeIntegrity -> Flags 0xA3F0 | Catalog 0x46 (70) | Catalog Offset
0x2000001 | Reserved 0x46A4A0
[LoadConfig] GuardAddressTakenIatEntryTable 0x8000011 | Count 0x46A558
(4629848)
[LoadConfig] GuardLongJumpTargetTable 0x8000001 | Count 0x46A5F8 (4630008)
[LoadConfig] HybridMetadataPointer 0x8000011 | DynamicValueRelocTable 0x46A66C
[LoadConfig] FailFastIndirectProc 0x8000011 | FailFastPointer 0x46C360
[LoadConfig] UnknownZero1 0x8000011
[File Heuristics] -> Flag #1 : 00000000000001001100000000000000 (0x0004C000)
[Entrypoint Section Entropy] : 6.49 (section #0) ".text   " | Size : 0x49B6
(18870) byte(s)
[DllCharacteristics] -> Flag : (0x0000) -> NONE
[SectionCount] 5 (0x5) | ImageSize 0x2035C000 (540393472) byte(s)
[ModuleReport] [IAT] Modules -> SHELL32.dll | USER32.dll | KERNEL32.dll |
GDI32.dll | ADVAPI32.dll
[-= Installer =-] WinZip SFX v2.2 Build 4003 Setup Archive !
--- snip ---

Using the version info 'WinZip SFX v2.2 Build 4003' from the inner installer,
I've searched the vendor website for old versions.

https://www.winzip.com/win/en/downarc.html

WinZip 2.2:

https://web.archive.org/web/20060615191332/http://download.winzip.com/ov/wzipse22.exe

WinZip 3.0:

https://web.archive.org/web/20110221065725/http://download.winzip.com/ov/wzipse30.exe

Guess what ... if you execute 'wzipse22.exe' you can see the same problem
briefly: glyphs not properly rendered.

--- snip ---
00fc:Call gdi32.CreateFontIndirectA(0031ea1c) ret=0040204e
00fc:trace:font:CreateFontIndirectExW (-8 0 0 0 0 0 0 0 128) L"MS Sans Serif"  
 => 0002006A
00fc:Ret  gdi32.CreateFontIndirectA() retval=0002006a ret=0040204e 
--- snip ---

'wzipse30.exe' works ok. The filenames are properly rendered during extraction
process. Although that installer uses a different font and height it doesn't
pass stupid lfCharSet value.

--- snip ---
00fc:Call gdi32.CreateFontIndirectA(0031e5c0) ret=004039bc
00fc:trace:font:CreateFontIndirectExW (-10 0 0 0 0 0 0 0 0) L"MS Shell Dlg"   
=> 00020074
00fc:Ret  gdi32.CreateFontIndirectA() retval=00020074 ret=004039bc
--- snip ---

$ sha1sum dxsdk*
1e9cdbef391ebfbf781e6c87a375138d8c195c57  dxsdk_aug2006.exe
839a494dfb83ce24bed4842cf67951466461c937  dxsdk.exe

$ du -sh dxsdk*
507M    dxsdk_aug2006.exe
516M    dxsdk.exe

$ wine --version
wine-6.0-rc3

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