[Bug 59643] New: SHCreateStreamOnFileW (IStream::Seek) truncates 64-bit offsets to 32-bit, breaking >4GB file reads
http://bugs.winehq.org/show_bug.cgi?id=59643 Bug ID: 59643 Summary: SHCreateStreamOnFileW (IStream::Seek) truncates 64-bit offsets to 32-bit, breaking >4GB file reads Product: Wine Version: 10.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: shlwapi Assignee: wine-bugs@list.winehq.org Reporter: thistastesugly@gmail.com Distribution: --- Created attachment 80733 --> http://bugs.winehq.org/attachment.cgi?id=80733 minimal C++ Proof of Concept When using SHCreateStreamOnFileW to obtain an IStream for a file larger than 4GB, the IStream::Seek method incorrectly truncates 64-bit offsets (LARGE_INTEGER) to 32-bit values. This breaks applications that rely on shlwapi streams to parse large files. Steps to Reproduce: Create a dummy file larger than 4GB (e.g., 5GB). Use SHCreateStreamOnFileW to open it. Call IStream::Stat (This correctly reports the 64-bit size). Call IStream::Seek to an offset past 4GB (e.g., 4294968320 / 0x100000400). Observe the new position returned by Seek. Expected Results (Windows Native): Plaintext [*] Attempting to open: dummy_5gb.bin [+] SHCreateStreamOnFileW succeeded. [+] IStream::Stat size: 5331951616 bytes [*] Seeking to offset: 4294968320 [+] Seek succeeded. New position reported: 4294968320 Actual Results (Wine): Plaintext [*] Attempting to open: dummy_5gb.bin [+] SHCreateStreamOnFileW succeeded. [+] IStream::Stat size: 5331951616 bytes [*] Seeking to offset: 4294968320 [+] Seek succeeded. New position reported: 1024 Note that 4294968320 (0x100000400) truncated to 32 bits is exactly 1024 (0x400). compiled on "x64 Native Tools Command Prompt for VS 2022" using "cl.exe /MD stream_test.cpp" -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59643 thistastesugly@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59643 Nikolay Sivov <bunglehead@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Nikolay Sivov <bunglehead@gmail.com> --- Thanks, sent a fix for this https://gitlab.winehq.org/wine/wine/-/merge_requests/10642. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59643 Nikolay Sivov <bunglehead@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59643 Gijs Vermeulen <gijsvrm@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |4b63023561c82b82c8a4b58ea6f | |0e379032a78a1 Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Gijs Vermeulen <gijsvrm@gmail.com> --- (In reply to Nikolay Sivov from comment #1) MR was merged as <https://gitlab.winehq.org/wine/wine/-/commit/4b63023561c82b82c8a4b58ea6f0e37...>, marking FIXED. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59643 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #3 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.7. -- 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.
participants (1)
-
WineHQ Bugzilla