Akihiro Sagawa sagawa.aki@gmail.com writes:
This fix bug 19566 and 32013.
dlls/winmm/mmio.c | 31 +++++++++++++------------------ dlls/winmm/tests/mmio.c | 16 ++++++++-------- 2 files changed, 21 insertions(+), 26 deletions(-)
It doesn't work on 64-bit:
../../../../wine/tools/runtest -q -P wine -M avifil32.dll -T ../../.. -p avifil32_test.exe.so ../../../../wine/dlls/avifil32/tests/api.c && touch api.ok wine: Unhandled page fault on read access to 0x00040000 at address 0x2b088aa9b1cb (thread 0022), starting debugger... Unhandled exception: page fault on read access to 0x00040000 in 64-bit code (0x00002b088aa9b1cb). Register dump: rip:00002b088aa9b1cb rsp:000000000022ef58 rbp:0000000000000000 eflags:00010216 ( R- -- I -A-P- ) rax:0000000000340270 rbx:000000000003c100 rcx:0000000000000d04 rdx:0000000045455246 rsi:0000000000040000 rdi:0000000000341a50 r8:0000000045455246 r9:0000000000000000 r10:0000000000340030 r11:0000000000008000 r12:0000000045455246 r13:00000000457954b6 r14:0000000045455246 r15:000000000003bfe0 Stack dump: 0x000000000022ef58: 00002b088c7d1cfb 0000000000000000 0x000000000022ef68: 0000000000000001 0000000000000005 0x000000000022ef78: 00002b088c7d19bd 5b5b5b5b5b5b5b5b 0x000000000022ef88: 5b5b5b5b5b5b5b5b 2020202020202020 0x000000000022ef98: 2020202020202020 0000000000202020 0x000000000022efa8: 0000000000000000 ffffffffffffffff 0x000000000022efb8: ffffffffffffffff 0000000000202020 0x000000000022efc8: 0000000020000000 000000ffffffffff 0x000000000022efd8: ff000000ffffff00 0000000000000000 0x000000000022efe8: 0000000000000000 0000000000000000 0x000000000022eff8: 0000000000000000 0000000000000000 0x000000000022f008: 0000000000000000 0000000000000000 Backtrace: =>0 0x00002b088aa9b1cb in libc.so.6 (+0x881cb) (0x0000000000000000) 1 0x00002b088c7d1cfb mmioRead+0x11a(hmmio=0x1, pch="", cch=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/winmm/../../../wine/dlls/winmm/mmio.c:779] in winmm (0x0000000000000000) 2 0x00002b088c35d774 ReadChunkIntoExtra+0xf3(extra=<is not available>, hmmio=0x1, lpck=0x22f1f0) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/../../../wine/dlls/avifil32/extrachunk.c:134] in avifil32 (0x0000000000000000) 3 0x00002b088c35d8ce FindChunkAndKeepExtras+0xcd(extra=0x3bfe0, hmmio=0x1, lpck=0x22f1f0, lpckParent=0x22f190, flags=0x10) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/../../../wine/dlls/avifil32/extrachunk.c:197] in avifil32 (0x0000000000000001) 4 0x00002b088c356037 IPersistFile_fnLoad+0xee6(iface=<is not available>, pszFileName=<is not available>, dwMode=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/../../../wine/dlls/avifil32/avifile.c:1871] in avifil32 (0x000000000003bfe0) 5 0x00002b088c34a597 AVIFileOpenW+0x156(ppfile=0x22f6c8, szFile="C:\users\julliard\Temp\wine_avifil32_test.avi", uMode=0x20, lpHandler=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/../../include/objidl.h:5274] in avifil32 (0x000000000022f6c8) 6 0x00002b088c34a942 AVIFileOpenA+0x131(ppfile=0x22f6c8, szFile="C:\users\julliard\Temp\wine_avifil32_test.avi", uMode=0x20, lpHandler=(nil)) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/../../../wine/dlls/avifil32/api.c:218] in avifil32 (0x0000000000000000) 7 0x00002b088c12ea01 test_default_data+0xd0() [/home/julliard/wine/build/obj-elf64/dlls/avifil32/tests/../../../../wine/dlls/avifil32/tests/api.c:374] in avifil32_test (0x0000000000000000) 8 0x00002b088c12fd2e func_api+0x29d() [/home/julliard/wine/build/obj-elf64/dlls/avifil32/tests/../../../../wine/dlls/avifil32/tests/api.c:552] in avifil32_test (0x0000000000000000) 9 0x00002b088c130055 run_test+0x114(name=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/tests/../../../../wine/include/wine/test.h:557] in avifil32_test (0x00002b088c3320e0) 10 0x00002b088c12d101 main+0x110(argc=<is not available>, argv=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/avifil32/tests/../../../../wine/include/wine/test.h:627] in avifil32_test (0x00002b088ad94d90) 11 0x00002b088c130ae2 __wine_spec_exe_entry+0xa1(peb=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/winecrt0/../../../wine/dlls/winecrt0/exe_entry.c:36] in avifil32_test (0x00002b088a7c78f0) 12 0x000000007b874171 start_process+0xb0(peb=0x7fffffbef000) [/home/julliard/wine/build/obj-elf64/dlls/kernel32/../../../wine/dlls/kernel32/process.c:1052] in kernel32 (0x00002b088c130a40) 13 0x00002b088b02d9ae call_thread_func+0x6d(entry=0x7b8740c0, arg=0x7fffffbef000, frame=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/ntdll/../../../wine/dlls/ntdll/signal_x86_64.c:3230] in ntdll (0x00007fff7d40bed0) 14 0x00002b088b02709a call_thread_entry_point+0x29() in ntdll (0x00007fff7d40bed0) 15 0x00002b088aff8a66 start_process+0x15(kernel_start=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:2653] in ntdll (0x00007fff7d40bed0) 16 0x00002b088a4a1283 wine_call_on_stack+0x12() in libwine.so.1 (0x00007fff7d40bed0) 17 0x00002b088a4a12d9 wine_switch_to_stack+0x8(func=<is not available>, arg=<is not available>, stack=<is not available>) [/home/julliard/wine/build/obj-elf64/libs/wine/../../../wine/libs/wine/port.c:59] in libwine.so.1 (0x00007fffffbef000) 18 0x00002b088affe510 LdrInitializeThunk+0x45f(kernel_start=0x7b8740c0, unknown2=<is not available>, unknown3=<is not available>, unknown4=<is not available>) [/home/julliard/wine/build/obj-elf64/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:2709] in ntdll (0x00007fffffbef000) 19 0x000000007b87a5fd __wine_kernel_init+0x90c() [/home/julliard/wine/build/obj-elf64/dlls/kernel32/../../../wine/dlls/kernel32/process.c:1255] in kernel32 (0x00002b088b28f980) 20 0x00002b088affed84 __wine_process_init+0x143() [/home/julliard/wine/build/obj-elf64/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:2918] in ntdll (0x00007fff7d40d180) 21 0x00002b088a49f488 wine_init+0x297(argc=0x3, argv=0x7fff7d40d678, error="", error_size=0x400) [/home/julliard/wine/build/obj-elf64/libs/wine/../../../wine/libs/wine/loader.c:831] in libwine.so.1 (0x00007fff7d40d180) 22 0x000000007bf00da2 main+0x71(argc=0x3, argv=0x7fff7d40d678) [/home/julliard/wine/build/obj-elf64/loader/../../wine/loader/main.c:237] in <wine-loader> (0x00007fff7d40d678) 23 0x00002b088aa31ead __libc_start_main+0xfc(main=<is not available>, argc=<is not available>, ubp_av=<is not available>, init=<is not available>, fini=<is not available>, rtld_fini=<is not available>, stack_end=0x7fff7d40d668) [/home/aurel32/eglibc-sid/eglibc-2.13/csu/libc-start.c:228] in libc.so.6 (0x0000000000000000) 24 0x000000007bf00e9d _start+0x28() in <wine-loader> (0x0000000000000000) 0x00002b088aa9b1cb: repe movsq (%rsi),%es:(%rdi)