[Bug 47246] New: DbgPrint does not handle unicode format string '%wZ' ( ReactOS 0.4.11-dev-603+ installer )

wine-bugs at winehq.org wine-bugs at winehq.org
Wed May 22 02:25:46 CDT 2019


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

            Bug ID: 47246
           Summary: DbgPrint does not handle unicode format string '%wZ'
                    (ReactOS 0.4.11-dev-603+ installer )
           Product: Wine
           Version: 4.8
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ntdll
          Assignee: wine-bugs at winehq.org
          Reporter: focht at gmx.net
      Distribution: ---

Hello folks,

mentioned in https://jira.reactos.org/browse/CORE-16043 which is about a
different issue -> bug 47242

https://jira.reactos.org/browse/CORE-16043?focusedCommentId=114608&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-114608

--- quote ---
...

However, the fact that the debug log says "NtOpenSymbolicLinkObject(Z) failed
with Status 0x006cf6a4" while the corresponding code line is:

 457         /*
 458          * We failed at opening the \SystemRoot link (usually due to wrong
 459          * access rights). Do not consider this as a fatal error, but use
 460          * instead the image file path as the installation source path.
 461          */
 462         DPRINT1("NtOpenSymbolicLinkObject(%wZ) failed with Status
0x%08lx\n",
 463                 &SystemRootPath, Status);

is scarier, because "0x006cf6a4" is NOT a valid status code, and SystemRootPath
is up to this point still pointing to the constant string L"
SystemRoot" in UNICODE_STRING format. Maybe also their debugging procedure does
not understand what %wZ means ? (and so it displays garbage)

--- quote ---

Indeed. Trace log:

--- snip ---
$ WINEDEBUG=+seh,+relay,+ntdll,+server wine ./reactos.exe >>log.txt 2>&1
...
0009:Call
ntdll.NtQueryInformationProcess(ffffffff,0000001b,0034f91c,00000210,00000000)
ret=00409074
0009: get_dll_info( handle=ffffffff, base_address=00000000 )
0009: get_dll_info() = 0 { entry_point=00000000, filename_len=86,
filename=L"Z:\\home\\focht\\Downloads\\reactos\\reactos.exe" }
0009:Ret  ntdll.NtQueryInformationProcess() retval=00000000 ret=00409074
0009:Call msvcrt.wcsrchr(0034f924
L"Z:\\home\\focht\\Downloads\\reactos\\reactos.exe",0000005c) ret=004090a7
0009:Ret  msvcrt.wcsrchr() retval=0034f962 ret=004090a7
0009:Call msvcrt.wcslen(0034f924 L"Z:\\home\\focht\\Downloads\\reactos")
ret=004090c7
0009:Ret  msvcrt.wcslen() retval=0000001f ret=004090c7
0009:Call ntdll.NtOpenSymbolicLinkObject(0034fd50,00000001,0034fd34)
ret=0040910b
0009:trace:ntdll:NtOpenSymbolicLinkObject
(0x34fd50,0x00000001,{name=L"\\SystemRoot", attr=0x00000040, hRoot=(nil),
sd=(nil)}
)
0009: open_symlink( access=00000001, attributes=00000040, rootdir=0000,
name=L"\\SystemRoot" )
0009: open_symlink() = OBJECT_NAME_NOT_FOUND { handle=0000 }
0009:Ret  ntdll.NtOpenSymbolicLinkObject() retval=c0000034 ret=0040910b
0009:trace:ntdll:pf_vsnprintf format is L"(%s:%d) NtOpenSymbolicLinkObject(%wZ)
failed with Status 0x%08lx\n"
DbgPrint says: (base\setup\lib\setuplib.c:454) NtOpenSymbolicLinkObject(Z)
failed with Status 0x0034fd54
0009:Call ntdll.RtlCreateUnicodeString(00444edc,0034f924
L"Z:\\home\\focht\\Downloads\\reactos") ret=004091db
0009:Ret  ntdll.RtlCreateUnicodeString() retval=00000001 ret=004091db
0009:Call msvcrt.wcsrchr(0034f924
L"Z:\\home\\focht\\Downloads\\reactos",0000005c) ret=004091e9
0009:Ret  msvcrt.wcsrchr() retval=0034f952 ret=004091e9
0009:Call ntdll.RtlCreateUnicodeString(00444ed4,0034f952 L"\\reactos")
ret=00409203
0009:Ret  ntdll.RtlCreateUnicodeString() retval=00000001 ret=00409203
0009:Call ntdll.RtlCreateUnicodeString(00444ecc,0034f924
L"Z:\\home\\focht\\Downloads") ret=0040922d
0009:Ret  ntdll.RtlCreateUnicodeString() retval=00000001 ret=0040922d
0009:trace:ntdll:pf_vsnprintf format is L"(%s:%d) SourcePath: '%wZ'\n"
DbgPrint says: (base\setup\reactos\reactos.c:986) SourcePath: 'Z'
0009:trace:ntdll:pf_vsnprintf format is L"(%s:%d) SourceRootPath: '%wZ'\n"
DbgPrint says: (base\setup\reactos\reactos.c:987) SourceRootPath: 'Z'
0009:trace:ntdll:pf_vsnprintf format is L"(%s:%d) SourceRootDir: '%wZ'\n"
DbgPrint says: (base\setup\reactos\reactos.c:988) SourceRootDir: 'Z' 
...
--- snip ---

Wine source:

https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntdll/printf.c#l418

Microsoft docs:

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-dbgprint

https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=vs-2019


$ sha1sum reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.*
bcb4c544c61ddf899ccd0266cdc8f40cc8dfa96d 
reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.7z
bc0293827c84f6402cbcb39c1628f38ff16ef651 
reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.iso

$ du -sh reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.*
55M    reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.7z
73M    reactos-bootcd-0.4.11-dev-603-g4bf9f6f-x86-msvc-win-dbg.iso

$ wine --version
wine-4.8-296-g6a610a3258

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