diff -Nru wine-staging-1.7.45~ubuntu14.10.1/ANNOUNCE wine-staging-1.7.46~ubuntu14.10.1/ANNOUNCE --- wine-staging-1.7.45~ubuntu14.10.1/ANNOUNCE 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/ANNOUNCE 2015-06-28 16:51:28.000000000 +0000 @@ -1,16 +1,17 @@ -The Wine development release 1.7.45 is now available. +The Wine development release 1.7.46 is now available. What's new in this release (see below for details): - - Better debugging support on 64-bit Mac OS X. - - Some more progress on DirectWrite implementation. - - A number of RichEdit control fixes. - - Beginning implementation of the old MSVCIRT C++ runtime. + - Improvements in the BITS file transfer service. + - Still more progress on DirectWrite implementation. + - Support for shared user data on 64-bit. + - Various C++ runtime improvements. + - Some more support for the 64-bit ARM platform. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.45.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.45.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.7.46.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.46.tar.bz2 Binary packages for various distributions will be available from: @@ -26,378 +27,421 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.45 (total 49): +Bugs fixed in 1.7.46 (total 67): - 2805 Utopia angel does not start (clipboard error) - 4463 dogwaffle exits during initalization with a visual basic error - 7425 Gothic 2 crashes without native directmusic - 9473 Adobe Reader 6 / Adobe Acrobat Pro 6: Zoomfactor and Pagenumber are empty (riched20.dll) - 11176 Adobe Reader 6 / Adobe Acrobat Pro 6: Searching not possible (riched20.dll) - 11849 Adobe Acrobat Pro 6 & 7 / Adobe Reader 6 & 7 -- Updates fail - 12451 Adobe Acrobat / Reader opens the wrong URL - 14896 GTA: San Andreas - Ambient Sounds are too quiet (EAX) - 18019 Some Bioware games' setup crashes when changing install directory - 19156 Street Fighter 4 Benchmark: Poor framerate - 19813 Voddler client hangs on startup (kernel32.GetSystemTimes is a stub) - 20830 Dameware NTutilities crashes trying yo create AD object - 21042 Outlook Express crashes before sending a message - 21579 Multiple applications crash with builtin RichEdit (text host window/gui control methods must not be called during CreateTextServices)(Yahoo Messenger 10, BSSB-Win, ICQ 6,7,8) - 21708 d3d is trying to use GL_DEPTH_TEXTURE_MODE_ARB when driver doesn't support ARB_depth_texture - 23174 Fallout 3: Diologue and Video/sound issues - 23997 Gridrunner Revolution: doesn't render certain objects in-game - 24033 StarCraft2 bad physics issue on non-flat landscape parts that is unrelated to the physics - 24299 Starcraft 2: Custom maps with dialog labels using style "ABChoiceBackButtonText" crashes game - 26808 Multiple games need XAudio2 '{5a508685-a254-4fba-9b82-9a24b00306af}' XAudio2_7.dll (Blue Toad Murder Files, Crazy Machines, Zafehouse Diaries) - 28768 Multiple GFWL (Games For Windows Live) 1.x games crash on startup (Kane & Lynch: Dead Men) - 29349 Summoner launch screen: corrupted graphics - 31896 Portable Calibre does not add book to library - 32060 Guild Wars: Input gets stuck - 32966 mshtml: crash in get_frame_by_name( "jQuery" ) using jQuery 1.3.2 - 33592 Family Tree Builder crashes partway through import of components - 34684 RaidCall 7.2.x crashes when joining a group - 34808 wine iexplore.exe http://peacekeeper.futuremark.com crashes - 34982 Multiple web-installers crash in 'get_frame_by_name' with NULL 'HTMLOuterWindow' (Horizon XBOX tool, MAGIX Video Deluxe MX Plus 18) - 35029 Ancient Gems (myrealgames.com) crashes on startup - 35191 make install shouldn't call update-desktop-database - 36135 valgrind shows some errors in ole32/tests/ole2.c - 36704 wine cmd uses overwrite mode instead of insert mode - 37713 winecfg: Window title isn't updated when removing application from the list - 38384 64-bit InstallShield engine COM server 'ISBEW64.exe' crashes during installation of AT&T Connect iMeeting - 38443 valgrind shows some invalid writes in dpnet/tests/address.c - 38462 valgrind shows an uninitialized variable in dlls/mshtml/tests/activex.c test_exec_script() - 38576 PES2015 won't connect to online services/2 (ConvertInterfaceLuidToGuid is missing) - 38593 valgrind shows uninitialized memory in set_mwm_hints() - 38595 FXCM Trading Station II doesn't install without winetricks vcrun2005 - 38654 Multiple games have rendering issues when anti-aliasing enabled (King's Bounty series, GTA: San Andreas, Tomb Raider: Anniversary) - 38658 PerfectWorld's Arc game client: window contents missing after log-in (needs better support for NtQueryInformationJobObject) - 38664 PJConv crashes after dropping an image file. - 38683 Waldorf Spectre application crashes on start - 38694 Waldorf Spectre crashes when clicking on buttons in the user interface - 38710 Simon the sorcerer 5 hangs when changing settings - 38717 MX Simulator demo doesn't display menu correctly - 38725 valgrind shows an invalid write in ole32/tests/usrmarshal.c - 38733 appcertui helper tool from Windows SDK 8.1 App Certification Kit crashes on unimplemented function api-ms-win-core-processthreads-l1-1-1.dll.OpenProcessToken + 6316 MYOB V13 prints a blank page + 15564 BlogJet: typing text and account signup don't work + 16196 Back and Forward buttons in Google Sketchup's 3D Warehouse do nothing + 16885 Yahoo Messenger 8/9 menu invisible, 'X' box hotspot in wrong place + 19648 Lotus Organizer 97 - No text on tabs + 19695 Gox Box window loses focus when list box is expanded + 20927 MYOB version 6 crashes when printing + 22085 Roller Coaster Tycoon can't change the screen resolution + 23148 Lotus Freelance Graphics 2.1 reports a C runtime error and exits + 24823 Miranda IM crashes with a modern contact list plugin + 26656 Cherry-SMS desktop app crashes / shows no country code + 26791 backtraces broken on gcc 4.7 + 28148 Neuro Hunter: certain effects are invisible + 28189 regsvr32: No usage in wineconsole + 29929 Demo installer stuck at program folder selection + 30805 Graphical glitch in the menu of Medieval total war + 30873 BMFont crashes on visualise option or save bitmap font as + 31228 "A simple IOCP Server/Client Class" locks up in GetMessage + 31694 A ton of 'error loading char 255 - bad news!' errors when compiling wine with newer Freetype + 31757 Adobe Application Manager 6.x/7.x download fails with error code A12E5 (winhttp request headers missing byte range) + 32127 Oblivion Launcher crash on start + 32214 Shaiya Online (MMORPG, Aeria Games) crashes on startup + 32550 Points2Grid crashes on calculation + 33831 AliWangwang hangs before login + 33849 Multiple 64-bit kernel drivers crash on access to KI_USER_SHARED_DATA range (0xfffff78000000000) (Tages DRM, Comodo Backup) + 34112 Skilors Grooveshark Downloader installer crashes + 34357 TaxAct 2012 and 2013 crash on startup + 34406 Finale Notepad 2012 doesn't copy/create user files on program start + 34843 Garmin BaseCamp 4.1.2 fails due to unimplemented gdiplus.GdipCreateRegionRgnData + 35537 Easy Bridge version 4.0.2 installer crashes + 35540 Netgear Powerline 3.1: desktop shortcut blank + 35775 Multiple Realarcade installers crash on startup due to IFile::PutAttributes method stub + 35949 Starcraft Campaign Editor does not highlight links in triggers on hover + 36192 valgrind shows a definite leak in mmdevapi/tests/capture.c + 36235 valgrind shows 3 leaks in amstream/tests/amstream.c + 36318 valgrind shows a leak in quartz/tests/filtermapper.c + 36321 valgrind shows a possible leak in quartz/tests/referenceclock.c + 36324 valgrind shows a leak in rpcrt4/tests/ndr_marshall.c + 36555 valgrind shows a definite leak in amstream/tests/amstream.c + 36780 Tomb Raider III (steam) crashes + 36916 Command and Conquer Tiberium Wars Demo reports 'Please make sure you have DirectX 9.0 or higher installed.' + 36953 Galactic Civilizations II: stars not rendered + 37303 Change of paper size in print dialog do not update DEVMODE dmFormName member + 37307 Urban Assault black screen when using software renderer (incorrect device enumeration order) + 37403 Regedit: Wrong default registry key is selected + 37502 Naturosoft Pro fails on startup with 'Run-time error 445: Object doesn't support this action' (needs richedit:ITextRange_fnExpand method implementation) + 37767 IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests + 38114 Steam client doesn't allow to install games in different locations (needs kernel32.GetVolumePathName implementation) + 38364 AutoPatcher Updater 1.4.x needs IFileSystem3::GetSpecialFolder() + 38411 3DMark05 v1.30 crashes during system info scan (needs support for 'Win32_Process' WMI class 'WorkingSetSize' property) + 38470 __chkstk not implemented on ARM + 38517 Winhttprequest doesn't keep user logged in + 38525 Winhttprequest follows redirects to wrong url + 38624 jre-8u45-windows-i586.exe installer exits silently (needs advapi32.dll GetWindowsAccountDomainSid stub) + 38638 Bad text encoding output in regsvr32 console output + 38645 QQ 6.x crashes after open the qqzone tab (webkit crash) + 38691 Dia Portable 0.97 crashes on startup in libcairo-2 + 38695 valgrind shows uninitialized memory in dlls/gdi32/freetype.c:WineEngInit() (win64) + 38713 Link failure due to use of libunwind in ntdll + 38719 64-bit ARM Windows applications from Windows SDK for Windows 10 crash when accessing TEB/PEB members (AArch64 platform specific register X18 must be reserved for TEB) + 38739 valgrind shows a possible leak in ole32/tests/usrmarshal.c + 38747 msvcrt.dll does not implement _getwch, _getwche, and _ungetwch + 38752 Foobar2000 UPnP/DLNA media server hangs on exit + 38758 SlingPlayer 1.x installers fail + 38764 Improper device request/IRP handling causes heap corruption in wineserver + 38769 Additional AES algorithms in schannel break wine build + 38783 64bit msys32 crashes on unimplemented RtlCopyMemory ---------------------------------------------------------------- -Changes since 1.7.44: +Changes since 1.7.45: -Akihiro Sagawa (4): - shell32/tests: Make tests run on win2k again. - shell32/tests: Add tests for DragQueryFile. - shell32: Skip buffer allocation when querying drop file numbers. - mciqtz32: Watch the player thread while waiting a player task. - -Alexandre Julliard (14): - user32: Get rid of the unused parameter in the EmptyClipboard driver entry point. - user32: Merge the AcquireClipboard and EmptyClipboard driver entry points. - user32/tests: Remove support for Win9x in clipboard test. - server: Use a standard timestamp for the clipboard. - server: Use separate helper functions for setting and resetting clipboard windows. - server: Store the clipboard windows as full handles. - server: Allow opening the clipboard again with the same owner. - server: Check for the current owner window on the server side for releases. - user32/tests: Add tests for clipboard sequence number and notifications. - user32: Disallow format 0 in SetClipboardData. - user32/tests: Add tests for calling EmptyClipboard from a different thread. - server: Add a request to empty the clipboard. - kernel32: Avoid resolving imports against the advapi32 forwards. - user32/tests: Add tests for SetClipboardData from a different thread. - -Alistair Leslie-Hughes (3): - oledb32: Fix memory leak. - odbccp32: Add a trace message to functions. - dpnet: Implement IDirectPlay8Address GetComponentByIndex. - -Austin English (1): - api-ms-win-core-processthreads-l1-1-1: Add advapi32 forwards. - -Bruno Jesus (1): - dmstyle: Don't fake success on IDirectMusicUtils_IPersistStream_ParseReference. - -Charles Davis (1): - server: Get debug registers on 64-bit Mac OS. - -Damjan Jovanovic (7): - qcap: Implement the SmartTee allocator functions. - qcap: Get the SmartTee filter to a minimally functional level. - qcap: Add the SmartTee filter automatically as necessary, and test this. - qcap: Load the default renderer when it's not specified. - qcap: If we have a single VfwCapture pin, its category should be PIN_CATEGORY_CAPTURE. - qcap: Add initial audio capture filter. - qcap: The VfwCapture filter's GetNumberOfCapabilities() should set the capability count to zero. - -Daniel Lehman (5): - msvcrt: Add __swprintf_l. - msvcp110: Add _Yarn implementaton. - msvcrt: Add _W_Getdays. - msvcrt: Add _W_GetMonths. - msvcp110: Add wide-char days and months to _LocInfo. +Akihiro Sagawa (1): + winetest: Add SystemPreferredUILanguages to the log. -Dmitry Timoshkov (1): - mshtml: Handle VT_INT/VT_UI4 same way as VT_I4/VT_UINT in IHTMLElementCollection::item. +Alex Henrie (2): + riched20: Fix link notification conditions and add tests. + user32: Send BM_SETCHECK before WM_CAPTURECHANGED and add tests. + +Alexandre Julliard (1): + d3dcompiler_43: Add a helper function for register token to avoid compiler warnings. + +Alistair Leslie-Hughes (8): + scrrun: Implement ITextStream Close. + d3dcompiler_46: Add stub dll. + d3dcompiler_47: Add stub dll. + dpnet: Correct adding components in Duplicate. + d3dcompiler: Share the source with d3dcompiler_46. + d3dcompiler: Rename d3dcompiler_43_main.c to main.c. + d3dcompiler: Share the source with d3dcompiler_47. + dpnet: Don't return partially initialized object. + +Andrew Eikum (4): + xaudio2_7: Move object creation to avoid forward declaration. + xaudio2_7: Simplify object creation. + xaudio2_7: Wrap long lines. + include: Upgrade interface definitions to XAudio2 2.8. + +André Hentschel (7): + include: Rename 64-bit PState to 32-bit Cpsr on ARM64. + ntdll: Implement RtlCaptureContext on ARM64. + ntdll: Fix CONTEXT_ARM in RtlCaptureContext. + winebuild: Create stubs for ARM64. + ntdll: Set platform register x18 to TEB on ARM64. + ntdll: Set TPIDRURW inline on ARM. + include: Add IMAGE_LOAD_CONFIG_DIRECTORY64 definition. + +Aric Stewart (4): + include: Add ddk/hidclass.h. + include: Add ddk/hidpi.h. + hid: Break HidD functions out into their own module. + hid: Translate HidD_ functions to their IOCTLs. + +Bernhard Übelacker (2): + comctl32/tests: Free memory used by property sheet page (Valgrind). + advapi32: Fix RegEnumValueW when enumerating long values. + +Bruno Jesus (6): + dmband: Don't fake success on IDirectMusicUtils_IPersistStream_ParseReference. + dmime: Don't fake success on IDirectMusicUtils_IPersistStream_ParseReference. + ws2_32/tests: Add UDP select() test for unbound socket. + ws2_32: Trace accepted socket. + ws2_32: Add a helper to get socket type. + ws2_32: UDP sockets can write data even when unbound. + +Daniel Lehman (1): + msvcp90: Set _Locimp vtable in _Locimp ctors (Valgrind). -Erich Hoover (1): - kernel32: Implement GetSystemTimes. +Dmitry Timoshkov (1): + gdiplus: Implement GdipCreateRegionRgnData. -Guillaume Charifi (2): - xaudio2_7: Implement IXaudio2 interface as stub. - xaudio2_7: Add XAudio2 class registration. - -Hans Leidekker (5): - include: Add missing BITS interfaces. - qmgr: Update to IBackgroundCopyFile2. - qmgr: Update to IBackgroundCopyJob3. - qmgr: Add IHttpNegotiate support to the bind status callback. - qmgr: Implement IBackgroundCopyError. +Erich Hoover (7): + ntdll: Fix IOCTL_DVD_READ_STRUCTURE expected output size. + kernel32: Implement GetVolumePathName. + kernel32/tests: Convert GetVolumePathName tests into a list. + kernel32/tests: Add a bunch more GetVolumePathName tests. + kernel32: Handle semi-DOS paths in GetVolumePathName. + kernel32: Handle bogus DOS paths in GetVolumePathName. + kernel32: Handle device paths in GetVolumePathName. + +Gerald Pfeifer (2): + winedbg: Avoid "uninitialized variable" compiler warning in types_extract_as_longlong. + oleaut32: Fix indentation in test_safearray. + +Hans Leidekker (24): + qmgr: Use winhttp for HTTP transfers instead of wininet. + qmgr: Add a stub implementation of IBackgroundCopyJobHttpOptions. + qmgr: Implement IBackgroundCopyJobHttpOptions::SetSecurityFlags and IBackgroundCopyJobHttpOptions::GetSecurityFlags. + qmgr: Implement IBackgroundCopyJobHttpOptions::SetCustomHeaders and IBackgroundCopyJobHttpOptions::GetCustomHeaders. + qmgr: Implement IBackgroundCopyJob::SetCredentials and IBackgroundCopyJob::RemoveCredentials. + qmgr: Implement IBackgroundCopyJob::Cancel. + qmgr: Don't inline transitionJobState. + qmgr/tests: Add tests. + winhttp: Store credentials set with WinHttpSetCredentials separately from username and password set through options. + winhttp: Improve parsing of cookie values. + winhttp: Correctly handle relative redirect paths. + winhttp: Keep the session open in the request object. + advapi32/tests: Add tests to show that reading the SACL requires a special privilege. + winhttp/tests: Fix a test failure on win2k. + winhttp: Fix handling of the headers length parameter in WinHttpAddRequestHeaders and WinHttpSendRequest. + msi/tests: Fix test failures on win2k3. + msi: Open database cabinet streams through the streams implementation. + wbemprox: Fix some memory leaks (Coverity). + wbemprox: Implement Win32_OperatingSystem.Primary. + wbemprox: Implement Win32_Process.WorkingSetSize. + winhttp: Fix a couple of corner cases in header processing. + winhttp: Coalesce cookie headers. + winhttp: Perform a case sensitive match on cookie names. + winhttp: Store cookies in reverse order. + +Henri Verbeet (10): + wined3d: Use surface_get_rect() in wined3d_surface_update_overlay(). + wined3d: Implement SM4 discard in the GLSL shader backend. + d2d1: Fix the ID2D1Factory::CreatePathGeometry() declaration. + d2d1: Implement d2d_factory_CreatePathGeometry(). + d2d1: Implement d2d_path_geometry_Open(). + d2d1: Implement d2d_geometry_sink_AddLine(). + d2d1: Implement d2d_geometry_sink_AddQuadraticBezier(). + d2d1: Implement d2d_geometry_sink_AddBezier(). + d2d1: Implement d2d_text_renderer_DrawGlyphRun(). + d3d10core: Translate d3d10 usage to wined3d usage for buffers. + +Hugh McMaster (7): + regsvr32: Move /i command line code to a separate function. + regsvr32: Convert if-else block to switch statement. + net: WriteFile should output the number of bytes in the char array, not the length of the WCHAR array. + regsvr32: Convert codebase to Unicode. + regsvr32: Add WriteFile fallback if WriteConsole fails. + regsvr32: Make Dll* exports WINAPI. + regsvr32: Clean up and update comments to reflect changes to the codebase. Huw D. M. Davies (7): - riched20: Append a final \par when writing the whole buffer. - mmdevapi/tests: Link against advapi32. - shlwapi/tests: Fix failing tests on Vista and Win 2008. - wshom/tests: Use RegQueryValueEx so that the tests run on Win 2k and XP. - shell32/tests: Fix failing test on Win 2k. - wininet/tests: Fix tests on Win 2k. - user32/tests: Use the correct codepage for WM_CHAR tests. - -Indrek Altpere (2): - mshtml: Add NULL check to avoid crashing due to Gecko bug. - mshtml: Add NULL check to get_frame_by_name. - -Iván Matellanes (12): - msvcirt: Add initial implementation of streambuf. - msvcirt/tests: Add initial tests for streambuf. - msvcirt: Add implementation of streambuf::allocate. - msvcirt: Add implementation of streambuf buffer getters. - msvcirt: Add implementation of streambuf::unbuffered. - msvcirt: Add implementation of streambuf locking. - msvcirt: Add implementation of streambuf::gbump/pbump. - msvcirt: Add implementation of streambuf::sync. - msvcirt: Add implementation of streambuf::seekoff/seekpos. - msvcirt: Add implementation of streambuf::in_avail/out_waiting. - msvcirt/tests: Add more streambuf tests. - msvcirt: Fix implementation of streambuf::sync. - -Jacek Caban (7): - jscript: Correctly handle pvarResult in ParseScriptText. - jscript: Added beginning support for 'automagic' event binding feature. - jscript: Added 'automagic' test. - mshtml: Fixed leak in HTMLCurrentStyle_Create. - kernel32: Treat empty locale name as LOCALE_INVARIANT. - setupapi: Allow more than one Wine manifest in a DLL. - gdiplus: Added version 1.1 manifest. - -Jerome Leclanche (1): - makefiles: Do not run update-desktop-database on make install/uninstall. - -Joachim Priesner (2): - comdlg32: File dialog: Append multi-part extensions like .abc.def. - ieframe: shellbrowser: Strip 'file://' from file URLs in BEFORENAVIGATE2 callbacks. - -Ken Thomases (8): - winemac: Remove extraneous CDECL attribute. - configure: Warn for a 64-bit build without CFI directive support. - configure: Add a check for libunwind.h. - ntdll: Add support for using libunwind to unwind the stack for x86_64. - ntdll: Add partial support for version 3 of DWARF CIEs which are generated by Clang/LLVM. - winecoreaudio: Fix build by importing advapi32. - Revert "ntdll: Avoid one of the calls to getattrlist() when read_directory_getattrlist() checks the case sensitivity of the file system.". - ntdll: Fix the "not found" status set by read_directory_stat() and read_directory_getattrlist() for when restart_scan is set. - -Louis Lenders (1): - kernel32/tests: Add tests for GetSystemTimes. - -Marcus Meissner (1): - msi: Free rec in error exit (Coverity). - -Mark Harmstone (1): - winecfg: Invalidate property sheet when font changed. - -Matteo Bruni (15): - wined3d: Always enable GL_PROGRAM_POINT_SIZE in the GLSL backend. - wined3d: Clamp per-vertex point size in vertex shaders. - wined3d: Handle point sprites with PS 3.0. - d3d9/tests: Add more tests for point size. - d3d8/tests: Port the point size test to D3D8. - wined3d: Introduce a get_fog_start_end() function. - wined3d: Don't use the builtin FFP uniforms for fog parameters. - d3d9/tests: Add a test for reordering texture coordinates via D3DTSS_TEXCOORDINDEX. - d3d8/tests: Add a test for reordering texture coordinates via D3DTSS_TEXCOORDINDEX. - ddraw/tests: Add a test for reordering texture coordinates via D3DTSS_TEXCOORDINDEX. - d3d9/tests: Test the default diffuse color for vertex shaders. - d3d9/tests: Test the default colors for fixed function vertex processing. - d3d8/tests: Port the vertex shader input test to D3D8. - d3d8/tests: Port part of the fixed function attributes test to D3D8. - wined3d: Avoid the builtin GLSL vertex attributes. - -Michael Müller (8): - amstream: Correctly check return values in IAMMultiMediaStreamImpl_Initialize (Coverity). - kernel32: Correctly check for an empty short filename in GetShortPathNameW (Coverity). - wbemprox: Treat \r as whitespace. - winebuild: Set a valid major and minor linker version. - kernel32: Improve stub for SetFileInformationByHandle. - kernel32: Forward SetFileInformationByHandle FileDispositionInfo class to ntdll. - d3d8: Mark one more function as hotpatchable. - ddraw: Make some functions hotpachable. - -Michael Stefaniuc (11): - dswave: Remove gratuitous IDirectMusicSegment8 from DirectSoundWave. - dswave/tests: Check for the private interface in DirectSoundWave. - dswave: COM cleanup for the IUnknown interface of DirectSoundWave. - dswave: Use the generic DirectMusicObject implementation for DSWave. - dswave: Get rid of the extra pointer to a DMUS_OBJECTDESC. - dswave: Finish the cleanup of create_dswave(). - dmstyle: Remove unused arguments from helper functions. - dmstyle: Pass the object instead of the iface to helper functions. - dmstyle: Use the generic DirectMusicObject implementation for DMStyle. - dmcompos: Use the generic DirectMusicObject implementation for DMChordMap. - dmcompos: Get rid of the extra pointer to a DMUS_OBJECTDESC. - -Nikolay Sivov (75): - oleaut32: Implemented a couple more proxy/stub methods. - ole32: Implemented some proxy/stubs methods. - mshtml/tests: Fix use-after-free in events tests. - dwrite: Forward GetGdiCompatibleGlyphPlacements() to corresponding font methods. - dwrite: Report inline objects in Draw(). - dwrite: Fix wrong run data reported to a renderer. - dwrite: Properly report drawing effect in DrawGlyphRun()/DrawInlineObject(). - dwrite: Handle inline object GetMetrics() failure. - dwrite: Handle GetBreakConditions() failure. - riched20: Implement GetText() for regular range. - riched20/tests: Small test for GetClientSite(). - riched20: Move data linking text range to IRichEditOle in separate structure. - riched20: Properly implement GetClientSite(). - riched20: Create selection instance first time it's requested. - mmdevapi: Return interface pointers instead of impl pointers. - ole32: Avoid potential null pointer access (Coverity). - ole32: Initialize returned value for disconnected case too in proxy_manager_get_remunknown() (Coverity). - dwrite: Fix potential null pointer dereference in GetInlineObject() (Coverity). - wined3d: Remove unnecessary test for 0 (Coverity). - urlmon: Remove unreachable code (Coverity). - riched20/tests: Don't use global vars for host/textservices. - riched20: Reduce code duplication in WM_SETTEXT/WM_CREATE handler. - riched20: Avoid extra host calls during CreateTextServices(). - riched20: Return 0x0 size for NULL objects. - comctl32/toolbar: Remove always true condition (Coverity). - d3d8: Fix token type checks in convert_to_wined3d_declaration (Coverity). - winex11: Remove unreachable XFreePixmap(), mask_pixmap is always NULL on failure (Coverity). - winebuild: Remove always false condition (Coverity). - mshtml: Handle allocation failure during collection creation (Coverity). - oleaut32: Improve error handling in GetRecordInfoFromTypeInfo() (Coverity). - oledb32: Handle CLSIDFromProgID() failure (Coverity). - dwrite: Fix potential null pointer access in GetFontCollection() (Coverity). - wineoss: Properly initialize pollfd structure (Coverity). - shell32/tests: Fix Verbs instance leak (Valgrind). - riched20/tests: Fix a BSTR leak (Valgrind). - ole32: Fix length of buffer allocated by SNB_UserUnmarshal() (Valgrind). - shell32/tests: Fix one of test failures on win2k. - shell32/tests: Fix tests failures on win2k. - ole32/tests: Test if user memory routines are called, remove some useless traces. - dwrite/tests: Test actual strings being reported to a renderer. - dwrite: Added a range data header to distinguish range kinds. - dwrite: Store strikethrough settings in a separate list. - dwrite: Report strikethrough ranges to renderer. - dwrite/tests: Some tests for setting per-range layout properties. - iphlpapi: Added ConvertInterfaceLuidToGuid() stub. - shlwapi: Fix error handling in IUnknown_GetClassID (Coverity). - shell32/tests: Fix error code on win2k. - browseui: Added IEnumString stub for ACListISF. - browseui: Use method wrappers when forwarding, rearrange functions to match vtable order. - kernel32: Fail properly for unsupported classes in GetFileInformationByHandleEx. - gdi32: Return GCP_USEKERNING if font has kerning pairs support. - crypt32: Fix tracing of out argument (Coverity). - msctf: Set fActive directly in ActivateLanguageProfile() (Coverity). - oleaut32: Remove dead switch case VT_I1 entry for VarSub (Coverity). - gameux: Use matching heap call (Coverity). - dwrite: Use [0,~0u) as initial text range. - dwrite: Validate per-range attribute values. - riched20: Implement GetStoryLength(). - riched20: Implement GetDuplicate() for selection. - riched20: Handle range method failures in IsEqual (Coverity). - riched20: Handle range method failures in InRange (Coverity). - riched20: Improve error handling in SetFont (Coverity). - wined3d: dst_surface can't be NULL at this point (Coverity). - usp10: Remove dead null check that can't fail (Coverity). - oledb32: Fix instance leak on error path (Valgrind). - oledb32/tests: Added a test for GetDataSource() with created provider and custom properties. - kernel32/tests: Some tests for invalid classes in SetFileInformationByHandle(). - gdiplus: Added GdipImageSetAbort stub. - dwrite/tests: A test for case-sensitivity of SetFontFamilyName. - dwrite: Use [0,~0u) as initial range for strikethrough settings. - dwrite: Exit earlier when setting property for zero length range. - dwrite: Fix problems with outline conversion and reporting. - gdiplus: Implement trivial case of GdipCreateRegionRgnData for empty and infinite regions. - oledb32: Support provider-specific properties in GetDataSource(). - oledb32/tests: Improve IDataSourceLocator tests a bit. - -Piotr Caban (20): - msvcrt: Use fd critical section in dup2. - msvcrt: Use fd critical section in msvcrt_free_fd. - msvcrt: Use fd critical section in read. - msvcrt: Use fd critical section in _futime64. - msvcrt: Get rid of msvcrt_fdtoh helper. - msvcrt: Use fd critical section in msvcrt_create_io_inherit_block. - msvcrt: Get rid of msvcrt_is_valid_fd helper. - msvcrt: Use fd critical section in _setmode. - msvcrt: Don't lock __badioinfo. - msvcrt: Use fd critical section in _write. - msvcrt: Fix strtol implementation on strings not containing valid number. - msvcp90: Fix off by one issue in basic_string::rfind. - msvcrt: Fix possible deadlock in dup2 function. - msvcrt: Don't use MSVCRT_fdend in msvcrt_create_io_inherit_block. - msvcrt: Avoid using global critical section while allocating new file descriptors. - msvcrt: Remove no longer needed global lock from functions using fd critical sections. - msvcr: Add _getch_nolock implementation. - msvcr: Add _putch_nolock implementation. - msvcr: Add _getche_nolock implementation. - msvcr: Add _ungetch_nolock implementation. - -Qian Hong (5): - ntdll: Implemenent ObjectTypeInformation class support in NtQueryObject. - ntdll/tests: Add a few more ObjectTypeInformation tests. - server: Fix type name of IoCompletion. - server: Fix type name of File. - server: Fix type name of directory file. - -Sebastian Lackner (9): - server: Fix opening clipboard from multiple threads. - ntdll/tests: Don't call lstrlenW on non-null-terminated buffer. - ws2_32/tests: Add tests for calling select with zero timeout. - ws2_32: Fix uninitialized memory access in do_poll (Coverity). - kernel32/tests: Add tests for virtual memory alignment behaviour. - ntdll: Fix status code when NtMapViewOfSection parameter check fails. - quartz: Fix handling of periodic advice timers. - winedbg: Also output system information to the terminal, not only to dialog. - ntdll/tests: Add tests for info struct size for FileDispositionInformation. - -Stefan Dösinger (12): - wined3d: Read format flags from the volume container. - wined3d: Read format flags from the surface container. - wined3d: Set the gl resource type in resource_init. - wined3d: Keep track of renderbuffer capabilities. - wined3d: Use renderbuffers if the resource type is RB. - wined3d: Set WINED3DFMT_FLAG_FBO_ATTACHABLE on depth stencil formats. - wined3d: Require FBO attachability for render targets and depth stencils. - wined3d: Don't use depth textures without ARB_depth_texture. - wined3d: Downgrade the framebuffer attachment FIXMEs to WARNs. - wined3d: Disable the depth stencil on multisample mismatch. - d3d9/tests: Test multisample mismatch. - d3d8: Reject FBs with mismatching multisample settings. + oleaut32/tests: Add broken behaviour on Win 2003. + user32/tests: Add some optional messages for Win XP. + user32/tests: Try to fix the test failures on Win 2k. + gdi32/tests: Fix Courier test on Arabic locales. + gdi32/tests: Japanese Win 7 uses MS Shell Dlg as its default GUI font. + Revert "advapi32: Fix RegEnumValueW when enumerating long values.". + shell32/tests: Don't leave behind open explorer windows. + +Iván Matellanes (9): + msvcirt: Add implementation of streambuf::sgetc. + msvcirt: Add implementation of streambuf::sputc. + msvcirt: Print error messages in unimplemented functions. + msvcirt: Add implementation of streambuf::xsgetn. + msvcirt: Add implementation of streambuf::xsputn. + msvcirt: Add implementation of streambuf::sgetn/sputn. + msvcirt: Add implementation of streambuf::snextc. + msvcirt: Add implementation of streambuf::sbumpc. + msvcirt: Add implementation of streambuf::stossc. + +Jacek Caban (18): + scrrun: Added IFile::put_Attributes imeplementation. + wininet: Get rid of no longer needed read_chunked field. + wininet: Don't pass BLOCKING_WAITALL to NETCON_recv in netconn_read. + secur32: Added support for a few more algorithms in schannel_get_cipher_algid. + secur32: Use gnutls_cipher_get_block_size to get cupher block size. + secur32: Fixed compilation on with gnutls. + secur32: Fixed compilation on very old gnutls versions. + mshtml: Use test.winehq.org over http in img_onload tests. + wininet: Get rid of unneeded MSG_WAITALL support in NETCON_recv. + wininet: Don't use blocking_mode_t in netconn.c. + mshtml: Added IHTMLXMLHttpRequest::onreadystatechange property implementation. + wininet: Call set_socket_blocking always and only when needed. + wininet: Cache blocking state in netconn_t. + urlmon/tests: Skip https tests on platforms that don't support them. + msscript.ocx: Added stub DLL. + msscript.ocx: Added typelib. + msscript.ocx: Added DLL registration implementation. + msscript.ocx: Added ScriptControl class factory. + +Jared Smudde (1): + winhlp32: Move Always on top to Options. + +Ken Thomases (12): + configure: Only check for libunwind.h on OS X. + dbghelp: Fix STABS support for 64-bit on OS X. + dbghelp: Eliminate an unnecessary parameter from macho_load_debug_info(). + dbghelp: Fix a leak of the Mach-O module structure by adding a module_remove callback. + dbghelp: Enable enumerating and loading 64-bit Mach-O modules. + dbghelp: Remove the unused arch_size field of struct macho_file_map. + dbghelp: Use existing IMAGE_NO_MAP constant instead of redundant MACHO_NO_MAP. + dbghelp: Move the macho_file_map structure into image_file_map. + dbghelp: For Mach-O, keep the module file mapped for as long as the module is tracked. + dbghelp: Implement the image_private.h functions for Mach-O modules. + dbghelp: Add partial support for version 3 of DWARF CIEs which are generated by Clang/LLVM. + dbghelp: Parse the DWARF information in Mach-O modules. + +Marcus Meissner (3): + shlwapi: Add missing braces (Coverity). + oledb32: Free memory on error exit (Coverity). + kernel32: GetCurrentDirectoryW gets characters, not bytes. + +Matteo Bruni (9): + wined3d: Handle per-vertex point size in the GLSL FFP replacement. + wined3d: Cleanup and simplify texture sampling code generation. + wined3d: Drop WINED3D_RS_TEXTUREPERSPECTIVE handling. + wined3d: Make use of the EXT_BLEND_SUBTRACT flag. + d3dcompiler: Handle redefining an intrinsic function as a user-defined function. + d3dcompiler: Handle writemask in make_assignment(). + d3dcompiler: Parse ": register()" syntax. + wined3d: Drop unused gl_info parameter from shader_glsl_ffp_vertex_lighting(). + wined3d: Don't flag WINED3D_SHADER_CONST_FFP_PROJ on transformed <-> untransformed vdecl change. + +Michael Müller (7): + wininet: Use random names when caching very long urls. + advapi32/tests: Add tests for GetWindowsAccountDomainSid. + advapi32: Add initial implementation for GetWindowsAccountDomainSid. + fltlib: Add stub for FilterLoad. + wininet/tests: Add tests for overriding host header. + rpcrt4: Fix arguments of HttpAddRequestHeaders. + wininet: Fix arguments of HttpAddRequestHeaders. + +Michael Stefaniuc (25): + dmband: Pass the object instead of the iface to helpers. + dmband: Use the generic DirectMusicObject implementation for DMBand. + dmband/tests: Add IPersistStream tests for DMBandTrack. + dmcompos/tests: Add IPersistStream tests for DM*Track. + dmime: Pass objects instead of ifaces to helpers. + dmime: Remove unused arguments from helper functions. + dmime: Use the generic DirectMusicObject implementation for DMSegment. + dmime: Use the generic DMObject implementation for DMAudioPathConfig. + dmime: Get rid of the extra pointer to a DMUS_OBJECTDESC. + dmime: Use the generic DMObject implementation for DMGraph. + dmime/tests: Add IPersistStream tests for DM*Track. + dmstyle/tests: Add IPersistStream tests for DM*Track. + dmband: IsParamSupported method doesn't crashes on NULL. + dmband: Implement the E_NOTIMPL methods of IDirectMusicTrack8. + dmband/tests: Add some basic IDirectMusicTrack8 tests. + dmcompos: IsParamSupported of DMChordMapTrack doesn't crashes on NULL. + dmcompos: Implement the E_NOTIMPL methods of IDirectMusicTrack8. + dmcompos/tests: Add some basic IDirectMusicTrack8 tests. + dmcompos: Move struct definitions to the files that need them. + dmime: Move struct definitions to the files that need them. + dmband: Pass objects instead of ifaces to helpers. + dmband: COM cleanup for IDirectMusicTrack8. + dmband: Remove the extraneous IUnknown from DMBandTrack. + dmband: Use the generic IPersistStream implementation from dmobject. + dmstyle: IsParamSupported method doesn't crashes on NULL. + +Mohamed Mediouni (1): + ntdll: Multiply r4 with the word size in ARM for __chkstk. + +Nikolay Sivov (50): + regedit: Make it possible for save/restore position on tree root. + msxml3: Handle SafeArrayAccessData() failure in load() (Coverity). + dwrite/tests: Test to show that GetCurrentTransform/GetPixelsPerDip are not really used from Draw(). + dwrite: Fix splitted range length, initial test for GetMetrics(). + dwrite: Check format directions in CreateEllipsisTrimmingSign(). + dwrite: Initial implementation of Draw() for trimming sign. + dwrite: Call GetCount() once when looking for family name. + dwrite: Fix the way drawing effects are reported for inline objects. + ole32: Marshal HDC as remotable handle. + ole32: Marshal HICON as remotable handle. + dwrite: Validate format property values. + ole32: Marshal HBRUSH as remotable handle. + oleaut32/tests: Test that user memory functions are not called. + riched20: Improve tracing for unimplemented range methods. + riched20: Implement Expand for tomStory case. + riched20/tests: Some more EM_SETSEL tests. + riched20/tests: Remove explicit todo flag values from static test data. + ole32: Fix a typo in argument name. + dwrite/tests: Initial test for GetLineMetrics(). + dwrite/tests: Initial test for GetBaseline(). + riched20: Improve tracing for unimplemented selection methods. + comctl32/monthcal: Fix title to use properly localized year/month format. + dwrite: Set cluster length together with other metrics. + dwrite: Actually set isWhitespace for space clusters. + dwrite: Count last cluster length too when building a line. + kernel32: Export RtlCopyMemory(). + ole32/tests: Fix source buffer leak (Valgrind). + amstream: Get rid of some casts by using proper iface types. + amstream/tests: Get rid of global stream pointer that we don't really need. + amstream: Release pins and streams array on instance release (Valgrind). + gdi32/freetype: Properly handle loading of FT_Long-sized types (Valgrind). + ieframe/tests: Fix some leaks (Valgrind). + oleaut32/tests: Fix stub buffer leak (Valgrind). + dwrite: Forward GetRecommendedRenderingMode() to newer method. + dwrite: Store character spacing layout settings. + quartz/tests: Get rid of some casts. + dwrite: Set line baseline/height from font metrics. + dwrite/tests: Show that line baseline is relative to this line. + dwrite: Set baseline origin Y for reported runs. + dwrite: Call SetFillMode() once per run. + amstream: Implement IDirectDrawStreamSample_GetSurface(). + amstream: Keep stream reference when creating sample. + amstream: Implement GetDirectDraw(). + amstream: Forward IUnknown methods to IAMMediaStream for streams. + qmgr: Simplify string duplication using a helper. + qmgr: Simplify GetProgress() with a structure copy. + amstream: Create a surface if it wasn't provided in CreateSample(). + dmsynth: Cleanup IDirectMusicSynth8 creation helper. + dwrite: Properly reduce glyph count of effective run. + dwrite: Fix clustermap shifting for effective run. + +Olivier F. R. Dierick (1): + kernel32: Implement SetFileCompletionNotificationModes as a stub. + +Piotr Caban (15): + msvcrt: Open console input handle with write permission so SetConsoleMode can work on it. + msvcp60: Sync spec files. + msvcrt: Write directly to the console in _putwch. + msvcrt: Fix return value of _cputs. + msvcrt: Fix return value of cputws. + msvcrt: Add _getwch implementation. + msvcrt: Add _getwche implementation. + msvcrt: Add _ungetwch implementation. + msvcr120: Add ___lc_locale_name_func implementation. + msvcp110: Use ___lc_locale_name_func in _Getctype. + msvcp110: Use ___lc_locale_name_func in _Getdateorder. + msvcp110: Fix _Collvec structure layout. + wininet: Improve handling of long URLs in CreateUrlCacheEntry function. + msvcr110: Add __crtGetLocaleInfoEx implementation. + msvcrt: Cache locale string to LCID conversion results. + +Qian Hong (2): + include: Remove duplicate macro definition in shellapi.h. + winemenubuilder: Fix copy and paste error. + +Sebastian Lackner (14): + server: Delay destruction of file object in set_irp_result. + ntoskrnl: Add initial code to emulate memory access to USER_SHARED_DATA on x86_64. + ntoskrnl: Add emulation for 'mov Ob, AL' and 'mov Ovqp, rAX' instruction. + ntoskrnl: Add emulation for 'movzx {Eb,Ew}, Gv' instruction. + kernel32/tests: Add a lot of picky GetVolumePathName tests. + kernel32/tests: Add GetVolumePathNameW tests. + ntoskrnl: Use SIZE_T to store 64-bit offset to USER_SHARED_DATA page. + advapi32/tests: Explicitly check return value of GetTokenInformation. + windowscodecs/tests: Fix test condition which is always true. + windowscodecs: Distinguish interface pointer and implementation pointer. + qcap: Distinguish interface pointer and implementation pointer for base filter. + quartz: Distinguish interface pointer and implementation pointer in multiple interfaces. + ntdll: NtMapViewOfSection should fail if both addr_ptr and zero_bits is set. + ntdll: Implement support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection. + +Thomas Faber (2): + dimm.idl: Add IActiveIMMMessagePumpOwner. + msimtf: Add stub implementation for IActiveIMMMessagePumpOwner. Thomas Faller (2): - gdi32: Prevent unneeded operations by flag check. - cmd: Fix access of uninitialized memory. + cmd: Fix invalid memory access. + cmd: Fix invalid "else if" execution. -Vincent Povirk (1): - ole32: Fix storage locking for read-only exclusive mode. +YongHao Hu (6): + msvcp110: Add tr2_sys__File_size implementation and test. + msvcp110: Add tr2_sys__Equivalent implementation and test. + msvcp110: Add tr2_sys__Current_get implementation and test. + msvcp110: Add tr2_sys__Current_set implementation and test. + msvcp110: Add tr2_sys__Make_dir implementation and test. + msvcp110: Add tr2_sys__Remove_dir implementation and test. -Zebediah Figura (2): - include: Add WNODE flags to wmistr.h. - include: Add event trace flags and guid to evntrace.h. - -Zhenbo Li (2): - mshtml: Implement IHTMLXMLHttpRequestFactory as a stub. - mshtml: Implement IHTMLXMLHttpRequest as a stub. +Zhenbo Li (1): + mshtml/tests: Added IHTMLXMLHttpRequest tests. -- Alexandre Julliard diff -Nru wine-staging-1.7.45~ubuntu14.10.1/AUTHORS wine-staging-1.7.46~ubuntu14.10.1/AUTHORS --- wine-staging-1.7.45~ubuntu14.10.1/AUTHORS 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/AUTHORS 2015-06-28 16:51:28.000000000 +0000 @@ -600,6 +600,7 @@ Jan Willamowius Jan Zerebecki Jared Lapsley +Jared Smudde Jaroslav Šmíd Jaroslaw Piotr Sobieszek Jason Edmeades @@ -993,6 +994,7 @@ Milan Ševčík Milko Krachounov Misha Koshelev +Mohamed Mediouni Molle Bestefich Morten Eriksen Morten Rønne @@ -1048,6 +1050,7 @@ Oleh R. Nykyforchyn Oleksij Rempel Oliver Stieber +Olivier F. R. Dierick Olivier Houchard Olli-Pekka Wallin Ondrej Macek diff -Nru wine-staging-1.7.45~ubuntu14.10.1/configure wine-staging-1.7.46~ubuntu14.10.1/configure --- wine-staging-1.7.45~ubuntu14.10.1/configure 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/configure 2015-06-28 16:51:28.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Wine 1.7.45. +# Generated by GNU Autoconf 2.69 for Wine 1.7.46. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.45' -PACKAGE_STRING='Wine 1.7.45' +PACKAGE_VERSION='1.7.46' +PACKAGE_STRING='Wine 1.7.46' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -984,6 +984,8 @@ enable_d3dcompiler_41 enable_d3dcompiler_42 enable_d3dcompiler_43 +enable_d3dcompiler_46 +enable_d3dcompiler_47 enable_d3dim enable_d3drm enable_d3dx10_33 @@ -1150,6 +1152,7 @@ enable_msnet32 enable_mspatcha enable_msrle32 +enable_msscript_ocx enable_mssign32 enable_mssip32 enable_mstask @@ -2036,7 +2039,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.7.45 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.46 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2105,7 +2108,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.45:";; + short | recursive ) echo "Configuration of Wine 1.7.46:";; esac cat <<\_ACEOF @@ -2301,7 +2304,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.45 +Wine configure 1.7.46 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2819,7 +2822,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.7.45, which was +It was created by Wine $as_me 1.7.46, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -6626,7 +6629,6 @@ lber.h \ ldap.h \ libproc.h \ - libunwind.h \ link.h \ linux/cdrom.h \ linux/compiler.h \ @@ -7849,6 +7851,18 @@ ;; darwin*|macosx*) + for ac_header in libunwind.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libunwind.h" "ac_cv_header_libunwind_h" "$ac_includes_default" +if test "x$ac_cv_header_libunwind_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUNWIND_H 1 +_ACEOF + +fi + +done + LIBEXT="dylib" DLLFLAGS="$DLLFLAGS -fPIC" LIBWINE_LDFLAGS="-multiply_defined suppress" @@ -17168,6 +17182,8 @@ wine_fn_config_dll d3dcompiler_42 enable_d3dcompiler_42 wine_fn_config_dll d3dcompiler_43 enable_d3dcompiler_43 implib d3dcompiler wine_fn_config_test dlls/d3dcompiler_43/tests d3dcompiler_43_test +wine_fn_config_dll d3dcompiler_46 enable_d3dcompiler_46 +wine_fn_config_dll d3dcompiler_47 enable_d3dcompiler_47 wine_fn_config_dll d3dim enable_d3dim implib wine_fn_config_dll d3drm enable_d3drm implib wine_fn_config_test dlls/d3drm/tests d3drm_test @@ -17411,6 +17427,7 @@ wine_fn_config_dll mspatcha enable_mspatcha implib wine_fn_config_dll msrle32 enable_msrle32 po wine_fn_config_test dlls/msrle32/tests msrle32_test +wine_fn_config_dll msscript.ocx enable_msscript_ocx clean wine_fn_config_dll mssign32 enable_mssign32 wine_fn_config_dll mssip32 enable_mssip32 wine_fn_config_dll mstask enable_mstask clean @@ -18514,7 +18531,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.7.45, which was +This file was extended by Wine $as_me 1.7.46, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18585,7 +18602,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Wine config.status 1.7.45 +Wine config.status 1.7.46 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/configure.ac wine-staging-1.7.46~ubuntu14.10.1/configure.ac --- wine-staging-1.7.45~ubuntu14.10.1/configure.ac 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/configure.ac 2015-06-28 16:51:28.000000000 +0000 @@ -424,7 +424,6 @@ lber.h \ ldap.h \ libproc.h \ - libunwind.h \ link.h \ linux/cdrom.h \ linux/compiler.h \ @@ -751,6 +750,7 @@ ;; darwin*|macosx*) + AC_CHECK_HEADERS(libunwind.h) LIBEXT="dylib" DLLFLAGS="$DLLFLAGS -fPIC" LIBWINE_LDFLAGS="-multiply_defined suppress" @@ -2856,6 +2856,8 @@ WINE_CONFIG_DLL(d3dcompiler_42) WINE_CONFIG_DLL(d3dcompiler_43,,[implib],[d3dcompiler]) WINE_CONFIG_TEST(dlls/d3dcompiler_43/tests) +WINE_CONFIG_DLL(d3dcompiler_46) +WINE_CONFIG_DLL(d3dcompiler_47) WINE_CONFIG_DLL(d3dim,,[implib]) WINE_CONFIG_DLL(d3drm,,[implib]) WINE_CONFIG_TEST(dlls/d3drm/tests) @@ -3099,6 +3101,7 @@ WINE_CONFIG_DLL(mspatcha,,[implib]) WINE_CONFIG_DLL(msrle32,,[po]) WINE_CONFIG_TEST(dlls/msrle32/tests) +WINE_CONFIG_DLL(msscript.ocx,,[clean]) WINE_CONFIG_DLL(mssign32) WINE_CONFIG_DLL(mssip32) WINE_CONFIG_DLL(mstask,,[clean]) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/debian/bzr-builder.manifest wine-staging-1.7.46~ubuntu14.10.1/debian/bzr-builder.manifest --- wine-staging-1.7.45~ubuntu14.10.1/debian/bzr-builder.manifest 2015-06-13 23:57:28.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/debian/bzr-builder.manifest 2015-06-28 17:36:08.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.4 deb-version 1.7.45 -lp:wine revid:git-v1:cde46665fa8503e90c9a2fab1898cdb4d22f667b -merge compholio-release-package lp:wine-compholio revid:git-v1:7c0b90ad1936b9bc2e7155ccd9cd2ba65178b166 +# bzr-builder format 0.4 deb-version 1.7.46 +lp:wine revid:git-v1:ae6efa469bfaecade30e160d195d607bdcdcc6ae +merge compholio-release-package lp:wine-compholio revid:git-v1:8d92e1177f7dc5ef4e9846fb1e47be2670e33306 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/debian/changelog wine-staging-1.7.46~ubuntu14.10.1/debian/changelog --- wine-staging-1.7.45~ubuntu14.10.1/debian/changelog 2015-06-13 23:57:28.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/debian/changelog 2015-06-28 17:36:08.000000000 +0000 @@ -1,8 +1,51 @@ -wine-staging (1.7.45~ubuntu14.10.1) utopic; urgency=low +wine-staging (1.7.46~ubuntu14.10.1) utopic; urgency=low * Auto build. - -- Sebastian Lackner Sat, 13 Jun 2015 23:57:28 +0000 + -- Sebastian Lackner Sun, 28 Jun 2015 17:36:08 +0000 + +wine-staging (1.7.46) unstable; urgency=low + * Add reference to upstream bug report for various patchsets. + * Added patch to improve IoGetDeviceObjectPointer stub to appease SecuROM 5.x. + * Added patch to globally invalidate key state on changes in other threads. + * Added patch to fix possible use-after-free in wineserver device IPR code. + * Added patch to fix wineserver crash when pipe server object is destroyed + before client (fixes Wine Staging Bug #393). + * Added patches to improve crosscompiling Wine for other platforms. + * Added patch to improve output of '--check-libs' on OSX. + * Added patch to implement general tab for file property dialog. + * Added patch to initialize *lpcDevices in RasEnumDevicesA. + * Improved nvcuda-CUDA_Support patchset to search for dylib on OSX. + * Improved wined3d-DXTn patchset to search for dylib on OSX. + * Updated kernel32-GetVolumePathName to fix several test failures. + * Updated ntoskrnl-Emulator patchset to implement emulation of MOVZX + instruction on x86_64. + * Updated patchset ntdll-WRITECOPY to be compatible with OSX (fixes Wine + Staging Bug #399). + * Disable patch to avoid crash when NULL pointer is passed to atof / strtod + functions (fixed upstream). + * Removed patch for implementation of GdipCreateRegionRgnData (accepted + upstream). + * Removed patch to fix output buffer size for IOCTL_DVD_READ_STRUCTURE + requests (accepted upstream). + * Removed patch to add stub for kernel32.SetFileCompletionNotificationModes + (accepted upstream). + * Removed patch to use random names when caching very long urls in wininet + (accepted upstream). + * Removed patch to fix link notification conditions for riched20 (accepted + upstream). + * Removed patch to emulate access to USER_SHARE_DATA on x86_64 (accepted + upstream). + * Removed patch to fix possible use-after-free in wineserver device IPR code + (accepted upstream). + * Removed patches to implement GetVolumePathName (accepted upstream). + * Removed patch for advapi32.GetWindowsAccountDomainSid (accepted upstream). + * Removed patch for stub implementation of fltlib.FilterLoad (accepted + upstream). + * Removed patch for AT_ROUND_TO_PAGE support in NtMapViewOfSection (accepted + upstream). + * Removed patch to fix linking against libunwind on Linux (fixed upstream). + -- Sebastian Lackner Sun, 28 Jun 2015 18:20:36 +0200 wine-staging (1.7.45) unstable; urgency=low * Add reference to upstream bug report for various patchsets. diff -Nru wine-staging-1.7.45~ubuntu14.10.1/debian/rules wine-staging-1.7.46~ubuntu14.10.1/debian/rules --- wine-staging-1.7.45~ubuntu14.10.1/debian/rules 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/debian/rules 2015-06-28 17:08:11.000000000 +0000 @@ -24,7 +24,6 @@ --infodir=\$${prefix}/share/info \ --enable-win64 \ --without-gstreamer \ - --without-unwind \ --with-xattr \ $(CONFFLAGS) else diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/advapi32.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/advapi32.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/advapi32.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/advapi32.spec 2015-06-28 16:51:28.000000000 +0000 @@ -363,7 +363,7 @@ @ stdcall GetTrusteeTypeW(ptr) @ stdcall GetUserNameA(ptr ptr) @ stdcall GetUserNameW(ptr ptr) -# @ stub GetWindowsAccountDomainSid +@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) # @ stub I_QueryTagInformation # @ stub I_ScGetCurrentGroupStateW # @ stub I_ScIsSecurityProcess diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/security.c wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/security.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/security.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/security.c 2015-06-28 16:51:28.000000000 +0000 @@ -1538,6 +1538,52 @@ pSecurityDescriptor, ControlBitsOfInterest, ControlBitsToSet ) ); } +/****************************************************************************** + * GetWindowsAccountDomainSid [ADVAPI32.@] + */ +BOOL WINAPI GetWindowsAccountDomainSid( PSID sid, PSID domain_sid, DWORD *size ) +{ + SID_IDENTIFIER_AUTHORITY domain_ident = { SECURITY_NT_AUTHORITY }; + DWORD required_size; + int i; + + FIXME( "(%p %p %p): semi-stub\n", sid, domain_sid, size ); + + if (!sid || !IsValidSid( sid )) + { + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } + + if (!size) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + if (*GetSidSubAuthorityCount( sid ) < 4) + { + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } + + required_size = GetSidLengthRequired( 4 ); + if (*size < required_size || !domain_sid) + { + *size = required_size; + SetLastError( domain_sid ? ERROR_INSUFFICIENT_BUFFER : + ERROR_INVALID_PARAMETER ); + return FALSE; + } + + InitializeSid( domain_sid, &domain_ident, 4 ); + for (i = 0; i < 4; i++) + *GetSidSubAuthority( domain_sid, i ) = *GetSidSubAuthority( sid, i ); + + *size = required_size; + return TRUE; +} + /* ############################## ###### ACL FUNCTIONS ###### ############################## diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/tests/security.c wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/tests/security.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/advapi32/tests/security.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/advapi32/tests/security.c 2015-06-28 16:51:28.000000000 +0000 @@ -129,6 +129,7 @@ static NTSTATUS (WINAPI *pNtCreateFile)(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(LPCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*); static NTSTATUS (WINAPI *pRtlAnsiStringToUnicodeString)(PUNICODE_STRING,PCANSI_STRING,BOOLEAN); +static BOOL (WINAPI *pGetWindowsAccountDomainSid)(PSID,PSID,DWORD*); static HMODULE hmod; static int myARGC; @@ -190,6 +191,7 @@ pConvertStringSidToSidA = (void *)GetProcAddress(hmod, "ConvertStringSidToSidA"); pGetAclInformation = (void *)GetProcAddress(hmod, "GetAclInformation"); pGetAce = (void *)GetProcAddress(hmod, "GetAce"); + pGetWindowsAccountDomainSid = (void *)GetProcAddress(hmod, "GetWindowsAccountDomainSid"); myARGC = winetest_get_mainargs( &myARGV ); } @@ -4290,7 +4292,8 @@ win_skip("Failed to get current user token\n"); return; } - GetTokenInformation(token, TokenUser, b, l, &l); + bret = GetTokenInformation(token, TokenUser, b, l, &l); + ok(bret, "GetTokenInformation(TokenUser) failed with error %d\n", GetLastError()); CloseHandle( token ); user_sid = ((TOKEN_USER *)b)->User.Sid; @@ -5835,6 +5838,171 @@ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %d\n", GetLastError()); } +static void test_system_security_access(void) +{ + static const WCHAR testkeyW[] = + {'S','O','F','T','W','A','R','E','\\','W','i','n','e','\\','S','A','C','L','t','e','s','t',0}; + LONG res; + HKEY hkey; + PSECURITY_DESCRIPTOR sd; + ACL *sacl; + DWORD err, len = 128; + TOKEN_PRIVILEGES priv, *priv_prev; + HANDLE token; + LUID luid; + BOOL ret; + + if (!OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token )) return; + if (!LookupPrivilegeValueA( NULL, SE_SECURITY_NAME, &luid )) + { + CloseHandle( token ); + return; + } + + /* ACCESS_SYSTEM_SECURITY requires special privilege */ + res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ|ACCESS_SYSTEM_SECURITY, NULL, &hkey, NULL ); + todo_wine ok( res == ERROR_PRIVILEGE_NOT_HELD, "got %d\n", res ); + + priv.PrivilegeCount = 1; + priv.Privileges[0].Luid = luid; + priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + priv_prev = HeapAlloc( GetProcessHeap(), 0, len ); + ret = AdjustTokenPrivileges( token, FALSE, &priv, len, priv_prev, &len ); + ok( ret, "got %u\n", GetLastError()); + + res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ|ACCESS_SYSTEM_SECURITY, NULL, &hkey, NULL ); + ok( !res, "got %d\n", res ); + + /* restore privileges */ + ret = AdjustTokenPrivileges( token, FALSE, priv_prev, 0, NULL, NULL ); + ok( ret, "got %u\n", GetLastError() ); + HeapFree( GetProcessHeap(), 0, priv_prev ); + + /* privilege is checked on access */ + err = GetSecurityInfo( hkey, SE_REGISTRY_KEY, SACL_SECURITY_INFORMATION, NULL, NULL, NULL, &sacl, &sd ); + todo_wine ok( err == ERROR_PRIVILEGE_NOT_HELD, "got %u\n", err ); + + priv.PrivilegeCount = 1; + priv.Privileges[0].Luid = luid; + priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + priv_prev = HeapAlloc( GetProcessHeap(), 0, len ); + ret = AdjustTokenPrivileges( token, FALSE, &priv, len, priv_prev, &len ); + ok( ret, "got %u\n", GetLastError()); + + err = GetSecurityInfo( hkey, SE_REGISTRY_KEY, SACL_SECURITY_INFORMATION, NULL, NULL, NULL, &sacl, &sd ); + ok( err == ERROR_SUCCESS, "got %u\n", err ); + RegCloseKey( hkey ); + LocalFree( sd ); + + /* handle created without ACCESS_SYSTEM_SECURITY, privilege held */ + res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ, NULL, &hkey, NULL ); + ok( res == ERROR_SUCCESS, "got %d\n", res ); + + sd = NULL; + err = GetSecurityInfo( hkey, SE_REGISTRY_KEY, SACL_SECURITY_INFORMATION, NULL, NULL, NULL, &sacl, &sd ); + todo_wine ok( err == ERROR_SUCCESS, "got %u\n", err ); + RegCloseKey( hkey ); + LocalFree( sd ); + + /* restore privileges */ + ret = AdjustTokenPrivileges( token, FALSE, priv_prev, 0, NULL, NULL ); + ok( ret, "got %u\n", GetLastError() ); + HeapFree( GetProcessHeap(), 0, priv_prev ); + + /* handle created without ACCESS_SYSTEM_SECURITY, privilege not held */ + res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ, NULL, &hkey, NULL ); + ok( res == ERROR_SUCCESS, "got %d\n", res ); + + err = GetSecurityInfo( hkey, SE_REGISTRY_KEY, SACL_SECURITY_INFORMATION, NULL, NULL, NULL, &sacl, &sd ); + todo_wine ok( err == ERROR_PRIVILEGE_NOT_HELD, "got %u\n", err ); + RegCloseKey( hkey ); + + res = RegDeleteKeyW( HKEY_LOCAL_MACHINE, testkeyW ); + ok( !res, "got %d\n", res ); + CloseHandle( token ); +} + +static void test_GetWindowsAccountDomainSid(void) +{ + char *user, buffer1[SECURITY_MAX_SID_SIZE], buffer2[SECURITY_MAX_SID_SIZE]; + SID_IDENTIFIER_AUTHORITY domain_ident = { SECURITY_NT_AUTHORITY }; + PSID domain_sid = (PSID *)&buffer1; + PSID domain_sid2 = (PSID *)&buffer2; + DWORD sid_size; + PSID user_sid; + HANDLE token; + BOOL bret = TRUE; + int i; + + if (!pGetWindowsAccountDomainSid) + { + win_skip("GetWindowsAccountDomainSid not available\n"); + return; + } + + if (!OpenThreadToken(GetCurrentThread(), TOKEN_READ, TRUE, &token)) + { + if (GetLastError() != ERROR_NO_TOKEN) bret = FALSE; + else if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) bret = FALSE; + } + if (!bret) + { + win_skip("Failed to get current user token\n"); + return; + } + + bret = GetTokenInformation(token, TokenUser, NULL, 0, &sid_size); + ok(!bret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "GetTokenInformation(TokenUser) failed with error %d\n", GetLastError()); + user = HeapAlloc(GetProcessHeap(), 0, sid_size); + bret = GetTokenInformation(token, TokenUser, user, sid_size, &sid_size); + ok(bret, "GetTokenInformation(TokenUser) failed with error %d\n", GetLastError()); + CloseHandle(token); + user_sid = ((TOKEN_USER *)user)->User.Sid; + + SetLastError(0xdeadbeef); + bret = pGetWindowsAccountDomainSid(0, 0, 0); + ok(!bret, "GetWindowsAccountDomainSid succeeded\n"); + ok(GetLastError() == ERROR_INVALID_SID, "expected ERROR_INVALID_SID, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + bret = pGetWindowsAccountDomainSid(user_sid, 0, 0); + ok(!bret, "GetWindowsAccountDomainSid succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + sid_size = SECURITY_MAX_SID_SIZE; + SetLastError(0xdeadbeef); + bret = pGetWindowsAccountDomainSid(user_sid, 0, &sid_size); + ok(!bret, "GetWindowsAccountDomainSid succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); + + SetLastError(0xdeadbeef); + bret = pGetWindowsAccountDomainSid(user_sid, domain_sid, 0); + ok(!bret, "GetWindowsAccountDomainSid succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + sid_size = 1; + SetLastError(0xdeadbeef); + bret = pGetWindowsAccountDomainSid(user_sid, domain_sid, &sid_size); + ok(!bret, "GetWindowsAccountDomainSid succeeded\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); + + sid_size = SECURITY_MAX_SID_SIZE; + bret = pGetWindowsAccountDomainSid(user_sid, domain_sid, &sid_size); + ok(bret, "GetWindowsAccountDomainSid failed with error %d\n", GetLastError()); + ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); + InitializeSid(domain_sid2, &domain_ident, 4); + for (i = 0; i < 4; i++) + *GetSidSubAuthority(domain_sid2, i) = *GetSidSubAuthority(user_sid, i); + ok(EqualSid(domain_sid, domain_sid2), "unexpected domain sid\n"); + + HeapFree(GetProcessHeap(), 0, user); +} + START_TEST(security) { init(); @@ -5866,6 +6034,7 @@ test_ConvertSecurityDescriptorToString(); test_PrivateObjectSecurity(); test_acls(); + test_GetWindowsAccountDomainSid(); test_GetSecurityInfo(); test_GetSidSubAuthority(); test_CheckTokenMembership(); @@ -5877,4 +6046,5 @@ test_default_dacl_owner_sid(); test_AdjustTokenPrivileges(); test_AddAce(); + test_system_security_access(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/amstream.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/amstream.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/amstream.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/amstream.c 2015-06-28 16:51:28.000000000 +0000 @@ -27,7 +27,6 @@ #include "wingdi.h" #include "amstream_private.h" -#include "amstream.h" WINE_DEFAULT_DEBUG_CHANNEL(amstream); @@ -37,10 +36,10 @@ IGraphBuilder* pFilterGraph; IMediaSeeking* media_seeking; IMediaControl* media_control; - IBaseFilter* media_stream_filter; + IMediaStreamFilter *media_stream_filter; IPin* ipin; ULONG nbStreams; - IMediaStream** pStreams; + IAMMediaStream **pStreams; STREAM_TYPE StreamType; OAEVENT event; } IAMMultiMediaStreamImpl; @@ -114,11 +113,12 @@ if (!ref) { for(i = 0; i < This->nbStreams; i++) - IMediaStream_Release(This->pStreams[i]); + IAMMediaStream_Release(This->pStreams[i]); + CoTaskMemFree(This->pStreams); if (This->ipin) IPin_Release(This->ipin); if (This->media_stream_filter) - IBaseFilter_Release(This->media_stream_filter); + IMediaStreamFilter_Release(This->media_stream_filter); if (This->media_seeking) IMediaSeeking_Release(This->media_seeking); if (This->media_control) @@ -151,10 +151,10 @@ for (i = 0; i < This->nbStreams; i++) { - IMediaStream_GetInformation(This->pStreams[i], &PurposeId, NULL); + IAMMediaStream_GetInformation(This->pStreams[i], &PurposeId, NULL); if (IsEqualIID(&PurposeId, idPurpose)) { - *ppMediaStream = This->pStreams[i]; + *ppMediaStream = (IMediaStream*)This->pStreams[i]; IMediaStream_AddRef(*ppMediaStream); return S_OK; } @@ -258,9 +258,9 @@ if (SUCCEEDED(hr)) hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control); if (SUCCEEDED(hr)) - hr = CoCreateInstance(&CLSID_MediaStreamFilter, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&This->media_stream_filter); + hr = CoCreateInstance(&CLSID_MediaStreamFilter, NULL, CLSCTX_INPROC_SERVER, &IID_IMediaStreamFilter, (void**)&This->media_stream_filter); if (SUCCEEDED(hr)) - hr = IGraphBuilder_AddFilter(This->pFilterGraph, This->media_stream_filter, filternameW); + hr = IGraphBuilder_AddFilter(This->pFilterGraph, (IBaseFilter*)This->media_stream_filter, filternameW); if (SUCCEEDED(hr)) { IMediaEventEx* media_event = NULL; @@ -277,7 +277,7 @@ if (FAILED(hr)) { if (This->media_stream_filter) - IBaseFilter_Release(This->media_stream_filter); + IMediaStreamFilter_Release(This->media_stream_filter); This->media_stream_filter = NULL; if (This->media_seeking) IMediaSeeking_Release(This->media_seeking); @@ -313,19 +313,17 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilter(IAMMultiMediaStream* iface, IMediaStreamFilter** ppFilter) { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); - HRESULT hr = S_OK; TRACE("(%p/%p)->(%p)\n", This, iface, ppFilter); if (!ppFilter) return E_POINTER; - *ppFilter = NULL; - - if (This->media_stream_filter) - hr = IBaseFilter_QueryInterface(This->media_stream_filter, &IID_IMediaStreamFilter, (LPVOID*)ppFilter); + *ppFilter = This->media_stream_filter; + if (*ppFilter) + IMediaStreamFilter_AddRef(*ppFilter); - return hr; + return S_OK; } static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* stream_object, const MSPID* PurposeId, @@ -333,8 +331,8 @@ { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); HRESULT hr; - IMediaStream* pStream; - IMediaStream** pNewStreams; + IAMMediaStream* pStream; + IAMMediaStream** pNewStreams; TRACE("(%p/%p)->(%p,%s,%x,%p)\n", This, iface, stream_object, debugstr_guid(PurposeId), dwFlags, ppNewStream); @@ -374,10 +372,10 @@ hr = audiomediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); if (SUCCEEDED(hr)) { - pNewStreams = CoTaskMemRealloc(This->pStreams, (This->nbStreams+1) * sizeof(IMediaStream*)); + pNewStreams = CoTaskMemRealloc(This->pStreams, (This->nbStreams+1) * sizeof(IAMMediaStream*)); if (!pNewStreams) { - IMediaStream_Release(pStream); + IAMMediaStream_Release(pStream); return E_OUTOFMEMORY; } This->pStreams = pNewStreams; @@ -385,13 +383,13 @@ This->nbStreams++; if (ppNewStream) - *ppNewStream = pStream; + *ppNewStream = (IMediaStream*)pStream; } if (SUCCEEDED(hr)) { /* Add stream to the media stream filter */ - IMediaStreamFilter_AddMediaStream((IMediaStreamFilter*)This->media_stream_filter, (IAMMediaStream*)pStream); + IMediaStreamFilter_AddMediaStream(This->media_stream_filter, pStream); } return hr; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/amstream_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/amstream_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/amstream_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/amstream_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -31,13 +31,14 @@ #include "dshow.h" #include "mmstream.h" #include "austream.h" +#include "amstream.h" HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT MediaStreamFilter_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT ddrawmediastream_create(IMultiMediaStream *Parent, const MSPID *pPurposeId, - STREAM_TYPE StreamType, IMediaStream **ppMediaStream) DECLSPEC_HIDDEN; + STREAM_TYPE StreamType, IAMMediaStream **ppMediaStream) DECLSPEC_HIDDEN; HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - STREAM_TYPE stream_type, IMediaStream **media_stream) DECLSPEC_HIDDEN; + STREAM_TYPE stream_type, IAMMediaStream **media_stream) DECLSPEC_HIDDEN; #endif /* __AMSTREAM_PRIVATE_INCLUDED__ */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/audiodata.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/audiodata.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/audiodata.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/audiodata.c 2015-06-28 16:51:28.000000000 +0000 @@ -25,8 +25,6 @@ #include "winbase.h" #include "amstream_private.h" -#include "amstream.h" - WINE_DEFAULT_DEBUG_CHANNEL(amstream); typedef struct { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/main.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/main.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/main.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/main.c 2015-06-28 16:51:28.000000000 +0000 @@ -32,7 +32,6 @@ #include "rpcproxy.h" #include "amstream_private.h" -#include "amstream.h" #include "wine/debug.h" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = amstream.dll -IMPORTS = strmiids strmbase uuid ole32 advapi32 +IMPORTS = strmiids strmbase uuid ole32 advapi32 ddraw C_SRCS = \ amstream.c \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/mediastream.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/mediastream.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/mediastream.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/mediastream.c 2015-06-28 16:51:28.000000000 +0000 @@ -26,13 +26,13 @@ #include "wingdi.h" #include "amstream_private.h" -#include "amstream.h" #include "ddstream.h" WINE_DEFAULT_DEBUG_CHANNEL(amstream); -static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample); +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, + const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample); static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample); typedef struct { @@ -42,6 +42,7 @@ IMultiMediaStream* parent; MSPID purpose_id; STREAM_TYPE stream_type; + IDirectDraw7 *ddraw; } DirectDrawMediaStreamImpl; static inline DirectDrawMediaStreamImpl *impl_from_DirectDrawMediaStream_IAMMediaStream(IAMMediaStream *iface) @@ -94,7 +95,11 @@ TRACE("(%p/%p)->(): new ref = %u\n", iface, This, ref); if (!ref) + { + if (This->ddraw) + IDirectDraw7_Release(This->ddraw); HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -242,48 +247,22 @@ REFIID riid, void **ret_iface) { DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); - - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IMediaStream) || - IsEqualGUID(riid, &IID_IDirectDrawMediaStream)) - { - IDirectDrawMediaStream_AddRef(iface); - *ret_iface = iface; - return S_OK; - } - else if (IsEqualGUID(riid, &IID_IAMMediaStream)) - { - IDirectDrawMediaStream_AddRef(iface); - *ret_iface = &This->IAMMediaStream_iface; - return S_OK; - } - - ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ret_iface); - return E_NOINTERFACE; + return IAMMediaStream_QueryInterface(&This->IAMMediaStream_iface, riid, ret_iface); } static ULONG WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_AddRef(IDirectDrawMediaStream *iface) { DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - TRACE("(%p/%p)\n", iface, This); - - return InterlockedIncrement(&This->ref); + return IAMMediaStream_AddRef(&This->IAMMediaStream_iface); } static ULONG WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Release(IDirectDrawMediaStream *iface) { DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - ULONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p/%p)\n", iface, This); - - if (!ref) - HeapFree(GetProcessHeap(), 0, This); - - return ref; + return IAMMediaStream_Release(&This->IAMMediaStream_iface); } /*** IMediaStream methods ***/ @@ -373,11 +352,22 @@ } static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetDirectDraw(IDirectDrawMediaStream *iface, - IDirectDraw **ppDirectDraw) + IDirectDraw **ddraw) { - FIXME("(%p)->(%p) stub!\n", iface, ppDirectDraw); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", iface, ddraw); + + *ddraw = NULL; + if (!This->ddraw) + { + HRESULT hr = DirectDrawCreateEx(NULL, (void**)&This->ddraw, &IID_IDirectDraw7, NULL); + if (FAILED(hr)) + return hr; + IDirectDraw7_SetCooperativeLevel(This->ddraw, NULL, DDSCL_NORMAL); + } + + return IDirectDraw7_QueryInterface(This->ddraw, &IID_IDirectDraw, (void**)ddraw); } static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetDirectDraw(IDirectDrawMediaStream *iface, @@ -389,12 +379,12 @@ } static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSample(IDirectDrawMediaStream *iface, - IDirectDrawSurface *pSurface, const RECT *pRect, DWORD dwFlags, + IDirectDrawSurface *surface, const RECT *rect, DWORD dwFlags, IDirectDrawStreamSample **ppSample) { - TRACE("(%p)->(%p,%p,%x,%p)\n", iface, pSurface, pRect, dwFlags, ppSample); + TRACE("(%p)->(%p,%s,%x,%p)\n", iface, surface, wine_dbgstr_rect(rect), dwFlags, ppSample); - return ddrawstreamsample_create(iface, ppSample); + return ddrawstreamsample_create(iface, surface, rect, ppSample); } static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetTimePerFrame(IDirectDrawMediaStream *iface, @@ -428,7 +418,7 @@ }; HRESULT ddrawmediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - STREAM_TYPE stream_type, IMediaStream **media_stream) + STREAM_TYPE stream_type, IAMMediaStream **media_stream) { DirectDrawMediaStreamImpl *object; @@ -446,7 +436,7 @@ object->purpose_id = *purpose_id; object->stream_type = stream_type; - *media_stream = (IMediaStream*)&object->IAMMediaStream_iface; + *media_stream = &object->IAMMediaStream_iface; return S_OK; } @@ -658,52 +648,22 @@ REFIID riid, void **ret_iface) { AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); - TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); - - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IMediaStream) || - IsEqualGUID(riid, &IID_IAudioMediaStream)) - { - IAudioMediaStream_AddRef(iface); - *ret_iface = iface; - return S_OK; - } - else if (IsEqualGUID(riid, &IID_IAMMediaStream)) - { - IAudioMediaStream_AddRef(iface); - *ret_iface = &This->IAMMediaStream_iface; - return S_OK; - } - - - *ret_iface = NULL; - - ERR("(%p/%p)->(%s,%p),not found\n", iface, This, debugstr_guid(riid), ret_iface); - return E_NOINTERFACE; + return IAMMediaStream_QueryInterface(&This->IAMMediaStream_iface, riid, ret_iface); } static ULONG WINAPI AudioMediaStreamImpl_IAudioMediaStream_AddRef(IAudioMediaStream *iface) { AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p/%p): new ref = %u\n", iface, This, ref); - - return ref; + TRACE("(%p/%p)\n", iface, This); + return IAMMediaStream_AddRef(&This->IAMMediaStream_iface); } static ULONG WINAPI AudioMediaStreamImpl_IAudioMediaStream_Release(IAudioMediaStream *iface) { AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p/%p): new ref = %u\n", iface, This, ref); - - if (!ref) - HeapFree(GetProcessHeap(), 0, This); - - return ref; + TRACE("(%p/%p)\n", iface, This); + return IAMMediaStream_Release(&This->IAMMediaStream_iface); } /*** IMediaStream methods ***/ @@ -828,7 +788,7 @@ }; HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - STREAM_TYPE stream_type, IMediaStream **media_stream) + STREAM_TYPE stream_type, IAMMediaStream **media_stream) { AudioMediaStreamImpl *object; @@ -846,7 +806,7 @@ object->purpose_id = *purpose_id; object->stream_type = stream_type; - *media_stream = (IMediaStream*)&object->IAMMediaStream_iface; + *media_stream = &object->IAMMediaStream_iface; return S_OK; } @@ -855,6 +815,8 @@ IDirectDrawStreamSample IDirectDrawStreamSample_iface; LONG ref; IMediaStream *parent; + IDirectDrawSurface *surface; + RECT rect; } IDirectDrawStreamSampleImpl; static inline IDirectDrawStreamSampleImpl *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface) @@ -901,7 +863,12 @@ TRACE("(%p)->(): new ref = %u\n", iface, ref); if (!ref) + { + if (This->surface) + IDirectDrawSurface_Release(This->surface); + IMediaStream_Release(This->parent); HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -949,9 +916,21 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSurface(IDirectDrawStreamSample *iface, IDirectDrawSurface **ddraw_surface, RECT *rect) { - FIXME("(%p)->(%p,%p): stub\n", iface, ddraw_surface, rect); + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); - return E_NOTIMPL; + TRACE("(%p)->(%p,%p)\n", iface, ddraw_surface, rect); + + if (ddraw_surface) + { + *ddraw_surface = This->surface; + if (*ddraw_surface) + IDirectDrawSurface_AddRef(*ddraw_surface); + } + + if (rect) + *rect = This->rect; + + return S_OK; } static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSample *iface, const RECT *rect) @@ -978,21 +957,78 @@ IDirectDrawStreamSampleImpl_SetRect }; -static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample) +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, + const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample) { IDirectDrawStreamSampleImpl *object; + HRESULT hr; TRACE("(%p)\n", ddraw_stream_sample); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawStreamSampleImpl)); + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) return E_OUTOFMEMORY; object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl; object->ref = 1; object->parent = (IMediaStream*)parent; + IMediaStream_AddRef(object->parent); + + if (surface) + { + object->surface = surface; + IDirectDrawSurface_AddRef(surface); + } + else + { + DDSURFACEDESC desc; + IDirectDraw *ddraw; + + hr = IDirectDrawMediaStream_GetDirectDraw(parent, &ddraw); + if (FAILED(hr)) + { + IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); + return hr; + } + + desc.dwSize = sizeof(desc); + desc.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT; + desc.dwHeight = 100; + desc.dwWidth = 100; + desc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); + desc.ddpfPixelFormat.dwFlags = DDPF_RGB; + desc.ddpfPixelFormat.dwRGBBitCount = 32; + desc.ddpfPixelFormat.dwRBitMask = 0xff0000; + desc.ddpfPixelFormat.dwGBitMask = 0x00ff00; + desc.ddpfPixelFormat.dwBBitMask = 0x0000ff; + desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0; + desc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN; + + hr = IDirectDraw_CreateSurface(ddraw, &desc, &object->surface, NULL); + IDirectDraw_Release(ddraw); + if (FAILED(hr)) + { + ERR("failed to create surface, 0x%08x\n", hr); + IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); + return hr; + } + } + + if (rect) + object->rect = *rect; + else if (object->surface) + { + DDSURFACEDESC desc = { sizeof(desc) }; + hr = IDirectDrawSurface_GetSurfaceDesc(object->surface, &desc); + if (hr == S_OK) + { + object->rect.left = object->rect.top = 0; + object->rect.right = desc.dwWidth; + object->rect.bottom = desc.dwHeight; + } + } - *ddraw_stream_sample = (IDirectDrawStreamSample*)&object->IDirectDrawStreamSample_iface; + *ddraw_stream_sample = &object->IDirectDrawStreamSample_iface; return S_OK; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/mediastreamfilter.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/mediastreamfilter.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/mediastreamfilter.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/mediastreamfilter.c 2015-06-28 16:51:28.000000000 +0000 @@ -29,7 +29,6 @@ #include "wine/strmbase.h" #include "amstream_private.h" -#include "amstream.h" #include "ddstream.h" @@ -250,6 +249,8 @@ IMediaStream_Release(This->streams[i]); IPin_Release(This->pins[i]); } + CoTaskMemFree(This->streams); + CoTaskMemFree(This->pins); BaseFilter_Destroy(&This->filter); HeapFree(GetProcessHeap(), 0, This); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/tests/amstream.c wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/tests/amstream.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/amstream/tests/amstream.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/amstream/tests/amstream.c 2015-06-28 16:51:28.000000000 +0000 @@ -26,21 +26,25 @@ #include "amstream.h" #include "vfwmsgs.h" +#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) +static void _expect_ref(IUnknown* obj, ULONG ref, int line) +{ + ULONG rc = IUnknown_AddRef(obj); + IUnknown_Release(obj); + ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); +} + static const WCHAR filenameW[] = {'t','e','s','t','.','a','v','i',0}; -static IAMMultiMediaStream* pams; static IDirectDraw7* pdd7; static IDirectDrawSurface7* pdds7; -static int create_ammultimediastream(void) +static IAMMultiMediaStream *create_ammultimediastream(void) { - return S_OK == CoCreateInstance( - &CLSID_AMMultiMediaStream, NULL, CLSCTX_INPROC_SERVER, &IID_IAMMultiMediaStream, (LPVOID*)&pams); -} - -static void release_ammultimediastream(void) -{ - IAMMultiMediaStream_Release(pams); + IAMMultiMediaStream *stream = NULL; + CoCreateInstance(&CLSID_AMMultiMediaStream, NULL, CLSCTX_INPROC_SERVER, &IID_IAMMultiMediaStream, + (void**)&stream); + return stream; } static int create_directdraw(void) @@ -89,10 +93,11 @@ static void test_openfile(void) { + IAMMultiMediaStream *pams; HRESULT hr; IGraphBuilder* pgraph; - if (!create_ammultimediastream()) + if (!(pams = create_ammultimediastream())) return; hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph); @@ -112,21 +117,24 @@ if (pgraph) IGraphBuilder_Release(pgraph); - release_ammultimediastream(); + IAMMultiMediaStream_Release(pams); } static void test_renderfile(void) { + IAMMultiMediaStream *pams; HRESULT hr; IMediaStream *pvidstream = NULL; IDirectDrawMediaStream *pddstream = NULL; IDirectDrawStreamSample *pddsample = NULL; + IDirectDrawSurface *surface; + RECT rect; - if (!create_ammultimediastream()) + if (!(pams = create_ammultimediastream())) return; if (!create_directdraw()) { - release_ammultimediastream(); + IAMMultiMediaStream_Release(pams); return; } @@ -153,31 +161,46 @@ hr = IDirectDrawMediaStream_CreateSample(pddstream, NULL, NULL, 0, &pddsample); ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + surface = NULL; + hr = IDirectDrawStreamSample_GetSurface(pddsample, &surface, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(surface == NULL, "got %p\n", surface); + IDirectDrawStreamSample_Release(pddsample); + + hr = IDirectDrawSurface7_QueryInterface(pdds7, &IID_IDirectDrawSurface, (void**)&surface); + ok(hr == S_OK, "got 0x%08x\n", hr); + + EXPECT_REF(surface, 1); + hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, NULL, 0, &pddsample); + ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + EXPECT_REF(surface, 2); + IDirectDrawStreamSample_Release(pddsample); + IDirectDrawSurface_Release(surface); + error: - if (pddsample) - IDirectDrawStreamSample_Release(pddsample); if (pddstream) IDirectDrawMediaStream_Release(pddstream); if (pvidstream) IMediaStream_Release(pvidstream); release_directdraw(); - release_ammultimediastream(); + IAMMultiMediaStream_Release(pams); } static void test_media_streams(void) { + IAMMultiMediaStream *pams; HRESULT hr; IMediaStream *video_stream = NULL; IMediaStream *audio_stream = NULL; IMediaStream *dummy_stream; IMediaStreamFilter* media_stream_filter = NULL; - if (!create_ammultimediastream()) + if (!(pams = create_ammultimediastream())) return; if (!create_directdraw()) { - release_ammultimediastream(); + IAMMultiMediaStream_Release(pams); return; } @@ -424,7 +447,111 @@ IMediaStreamFilter_Release(media_stream_filter); release_directdraw(); - release_ammultimediastream(); + IAMMultiMediaStream_Release(pams); +} + +static void test_IDirectDrawStreamSample(void) +{ + DDSURFACEDESC desc = { sizeof(desc) }; + IAMMultiMediaStream *pams; + HRESULT hr; + IMediaStream *pvidstream = NULL; + IDirectDrawMediaStream *pddstream = NULL; + IDirectDrawStreamSample *pddsample = NULL; + IDirectDrawSurface7 *surface7; + IDirectDrawSurface *surface, *surface2; + IDirectDraw *ddraw, *ddraw2; + IDirectDraw7 *ddraw7; + RECT rect; + + if (!(pams = create_ammultimediastream())) + return; + if (!create_directdraw()) + { + IAMMultiMediaStream_Release(pams); + return; + } + + hr = IAMMultiMediaStream_Initialize(pams, STREAMTYPE_READ, 0, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IAMMultiMediaStream_AddMediaStream(pams, (IUnknown*)pdd7, &MSPID_PrimaryVideo, 0, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &pvidstream); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (FAILED(hr)) goto error; + + hr = IMediaStream_QueryInterface(pvidstream, &IID_IDirectDrawMediaStream, (LPVOID*)&pddstream); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (FAILED(hr)) goto error; + + hr = IDirectDrawMediaStream_GetDirectDraw(pddstream, &ddraw); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDirectDrawMediaStream_GetDirectDraw(pddstream, &ddraw2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(ddraw == ddraw2, "got %p, %p\n", ddraw, ddraw2); + + hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw7, (void**)&ddraw7); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDirectDraw7_Release(ddraw7); + + IDirectDraw_Release(ddraw2); + IDirectDraw_Release(ddraw); + + hr = IDirectDrawMediaStream_CreateSample(pddstream, NULL, NULL, 0, &pddsample); + ok(hr == S_OK, "got 0x%08x\n", hr); + + surface = NULL; + hr = IDirectDrawStreamSample_GetSurface(pddsample, &surface, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(surface != NULL, "got %p\n", surface); + + hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void**)&surface7); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDirectDrawSurface7_Release(surface7); + + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(desc.dwWidth == 100, "width %d\n", desc.dwWidth); + ok(desc.dwHeight == 100, "height %d\n", desc.dwHeight); + ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "format flags %08x\n", desc.ddpfPixelFormat.dwFlags); + ok(desc.ddpfPixelFormat.dwRGBBitCount, "dwRGBBitCount %d\n", desc.ddpfPixelFormat.dwRGBBitCount); + IDirectDrawSurface_Release(surface); + IDirectDrawStreamSample_Release(pddsample); + + hr = IDirectDrawSurface7_QueryInterface(pdds7, &IID_IDirectDrawSurface, (void**)&surface); + ok(hr == S_OK, "got 0x%08x\n", hr); + + EXPECT_REF(surface, 1); + hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, NULL, 0, &pddsample); + ok(hr == S_OK, "got 0x%08x\n", hr); + EXPECT_REF(surface, 2); + + surface2 = NULL; + memset(&rect, 0, sizeof(rect)); + hr = IDirectDrawStreamSample_GetSurface(pddsample, &surface2, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(surface == surface2, "got %p\n", surface2); + ok(rect.right > 0 && rect.bottom > 0, "got %d, %d\n", rect.right, rect.bottom); + EXPECT_REF(surface, 3); + IDirectDrawSurface_Release(surface2); + + hr = IDirectDrawStreamSample_GetSurface(pddsample, NULL, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IDirectDrawStreamSample_Release(pddsample); + IDirectDrawSurface_Release(surface); + +error: + if (pddstream) + IDirectDrawMediaStream_Release(pddstream); + if (pvidstream) + IMediaStream_Release(pvidstream); + + release_directdraw(); + IAMMultiMediaStream_Release(pams); } START_TEST(amstream) @@ -434,6 +561,7 @@ CoInitializeEx(NULL, COINIT_MULTITHREADED); test_media_streams(); + test_IDirectDrawStreamSample(); file = CreateFileW(filenameW, 0, 0, NULL, OPEN_EXISTING, 0, NULL); if (file != INVALID_HANDLE_VALUE) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec 2015-06-28 16:51:28.000000000 +0000 @@ -45,7 +45,7 @@ @ stub RaiseFailFastException @ stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) kernel32.RegisterWaitForSingleObject @ stdcall SetConsoleTitleA(str) kernel32.SetConsoleTitleA -@ stub SetFileCompletionNotificationModes +@ stdcall SetFileCompletionNotificationModes(long long) kernel32.SetFileCompletionNotificationModes @ stdcall SetHandleCount(long) kernel32.SetHandleCount @ stdcall SetMailslotInfo(long long) kernel32.SetMailslotInfo @ stdcall SetVolumeLabelW(wstr wstr) kernel32.SetVolumeLabelW diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec 2015-06-28 16:51:28.000000000 +0000 @@ -57,7 +57,7 @@ @ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority @ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount @ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation -@ stub GetWindowsAccountDomainSid +@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid @ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken @ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser @ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec 2015-06-28 16:51:28.000000000 +0000 @@ -63,7 +63,7 @@ @ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority @ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount @ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation -@ stub GetWindowsAccountDomainSid +@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid @ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken @ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser @ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/comctl32/monthcal.c wine-staging-1.7.46~ubuntu14.10.1/dlls/comctl32/monthcal.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/comctl32/monthcal.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/comctl32/monthcal.c 2015-06-28 16:51:28.000000000 +0000 @@ -866,10 +866,16 @@ /* paint a title with buttons and month/year string */ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { - static const WCHAR fmt_monthW[] = { '%','s',' ','%','l','d',0 }; + static const WCHAR mmmmW[] = {'M','M','M','M',0}; + static const WCHAR mmmW[] = {'M','M','M',0}; + static const WCHAR mmW[] = {'M','M',0}; + static const WCHAR fmtyearW[] = {'%','l','d',0}; + static const WCHAR fmtmmW[] = {'%','0','2','d',0}; + static const WCHAR fmtmW[] = {'%','d',0}; RECT *title = &infoPtr->calendars[calIdx].title; const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month; - WCHAR buf_month[80], buf_fmt[80]; + WCHAR monthW[80], strW[80], fmtW[80], yearW[6] /* valid year range is 1601-30827 */; + int yearoffset, monthoffset, shiftX; SIZE sz; /* fill header box */ @@ -880,21 +886,65 @@ SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]); SelectObject(hdc, infoPtr->hBoldFont); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1 + st->wMonth - 1, - buf_month, countof(buf_month)); + /* draw formatted date string */ + GetDateFormatW(LOCALE_USER_DEFAULT, DATE_YEARMONTH, st, NULL, strW, countof(strW)); + DrawTextW(hdc, strW, strlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); + + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, countof(fmtW)); + wsprintfW(yearW, fmtyearW, st->wYear); + + /* month is trickier as it's possible to have different format pictures, we'll + test for M, MM, MMM, and MMMM */ + if (strstrW(fmtW, mmmmW)) + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, countof(monthW)); + else if (strstrW(fmtW, mmmW)) + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, countof(monthW)); + else if (strstrW(fmtW, mmW)) + wsprintfW(monthW, fmtmmW, st->wMonth); + else + wsprintfW(monthW, fmtmW, st->wMonth); + + /* update hit boxes */ + yearoffset = 0; + while (strW[yearoffset]) + { + if (!strncmpW(&strW[yearoffset], yearW, strlenW(yearW))) + break; + yearoffset++; + } + + monthoffset = 0; + while (strW[monthoffset]) + { + if (!strncmpW(&strW[monthoffset], monthW, strlenW(monthW))) + break; + monthoffset++; + } + + /* for left limits use offsets */ + sz.cx = 0; + if (yearoffset) + GetTextExtentPoint32W(hdc, strW, yearoffset, &sz); + infoPtr->calendars[calIdx].titleyear.left = sz.cx; + + sz.cx = 0; + if (monthoffset) + GetTextExtentPoint32W(hdc, strW, monthoffset, &sz); + infoPtr->calendars[calIdx].titlemonth.left = sz.cx; + + /* for right limits use actual string parts lengths */ + GetTextExtentPoint32W(hdc, &strW[yearoffset], strlenW(yearW), &sz); + infoPtr->calendars[calIdx].titleyear.right = infoPtr->calendars[calIdx].titleyear.left + sz.cx; - wsprintfW(buf_fmt, fmt_monthW, buf_month, st->wYear); - DrawTextW(hdc, buf_fmt, strlenW(buf_fmt), title, - DT_CENTER | DT_VCENTER | DT_SINGLELINE); - - /* update title rectangles with current month - used while testing hits */ - GetTextExtentPoint32W(hdc, buf_fmt, strlenW(buf_fmt), &sz); - infoPtr->calendars[calIdx].titlemonth.left = title->right / 2 + title->left / 2 - sz.cx / 2; - infoPtr->calendars[calIdx].titleyear.right = title->right / 2 + title->left / 2 + sz.cx / 2; - - GetTextExtentPoint32W(hdc, buf_month, strlenW(buf_month), &sz); + GetTextExtentPoint32W(hdc, monthW, strlenW(monthW), &sz); infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx; - infoPtr->calendars[calIdx].titleyear.left = infoPtr->calendars[calIdx].titlemonth.right; + + /* Finally translate rectangles to match center aligned string, + hit rectangles are relative to title rectangle before translation. */ + GetTextExtentPoint32W(hdc, strW, strlenW(strW), &sz); + shiftX = (title->right - title->left - sz.cx) / 2 + title->left; + OffsetRect(&infoPtr->calendars[calIdx].titleyear, shiftX, 0); + OffsetRect(&infoPtr->calendars[calIdx].titlemonth, shiftX, 0); } static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/comctl32/tests/propsheet.c wine-staging-1.7.46~ubuntu14.10.1/dlls/comctl32/tests/propsheet.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/comctl32/tests/propsheet.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/comctl32/tests/propsheet.c 2015-06-28 16:51:28.000000000 +0000 @@ -874,6 +874,7 @@ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); ok(r == 3, "got %d\n", r); + DestroyPropertySheetPage(hpsp[4]); DestroyWindow(hdlg); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/d2d1_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/d2d1_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/d2d1_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/d2d1_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -189,4 +189,13 @@ IDWriteRenderingParams *text_rendering_params) DECLSPEC_HIDDEN; struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStateBlock *iface) DECLSPEC_HIDDEN; +struct d2d_geometry +{ + ID2D1Geometry ID2D1Geometry_iface; + ID2D1GeometrySink ID2D1GeometrySink_iface; + LONG refcount; +}; + +void d2d_path_geometry_init(struct d2d_geometry *geometry) DECLSPEC_HIDDEN; + #endif /* __WINE_D2D1_PRIVATE_H */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/factory.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/factory.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/factory.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/factory.c 2015-06-28 16:51:28.000000000 +0000 @@ -134,11 +134,21 @@ return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory *iface, ID2D1PathGeometry *geometry) +static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory *iface, ID2D1PathGeometry **geometry) { - FIXME("iface %p, geometry %p stub!\n", iface, geometry); + struct d2d_geometry *object; - return E_NOTIMPL; + TRACE("iface %p, geometry %p.\n", iface, geometry); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + d2d_path_geometry_init(object); + + TRACE("Created path geometry %p.\n", object); + *geometry = (ID2D1PathGeometry *)&object->ID2D1Geometry_iface; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory *iface, diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/geometry.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/geometry.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/geometry.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/geometry.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,396 @@ +/* + * Copyright 2015 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include "d2d1_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d2d); + +static inline struct d2d_geometry *impl_from_ID2D1GeometrySink(ID2D1GeometrySink *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1GeometrySink_iface); +} + +static HRESULT STDMETHODCALLTYPE d2d_geometry_sink_QueryInterface(ID2D1GeometrySink *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID2D1GeometrySink) + || IsEqualGUID(iid, &IID_ID2D1SimplifiedGeometrySink) + || IsEqualGUID(iid, &IID_IUnknown)) + { + ID2D1GeometrySink_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d2d_geometry_sink_AddRef(ID2D1GeometrySink *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + + TRACE("iface %p.\n", iface); + + return ID2D1Geometry_AddRef(&geometry->ID2D1Geometry_iface); +} + +static ULONG STDMETHODCALLTYPE d2d_geometry_sink_Release(ID2D1GeometrySink *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + + TRACE("iface %p.\n", iface); + + return ID2D1Geometry_Release(&geometry->ID2D1Geometry_iface); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_SetFillMode(ID2D1GeometrySink *iface, D2D1_FILL_MODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_SetSegmentFlags(ID2D1GeometrySink *iface, D2D1_PATH_SEGMENT flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *iface, + D2D1_POINT_2F start_point, D2D1_FIGURE_BEGIN figure_begin) +{ + FIXME("iface %p, start_point {%.8e, %.8e}, figure_begin %#x stub!\n", + iface, start_point.x, start_point.y, figure_begin); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *iface, + const D2D1_POINT_2F *points, UINT32 count) +{ + FIXME("iface %p, points %p, count %u stub!\n", iface, points, count); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddBeziers(ID2D1GeometrySink *iface, + const D2D1_BEZIER_SEGMENT *beziers, UINT32 count) +{ + FIXME("iface %p, beziers %p, count %u stub!\n", iface, beziers, count); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_EndFigure(ID2D1GeometrySink *iface, D2D1_FIGURE_END figure_end) +{ + FIXME("iface %p, figure_end %#x stub!\n", iface, figure_end); +} + +static HRESULT STDMETHODCALLTYPE d2d_geometry_sink_Close(ID2D1GeometrySink *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddLine(ID2D1GeometrySink *iface, D2D1_POINT_2F point) +{ + TRACE("iface %p, point {%.8e, %.8e}.\n", iface, point.x, point.y); + + d2d_geometry_sink_AddLines(iface, &point, 1); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddBezier(ID2D1GeometrySink *iface, const D2D1_BEZIER_SEGMENT *bezier) +{ + TRACE("iface %p, bezier %p.\n", iface, bezier); + + d2d_geometry_sink_AddBeziers(iface, bezier, 1); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddQuadraticBezier(ID2D1GeometrySink *iface, + const D2D1_QUADRATIC_BEZIER_SEGMENT *bezier) +{ + TRACE("iface %p, bezier %p.\n", iface, bezier); + + ID2D1GeometrySink_AddQuadraticBeziers(iface, bezier, 1); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddQuadraticBeziers(ID2D1GeometrySink *iface, + const D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, UINT32 bezier_count) +{ + FIXME("iface %p, beziers %p, bezier_count %u stub!\n", iface, beziers, bezier_count); +} + +static void STDMETHODCALLTYPE d2d_geometry_sink_AddArc(ID2D1GeometrySink *iface, const D2D1_ARC_SEGMENT *arc) +{ + FIXME("iface %p, arc %p stub!\n", iface, arc); +} + +struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl = +{ + d2d_geometry_sink_QueryInterface, + d2d_geometry_sink_AddRef, + d2d_geometry_sink_Release, + d2d_geometry_sink_SetFillMode, + d2d_geometry_sink_SetSegmentFlags, + d2d_geometry_sink_BeginFigure, + d2d_geometry_sink_AddLines, + d2d_geometry_sink_AddBeziers, + d2d_geometry_sink_EndFigure, + d2d_geometry_sink_Close, + d2d_geometry_sink_AddLine, + d2d_geometry_sink_AddBezier, + d2d_geometry_sink_AddQuadraticBezier, + d2d_geometry_sink_AddQuadraticBeziers, + d2d_geometry_sink_AddArc, +}; + +static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID2D1PathGeometry) + || IsEqualGUID(iid, &IID_ID2D1Geometry) + || IsEqualGUID(iid, &IID_ID2D1Resource) + || IsEqualGUID(iid, &IID_IUnknown)) + { + ID2D1PathGeometry_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d2d_path_geometry_AddRef(ID2D1PathGeometry *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface); + ULONG refcount = InterlockedIncrement(&geometry->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d2d_path_geometry_Release(ID2D1PathGeometry *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface); + ULONG refcount = InterlockedDecrement(&geometry->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, geometry); + + return refcount; +} + +static void STDMETHODCALLTYPE d2d_path_geometry_GetFactory(ID2D1PathGeometry *iface, ID2D1Factory **factory) +{ + FIXME("iface %p, factory %p stub!\n", iface, factory); + + *factory = NULL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetBounds(ID2D1PathGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, D2D1_RECT_F *bounds) +{ + FIXME("iface %p, transform %p, bounds %p stub!\n", iface, transform, bounds); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetWidenedBounds(ID2D1PathGeometry *iface, float stroke_width, + ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_RECT_F *bounds) +{ + FIXME("iface %p, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, bounds %p stub!\n", + iface, stroke_width, stroke_style, transform, tolerance, bounds); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_StrokeContainsPoint(ID2D1PathGeometry *iface, + D2D1_POINT_2F point, float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, + float tolerance, BOOL *contains) +{ + FIXME("iface %p, point {%.8e, %.8e}, stroke_width %.8e, stroke_style %p, " + "transform %p, tolerance %.8e, contains %p stub!\n", + iface, point.x, point.y, stroke_width, stroke_style, transform, tolerance, contains); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_FillContainsPoint(ID2D1PathGeometry *iface, + D2D1_POINT_2F point, const D2D1_MATRIX_3X2_F *transform, float tolerance, BOOL *contains) +{ + FIXME("iface %p, point {%.8e, %.8e}, transform %p, tolerance %.8e, contains %p stub!\n", + iface, point.x, point.y, transform, tolerance, contains); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CompareWithGeometry(ID2D1PathGeometry *iface, + ID2D1Geometry *geometry, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_GEOMETRY_RELATION *relation) +{ + FIXME("iface %p, geometry %p, transform %p, tolerance %.8e, relation %p stub!\n", + iface, geometry, transform, tolerance, relation); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Simplify(ID2D1PathGeometry *iface, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION option, const D2D1_MATRIX_3X2_F *transform, float tolerance, + ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, option %#x, transform %p, tolerance %.8e, sink %p stub!\n", + iface, option, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Tessellate(ID2D1PathGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1TessellationSink *sink) +{ + FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CombineWithGeometry(ID2D1PathGeometry *iface, + ID2D1Geometry *geometry, D2D1_COMBINE_MODE combine_mode, const D2D1_MATRIX_3X2_F *transform, + float tolerance, ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, geometry %p, combine_mode %#x, transform %p, tolerance %.8e, sink %p stub!\n", + iface, geometry, combine_mode, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Outline(ID2D1PathGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeArea(ID2D1PathGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, float *area) +{ + FIXME("iface %p, transform %p, tolerance %.8e, area %p stub!\n", iface, transform, tolerance, area); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeLength(ID2D1PathGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, float *length) +{ + FIXME("iface %p, transform %p, tolerance %.8e, length %p stub!\n", iface, transform, tolerance, length); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputePointAtLength(ID2D1PathGeometry *iface, float length, + const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_POINT_2F *point, D2D1_POINT_2F *tangent) +{ + FIXME("iface %p, length %.8e, transform %p, tolerance %.8e, point %p, tangent %p stub!\n", + iface, length, transform, tolerance, point, tangent); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Widen(ID2D1PathGeometry *iface, float stroke_width, + ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, float tolerance, + ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, sink %p stub!\n", + iface, stroke_width, stroke_style, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Open(ID2D1PathGeometry *iface, ID2D1GeometrySink **sink) +{ + struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface); + + TRACE("iface %p, sink %p.\n", iface, sink); + + *sink = &geometry->ID2D1GeometrySink_iface; + ID2D1GeometrySink_AddRef(*sink); + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Stream(ID2D1PathGeometry *iface, ID2D1GeometrySink *sink) +{ + FIXME("iface %p, sink %p stub!\n", iface, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetSegmentCount(ID2D1PathGeometry *iface, UINT32 *count) +{ + FIXME("iface %p, count %p stub!\n", iface, count); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetFigureCount(ID2D1PathGeometry *iface, UINT32 *count) +{ + FIXME("iface %p, count %p stub!\n", iface, count); + + return E_NOTIMPL; +} + +static const struct ID2D1PathGeometryVtbl d2d_path_geometry_vtbl = +{ + d2d_path_geometry_QueryInterface, + d2d_path_geometry_AddRef, + d2d_path_geometry_Release, + d2d_path_geometry_GetFactory, + d2d_path_geometry_GetBounds, + d2d_path_geometry_GetWidenedBounds, + d2d_path_geometry_StrokeContainsPoint, + d2d_path_geometry_FillContainsPoint, + d2d_path_geometry_CompareWithGeometry, + d2d_path_geometry_Simplify, + d2d_path_geometry_Tessellate, + d2d_path_geometry_CombineWithGeometry, + d2d_path_geometry_Outline, + d2d_path_geometry_ComputeArea, + d2d_path_geometry_ComputeLength, + d2d_path_geometry_ComputePointAtLength, + d2d_path_geometry_Widen, + d2d_path_geometry_Open, + d2d_path_geometry_Stream, + d2d_path_geometry_GetSegmentCount, + d2d_path_geometry_GetFigureCount, +}; + +void d2d_path_geometry_init(struct d2d_geometry *geometry) +{ + geometry->ID2D1Geometry_iface.lpVtbl = (ID2D1GeometryVtbl *)&d2d_path_geometry_vtbl; + geometry->ID2D1GeometrySink_iface.lpVtbl = &d2d_geometry_sink_vtbl; + geometry->refcount = 1; +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -6,6 +6,7 @@ bitmap.c \ brush.c \ factory.c \ + geometry.c \ mesh.c \ render_target.c \ state_block.c \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/render_target.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/render_target.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d2d1/render_target.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d2d1/render_target.c 2015-06-28 16:51:28.000000000 +0000 @@ -1293,12 +1293,27 @@ float baseline_origin_x, float baseline_origin_y, DWRITE_MEASURING_MODE measuring_mode, const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *desc, IUnknown *effect) { - FIXME("iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, " - "measuring_mode %#x, glyph_run %p, desc %p, effect %p stub!\n", + struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface); + D2D1_POINT_2F baseline_origin = {baseline_origin_x, baseline_origin_y}; + struct d2d_draw_text_layout_ctx *context = ctx; + + TRACE("iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, " + "measuring_mode %#x, glyph_run %p, desc %p, effect %p.\n", iface, ctx, baseline_origin_x, baseline_origin_y, measuring_mode, glyph_run, desc, effect); - return E_NOTIMPL; + if (desc) + FIXME("Ignoring glyph run description %p.\n", desc); + if (effect) + FIXME("Ignoring effect %p.\n", effect); + if (context->options) + FIXME("Ignoring options %#x.\n", context->options); + + TRACE("%s\n", debugstr_wn(desc->string, desc->stringLength)); + ID2D1RenderTarget_DrawGlyphRun(&render_target->ID2D1RenderTarget_iface, + baseline_origin, glyph_run, context->brush, measuring_mode); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRenderer *iface, void *ctx, diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d10core/buffer.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d10core/buffer.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d10core/buffer.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d10core/buffer.c 2015-06-28 16:51:28.000000000 +0000 @@ -233,10 +233,8 @@ buffer->refcount = 1; wined3d_private_store_init(&buffer->private_store); - FIXME("Implement DXGI<->wined3d usage conversion\n"); - wined3d_desc.byte_width = desc->ByteWidth; - wined3d_desc.usage = desc->Usage; + wined3d_desc.usage = wined3d_usage_from_d3d10core(0, desc->Usage); wined3d_desc.bind_flags = desc->BindFlags; wined3d_desc.cpu_access_flags = desc->CPUAccessFlags; wined3d_desc.misc_flags = desc->MiscFlags; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d8/tests/visual.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d8/tests/visual.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d8/tests/visual.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d8/tests/visual.c 2015-06-28 16:51:28.000000000 +0000 @@ -6475,7 +6475,7 @@ {decl, &vs1, &ps1, D3DFVF_XYZ, 32, 32}, {NULL, &novs, &ps1, D3DFVF_XYZ, 32, 62}, {decl, &vs1, &nops, D3DFVF_XYZ, 32, 32}, - /* {NULL, &novs, &nops, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 48}, */ + {NULL, &novs, &nops, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 48}, {decl_psize, &vs1_psize, &ps1, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 24}, }; static const struct diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d9/tests/visual.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d9/tests/visual.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3d9/tests/visual.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3d9/tests/visual.c 2015-06-28 16:51:28.000000000 +0000 @@ -10325,7 +10325,7 @@ {&vs1, &ps2_zw, D3DFVF_XYZ, 32, 32, TRUE, FALSE}, {&vs3, &ps3, D3DFVF_XYZ, 32, 32, FALSE, TRUE}, {&vs3, &ps3_zw, D3DFVF_XYZ, 32, 32, TRUE, FALSE}, - /* {&novs, &nops, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 48, FALSE, FALSE}, */ + {&novs, &nops, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 48, FALSE, FALSE}, {&vs1_psize, &ps1, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 24, FALSE, FALSE}, {&vs3_psize, &ps3, D3DFVF_XYZ | D3DFVF_PSIZE, 48, 24, FALSE, TRUE}, }; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/bytecodewriter.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/bytecodewriter.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/bytecodewriter.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/bytecodewriter.c 2015-06-28 16:51:28.000000000 +0000 @@ -571,6 +571,13 @@ } } +static DWORD d3dsp_register( D3DSHADER_PARAM_REGISTER_TYPE type, DWORD num ) +{ + return ((type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK) | + ((type << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2) | + (num & D3DSP_REGNUM_MASK); /* No shift */ +} + /****************************************************** * Implementation of the writer functions starts here * ******************************************************/ @@ -611,10 +618,7 @@ static void write_const(struct constant **consts, int num, DWORD opcode, DWORD reg_type, struct bytecode_buffer *buffer, BOOL len) { int i; DWORD instr_def = opcode; - const DWORD reg = (1<<31) | - ((reg_type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK) | - ((reg_type << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2) | - D3DSP_WRITEMASK_ALL; + const DWORD reg = (1<<31) | d3dsp_register( reg_type, 0 ) | D3DSP_WRITEMASK_ALL; if(len) { if(opcode == D3DSIO_DEFB) @@ -849,41 +853,28 @@ } static DWORD map_vs_output(struct bc_writer *This, DWORD regnum, DWORD mask, DWORD *has_components) { - DWORD token = 0; DWORD i; *has_components = TRUE; if(regnum == This->oPos_regnum) { - token |= (D3DSPR_RASTOUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= D3DSRO_POSITION & D3DSP_REGNUM_MASK; /* No shift */ - return token; + return d3dsp_register( D3DSPR_RASTOUT, D3DSRO_POSITION ); } if(regnum == This->oFog_regnum && mask == This->oFog_mask) { - token |= (D3DSPR_RASTOUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= D3DSRO_FOG & D3DSP_REGNUM_MASK; /* No shift */ - token |= D3DSP_WRITEMASK_ALL; *has_components = FALSE; - return token; + return d3dsp_register( D3DSPR_RASTOUT, D3DSRO_FOG ) | D3DSP_WRITEMASK_ALL; } if(regnum == This->oPts_regnum && mask == This->oPts_mask) { - token |= (D3DSPR_RASTOUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= D3DSRO_POINT_SIZE & D3DSP_REGNUM_MASK; /* No shift */ - token |= D3DSP_WRITEMASK_ALL; *has_components = FALSE; - return token; + return d3dsp_register( D3DSPR_RASTOUT, D3DSRO_POINT_SIZE ) | D3DSP_WRITEMASK_ALL; } for(i = 0; i < 2; i++) { if(regnum == This->oD_regnum[i]) { - token |= (D3DSPR_ATTROUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= i & D3DSP_REGNUM_MASK; /* No shift */ - return token; + return d3dsp_register( D3DSPR_ATTROUT, i ); } } for(i = 0; i < 8; i++) { if(regnum == This->oT_regnum[i]) { - token |= (D3DSPR_TEXCRDOUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= i & D3DSP_REGNUM_MASK; /* No shift */ - return token; + return d3dsp_register( D3DSPR_TEXCRDOUT, i ); } } @@ -922,8 +913,7 @@ case BWRITERSPR_INPUT: case BWRITERSPR_TEMP: case BWRITERSPR_CONST: - token |= (reg->type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( reg->type, reg->regnum ); has_wmask = TRUE; break; @@ -933,8 +923,7 @@ This->state = E_INVALIDARG; return; } - token |= (D3DSPR_ADDR << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( D3DSPR_ADDR, 0 ); has_wmask = TRUE; break; @@ -949,9 +938,7 @@ This->state = E_INVALIDARG; return; } - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( D3DSPR_PREDICATE, 0 ); has_wmask = TRUE; break; @@ -1015,8 +1002,7 @@ case BWRITERSPR_TEMP: case BWRITERSPR_CONST: case BWRITERSPR_ADDR: - token |= (reg->type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( reg->type, reg->regnum ); if(reg->rel_reg) { if(reg->rel_reg->type != BWRITERSPR_ADDR || reg->rel_reg->regnum != 0 || @@ -1053,48 +1039,37 @@ } static DWORD map_ps13_temp(struct bc_writer *This, const struct shader_reg *reg) { - DWORD token = 0; if(reg->regnum == T0_REG) { - token |= (D3DSPR_TEXTURE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ + return d3dsp_register( D3DSPR_TEXTURE, 0 ); } else if(reg->regnum == T1_REG) { - token |= (D3DSPR_TEXTURE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= 1 & D3DSP_REGNUM_MASK; /* No shift */ + return d3dsp_register( D3DSPR_TEXTURE, 1 ); } else if(reg->regnum == T2_REG) { - token |= (D3DSPR_TEXTURE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= 2 & D3DSP_REGNUM_MASK; /* No shift */ + return d3dsp_register( D3DSPR_TEXTURE, 2 ); } else if(reg->regnum == T3_REG) { - token |= (D3DSPR_TEXTURE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= 3 & D3DSP_REGNUM_MASK; /* No shift */ + return d3dsp_register( D3DSPR_TEXTURE, 3 ); } else { - token |= (D3DSPR_TEMP << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + return d3dsp_register( D3DSPR_TEMP, reg->regnum ); } - return token; } static DWORD map_ps_input(struct bc_writer *This, const struct shader_reg *reg) { - DWORD i, token = 0; + DWORD i; /* Map color interpolators */ for(i = 0; i < 2; i++) { if(reg->regnum == This->v_regnum[i]) { - token |= (D3DSPR_INPUT << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= i & D3DSP_REGNUM_MASK; /* No shift */ - return token; + return d3dsp_register( D3DSPR_INPUT, i ); } } for(i = 0; i < 8; i++) { if(reg->regnum == This->t_regnum[i]) { - token |= (D3DSPR_TEXTURE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= i & D3DSP_REGNUM_MASK; /* No shift */ - return token; + return d3dsp_register( D3DSPR_TEXTURE, i ); } } WARN("Invalid ps 1/2 varying\n"); This->state = E_INVALIDARG; - return token; + return 0; } static void ps_1_0123_srcreg(struct bc_writer *This, const struct shader_reg *reg, @@ -1120,8 +1095,7 @@ break; case BWRITERSPR_CONST: /* Can be mapped 1:1 */ - token |= (reg->type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( reg->type, reg->regnum ); break; default: @@ -1423,8 +1397,7 @@ /* Can be mapped 1:1 */ case BWRITERSPR_TEMP: case BWRITERSPR_CONST: - token |= (reg->type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( reg->type, reg->regnum ); break; default: @@ -1458,8 +1431,7 @@ switch(reg->type) { case BWRITERSPR_TEMP: /* 1:1 mapping */ - token |= (reg->type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( reg->type, reg->regnum ); break; /* For texkill */ @@ -1640,9 +1612,7 @@ case BWRITERSPR_CONSTBOOL: case BWRITERSPR_LABEL: d3d9reg = d3d9_register(reg->type); - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( d3d9reg, reg->regnum ); break; case BWRITERSPR_LOOP: @@ -1651,9 +1621,7 @@ This->state = E_INVALIDARG; return; } - token |= (D3DSPR_LOOP << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (D3DSPR_LOOP << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( D3DSPR_LOOP, 0 ); break; case BWRITERSPR_PREDICATE: @@ -1667,10 +1635,7 @@ This->state = E_INVALIDARG; return; } - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ - + token |= d3dsp_register( D3DSPR_PREDICATE, 0 ); break; default: @@ -1838,10 +1803,7 @@ DWORD i; DWORD instr_dcl = D3DSIO_DCL | (2 << D3DSI_INSTLENGTH_SHIFT); DWORD token; - const DWORD reg = (1<<31) | - ((D3DSPR_SAMPLER << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK) | - ((D3DSPR_SAMPLER << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2) | - D3DSP_WRITEMASK_ALL; + const DWORD reg = (1<<31) | d3dsp_register( D3DSPR_SAMPLER, 0 ) | D3DSP_WRITEMASK_ALL; for(i = 0; i < shader->num_samplers; i++) { /* Write the DCL instruction */ @@ -1896,9 +1858,7 @@ case BWRITERSPR_LABEL: case BWRITERSPR_DEPTHOUT: d3d9reg = d3d9_register(reg->type); - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( d3d9reg, reg->regnum ); break; case BWRITERSPR_PREDICATE: @@ -1911,9 +1871,7 @@ reg->regnum); This->state = E_INVALIDARG; } - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= 0 & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( D3DSPR_PREDICATE, 0 ); break; default: @@ -1946,9 +1904,7 @@ case BWRITERSPR_COLOROUT: case BWRITERSPR_DEPTHOUT: d3d9reg = d3d9_register(reg->type); - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( d3d9reg, reg->regnum ); break; case BWRITERSPR_PREDICATE: @@ -1956,9 +1912,7 @@ WARN("Predicate register not supported in ps_2_0\n"); This->state = E_INVALIDARG; } - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (D3DSPR_PREDICATE << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ + token |= d3dsp_register( D3DSPR_PREDICATE, reg->regnum ); break; /* texkill uses the input register as a destination parameter */ @@ -2113,10 +2067,7 @@ DWORD d3d9reg; d3d9reg = d3d9_register(reg->type); - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; - + token |= d3dsp_register( d3d9reg, reg->regnum ); token |= d3d9_swizzle(reg->u.swizzle) & D3DVS_SWIZZLE_MASK; token |= d3d9_srcmod(reg->srcmod); @@ -2166,12 +2117,8 @@ } d3d9reg = d3d9_register(reg->type); - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK; - token |= (d3d9reg << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2; - token |= reg->regnum & D3DSP_REGNUM_MASK; /* No shift */ - + token |= d3dsp_register( d3d9reg, reg->regnum ); token |= d3d9_dstmod(mod); - token |= d3d9_writemask(reg->u.writemask); put_dword(buffer, token); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_43_main.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_43_main.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_43_main.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_43_main.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Direct3D shader compiler main file - * - * Copyright 2010 Matteo Bruni for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#include "config.h" - -#include - -#include "windef.h" -#include "winbase.h" - -#include "d3dcompiler_private.h" - -BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(inst); - break; - } - return TRUE; -} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/d3dcompiler_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -747,12 +747,19 @@ #define HLSL_MODIFIERS_COMPARISON_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR) +struct reg_reservation +{ + enum bwritershader_param_register_type type; + DWORD regnum; +}; + struct hlsl_ir_var { struct hlsl_ir_node node; const char *name; const char *semantic; unsigned int modifiers; + const struct reg_reservation *reg_reservation; struct list scope_entry; struct hlsl_var_allocation *allocation; @@ -961,9 +968,16 @@ struct hlsl_type *type; const char *name; const char *semantic; + const struct reg_reservation *reg_reservation; unsigned int modifiers; }; +struct parse_colon_attribute +{ + const char *semantic; + struct reg_reservation *reg_reservation; +}; + struct parse_variable_def { struct list entry; @@ -971,7 +985,8 @@ char *name; unsigned int array_size; - char *semantic; + const char *semantic; + struct reg_reservation *reg_reservation; struct list *initializer; }; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/hlsl.y wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/hlsl.y --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/hlsl.y 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/hlsl.y 2015-06-28 16:51:28.000000000 +0000 @@ -597,6 +597,7 @@ var->name = v->name; var->modifiers = modifiers; var->semantic = v->semantic; + var->reg_reservation = v->reg_reservation; debug_dump_decl(type, modifiers, v->name, v->loc.line); if (hlsl_ctx.cur_scope == hlsl_ctx.globals) @@ -822,6 +823,7 @@ decl->node.loc = *loc; decl->name = param->name; decl->semantic = param->semantic; + decl->reg_reservation = param->reg_reservation; decl->modifiers = param->modifiers; if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE)) @@ -833,6 +835,48 @@ return TRUE; } +static struct reg_reservation *parse_reg_reservation(const char *reg_string) +{ + struct reg_reservation *reg_res; + enum bwritershader_param_register_type type; + DWORD regnum = 0; + + switch (reg_string[0]) + { + case 'c': + type = BWRITERSPR_CONST; + break; + case 'i': + type = BWRITERSPR_CONSTINT; + break; + case 'b': + type = BWRITERSPR_CONSTBOOL; + break; + case 's': + type = BWRITERSPR_SAMPLER; + break; + default: + FIXME("Unsupported register type.\n"); + return NULL; + } + + if (!sscanf(reg_string + 1, "%u", ®num)) + { + FIXME("Unsupported register reservation syntax.\n"); + return NULL; + } + + reg_res = d3dcompiler_alloc(sizeof(*reg_res)); + if (!reg_res) + { + ERR("Out of memory.\n"); + return NULL; + } + reg_res->type = type; + reg_res->regnum = regnum; + return reg_res; +} + static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tree *funcs, char *name, struct list *params, BOOL exact_signature) { @@ -879,6 +923,8 @@ struct parse_if_body if_body; enum parse_unary_op unary_op; enum parse_assign_op assign_op; + struct reg_reservation *reg_reservation; + struct parse_colon_attribute colon_attribute; } %token KW_BLENDSTATE @@ -1016,7 +1062,9 @@ %type func_prototype %type fields_list %type parameter +%type colon_attribute %type semantic +%type register_opt %type variable_def %type variables_def %type variables_def_optional @@ -1224,7 +1272,7 @@ pop_scope(&hlsl_ctx); } -func_prototype: var_modifiers type var_identifier '(' parameters ')' semantic +func_prototype: var_modifiers type var_identifier '(' parameters ')' colon_attribute { if (get_variable(hlsl_ctx.globals, $3)) { @@ -1232,12 +1280,17 @@ HLSL_LEVEL_ERROR, "redefinition of '%s'\n", $3); return 1; } - if ($2->base_type == HLSL_TYPE_VOID && $7) + if ($2->base_type == HLSL_TYPE_VOID && $7.semantic) { hlsl_report_message(hlsl_ctx.source_file, @7.first_line, @7.first_column, HLSL_LEVEL_ERROR, "void function with a semantic"); } + if ($7.reg_reservation) + { + FIXME("Unexpected register reservation for a function.\n"); + d3dcompiler_free($7.reg_reservation); + } $$.decl = new_func_decl($2, $5); if (!$$.decl) { @@ -1245,7 +1298,7 @@ return -1; } $$.name = $3; - $$.decl->semantic = $7; + $$.decl->semantic = $7.semantic; set_location(&$$.decl->node.loc, &@3); } @@ -1268,15 +1321,42 @@ var_identifier: VAR_IDENTIFIER | NEW_IDENTIFIER -semantic: /* Empty */ +colon_attribute: /* Empty */ { - $$ = NULL; + $$.semantic = NULL; + $$.reg_reservation = NULL; + } + | semantic + { + $$.semantic = $1; + $$.reg_reservation = NULL; + } + | register_opt + { + $$.semantic = NULL; + $$.reg_reservation = $1; } - | ':' any_identifier + +semantic: ':' any_identifier { $$ = $2; } + /* FIXME: Writemasks */ +register_opt: ':' KW_REGISTER '(' any_identifier ')' + { + $$ = parse_reg_reservation($4); + d3dcompiler_free($4); + } + | ':' KW_REGISTER '(' any_identifier ',' any_identifier ')' + { + FIXME("Ignoring shader target %s in a register reservation.\n", debugstr_a($4)); + d3dcompiler_free($4); + + $$ = parse_reg_reservation($6); + d3dcompiler_free($6); + } + parameters: scope_start { $$ = d3dcompiler_alloc(sizeof(*$$)); @@ -1315,13 +1395,14 @@ } } -parameter: input_mods var_modifiers type any_identifier semantic +parameter: input_mods var_modifiers type any_identifier colon_attribute { $$.modifiers = $1 ? $1 : HLSL_MODIFIER_IN; $$.modifiers |= $2; $$.type = $3; $$.name = $4; - $$.semantic = $5; + $$.semantic = $5.semantic; + $$.reg_reservation = $5.reg_reservation; } input_mods: /* Empty */ @@ -1526,22 +1607,24 @@ list_add_tail($$, &$3->entry); } -variable_def: any_identifier array semantic +variable_def: any_identifier array colon_attribute { $$ = d3dcompiler_alloc(sizeof(*$$)); set_location(&$$->loc, &@1); $$->name = $1; $$->array_size = $2; - $$->semantic = $3; + $$->semantic = $3.semantic; + $$->reg_reservation = $3.reg_reservation; } - | any_identifier array semantic '=' complex_initializer + | any_identifier array colon_attribute '=' complex_initializer { TRACE("Declaration with initializer.\n"); $$ = d3dcompiler_alloc(sizeof(*$$)); set_location(&$$->loc, &@1); $$->name = $1; $$->array_size = $2; - $$->semantic = $3; + $$->semantic = $3.semantic; + $$->reg_reservation = $3.reg_reservation; $$->initializer = $5; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/main.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/main.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/main.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Direct3D shader compiler main file + * + * Copyright 2010 Matteo Bruni for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" + +#include "d3dcompiler_private.h" + +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(inst); + break; + } + return TRUE; +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -8,7 +8,7 @@ blob.c \ bytecodewriter.c \ compiler.c \ - d3dcompiler_43_main.c \ + main.c \ reflection.c \ utils.c diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/utils.c wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/utils.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_43/utils.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_43/utils.c 2015-06-28 16:51:28.000000000 +0000 @@ -802,6 +802,7 @@ { d3dcompiler_free((void *)decl->name); d3dcompiler_free((void *)decl->semantic); + d3dcompiler_free((void *)decl->reg_reservation); d3dcompiler_free(decl); } @@ -1584,8 +1585,31 @@ type = left->data_type; else { - FIXME("Assignments with writemasks not supported yet.\n"); - type = NULL; + unsigned int dimx = 0; + DWORD bitmask; + enum hlsl_type_class type_class; + + if (left->data_type->type > HLSL_CLASS_LAST_NUMERIC) + { + hlsl_report_message(left->loc.file, left->loc.line, left->loc.col, HLSL_LEVEL_ERROR, + "writemask on a non scalar/vector/matrix type"); + d3dcompiler_free(assign); + return NULL; + } + bitmask = writemask & ((1 << left->data_type->dimx) - 1); + while (bitmask) + { + if (bitmask & 1) + dimx++; + bitmask >>= 1; + } + if (left->data_type->type == HLSL_CLASS_MATRIX) + FIXME("Assignments with writemasks and matrices on lhs are not supported yet.\n"); + if (dimx == 1) + type_class = HLSL_CLASS_SCALAR; + else + type_class = left->data_type->type; + type = new_hlsl_type(NULL, type_class, left->data_type->base_type, dimx, 1); } assign->node.type = HLSL_IR_ASSIGNMENT; assign->node.loc = left->loc; @@ -2479,6 +2503,22 @@ if (func_entry) { func = WINE_RB_ENTRY_VALUE(func_entry, struct hlsl_ir_function, entry); + if (intrinsic != func->intrinsic) + { + if (intrinsic) + { + ERR("Redeclaring a user defined function as an intrinsic.\n"); + return; + } + TRACE("Function %s redeclared as a user defined function.\n", debugstr_a(name)); + func->intrinsic = intrinsic; + wine_rb_destroy(&func->overloads, free_function_decl_rb, NULL); + if (wine_rb_init(&func->overloads, &hlsl_ir_function_decl_rb_funcs) == -1) + { + ERR("Failed to initialize function rbtree.\n"); + return; + } + } decl->func = func; if ((old_entry = wine_rb_get(&func->overloads, decl->parameters))) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/d3dcompiler_46.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/d3dcompiler_46.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/d3dcompiler_46.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/d3dcompiler_46.spec 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,25 @@ +@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) +@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) +@ stub D3DCompile2 +@ stub D3DCompileFromFile +@ stub D3DCompressShaders +@ stdcall D3DCreateBlob(long ptr) +@ stub D3DDecompressShaders +@ stdcall D3DDisassemble(ptr long long ptr ptr) +@ stdcall D3DDisassemble10Effect(ptr long ptr) d3dcompiler_43.D3DDisassemble10Effect +@ stub D3DDisassemble11Trace +@ stub D3DDisassembleRegion +@ stdcall D3DGetBlobPart(ptr long long long ptr) +@ stdcall D3DGetDebugInfo(ptr long ptr) +@ stdcall D3DGetInputAndOutputSignatureBlob(ptr long ptr) +@ stdcall D3DGetInputSignatureBlob(ptr long ptr) +@ stdcall D3DGetOutputSignatureBlob(ptr long ptr) +@ stub D3DGetTraceInstructionOffsets +@ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr) +@ stub D3DReadFileToBlob +@ stdcall D3DReflect(ptr long ptr ptr) +@ stub D3DReturnFailure1 +@ stub D3DSetBlobPart +@ stdcall D3DStripShader(ptr long long ptr) +@ stub D3DWriteBlobToFile +@ stub DebugSetMute diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,24 @@ +MODULE = d3dcompiler_46.dll +IMPORTS = dxguid uuid +EXTRALIBS = $(LIBWPP) +EXTRADEFS = -DD3D_COMPILER_VERSION=46 +PARENTSRC = ../d3dcompiler_43 + +C_SRCS = \ + asmparser.c \ + blob.c \ + bytecodewriter.c \ + compiler.c \ + main.c \ + reflection.c \ + utils.c + +LEX_SRCS = \ + asmshader.l \ + hlsl.l + +BISON_SRCS = \ + asmshader.y \ + hlsl.y + +RC_SRCS = version.rc diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/version.rc wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/version.rc --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_46/version.rc 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_46/version.rc 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#define WINE_FILEDESCRIPTION_STR "Wine D3DCompiler" +#define WINE_FILENAME_STR "d3dcompiler_46.dll" +#define WINE_FILEVERSION 9,30,9200,20789 +#define WINE_FILEVERSION_STR "9.30.9200.20789" +#define WINE_PRODUCTVERSION 9,30,9200,20789 +#define WINE_PRODUCTVERSION_STR "9.30.9200.20789" + +#include "wine/wine_common_ver.rc" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/d3dcompiler_47.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/d3dcompiler_47.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/d3dcompiler_47.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/d3dcompiler_47.spec 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,29 @@ +@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) +@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) +@ stub D3DCompile2 +@ stub D3DCompileFromFile +@ stub D3DCompressShaders +@ stdcall D3DCreateBlob(long ptr) +@ stub D3DCreateFunctionLinkingGraph +@ stub D3DCreateLinker +@ stub D3DDecompressShaders +@ stdcall D3DDisassemble(ptr long long ptr ptr) +@ stdcall D3DDisassemble10Effect(ptr long ptr) d3dcompiler_43.D3DDisassemble10Effect +@ stub D3DDisassemble11Trace +@ stub D3DDisassembleRegion +@ stdcall D3DGetBlobPart(ptr long long long ptr) +@ stdcall D3DGetDebugInfo(ptr long ptr) +@ stdcall D3DGetInputAndOutputSignatureBlob(ptr long ptr) +@ stdcall D3DGetInputSignatureBlob(ptr long ptr) +@ stdcall D3DGetOutputSignatureBlob(ptr long ptr) +@ stub D3DGetTraceInstructionOffsets +@ stub D3DLoadModule +@ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr) +@ stub D3DReadFileToBlob +@ stdcall D3DReflect(ptr long ptr ptr) +@ stub D3DReflectLibrary +@ stub D3DReturnFailure1 +@ stub D3DSetBlobPart +@ stdcall D3DStripShader(ptr long long ptr) +@ stub D3DWriteBlobToFile +@ stub DebugSetMute diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,24 @@ +MODULE = d3dcompiler_47.dll +IMPORTS = dxguid uuid +EXTRALIBS = $(LIBWPP) +EXTRADEFS = -DD3D_COMPILER_VERSION=47 +PARENTSRC = ../d3dcompiler_43 + +C_SRCS = \ + asmparser.c \ + blob.c \ + bytecodewriter.c \ + compiler.c \ + main.c \ + reflection.c \ + utils.c + +LEX_SRCS = \ + asmshader.l \ + hlsl.l + +BISON_SRCS = \ + asmshader.y \ + hlsl.y + +RC_SRCS = version.rc diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/version.rc wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/version.rc --- wine-staging-1.7.45~ubuntu14.10.1/dlls/d3dcompiler_47/version.rc 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/d3dcompiler_47/version.rc 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#define WINE_FILEDESCRIPTION_STR "Wine D3DCompiler" +#define WINE_FILENAME_STR "d3dcompiler_47.dll" +#define WINE_FILEVERSION 6,3,9600,16984 +#define WINE_FILEVERSION_STR "6.3.9600.16984" +#define WINE_PRODUCTVERSION 6,3,9600,16984 +#define WINE_PRODUCTVERSION_STR "6.3.9600.16984" + +#include "wine/wine_common_ver.rc" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/cpu_arm64.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/cpu_arm64.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/cpu_arm64.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/cpu_arm64.c 2015-06-28 16:51:28.000000000 +0000 @@ -166,7 +166,7 @@ #ifdef __aarch64__ switch (regno) { - + case CV_ARM64_PSTATE: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr; case CV_ARM64_X0 + 0: *size = sizeof(ctx->X0); return &ctx->X0; case CV_ARM64_X0 + 1: *size = sizeof(ctx->X1); return &ctx->X1; case CV_ARM64_X0 + 2: *size = sizeof(ctx->X2); return &ctx->X2; @@ -201,7 +201,6 @@ case CV_ARM64_LR: *size = sizeof(ctx->Lr); return &ctx->Lr; case CV_ARM64_SP: *size = sizeof(ctx->Sp); return &ctx->Sp; case CV_ARM64_PC: *size = sizeof(ctx->Pc); return &ctx->Pc; - case CV_ARM64_PSTATE: *size = sizeof(ctx->PState); return &ctx->PState; } #endif FIXME("Unknown register %x\n", regno); @@ -212,6 +211,7 @@ { switch (regno) { + case CV_ARM64_PSTATE: return "cpsr"; case CV_ARM64_X0 + 0: return "x0"; case CV_ARM64_X0 + 1: return "x1"; case CV_ARM64_X0 + 2: return "x2"; @@ -246,7 +246,6 @@ case CV_ARM64_LR: return "lr"; case CV_ARM64_SP: return "sp"; case CV_ARM64_PC: return "pc"; - case CV_ARM64_PSTATE: return "cpsr"; } FIXME("Unknown register %x\n", regno); return NULL; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/dbghelp_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/dbghelp_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/dbghelp_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/dbghelp_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -569,11 +569,9 @@ extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ -#define MACHO_NO_MAP ((const void*)-1) extern BOOL macho_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN; extern BOOL macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN; -struct macho_file_map; -extern BOOL macho_load_debug_info(struct module* module, struct macho_file_map* fmap) DECLSPEC_HIDDEN; +extern BOOL macho_load_debug_info(struct module* module) DECLSPEC_HIDDEN; extern struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/dwarf.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/dwarf.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/dwarf.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/dwarf.c 2015-06-28 16:51:28.000000000 +0000 @@ -2629,7 +2629,7 @@ /* parse the CIE first */ version = dwarf2_parse_byte(ctx); - if (version != 1) + if (version != 1 && version != 3) { FIXME("unknown CIE version %u at %p\n", version, ctx->data - 1); return FALSE; @@ -2639,7 +2639,10 @@ info->code_align = dwarf2_leb128_as_unsigned(ctx); info->data_align = dwarf2_leb128_as_signed(ctx); - info->retaddr_reg = dwarf2_parse_byte(ctx); + if (version == 1) + info->retaddr_reg = dwarf2_parse_byte(ctx); + else + info->retaddr_reg = dwarf2_leb128_as_unsigned(ctx); info->state.cfa_rule = RULE_CFA_OFFSET; end = NULL; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/image_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/image_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/image_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/image_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -42,6 +42,17 @@ #ifdef HAVE_SYS_LINK_H # include #endif +#ifdef HAVE_MACH_O_LOADER_H +#include + +#ifdef _WIN64 +typedef struct mach_header_64 macho_mach_header; +typedef struct section_64 macho_section; +#else +typedef struct mach_header macho_mach_header; +typedef struct section macho_section; +#endif +#endif #define IMAGE_NO_MAP ((void*)-1) @@ -94,6 +105,28 @@ }* sect; #endif } elf; + struct macho_file_map + { + size_t segs_size; + size_t segs_start; + int fd; + +#ifdef HAVE_MACH_O_LOADER_H + macho_mach_header mach_header; + const struct load_command* load_commands; + + /* The offset in the file which is this architecture. mach_header was + * read from arch_offset. */ + unsigned arch_offset; + + int num_sections; + struct + { + const macho_section* section; + const char* mapped; + }* sect; +#endif + } macho; struct pe_file_map { HANDLE hMap; @@ -123,6 +156,13 @@ extern DWORD_PTR elf_get_map_rva(const struct image_section_map* ism) DECLSPEC_HIDDEN; extern unsigned elf_get_map_size(const struct image_section_map* ism) DECLSPEC_HIDDEN; +extern BOOL macho_find_section(struct image_file_map* ifm, const char* segname, + const char* sectname, struct image_section_map* ism) DECLSPEC_HIDDEN; +extern const char* macho_map_section(struct image_section_map* ism) DECLSPEC_HIDDEN; +extern void macho_unmap_section(struct image_section_map* ism) DECLSPEC_HIDDEN; +extern DWORD_PTR macho_get_map_rva(const struct image_section_map* ism) DECLSPEC_HIDDEN; +extern unsigned macho_get_map_size(const struct image_section_map* ism) DECLSPEC_HIDDEN; + extern BOOL pe_find_section(struct image_file_map* fmap, const char* name, struct image_section_map* ism) DECLSPEC_HIDDEN; extern const char* pe_map_section(struct image_section_map* psm) DECLSPEC_HIDDEN; @@ -135,8 +175,9 @@ { switch (fmap->modtype) { - case DMT_ELF: return elf_find_section(fmap, name, SHT_NULL, ism); - case DMT_PE: return pe_find_section(fmap, name, ism); + case DMT_ELF: return elf_find_section(fmap, name, SHT_NULL, ism); + case DMT_MACHO: return macho_find_section(fmap, NULL, name, ism); + case DMT_PE: return pe_find_section(fmap, name, ism); default: assert(0); return FALSE; } } @@ -146,8 +187,9 @@ if (!ism->fmap) return NULL; switch (ism->fmap->modtype) { - case DMT_ELF: return elf_map_section(ism); - case DMT_PE: return pe_map_section(ism); + case DMT_ELF: return elf_map_section(ism); + case DMT_MACHO: return macho_map_section(ism); + case DMT_PE: return pe_map_section(ism); default: assert(0); return NULL; } } @@ -157,8 +199,9 @@ if (!ism->fmap) return; switch (ism->fmap->modtype) { - case DMT_ELF: elf_unmap_section(ism); break; - case DMT_PE: pe_unmap_section(ism); break; + case DMT_ELF: elf_unmap_section(ism); break; + case DMT_MACHO: macho_unmap_section(ism); break; + case DMT_PE: pe_unmap_section(ism); break; default: assert(0); return; } } @@ -168,8 +211,9 @@ if (!ism->fmap) return 0; switch (ism->fmap->modtype) { - case DMT_ELF: return elf_get_map_rva(ism); - case DMT_PE: return pe_get_map_rva(ism); + case DMT_ELF: return elf_get_map_rva(ism); + case DMT_MACHO: return macho_get_map_rva(ism); + case DMT_PE: return pe_get_map_rva(ism); default: assert(0); return 0; } } @@ -179,8 +223,9 @@ if (!ism->fmap) return 0; switch (ism->fmap->modtype) { - case DMT_ELF: return elf_get_map_size(ism); - case DMT_PE: return pe_get_map_size(ism); + case DMT_ELF: return elf_get_map_size(ism); + case DMT_MACHO: return macho_get_map_size(ism); + case DMT_PE: return pe_get_map_size(ism); default: assert(0); return 0; } } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/macho_module.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/macho_module.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/macho_module.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/macho_module.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,12 +24,6 @@ #include "config.h" #include "wine/port.h" -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "dbghelp_private.h" - -#ifdef HAVE_MACH_O_LOADER_H - #include #include #include @@ -40,6 +34,16 @@ # include #endif +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "dbghelp_private.h" +#include "winternl.h" +#include "wine/library.h" +#include "wine/debug.h" +#include "image_private.h" + +#ifdef HAVE_MACH_O_LOADER_H + #include #include #include @@ -62,10 +66,6 @@ }; #endif -#include "winternl.h" -#include "wine/library.h" -#include "wine/debug.h" - #ifdef WORDS_BIGENDIAN #define swap_ulong_be_to_host(n) (n) #else @@ -75,8 +75,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho); +#ifdef _WIN64 +typedef struct segment_command_64 macho_segment_command; +typedef struct nlist_64 macho_nlist; + +#define TARGET_CPU_TYPE CPU_TYPE_X86_64 +#define TARGET_MH_MAGIC MH_MAGIC_64 +#define TARGET_SEGMENT_COMMAND LC_SEGMENT_64 +#else +typedef struct segment_command macho_segment_command; +typedef struct nlist macho_nlist; + +#define TARGET_CPU_TYPE CPU_TYPE_X86 +#define TARGET_MH_MAGIC MH_MAGIC +#define TARGET_SEGMENT_COMMAND LC_SEGMENT +#endif + + struct macho_module_info { + struct image_file_map file_map; unsigned long load_addr; unsigned short in_use : 1, is_loader : 1; @@ -94,36 +112,7 @@ const WCHAR* module_name; /* OUT found module name (if MACHO_INFO_NAME is set) */ }; -/* structure holding information while handling a Mach-O image */ -#define BITS_PER_ULONG (sizeof(ULONG) * 8) -#define ULONGS_FOR_BITS(nbits) (((nbits) + BITS_PER_ULONG - 1) / BITS_PER_ULONG) -struct macho_file_map -{ - /* A copy of the Mach-O header for an individual architecture. */ - struct mach_header mach_header; - - /* The mapped load commands. */ - const struct load_command* load_commands; - - /* The portion of the file which is this architecture. mach_header was - * read from arch_offset. */ - unsigned arch_offset; - unsigned arch_size; - - /* The range of address space covered by all segments. */ - size_t segs_start; - size_t segs_size; - - /* Map of which sections contain code. Sections are accessed using 1-based - * index. Bit 0 of this bitset indicates if the bitset has been initialized. */ - RTL_BITMAP sect_is_code; - ULONG sect_is_code_buff[ULONGS_FOR_BITS(MAX_SECT + 1)]; - - /* The file. */ - int fd; -}; - -static void macho_unmap_file(struct macho_file_map* fmap); +static void macho_unmap_file(struct image_file_map* fmap); /****************************************************************** * macho_calc_range @@ -133,13 +122,13 @@ * that encompasses it. For a fat binary, the architecture will * itself be offset within the file, so take that into account. */ -static void macho_calc_range(const struct macho_file_map* fmap, unsigned offset, - unsigned len, unsigned* out_aligned_offset, - unsigned* out_aligned_end, unsigned* out_aligned_len, - unsigned* out_misalign) +static void macho_calc_range(const struct macho_file_map* fmap, unsigned long offset, + unsigned long len, unsigned long* out_aligned_offset, + unsigned long* out_aligned_end, unsigned long* out_aligned_len, + unsigned long* out_misalign) { - unsigned pagemask = sysconf( _SC_PAGESIZE ) - 1; - unsigned file_offset, misalign; + unsigned long pagemask = sysconf( _SC_PAGESIZE ) - 1; + unsigned long file_offset, misalign; file_offset = fmap->arch_offset + offset; misalign = file_offset & pagemask; @@ -156,21 +145,24 @@ * * Maps a range (offset, length in bytes) from a Mach-O file into memory */ -static const char* macho_map_range(const struct macho_file_map* fmap, unsigned offset, unsigned len) +static const char* macho_map_range(const struct macho_file_map* fmap, unsigned long offset, unsigned long len, + const char** base) { - unsigned misalign, aligned_offset, aligned_map_end, map_size; - const void* aligned_ptr; + unsigned long misalign, aligned_offset, aligned_map_end, map_size; + const void* aligned_ptr; - TRACE("(%p/%d, 0x%08x, 0x%08x)\n", fmap, fmap->fd, offset, len); + TRACE("(%p/%d, 0x%08lx, 0x%08lx)\n", fmap, fmap->fd, offset, len); macho_calc_range(fmap, offset, len, &aligned_offset, &aligned_map_end, &map_size, &misalign); aligned_ptr = mmap(NULL, map_size, PROT_READ, MAP_PRIVATE, fmap->fd, aligned_offset); - TRACE("Mapped (0x%08x - 0x%08x) to %p\n", aligned_offset, aligned_map_end, aligned_ptr); + TRACE("Mapped (0x%08lx - 0x%08lx) to %p\n", aligned_offset, aligned_map_end, aligned_ptr); - if (aligned_ptr == MAP_FAILED) return MACHO_NO_MAP; + if (aligned_ptr == MAP_FAILED) return IMAGE_NO_MAP; + if (base) + *base = aligned_ptr; return (const char*)aligned_ptr + misalign; } @@ -179,24 +171,30 @@ * * Unmaps a range (offset, length in bytes) of a Mach-O file from memory */ -static void macho_unmap_range(const void** mapped, const struct macho_file_map* fmap, - unsigned offset, unsigned len) +static void macho_unmap_range(const char** base, const void** mapped, const struct macho_file_map* fmap, + unsigned long offset, unsigned long len) { - TRACE("(%p, %p/%d, 0x%08x, 0x%08x)\n", mapped, fmap, fmap->fd, offset, len); + TRACE("(%p, %p, %p/%d, 0x%08lx, 0x%08lx)\n", base, mapped, fmap, fmap->fd, offset, len); - if (mapped && *mapped != MACHO_NO_MAP) + if ((mapped && *mapped != IMAGE_NO_MAP) || (base && *base != IMAGE_NO_MAP)) { - unsigned misalign, aligned_offset, aligned_map_end, map_size; - void* aligned_ptr; + unsigned long misalign, aligned_offset, aligned_map_end, map_size; + void* aligned_ptr; macho_calc_range(fmap, offset, len, &aligned_offset, &aligned_map_end, &map_size, &misalign); - aligned_ptr = (char*)*mapped - misalign; + if (mapped) + aligned_ptr = (char*)*mapped - misalign; + else + aligned_ptr = (void*)*base; if (munmap(aligned_ptr, map_size) < 0) WARN("Couldn't unmap the range\n"); - TRACE("Unmapped (0x%08x - 0x%08x) from %p - %p\n", aligned_offset, aligned_map_end, aligned_ptr, (char*)aligned_ptr + map_size); - *mapped = MACHO_NO_MAP; + TRACE("Unmapped (0x%08lx - 0x%08lx) from %p - %p\n", aligned_offset, aligned_map_end, aligned_ptr, (char*)aligned_ptr + map_size); + if (mapped) + *mapped = IMAGE_NO_MAP; + if (base) + *base = IMAGE_NO_MAP; } } @@ -208,14 +206,14 @@ * the munmap doesn't fragment the mapping. */ static BOOL macho_map_ranges(const struct macho_file_map* fmap, - unsigned offset1, unsigned len1, - unsigned offset2, unsigned len2, + unsigned long offset1, unsigned long len1, + unsigned long offset2, unsigned long len2, const void** mapped1, const void** mapped2) { - unsigned aligned_offset1, aligned_map_end1; - unsigned aligned_offset2, aligned_map_end2; + unsigned long aligned_offset1, aligned_map_end1; + unsigned long aligned_offset2, aligned_map_end2; - TRACE("(%p/%d, 0x%08x, 0x%08x, 0x%08x, 0x%08x, %p, %p)\n", fmap, fmap->fd, + TRACE("(%p/%d, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p, %p)\n", fmap, fmap->fd, offset1, len1, offset2, len2, mapped1, mapped2); macho_calc_range(fmap, offset1, len1, &aligned_offset1, &aligned_map_end1, NULL, NULL); @@ -223,33 +221,33 @@ if (aligned_map_end1 < aligned_offset2 || aligned_map_end2 < aligned_offset1) { - *mapped1 = macho_map_range(fmap, offset1, len1); - if (*mapped1 != MACHO_NO_MAP) + *mapped1 = macho_map_range(fmap, offset1, len1, NULL); + if (*mapped1 != IMAGE_NO_MAP) { - *mapped2 = macho_map_range(fmap, offset2, len2); - if (*mapped2 == MACHO_NO_MAP) - macho_unmap_range(mapped1, fmap, offset1, len1); + *mapped2 = macho_map_range(fmap, offset2, len2, NULL); + if (*mapped2 == IMAGE_NO_MAP) + macho_unmap_range(NULL, mapped1, fmap, offset1, len1); } } else { if (offset1 < offset2) { - *mapped1 = macho_map_range(fmap, offset1, offset2 + len2 - offset1); - if (*mapped1 != MACHO_NO_MAP) + *mapped1 = macho_map_range(fmap, offset1, offset2 + len2 - offset1, NULL); + if (*mapped1 != IMAGE_NO_MAP) *mapped2 = (const char*)*mapped1 + offset2 - offset1; } else { - *mapped2 = macho_map_range(fmap, offset2, offset1 + len1 - offset2); - if (*mapped2 != MACHO_NO_MAP) + *mapped2 = macho_map_range(fmap, offset2, offset1 + len1 - offset2, NULL); + if (*mapped2 != IMAGE_NO_MAP) *mapped1 = (const char*)*mapped2 + offset1 - offset2; } } TRACE(" => %p, %p\n", *mapped1, *mapped2); - return (*mapped1 != MACHO_NO_MAP) && (*mapped2 != MACHO_NO_MAP); + return (*mapped1 != IMAGE_NO_MAP) && (*mapped2 != IMAGE_NO_MAP); } /****************************************************************** @@ -260,14 +258,14 @@ * macho_map_ranges. */ static void macho_unmap_ranges(const struct macho_file_map* fmap, - unsigned offset1, unsigned len1, - unsigned offset2, unsigned len2, + unsigned long offset1, unsigned long len1, + unsigned long offset2, unsigned long len2, const void** mapped1, const void** mapped2) { - unsigned aligned_offset1, aligned_map_end1; - unsigned aligned_offset2, aligned_map_end2; + unsigned long aligned_offset1, aligned_map_end1; + unsigned long aligned_offset2, aligned_map_end2; - TRACE("(%p/%d, 0x%08x, 0x%08x, 0x%08x, 0x%08x, %p/%p, %p/%p)\n", fmap, fmap->fd, + TRACE("(%p/%d, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p/%p, %p/%p)\n", fmap, fmap->fd, offset1, len1, offset2, len2, mapped1, *mapped1, mapped2, *mapped2); macho_calc_range(fmap, offset1, len1, &aligned_offset1, &aligned_map_end1, NULL, NULL); @@ -275,35 +273,119 @@ if (aligned_map_end1 < aligned_offset2 || aligned_map_end2 < aligned_offset1) { - macho_unmap_range(mapped1, fmap, offset1, len1); - macho_unmap_range(mapped2, fmap, offset2, len2); + macho_unmap_range(NULL, mapped1, fmap, offset1, len1); + macho_unmap_range(NULL, mapped2, fmap, offset2, len2); } else { if (offset1 < offset2) { - macho_unmap_range(mapped1, fmap, offset1, offset2 + len2 - offset1); - *mapped2 = MACHO_NO_MAP; + macho_unmap_range(NULL, mapped1, fmap, offset1, offset2 + len2 - offset1); + *mapped2 = IMAGE_NO_MAP; } else { - macho_unmap_range(mapped2, fmap, offset2, offset1 + len1 - offset2); - *mapped1 = MACHO_NO_MAP; + macho_unmap_range(NULL, mapped2, fmap, offset2, offset1 + len1 - offset2); + *mapped1 = IMAGE_NO_MAP; } } } /****************************************************************** + * macho_find_section + */ +BOOL macho_find_section(struct image_file_map* ifm, const char* segname, const char* sectname, struct image_section_map* ism) +{ + struct macho_file_map* fmap; + unsigned i; + char tmp[sizeof(fmap->sect[0].section->sectname)]; + + /* Other parts of dbghelp use section names like ".eh_frame". Mach-O uses + names like "__eh_frame". Convert those. */ + if (sectname[0] == '.') + { + lstrcpynA(tmp, "__", sizeof(tmp)); + lstrcpynA(tmp + 2, sectname + 1, sizeof(tmp) - 2); + sectname = tmp; + } + + fmap = &ifm->u.macho; + for (i = 0; i < fmap->num_sections; i++) + { + if (strcmp(fmap->sect[i].section->sectname, sectname) == 0 && + (!segname || strcmp(fmap->sect[i].section->sectname, segname) == 0)) + { + ism->fmap = ifm; + ism->sidx = i; + return TRUE; + } + } + + ism->fmap = NULL; + ism->sidx = -1; + return FALSE; +} + +/****************************************************************** + * macho_map_section + */ +const char* macho_map_section(struct image_section_map* ism) +{ + struct macho_file_map* fmap = &ism->fmap->u.macho; + + assert(ism->fmap->modtype == DMT_MACHO); + if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections) + return IMAGE_NO_MAP; + + return macho_map_range(fmap, fmap->sect[ism->sidx].section->offset, fmap->sect[ism->sidx].section->size, + &fmap->sect[ism->sidx].mapped); +} + +/****************************************************************** + * macho_unmap_section + */ +void macho_unmap_section(struct image_section_map* ism) +{ + struct macho_file_map* fmap = &ism->fmap->u.macho; + + if (ism->sidx >= 0 && ism->sidx < fmap->num_sections && fmap->sect[ism->sidx].mapped != IMAGE_NO_MAP) + { + macho_unmap_range(&fmap->sect[ism->sidx].mapped, NULL, fmap, fmap->sect[ism->sidx].section->offset, + fmap->sect[ism->sidx].section->size); + } +} + +/****************************************************************** + * macho_get_map_rva + */ +DWORD_PTR macho_get_map_rva(const struct image_section_map* ism) +{ + if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections) + return 0; + return ism->fmap->u.macho.sect[ism->sidx].section->addr - ism->fmap->u.macho.segs_start; +} + +/****************************************************************** + * macho_get_map_size + */ +unsigned macho_get_map_size(const struct image_section_map* ism) +{ + if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections) + return 0; + return ism->fmap->u.macho.sect[ism->sidx].section->size; +} + +/****************************************************************** * macho_map_load_commands * * Maps the load commands from a Mach-O file into memory */ static const struct load_command* macho_map_load_commands(struct macho_file_map* fmap) { - if (fmap->load_commands == MACHO_NO_MAP) + if (fmap->load_commands == IMAGE_NO_MAP) { fmap->load_commands = (const struct load_command*) macho_map_range( - fmap, sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds); + fmap, sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds, NULL); TRACE("Mapped load commands: %p\n", fmap->load_commands); } @@ -317,10 +399,10 @@ */ static void macho_unmap_load_commands(struct macho_file_map* fmap) { - if (fmap->load_commands != MACHO_NO_MAP) + if (fmap->load_commands != IMAGE_NO_MAP) { TRACE("Unmapping load commands: %p\n", fmap->load_commands); - macho_unmap_range((const void**)&fmap->load_commands, fmap, + macho_unmap_range(NULL, (const void**)&fmap->load_commands, fmap, sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds); } } @@ -356,7 +438,7 @@ TRACE("(%p/%d, %u, %p, %p)\n", fmap, fmap->fd, cmd, cb, user); - if ((lc = macho_map_load_commands(fmap)) == MACHO_NO_MAP) return -1; + if ((lc = macho_map_load_commands(fmap)) == IMAGE_NO_MAP) return -1; TRACE("%d total commands\n", fmap->mach_header.ncmds); @@ -376,47 +458,81 @@ } /****************************************************************** - * macho_accum_segs_range + * macho_count_sections + * + * Callback for macho_enum_load_commands. Counts the number of + * significant sections in a Mach-O file. All commands are + * expected to be of LC_SEGMENT[_64] type. + */ +static int macho_count_sections(struct macho_file_map* fmap, const struct load_command* lc, void* user) +{ + const macho_segment_command* sc = (const macho_segment_command*)lc; + + TRACE("(%p/%d, %p, %p) segment %s\n", fmap, fmap->fd, lc, user, debugstr_an(sc->segname, sizeof(sc->segname))); + + fmap->num_sections += sc->nsects; + return 0; +} + +/****************************************************************** + * macho_load_section_info * * Callback for macho_enum_load_commands. Accumulates the address - * range covered by the segments of a Mach-O file. All commands - * are expected to be of LC_SEGMENT type. + * range covered by the segments of a Mach-O file and builds the + * section map. All commands are expected to be of LC_SEGMENT[_64] type. */ -static int macho_accum_segs_range(struct macho_file_map* fmap, - const struct load_command* lc, void* user) +static int macho_load_section_info(struct macho_file_map* fmap, const struct load_command* lc, void* user) { - const struct segment_command* sc = (const struct segment_command*)lc; - unsigned tmp, page_mask = sysconf( _SC_PAGESIZE ) - 1; + const macho_segment_command* sc = (const macho_segment_command*)lc; + int* section_index = (int*)user; + const macho_section* section; + int i; + unsigned long tmp, page_mask = sysconf( _SC_PAGESIZE ) - 1; - TRACE("(%p/%d, %p, %p) before: 0x%08x - 0x%08x\n", fmap, fmap->fd, lc, user, - (unsigned)fmap->segs_start, (unsigned)fmap->segs_size); - TRACE("Segment command vm: 0x%08x - 0x%08x\n", (unsigned)sc->vmaddr, - (unsigned)sc->vmaddr + sc->vmsize); + TRACE("(%p/%d, %p, %p) before: 0x%08lx - 0x%08lx\n", fmap, fmap->fd, lc, user, + (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size); + TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (unsigned long)sc->vmaddr, + (unsigned long)(sc->vmaddr + sc->vmsize)); if (!strncmp(sc->segname, "WINE_", 5)) - { TRACE("Ignoring special Wine segment %s\n", debugstr_an(sc->segname, sizeof(sc->segname))); - return 0; + else if (!strncmp(sc->segname, "__PAGEZERO", 10)) + TRACE("Ignoring __PAGEZERO segment\n"); + else + { + /* If this segment starts before previously-known earliest, record new earliest. */ + if (sc->vmaddr < fmap->segs_start) + fmap->segs_start = sc->vmaddr; + + /* If this segment extends beyond previously-known furthest, record new furthest. */ + tmp = (sc->vmaddr + sc->vmsize + page_mask) & ~page_mask; + if (fmap->segs_size < tmp) fmap->segs_size = tmp; + + TRACE("after: 0x%08lx - 0x%08lx\n", (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size); } - if (!strncmp(sc->segname, "__PAGEZERO", 10)) + + section = (const macho_section*)(sc + 1); + for (i = 0; i < sc->nsects; i++) { - TRACE("Ignoring __PAGEZERO segment\n"); - return 0; + fmap->sect[*section_index].section = §ion[i]; + fmap->sect[*section_index].mapped = IMAGE_NO_MAP; + (*section_index)++; } - /* If this segment starts before previously-known earliest, record - * new earliest. */ - if (sc->vmaddr < fmap->segs_start) - fmap->segs_start = sc->vmaddr; - - /* If this segment extends beyond previously-known furthest, record - * new furthest. */ - tmp = (sc->vmaddr + sc->vmsize + page_mask) & ~page_mask; - if (fmap->segs_size < tmp) fmap->segs_size = tmp; + return 0; +} - TRACE("after: 0x%08x - 0x%08x\n", (unsigned)fmap->segs_start, (unsigned)fmap->segs_size); +/****************************************************************** + * reset_file_map + */ +static inline void reset_file_map(struct image_file_map* ifm) +{ + struct macho_file_map* fmap = &ifm->u.macho; - return 0; + fmap->fd = -1; + fmap->load_commands = IMAGE_NO_MAP; + fmap->num_sections = 0; + fmap->sect = NULL; } /****************************************************************** @@ -424,8 +540,9 @@ * * Maps a Mach-O file into memory (and checks it's a real Mach-O file) */ -static BOOL macho_map_file(const WCHAR* filenameW, struct macho_file_map* fmap) +static BOOL macho_map_file(const WCHAR* filenameW, struct image_file_map* ifm) { + struct macho_file_map* fmap = &ifm->u.macho; struct fat_header fat_header; struct stat statbuf; int i; @@ -435,9 +552,14 @@ TRACE("(%s, %p)\n", debugstr_w(filenameW), fmap); - fmap->fd = -1; - fmap->load_commands = MACHO_NO_MAP; - RtlInitializeBitMap(&fmap->sect_is_code, fmap->sect_is_code_buff, MAX_SECT + 1); + reset_file_map(ifm); + + ifm->modtype = DMT_MACHO; +#ifdef _WIN64 + ifm->addr_size = 64; +#else + ifm->addr_size = 32; +#endif len = WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, NULL, 0, NULL, NULL); if (!(filename = HeapAlloc(GetProcessHeap(), 0, len))) @@ -477,20 +599,18 @@ struct fat_arch fat_arch; if (read(fmap->fd, &fat_arch, sizeof(fat_arch)) != sizeof(fat_arch)) goto done; - if (swap_ulong_be_to_host(fat_arch.cputype) == CPU_TYPE_X86) + if (swap_ulong_be_to_host(fat_arch.cputype) == TARGET_CPU_TYPE) { fmap->arch_offset = swap_ulong_be_to_host(fat_arch.offset); - fmap->arch_size = swap_ulong_be_to_host(fat_arch.size); break; } } if (i >= narch) goto done; - TRACE("... found x86 arch\n"); + TRACE("... found target arch (%d)\n", TARGET_CPU_TYPE); } else { fmap->arch_offset = 0; - fmap->arch_size = statbuf.st_size; TRACE("... not a fat header\n"); } @@ -500,8 +620,8 @@ goto done; TRACE("... got possible Mach header\n"); /* and check for a Mach-O header */ - if (fmap->mach_header.magic != MH_MAGIC || - fmap->mach_header.cputype != CPU_TYPE_X86) goto done; + if (fmap->mach_header.magic != TARGET_MH_MAGIC || + fmap->mach_header.cputype != TARGET_CPU_TYPE) goto done; /* Make sure the file type is one of the ones we expect. */ switch (fmap->mach_header.filetype) { @@ -513,22 +633,35 @@ default: goto done; } - TRACE("... verified Mach x86 header\n"); + TRACE("... verified Mach header\n"); + + fmap->num_sections = 0; + if (macho_enum_load_commands(fmap, TARGET_SEGMENT_COMMAND, macho_count_sections, NULL) < 0) + goto done; + TRACE("%d sections\n", fmap->num_sections); + + fmap->sect = HeapAlloc(GetProcessHeap(), 0, fmap->num_sections * sizeof(fmap->sect[0])); + if (!fmap->sect) + goto done; fmap->segs_size = 0; fmap->segs_start = ~0L; - if (macho_enum_load_commands(fmap, LC_SEGMENT, macho_accum_segs_range, NULL) < 0) + i = 0; + if (macho_enum_load_commands(fmap, TARGET_SEGMENT_COMMAND, macho_load_section_info, &i) < 0) + { + fmap->num_sections = 0; goto done; + } fmap->segs_size -= fmap->segs_start; - TRACE("segs_start: 0x%08x, segs_size: 0x%08x\n", (unsigned)fmap->segs_start, - (unsigned)fmap->segs_size); + TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (unsigned long)fmap->segs_start, + (unsigned long)fmap->segs_size); ret = TRUE; done: if (!ret) - macho_unmap_file(fmap); + macho_unmap_file(ifm); HeapFree(GetProcessHeap(), 0, filename); return ret; } @@ -538,51 +671,22 @@ * * Unmaps a Mach-O file from memory (previously mapped with macho_map_file) */ -static void macho_unmap_file(struct macho_file_map* fmap) +static void macho_unmap_file(struct image_file_map* ifm) { - TRACE("(%p/%d)\n", fmap, fmap->fd); - if (fmap->fd != -1) + TRACE("(%p/%d)\n", ifm, ifm->u.macho.fd); + if (ifm->u.macho.fd != -1) { - macho_unmap_load_commands(fmap); - close(fmap->fd); - fmap->fd = -1; - } -} - -/****************************************************************** - * macho_fill_sect_is_code - * - * Callback for macho_enum_load_commands. Determines which segments - * of a Mach-O file contain code. All commands are expected to be - * of LC_SEGMENT type. - */ -static int macho_fill_sect_is_code(struct macho_file_map* fmap, - const struct load_command* lc, void* user) -{ - const struct segment_command* sc = (const struct segment_command*)lc; - const struct section* sections; - int* cursect = user; - int i; - - TRACE("(%p/%d, %p, %p/%d) scanning %u sections\n", fmap, fmap->fd, lc, - cursect, *cursect, sc->nsects); + struct image_section_map ism; - sections = (const struct section*)(sc + 1); - for (i = 0; i < sc->nsects; i++) - { - if (*cursect > MAX_SECT) return -1; - (*cursect)++; + ism.fmap = ifm; + for (ism.sidx = 0; ism.sidx < ifm->u.macho.num_sections; ism.sidx++) + macho_unmap_section(&ism); - if (!(sections[i].flags & SECTION_TYPE) && - (sections[i].flags & (S_ATTR_PURE_INSTRUCTIONS|S_ATTR_SOME_INSTRUCTIONS))) - RtlSetBits(&fmap->sect_is_code, *cursect, 1); - else - RtlClearBits(&fmap->sect_is_code, *cursect, 1); - TRACE("Section %d (%d of this segment) is%s code\n", *cursect, i, - (RtlAreBitsSet(&fmap->sect_is_code, *cursect, 1) ? "" : " not")); + HeapFree(GetProcessHeap(), 0, ifm->u.macho.sect); + macho_unmap_load_commands(&ifm->u.macho); + close(ifm->u.macho.fd); + ifm->u.macho.fd = -1; } - - return 0; } /****************************************************************** @@ -594,17 +698,19 @@ */ static BOOL macho_sect_is_code(struct macho_file_map* fmap, unsigned char sectidx) { + BOOL ret; + TRACE("(%p/%d, %u)\n", fmap, fmap->fd, sectidx); - if (!RtlAreBitsSet(&fmap->sect_is_code, 0, 1)) - { - int cursect = 0; - if (macho_enum_load_commands(fmap, LC_SEGMENT, macho_fill_sect_is_code, &cursect) < 0) - WARN("Couldn't load sect_is_code map\n"); - RtlSetBits(&fmap->sect_is_code, 0, 1); - } + if (!sectidx) return FALSE; + + sectidx--; /* convert from 1-based to 0-based */ + if (sectidx >= fmap->num_sections) return FALSE; - return RtlAreBitsSet(&fmap->sect_is_code, sectidx, 1); + ret = (!(fmap->sect[sectidx].section->flags & SECTION_TYPE) && + (fmap->sect[sectidx].section->flags & (S_ATTR_PURE_INSTRUCTIONS|S_ATTR_SOME_INSTRUCTIONS))); + TRACE("-> %d\n", ret); + return ret; } struct symtab_elt @@ -667,24 +773,24 @@ { const struct symtab_command* sc = (const struct symtab_command*)lc; struct macho_debug_info* mdi = user; - const struct nlist* stab; + const macho_nlist* stab; const char* stabstr; int ret = 0; TRACE("(%p/%d, %p, %p) %u syms at 0x%08x, strings 0x%08x - 0x%08x\n", fmap, fmap->fd, lc, user, sc->nsyms, sc->symoff, sc->stroff, sc->stroff + sc->strsize); - if (!macho_map_ranges(fmap, sc->symoff, sc->nsyms * sizeof(struct nlist), + if (!macho_map_ranges(fmap, sc->symoff, sc->nsyms * sizeof(macho_nlist), sc->stroff, sc->strsize, (const void**)&stab, (const void**)&stabstr)) return 0; if (!stabs_parse(mdi->module, mdi->module->format_info[DFI_MACHO]->u.macho_info->load_addr - fmap->segs_start, - stab, sc->nsyms * sizeof(struct nlist), + stab, sc->nsyms * sizeof(macho_nlist), stabstr, sc->strsize, macho_stabs_def_cb, mdi)) ret = -1; - macho_unmap_ranges(fmap, sc->symoff, sc->nsyms * sizeof(struct nlist), + macho_unmap_ranges(fmap, sc->symoff, sc->nsyms * sizeof(macho_nlist), sc->stroff, sc->strsize, (const void**)&stab, (const void**)&stabstr); return ret; @@ -861,20 +967,24 @@ } /****************************************************************** - * macho_load_debug_info_from_map + * macho_load_debug_info * - * Loads the symbolic information from a Mach-O module. - * Returns - * FALSE if the file doesn't contain symbolic info (or this info - * cannot be read or parsed) - * TRUE on success + * Loads Mach-O debugging information from the module image file. */ -static BOOL macho_load_debug_info_from_map(struct module* module, - struct macho_file_map* fmap) +BOOL macho_load_debug_info(struct module* module) { BOOL ret = FALSE; struct macho_debug_info mdi; int result; + struct macho_file_map *fmap; + + if (module->type != DMT_MACHO || !module->format_info[DFI_MACHO]->u.macho_info) + { + ERR("Bad Mach-O module '%s'\n", debugstr_w(module->module.LoadedImageName)); + return FALSE; + } + + fmap = &module->format_info[DFI_MACHO]->u.macho_info->file_map.u.macho; TRACE("(%p, %p/%d)\n", module, fmap, fmap->fd); @@ -892,37 +1002,11 @@ macho_finish_stabs(module, &mdi.ht_symtab); - pool_destroy(&mdi.pool); - return ret; -} - -/****************************************************************** - * macho_load_debug_info - * - * Loads Mach-O debugging information from the module image file. - */ -BOOL macho_load_debug_info(struct module* module, struct macho_file_map* fmap) -{ - BOOL ret = TRUE; - struct macho_file_map my_fmap; - - TRACE("(%p, %p/%d)\n", module, fmap, fmap ? fmap->fd : -1); - - if (module->type != DMT_MACHO || !module->format_info[DFI_MACHO]->u.macho_info) - { - ERR("Bad Mach-O module '%s'\n", debugstr_w(module->module.LoadedImageName)); - return FALSE; - } - - if (!fmap) - { - fmap = &my_fmap; - ret = macho_map_file(module->module.LoadedImageName, fmap); - } - if (ret) - ret = macho_load_debug_info_from_map(module, fmap); + if (dwarf2_parse(module, module->reloc_delta, NULL /* FIXME: some thunks to deal with ? */, + &module->format_info[DFI_MACHO]->u.macho_info->file_map)) + ret = TRUE; - if (fmap == &my_fmap) macho_unmap_file(fmap); + pool_destroy(&mdi.pool); return ret; } @@ -934,19 +1018,28 @@ BOOL macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) { - struct macho_file_map fmap; + struct image_file_map fmap; TRACE("(%s, %p, %p, %p)\n", debugstr_w(name), base, size, checksum); if (!macho_map_file(name, &fmap)) return FALSE; - if (base) *base = fmap.segs_start; - *size = fmap.segs_size; - *checksum = calc_crc32(fmap.fd); + if (base) *base = fmap.u.macho.segs_start; + *size = fmap.u.macho.segs_size; + *checksum = calc_crc32(fmap.u.macho.fd); macho_unmap_file(&fmap); return TRUE; } /****************************************************************** + * macho_module_remove + */ +static void macho_module_remove(struct process* pcs, struct module_format* modfmt) +{ + macho_unmap_file(&modfmt->u.macho_info->file_map); + HeapFree(GetProcessHeap(), 0, modfmt); +} + +/****************************************************************** * macho_load_file * * Loads the information for Mach-O module stored in 'filename'. @@ -960,7 +1053,7 @@ unsigned long load_addr, struct macho_info* macho_info) { BOOL ret = TRUE; - struct macho_file_map fmap; + struct image_file_map fmap; TRACE("(%p/%p, %s, 0x%08lx, %p/0x%08x)\n", pcs, pcs->handle, debugstr_w(filename), load_addr, macho_info, macho_info->flags); @@ -987,8 +1080,8 @@ if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &dyld_image_info, sizeof(dyld_image_info), NULL)) { - TRACE("got dyld_image_info 0x%08x from PEB %p MacDyldImageInfo %p\n", - dyld_image_info, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved); + TRACE("got dyld_image_info 0x%08lx from PEB %p MacDyldImageInfo %p\n", + (unsigned long)dyld_image_info, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved); macho_info->dbg_hdr_addr = dyld_image_info; ret = TRUE; } @@ -1028,27 +1121,30 @@ HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct macho_module_info)); if (!modfmt) goto leave; if (!load_addr) - load_addr = fmap.segs_start; + load_addr = fmap.u.macho.segs_start; macho_info->module = module_new(pcs, filename, DMT_MACHO, FALSE, load_addr, - fmap.segs_size, 0, calc_crc32(fmap.fd)); + fmap.u.macho.segs_size, 0, calc_crc32(fmap.u.macho.fd)); if (!macho_info->module) { HeapFree(GetProcessHeap(), 0, modfmt); goto leave; } + macho_info->module->reloc_delta = macho_info->module->module.BaseOfImage - fmap.u.macho.segs_start; macho_module_info = (void*)(modfmt + 1); macho_info->module->format_info[DFI_MACHO] = modfmt; modfmt->module = macho_info->module; - modfmt->remove = NULL; + modfmt->remove = macho_module_remove; modfmt->loc_compute = NULL; modfmt->u.macho_info = macho_module_info; macho_module_info->load_addr = load_addr; + macho_module_info->file_map = fmap; + reset_file_map(&fmap); if (dbghelp_options & SYMOPT_DEFERRED_LOADS) macho_info->module->module.SymType = SymDeferred; - else if (!macho_load_debug_info(macho_info->module, &fmap)) + else if (!macho_load_debug_info(macho_info->module)) ret = FALSE; macho_info->module->format_info[DFI_MACHO]->u.macho_info->in_use = 1; @@ -1454,6 +1550,30 @@ #else /* HAVE_MACH_O_LOADER_H */ +BOOL macho_find_section(struct image_file_map* ifm, const char* segname, const char* sectname, struct image_section_map* ism) +{ + return FALSE; +} + +const char* macho_map_section(struct image_section_map* ism) +{ + return NULL; +} + +void macho_unmap_section(struct image_section_map* ism) +{ +} + +DWORD_PTR macho_get_map_rva(const struct image_section_map* ism) +{ + return 0; +} + +unsigned macho_get_map_size(const struct image_section_map* ism) +{ + return 0; +} + BOOL macho_synchronize_module_list(struct process* pcs) { return FALSE; @@ -1480,7 +1600,7 @@ return NULL; } -BOOL macho_load_debug_info(struct module* module, struct macho_file_map* fmap) +BOOL macho_load_debug_info(struct module* module) { return FALSE; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/module.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/module.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/module.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/module.c 2015-06-28 16:51:28.000000000 +0000 @@ -366,7 +366,7 @@ &idslW64); break; case DMT_MACHO: - ret = macho_load_debug_info(pair->effective, NULL); + ret = macho_load_debug_info(pair->effective); break; default: ret = FALSE; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/stabs.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/stabs.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dbghelp/stabs.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dbghelp/stabs.c 2015-06-28 16:51:28.000000000 +0000 @@ -111,7 +111,11 @@ unsigned char n_type; char n_other; short n_desc; +#if defined(__APPLE__) && defined(_WIN64) + unsigned long n_value; +#else unsigned n_value; +#endif }; static void stab_strcpy(char* dest, int sz, const char* source) @@ -1465,7 +1469,7 @@ case 35: case 36: loc.reg = CV_REG_MM0 + stab_ptr->n_value - 29; break; default: - FIXME("Unknown register value (%u)\n", stab_ptr->n_value); + FIXME("Unknown register value (%lu)\n", (unsigned long)stab_ptr->n_value); loc.reg = CV_REG_NONE; break; } @@ -1615,7 +1619,7 @@ case N_EXCL: if (stabs_add_include(stabs_find_include(ptr, stab_ptr->n_value)) < 0) { - ERR("Excluded header not found (%s,%d)\n", ptr, stab_ptr->n_value); + ERR("Excluded header not found (%s,%ld)\n", ptr, (unsigned long)stab_ptr->n_value); module_reset_debug_info(module); ret = FALSE; goto done; @@ -1661,8 +1665,8 @@ break; } stabbuff[0] = '\0'; - TRACE("0x%02x %x %s\n", - stab_ptr->n_type, stab_ptr->n_value, debugstr_a(strs + stab_ptr->n_strx)); + TRACE("0x%02x %lx %s\n", + stab_ptr->n_type, (unsigned long)stab_ptr->n_value, debugstr_a(strs + stab_ptr->n_strx)); } module->module.SymType = SymDia; module->module.CVSig = 'S' | ('T' << 8) | ('A' << 16) | ('B' << 24); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/band.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/band.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/band.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/band.c 2015-06-28 16:51:28.000000000 +0000 @@ -18,6 +18,7 @@ */ #include "dmband_private.h" +#include "dmobject.h" WINE_DEFAULT_DEBUG_CHANNEL(dmband); WINE_DECLARE_DEBUG_CHANNEL(dmfile); @@ -28,10 +29,8 @@ */ typedef struct IDirectMusicBandImpl { IDirectMusicBand IDirectMusicBand_iface; - const IDirectMusicObjectVtbl *ObjectVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; + struct dmobject dmobj; LONG ref; - DMUS_OBJECTDESC *pDesc; struct list Instruments; } IDirectMusicBandImpl; @@ -53,9 +52,9 @@ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicBand)) *ret_iface = iface; else if (IsEqualIID(riid, &IID_IDirectMusicObject)) - *ret_iface = &This->ObjectVtbl; + *ret_iface = &This->dmobj.IDirectMusicObject_iface; else if (IsEqualIID(riid, &IID_IPersistStream)) - *ret_iface = &This->PersistStreamVtbl; + *ret_iface = &This->dmobj.IPersistStream_iface; else { WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface); return E_NOINTERFACE; @@ -83,7 +82,6 @@ TRACE("(%p) ref=%d\n", This, ref); if (!ref) { - HeapFree(GetProcessHeap(), 0, This->pDesc); HeapFree(GetProcessHeap(), 0, This); DMBAND_UnlockModule(); } @@ -125,64 +123,9 @@ }; /* IDirectMusicBandImpl IDirectMusicObject part: */ -static HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface); - return IDirectMusicBand_QueryInterface(&This->IDirectMusicBand_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface); - return IDirectMusicBand_AddRef(&This->IDirectMusicBand_iface); -} - -static ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface); - return IDirectMusicBand_Release(&This->IDirectMusicBand_iface); -} - -static HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface); - TRACE("(%p, %p)\n", This, pDesc); - /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */ - memcpy (pDesc, This->pDesc, This->pDesc->dwSize); - return S_OK; -} - -static HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface); - TRACE("(%p, %p): setting descriptor:\n", This, pDesc); debug_DMUS_OBJECTDESC (pDesc); - - /* According to MSDN, we should copy only given values, not whole struct */ - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) - This->pDesc->guidObject = pDesc->guidObject; - if (pDesc->dwValidData & DMUS_OBJ_CLASS) - This->pDesc->guidClass = pDesc->guidClass; - if (pDesc->dwValidData & DMUS_OBJ_NAME) - lstrcpynW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) - lstrcpynW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) - lstrcpynW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) - This->pDesc->vVersion = pDesc->vVersion; - if (pDesc->dwValidData & DMUS_OBJ_DATE) - This->pDesc->ftDate = pDesc->ftDate; - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) { - This->pDesc->llMemLength = pDesc->llMemLength; - memcpy (This->pDesc->pbMemData, pDesc->pbMemData, pDesc->llMemLength); - } - if (pDesc->dwValidData & DMUS_OBJ_STREAM) { - /* according to MSDN, we copy the stream */ - IStream_Clone (pDesc->pStream, &This->pDesc->pStream); - } - - /* add new flags */ - This->pDesc->dwValidData |= pDesc->dwValidData; - - return S_OK; -} - -static HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor(IDirectMusicObject *iface, + IStream *pStream, DMUS_OBJECTDESC *pDesc) +{ DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[1], ListCount[1]; LARGE_INTEGER liMove; /* used when skipping chunks */ @@ -329,46 +272,19 @@ return S_OK; } -static const IDirectMusicObjectVtbl DirectMusicBand_Object_Vtbl = { - IDirectMusicBandImpl_IDirectMusicObject_QueryInterface, - IDirectMusicBandImpl_IDirectMusicObject_AddRef, - IDirectMusicBandImpl_IDirectMusicObject_Release, - IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor, - IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor, - IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor +static const IDirectMusicObjectVtbl dmobject_vtbl = { + dmobj_IDirectMusicObject_QueryInterface, + dmobj_IDirectMusicObject_AddRef, + dmobj_IDirectMusicObject_Release, + dmobj_IDirectMusicObject_GetDescriptor, + dmobj_IDirectMusicObject_SetDescriptor, + IDirectMusicObjectImpl_ParseDescriptor }; /* IDirectMusicBandImpl IPersistStream part: */ -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - return IDirectMusicBand_QueryInterface(&This->IDirectMusicBand_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - return IDirectMusicBand_AddRef(&This->IDirectMusicBand_iface); -} - -static ULONG WINAPI IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - return IDirectMusicBand_Release(&This->IDirectMusicBand_iface); -} - -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - TRACE("(%p, %p)\n", This, pClassID); - *pClassID = CLSID_DirectMusicBand; - return S_OK; -} - -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - FIXME("(%p): stub, always S_FALSE\n", This); - return S_FALSE; -} - -static HRESULT IDirectMusicBandImpl_IPersistStream_ParseInstrument (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); +static HRESULT parse_instrument(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ DMUS_PRIVATE_CHUNK Chunk; DWORD ListSize[3], ListCount[3]; LARGE_INTEGER liMove; /* used when skipping chunks */ @@ -418,7 +334,8 @@ switch (Chunk.fccID) { case DMUS_FOURCC_REF_LIST: { FIXME_(dmfile)(": DMRF (DM References) list\n"); - hr = IDirectMusicUtils_IPersistStream_ParseReference (iface, &Chunk, pStm, &pObject); + hr = IDirectMusicUtils_IPersistStream_ParseReference(&This->dmobj.IPersistStream_iface, + &Chunk, pStm, &pObject); if (FAILED(hr)) { ERR(": could not load Reference\n"); return hr; @@ -471,8 +388,9 @@ return S_OK; } -static HRESULT IDirectMusicBandImpl_IPersistStream_ParseInstrumentsList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - /*ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface);*/ +static HRESULT parse_instruments_list(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr; DMUS_PRIVATE_CHUNK Chunk; DWORD ListSize[3], ListCount[3]; @@ -499,7 +417,7 @@ switch (Chunk.fccID) { case DMUS_FOURCC_INSTRUMENT_LIST: { TRACE_(dmfile)(": Instrument list\n"); - hr = IDirectMusicBandImpl_IPersistStream_ParseInstrument (iface, &Chunk, pStm); + hr = parse_instrument(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -525,9 +443,9 @@ return S_OK; } -static HRESULT IDirectMusicBandImpl_IPersistStream_ParseBandForm (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); +static HRESULT parse_band_form(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; @@ -548,7 +466,7 @@ StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, This->pDesc); + hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -571,8 +489,8 @@ IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - - hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, This->pDesc); + + hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -591,7 +509,7 @@ } case DMUS_FOURCC_INSTRUMENTS_LIST: { TRACE_(dmfile)(": INSTRUMENTS list\n"); - hr = IDirectMusicBandImpl_IPersistStream_ParseInstrumentsList (iface, &Chunk, pStm); + hr = parse_instruments_list(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -618,9 +536,14 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); +static inline IDirectMusicBandImpl *impl_from_IPersistStream(IPersistStream *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicBandImpl, dmobj.IPersistStream_iface); +} +static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm) +{ + IDirectMusicBandImpl *This = impl_from_IPersistStream(iface); DMUS_PRIVATE_CHUNK Chunk; LARGE_INTEGER liMove; HRESULT hr; @@ -636,7 +559,7 @@ switch (Chunk.fccID) { case DMUS_FOURCC_BAND_FORM: { TRACE_(dmfile)(": Band form\n"); - hr = IDirectMusicBandImpl_IPersistStream_ParseBandForm (iface, &Chunk, pStm); + hr = parse_band_form(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -661,25 +584,15 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { - ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface); - FIXME("(%p): Saving not implemented yet\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { - return E_NOTIMPL; -} - -static const IPersistStreamVtbl DirectMusicBand_PersistStream_Vtbl = { - IDirectMusicBandImpl_IPersistStream_QueryInterface, - IDirectMusicBandImpl_IPersistStream_AddRef, - IDirectMusicBandImpl_IPersistStream_Release, - IDirectMusicBandImpl_IPersistStream_GetClassID, - IDirectMusicBandImpl_IPersistStream_IsDirty, - IDirectMusicBandImpl_IPersistStream_Load, - IDirectMusicBandImpl_IPersistStream_Save, - IDirectMusicBandImpl_IPersistStream_GetSizeMax +static const IPersistStreamVtbl persiststream_vtbl = { + dmobj_IPersistStream_QueryInterface, + dmobj_IPersistStream_AddRef, + dmobj_IPersistStream_Release, + unimpl_IPersistStream_GetClassID, + unimpl_IPersistStream_IsDirty, + IPersistStreamImpl_Load, + unimpl_IPersistStream_Save, + unimpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ @@ -694,13 +607,10 @@ return E_OUTOFMEMORY; } obj->IDirectMusicBand_iface.lpVtbl = &dmband_vtbl; - obj->ObjectVtbl = &DirectMusicBand_Object_Vtbl; - obj->PersistStreamVtbl = &DirectMusicBand_PersistStream_Vtbl; - obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); - DM_STRUCT_INIT(obj->pDesc); - obj->pDesc->dwValidData |= DMUS_OBJ_CLASS; - obj->pDesc->guidClass = CLSID_DirectMusicBand; obj->ref = 1; + dmobject_init(&obj->dmobj, &CLSID_DirectMusicBand, (IUnknown *)&obj->IDirectMusicBand_iface); + obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; + obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; list_init (&obj->Instruments); DMBAND_LockModule(); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/bandtrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/bandtrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/bandtrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/bandtrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -18,6 +18,7 @@ */ #include "dmband_private.h" +#include "dmobject.h" WINE_DEFAULT_DEBUG_CHANNEL(dmband); WINE_DECLARE_DEBUG_CHANNEL(dmfile); @@ -26,110 +27,97 @@ * IDirectMusicBandTrack implementation */ typedef struct IDirectMusicBandTrack { - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; + IDirectMusicTrack8 IDirectMusicTrack8_iface; + struct dmobject dmobj; /* IPersistStream only */ LONG ref; - DMUS_OBJECTDESC *pDesc; DMUS_IO_BAND_TRACK_HEADER header; struct list Bands; } IDirectMusicBandTrack; -static HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface); - TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); - - if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = &This->UnknownVtbl; - IUnknown_AddRef (iface); - return S_OK; - } else if (IsEqualIID (riid, &IID_IDirectMusicTrack) - || IsEqualIID (riid, &IID_IDirectMusicTrack8)) { - *ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl; - IUnknown_AddRef (iface); - return S_OK; - } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = &This->PersistStreamVtbl; - IUnknown_AddRef (iface); - return S_OK; - } - - WARN("(%p, %s,%p): not found\n", This, debugstr_dmguid(riid), ppobj); - return E_NOINTERFACE; +/* IDirectMusicBandTrack IDirectMusicTrack8 part: */ +static inline IDirectMusicBandTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicBandTrack, IDirectMusicTrack8_iface); } -static ULONG WINAPI IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface); - ULONG ref = InterlockedIncrement(&This->ref); +static HRESULT WINAPI IDirectMusicTrack8Impl_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid, + void **ret_iface) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); - TRACE("(%p) : AddRef from %d\n", This, ref - 1); + *ret_iface = NULL; - DMBAND_LockModule(); + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicTrack) || + IsEqualIID(riid, &IID_IDirectMusicTrack8)) + *ret_iface = iface; + else if (IsEqualIID(riid, &IID_IPersistStream)) + *ret_iface = &This->dmobj.IPersistStream_iface; + else { + WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface); + return E_NOINTERFACE; + } - return ref; + IUnknown_AddRef((IUnknown*)*ret_iface); + return S_OK; } -static ULONG WINAPI IDirectMusicBandTrack_IUnknown_Release (LPUNKNOWN iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) : ReleaseRef to %d\n", This, ref); +static ULONG WINAPI IDirectMusicTrack8Impl_AddRef(IDirectMusicTrack8 *iface) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + LONG ref = InterlockedIncrement(&This->ref); - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } + TRACE("(%p) ref=%d\n", This, ref); - DMBAND_UnlockModule(); - - return ref; + return ref; } -static const IUnknownVtbl DirectMusicBandTrack_Unknown_Vtbl = { - IDirectMusicBandTrack_IUnknown_QueryInterface, - IDirectMusicBandTrack_IUnknown_AddRef, - IDirectMusicBandTrack_IUnknown_Release -}; +static ULONG WINAPI IDirectMusicTrack8Impl_Release(IDirectMusicTrack8 *iface) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + LONG ref = InterlockedDecrement(&This->ref); -/* IDirectMusicBandTrack IDirectMusicTrack8 part: */ -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - return IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); -} + TRACE("(%p) ref=%d\n", This, ref); -static ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - return IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); -} + if (!ref) { + HeapFree(GetProcessHeap(), 0, This); + DMBAND_UnlockModule(); + } -static ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - return IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); + return ref; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_Init(IDirectMusicTrack8 *iface, + IDirectMusicSegment *pSegment) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p): stub\n", This, pSegment); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_InitPlay(LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* segment_state, IDirectMusicPerformance* performance, void** state_data, DWORD virtual_track8id, DWORD flags) +static HRESULT WINAPI IDirectMusicTrack8Impl_InitPlay(IDirectMusicTrack8 *iface, + IDirectMusicSegmentState *segment_state, IDirectMusicPerformance *performance, + void **state_data, DWORD virtual_track8id, DWORD flags) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p, %p, %p, %d, %x): stub\n", This, segment_state, performance, state_data, virtual_track8id, flags); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_EndPlay(IDirectMusicTrack8 *iface, void *pStateData) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p): stub\n", This, pStateData); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Play(LPDIRECTMUSICTRACK8 iface, void* state_data, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD flags, IDirectMusicPerformance* performance, IDirectMusicSegmentState* segment_state, DWORD virtual_id) +static HRESULT WINAPI IDirectMusicTrack8Impl_Play(IDirectMusicTrack8 *iface, void *state_data, + MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD flags, + IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state, + DWORD virtual_id) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p, %d, %d, %d, %x, %p, %p, %d): semi-stub\n", This, state_data, mtStart, mtEnd, mtOffset, flags, performance, segment_state, virtual_id); @@ -143,22 +131,32 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, + MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_SetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, + MUSIC_TIME mtTime, void *pParam) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %s, %d, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - +static HRESULT WINAPI IDirectMusicTrack8Impl_IsParamSupported(IDirectMusicTrack8 *iface, + REFGUID rguidType) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_BandParam) || IsEqualGUID (rguidType, &GUID_Clear_All_Bands) || IsEqualGUID (rguidType, &GUID_ConnectToDLSCollection) @@ -178,27 +176,38 @@ return DMUS_E_TYPE_UNSUPPORTED; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType)); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_AddNotificationType(IDirectMusicTrack8 *iface, + REFGUID notiftype) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype)); + return E_NOTIMPL; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType)); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_RemoveNotificationType(IDirectMusicTrack8 *iface, + REFGUID notiftype) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype)); + return E_NOTIMPL; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_Clone(IDirectMusicTrack8 *iface, MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, IDirectMusicTrack **ppTrack) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %d, %d, %p): stub\n", This, mtStart, mtEnd, ppTrack); return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_PlayEx(LPDIRECTMUSICTRACK8 iface, void* state_data, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD flags, IDirectMusicPerformance* performance, IDirectMusicSegmentState* segment_state, DWORD virtual_id) +static HRESULT WINAPI IDirectMusicTrack8Impl_PlayEx(IDirectMusicTrack8 *iface, void *state_data, + REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD flags, + IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state, + DWORD virtual_id) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %x, %p, %p, %d): stub\n", This, state_data, wine_dbgstr_longlong(rtStart), wine_dbgstr_longlong(rtEnd), wine_dbgstr_longlong(rtOffset), flags, performance, segment_state, virtual_id); @@ -206,9 +215,11 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx(LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* rtNext, void* param, void* state_data, DWORD flags) +static HRESULT WINAPI IDirectMusicTrack8Impl_GetParamEx(IDirectMusicTrack8 *iface, + REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME *rtNext, void *param, + void *state_data, DWORD flags) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %s, 0x%s, %p, %p, %p, %x): stub\n", This, debugstr_dmguid(rguidType), wine_dbgstr_longlong(rtTime), rtNext, param, state_data, flags); @@ -216,9 +227,10 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx(LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* param, void* state_data, DWORD flags) +static HRESULT WINAPI IDirectMusicTrack8Impl_SetParamEx(IDirectMusicTrack8 *iface, + REFGUID rguidType, REFERENCE_TIME rtTime, void *param, void *state_data, DWORD flags) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %s, 0x%s, %p, %p, %x): stub\n", This, debugstr_dmguid(rguidType), wine_dbgstr_longlong(rtTime), param, state_data, flags); @@ -226,72 +238,49 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); - FIXME("(%p, %p, %d, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_Compose(IDirectMusicTrack8 *iface, IUnknown *context, + DWORD trackgroup, IDirectMusicTrack **track) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %p, %d, %p): method not implemented\n", This, context, trackgroup, track); + return E_NOTIMPL; } -static HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface); +static HRESULT WINAPI IDirectMusicTrack8Impl_Join(IDirectMusicTrack8 *iface, + IDirectMusicTrack *pNewTrack, MUSIC_TIME mtJoin, IUnknown *pContext, DWORD dwTrackGroup, + IDirectMusicTrack **ppResultTrack) +{ + IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface); FIXME("(%p, %p, %d, %p, %d, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack); return S_OK; } -static const IDirectMusicTrack8Vtbl DirectMusicBandTrack_DirectMusicTrack_Vtbl = { - IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface, - IDirectMusicBandTrack_IDirectMusicTrack_AddRef, - IDirectMusicBandTrack_IDirectMusicTrack_Release, - IDirectMusicBandTrack_IDirectMusicTrack_Init, - IDirectMusicBandTrack_IDirectMusicTrack_InitPlay, - IDirectMusicBandTrack_IDirectMusicTrack_EndPlay, - IDirectMusicBandTrack_IDirectMusicTrack_Play, - IDirectMusicBandTrack_IDirectMusicTrack_GetParam, - IDirectMusicBandTrack_IDirectMusicTrack_SetParam, - IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported, - IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType, - IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType, - IDirectMusicBandTrack_IDirectMusicTrack_Clone, - IDirectMusicBandTrack_IDirectMusicTrack_PlayEx, - IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx, - IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx, - IDirectMusicBandTrack_IDirectMusicTrack_Compose, - IDirectMusicBandTrack_IDirectMusicTrack_Join +static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = { + IDirectMusicTrack8Impl_QueryInterface, + IDirectMusicTrack8Impl_AddRef, + IDirectMusicTrack8Impl_Release, + IDirectMusicTrack8Impl_Init, + IDirectMusicTrack8Impl_InitPlay, + IDirectMusicTrack8Impl_EndPlay, + IDirectMusicTrack8Impl_Play, + IDirectMusicTrack8Impl_GetParam, + IDirectMusicTrack8Impl_SetParam, + IDirectMusicTrack8Impl_IsParamSupported, + IDirectMusicTrack8Impl_AddNotificationType, + IDirectMusicTrack8Impl_RemoveNotificationType, + IDirectMusicTrack8Impl_Clone, + IDirectMusicTrack8Impl_PlayEx, + IDirectMusicTrack8Impl_GetParamEx, + IDirectMusicTrack8Impl_SetParamEx, + IDirectMusicTrack8Impl_Compose, + IDirectMusicTrack8Impl_Join }; /* IDirectMusicBandTrack IPersistStream part: */ -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - return IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); -} - -static ULONG WINAPI IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - return IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); -} - -static ULONG WINAPI IDirectMusicBandTrack_IPersistStream_Release (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - return IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); -} - -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - TRACE("(%p, %p)\n", This, pClassID); - *pClassID = CLSID_DirectMusicBandTrack; - return S_OK; -} - -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - FIXME("(%p): stub, always S_FALSE\n", This); - return S_FALSE; -} - -static HRESULT IDirectMusicBandTrack_IPersistStream_LoadBand (LPPERSISTSTREAM iface, IStream* pClonedStream, IDirectMusicBand** ppBand, - DMUS_PRIVATE_BAND_ITEM_HEADER* pHeader) { - - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); +static HRESULT load_band(IDirectMusicBandTrack *This, IStream *pClonedStream, + IDirectMusicBand **ppBand, DMUS_PRIVATE_BAND_ITEM_HEADER *pHeader) +{ HRESULT hr = E_FAIL; IPersistStream* pPersistStream = NULL; @@ -334,9 +323,9 @@ return S_OK; } -static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandsList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - - /*ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface);*/ +static HRESULT parse_bands_list(IDirectMusicBandTrack *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, ListSize[3], ListCount[3]; @@ -408,8 +397,8 @@ liMove.QuadPart = 0; liMove.QuadPart -= sizeof(FOURCC) + (sizeof(FOURCC)+sizeof(DWORD)); IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL); - - hr = IDirectMusicBandTrack_IPersistStream_LoadBand (iface, pClonedStream, &pBand, &header); + + hr = load_band(This, pClonedStream, &pBand, &header); if (FAILED(hr)) { ERR(": could not load track\n"); return hr; @@ -456,9 +445,9 @@ return S_OK; } -static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandTrackForm (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); +static HRESULT parse_bandtrack_form(IDirectMusicBandTrack *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; @@ -477,7 +466,7 @@ StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, This->pDesc); + hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -500,8 +489,8 @@ IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - - hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, This->pDesc); + + hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -520,7 +509,7 @@ } case DMUS_FOURCC_BANDS_LIST: { TRACE_(dmfile)(": TRACK list\n"); - hr = IDirectMusicBandTrack_IPersistStream_ParseBandsList (iface, &Chunk, pStm); + hr = parse_bands_list(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -547,10 +536,14 @@ return S_OK; } +static inline IDirectMusicBandTrack *impl_from_IPersistStream(IPersistStream *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicBandTrack, dmobj.IPersistStream_iface); +} -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - +static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm) +{ + IDirectMusicBandTrack *This = impl_from_IPersistStream(iface); DMUS_PRIVATE_CHUNK Chunk; LARGE_INTEGER liMove; HRESULT hr; @@ -566,7 +559,7 @@ switch (Chunk.fccID) { case DMUS_FOURCC_BANDTRACK_FORM: { TRACE_(dmfile)(": Band track form\n"); - hr = IDirectMusicBandTrack_IPersistStream_ParseBandTrackForm (iface, &Chunk, pStm); + hr = parse_bandtrack_form(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -591,48 +584,38 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - FIXME("(%p): Saving not implemented yet\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { - ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface); - FIXME("(%p, %p): stub\n", This, pcbSize); - return E_NOTIMPL; -} - -static const IPersistStreamVtbl DirectMusicBandTrack_PerststStream_Vtbl = { - IDirectMusicBandTrack_IPersistStream_QueryInterface, - IDirectMusicBandTrack_IPersistStream_AddRef, - IDirectMusicBandTrack_IPersistStream_Release, - IDirectMusicBandTrack_IPersistStream_GetClassID, - IDirectMusicBandTrack_IPersistStream_IsDirty, - IDirectMusicBandTrack_IPersistStream_Load, - IDirectMusicBandTrack_IPersistStream_Save, - IDirectMusicBandTrack_IPersistStream_GetSizeMax +static const IPersistStreamVtbl persiststream_vtbl = { + dmobj_IPersistStream_QueryInterface, + dmobj_IPersistStream_AddRef, + dmobj_IPersistStream_Release, + dmobj_IPersistStream_GetClassID, + unimpl_IPersistStream_IsDirty, + IPersistStreamImpl_Load, + unimpl_IPersistStream_Save, + unimpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ HRESULT WINAPI create_dmbandtrack(REFIID lpcGUID, void **ppobj) { - IDirectMusicBandTrack* track; - - track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandTrack)); - if (NULL == track) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } - track->UnknownVtbl = &DirectMusicBandTrack_Unknown_Vtbl; - track->TrackVtbl = &DirectMusicBandTrack_DirectMusicTrack_Vtbl; - track->PersistStreamVtbl = &DirectMusicBandTrack_PerststStream_Vtbl; - track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); - DM_STRUCT_INIT(track->pDesc); - track->pDesc->dwValidData |= DMUS_OBJ_CLASS; - track->pDesc->guidClass = CLSID_DirectMusicBandTrack; - track->ref = 0; /* will be inited by QueryInterface */ - list_init (&track->Bands); + IDirectMusicBandTrack *track; + HRESULT hr; + + track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track)); + if (!track) { + *ppobj = NULL; + return E_OUTOFMEMORY; + } + track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl; + track->ref = 1; + dmobject_init(&track->dmobj, &CLSID_DirectMusicBandTrack, + (IUnknown *)&track->IDirectMusicTrack8_iface); + track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; + list_init (&track->Bands); + + DMBAND_LockModule(); + hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj); + IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface); - return IDirectMusicBandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj); + return hr; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmobject.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmobject.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmobject.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmobject.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,185 @@ +/* + * Base IDirectMusicObject Implementation + * Keep in sync with the master in dlls/dmusic/dmobject.c + * + * Copyright (C) 2003-2004 Rok Mandeljc + * Copyright (C) 2014 Michael Stefaniuc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "objbase.h" +#include "dmusici.h" +#include "dmobject.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmobj); + +/* Generic IDirectMusicObject methods */ +static inline struct dmobject *impl_from_IDirectMusicObject(IDirectMusicObject *iface) +{ + return CONTAINING_RECORD(iface, struct dmobject, IDirectMusicObject_iface); +} + +HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, + void **ret_iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); +} + +ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_AddRef(This->outer_unk); +} + +ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_Release(This->outer_unk); +} + +HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + + TRACE("(%p/%p)->(%p)\n", iface, This, desc); + + if (!desc) + return E_POINTER; + + memcpy(desc, &This->desc, This->desc.dwSize); + + return S_OK; +} + +HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + HRESULT ret = S_OK; + + TRACE("(%p, %p)\n", iface, desc); + + if (!desc) + return E_POINTER; + + /* Immutable property */ + if (desc->dwValidData & DMUS_OBJ_CLASS) + { + desc->dwValidData &= ~DMUS_OBJ_CLASS; + ret = S_FALSE; + } + /* Set only valid fields */ + if (desc->dwValidData & DMUS_OBJ_OBJECT) + This->desc.guidObject = desc->guidObject; + if (desc->dwValidData & DMUS_OBJ_NAME) + lstrcpynW(This->desc.wszName, desc->wszName, DMUS_MAX_NAME); + if (desc->dwValidData & DMUS_OBJ_CATEGORY) + lstrcpynW(This->desc.wszCategory, desc->wszCategory, DMUS_MAX_CATEGORY); + if (desc->dwValidData & DMUS_OBJ_FILENAME) + lstrcpynW(This->desc.wszFileName, desc->wszFileName, DMUS_MAX_FILENAME); + if (desc->dwValidData & DMUS_OBJ_VERSION) + This->desc.vVersion = desc->vVersion; + if (desc->dwValidData & DMUS_OBJ_DATE) + This->desc.ftDate = desc->ftDate; + if (desc->dwValidData & DMUS_OBJ_MEMORY) { + This->desc.llMemLength = desc->llMemLength; + memcpy(This->desc.pbMemData, desc->pbMemData, desc->llMemLength); + } + if (desc->dwValidData & DMUS_OBJ_STREAM) + IStream_Clone(desc->pStream, &This->desc.pStream); + + This->desc.dwValidData |= desc->dwValidData; + + return ret; +} + +/* Generic IPersistStream methods */ +static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface) +{ + return CONTAINING_RECORD(iface, struct dmobject, IPersistStream_iface); +} + +HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, + void **ret_iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); +} + +ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_AddRef(This->outer_unk); +} + +ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_Release(This->outer_unk); +} + +HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + + TRACE("(%p, %p)\n", This, class); + + if (!class) + return E_POINTER; + + *class = This->desc.guidClass; + + return S_OK; +} + +/* IPersistStream methods not implemented in native */ +HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) +{ + TRACE("(%p, %p): method not implemented\n", iface, class); + return E_NOTIMPL; +} + +HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface) +{ + TRACE("(%p): method not implemented, always returning S_FALSE\n", iface); + return S_FALSE; +} + +HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, + BOOL clear_dirty) +{ + TRACE("(%p, %p, %d): method not implemented\n", iface, stream, clear_dirty); + return E_NOTIMPL; +} + +HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size) +{ + TRACE("(%p, %p): method not implemented\n", iface, size); + return E_NOTIMPL; +} + + +void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) +{ + dmobj->outer_unk = outer_unk; + dmobj->desc.dwSize = sizeof(dmobj->desc); + dmobj->desc.dwValidData = DMUS_OBJ_CLASS; + dmobj->desc.guidClass = *class; +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmobject.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmobject.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmobject.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmobject.h 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Base IDirectMusicObject Implementation + * Keep in sync with the master in dlls/dmusic/dmobject.h + * + * Copyright (C) 2014 Michael Stefaniuc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +struct dmobject { + IDirectMusicObject IDirectMusicObject_iface; + IPersistStream IPersistStream_iface; + IUnknown *outer_unk; + DMUS_OBJECTDESC desc; +}; + +void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) DECLSPEC_HIDDEN; + +/* Generic IDirectMusicObject methods */ +HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, + void **ret_iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN; + +/* Generic IPersistStream methods */ +HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, + void **ret_iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN; + +/* IPersistStream methods not implemented in native */ +HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, + CLSID *class) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, + BOOL clear_dirty) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, + ULARGE_INTEGER *size) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmutils.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmutils.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmutils.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmutils.c 2015-06-28 16:51:28.000000000 +0000 @@ -321,7 +321,7 @@ } TRACE_(dmfile)("** DM Reference End of Load ***\n"); - return S_OK; + return hr; } /* FOURCC to string conversion for debug messages */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmutils.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmutils.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/dmutils.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/dmutils.h 2015-06-28 16:51:28.000000000 +0000 @@ -27,8 +27,6 @@ DWORD dwSize; /* size of the chunk */ } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) - /** * Parsing utilities */ @@ -51,12 +49,6 @@ } guid_info; /* used for initialising structs */ -#define DM_STRUCT_INIT(x) \ - do { \ - memset((x), 0, sizeof(*(x))); \ - (x)->dwSize = sizeof(*x); \ - } while (0) - #define FE(x) { x, #x } #define GE(x) { &x, #x } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -5,6 +5,7 @@ band.c \ bandtrack.c \ dmband_main.c \ + dmobject.c \ dmutils.c IDL_SRCS = dmband.idl diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/tests/dmband.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/tests/dmband.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmband/tests/dmband.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmband/tests/dmband.c 2015-06-28 16:51:28.000000000 +0000 @@ -162,7 +162,7 @@ hr = IDirectMusicBand_QueryInterface(dmb, &IID_IPersistStream, (void**)&ps); ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); hr = IPersistStream_GetClassID(ps, &class); - todo_wine ok(hr == E_NOTIMPL, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(hr == E_NOTIMPL, "IPersistStream_GetClassID failed: %08x\n", hr); hr = IPersistStream_IsDirty(ps); ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); hr = IPersistStream_GetSizeMax(ps, &size); @@ -173,6 +173,75 @@ while (IDirectMusicBand_Release(dmb)); } +static void test_bandtrack(void) +{ + IDirectMusicTrack8 *dmt8; + IPersistStream *ps; + CLSID class; + ULARGE_INTEGER size; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicBandTrack, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicTrack8, (void**)&dmt8); + ok(hr == S_OK, "DirectMusicBandTrack create failed: %08x, expected S_OK\n", hr); + + /* IDirectMusicTrack8 */ + todo_wine { + hr = IDirectMusicTrack8_Init(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Init failed: %08x\n", hr); + hr = IDirectMusicTrack8_InitPlay(dmt8, NULL, NULL, NULL, 0, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_InitPlay failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_EndPlay(dmt8, NULL); + ok(hr == S_OK, "IDirectMusicTrack8_EndPlay failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_Play(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == DMUS_S_END, "IDirectMusicTrack8_Play failed: %08x\n", hr); + hr = IDirectMusicTrack8_GetParam(dmt8, NULL, 0, NULL, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_GetParam failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParam(dmt8, NULL, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_SetParam failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_IsParamSupported(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_IsParamSupported failed: %08x\n", hr); + hr = IDirectMusicTrack8_AddNotificationType(dmt8, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_AddNotificationType failed: %08x\n", hr); + hr = IDirectMusicTrack8_RemoveNotificationType(dmt8, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_RemoveNotificationType failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_Clone(dmt8, 0, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Clone failed: %08x\n", hr); + hr = IDirectMusicTrack8_PlayEx(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == DMUS_S_END, "IDirectMusicTrack8_PlayEx failed: %08x\n", hr); + hr = IDirectMusicTrack8_GetParamEx(dmt8, NULL, 0, NULL, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_GetParamEx failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParamEx(dmt8, NULL, 0, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_SetParamEx failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_Compose(dmt8, NULL, 0, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_Compose failed: %08x\n", hr); + hr = IDirectMusicTrack8_Join(dmt8, NULL, 0, NULL, 0, NULL); + todo_wine ok(hr == E_POINTER, "IDirectMusicTrack8_Join failed: %08x\n", hr); + + /* IPersistStream */ + hr = IDirectMusicTrack8_QueryInterface(dmt8, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &class); + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&class, &CLSID_DirectMusicBandTrack), + "Expected class CLSID_DirectMusicBandTrack got %s\n", wine_dbgstr_guid(&class)); + + /* Unimplemented IPersistStream methods */ + hr = IPersistStream_IsDirty(ps); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + hr = IPersistStream_GetSizeMax(ps, &size); + ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); + hr = IPersistStream_Save(ps, NULL, TRUE); + ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %08x\n", hr); + + while (IDirectMusicTrack8_Release(dmt8)); +} + START_TEST(dmband) { CoInitializeEx(NULL, COINIT_MULTITHREADED); @@ -187,6 +256,7 @@ test_COM(); test_COM_bandtrack(); test_dmband(); + test_bandtrack(); CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/chordmaptrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/chordmaptrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/chordmaptrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/chordmaptrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -28,6 +28,14 @@ /***************************************************************************** * IDirectMusicChordMapTrack implementation */ +typedef struct IDirectMusicChordMapTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicChordMapTrack; + /* IDirectMusicChordMapTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface); @@ -85,6 +93,11 @@ }; /* IDirectMusicChordMapTrack IDirectMusicTrack8 part: */ +static inline IDirectMusicChordMapTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicChordMapTrack, TrackVtbl); +} + static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface); return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); @@ -139,6 +152,10 @@ static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) { ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_IDirectMusicChordMap)) { TRACE("param supported\n"); return S_OK; @@ -147,16 +164,22 @@ return DMUS_E_TYPE_UNSUPPORTED; } -static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) { - ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface); - FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType)); - return S_OK; -} +static HRESULT WINAPI IDirectMusicTrack8Impl_AddNotificationType(IDirectMusicTrack8 *iface, + REFGUID notiftype) +{ + IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype)); + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectMusicTrack8Impl_RemoveNotificationType(IDirectMusicTrack8 *iface, + REFGUID notiftype) +{ + IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface); -static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) { - ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface); - FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType)); - return S_OK; + TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype)); + return E_NOTIMPL; } static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) { @@ -186,10 +209,13 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) { - ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface); - FIXME("(%p, %p, %d, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_Compose(IDirectMusicTrack8 *iface, IUnknown *context, + DWORD trackgroup, IDirectMusicTrack **track) +{ + IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %p, %d, %p): method not implemented\n", This, context, trackgroup, track); + return E_NOTIMPL; } static HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) { @@ -199,24 +225,24 @@ } static const IDirectMusicTrack8Vtbl DirectMusicChordMapTrack_Track_Vtbl = { - IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface, - IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef, - IDirectMusicChordMapTrack_IDirectMusicTrack_Release, - IDirectMusicChordMapTrack_IDirectMusicTrack_Init, - IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay, - IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay, - IDirectMusicChordMapTrack_IDirectMusicTrack_Play, - IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam, - IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam, - IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported, - IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType, - IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType, - IDirectMusicChordMapTrack_IDirectMusicTrack_Clone, - IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx, - IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx, - IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx, - IDirectMusicChordMapTrack_IDirectMusicTrack_Compose, - IDirectMusicChordMapTrack_IDirectMusicTrack_Join + IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface, + IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef, + IDirectMusicChordMapTrack_IDirectMusicTrack_Release, + IDirectMusicChordMapTrack_IDirectMusicTrack_Init, + IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay, + IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay, + IDirectMusicChordMapTrack_IDirectMusicTrack_Play, + IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam, + IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam, + IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported, + IDirectMusicTrack8Impl_AddNotificationType, + IDirectMusicTrack8Impl_RemoveNotificationType, + IDirectMusicChordMapTrack_IDirectMusicTrack_Clone, + IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx, + IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx, + IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx, + IDirectMusicTrack8Impl_Compose, + IDirectMusicChordMapTrack_IDirectMusicTrack_Join }; /* IDirectMusicChordMapTrack IPersistStream part: */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/dmcompos_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/dmcompos_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/dmcompos_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/dmcompos_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -43,12 +43,6 @@ #include "dmusics.h" /***************************************************************************** - * Interfaces - */ -typedef struct IDirectMusicChordMapTrack IDirectMusicChordMapTrack; -typedef struct IDirectMusicSignPostTrack IDirectMusicSignPostTrack; - -/***************************************************************************** * ClassFactory */ extern HRESULT WINAPI create_dmchordmap(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; @@ -56,34 +50,6 @@ extern HRESULT WINAPI create_dmchordmaptrack(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; extern HRESULT WINAPI create_dmsignposttrack(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; -/***************************************************************************** - * IDirectMusicChordMapTrack implementation structure - */ -struct IDirectMusicChordMapTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicChordMapTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicSignPostTrack implementation structure - */ -struct IDirectMusicSignPostTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicSignPostTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - /********************************************************************** * Dll lifetime tracking declaration for dmcompos.dll */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/signposttrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/signposttrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/signposttrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/signposttrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -28,6 +28,14 @@ /***************************************************************************** * IDirectMusicSignPostTrack implementation */ +typedef struct IDirectMusicSignPostTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicSignPostTrack; + /* IDirectMusicSignPostTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface); @@ -85,6 +93,11 @@ }; /* IDirectMusicSignPostTrack IDirectMusicTrack8 part: */ +static inline IDirectMusicSignPostTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicSignPostTrack, TrackVtbl); +} + static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); return IDirectMusicSignPostTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); @@ -124,24 +137,32 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) { - ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); - FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_GetParam(IDirectMusicTrack8 *iface, REFGUID type, + MUSIC_TIME time, MUSIC_TIME *next, void *param) +{ + IDirectMusicSignPostTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %d, %p, %p): method not implemented\n", This, debugstr_dmguid(type), time, + next, param); + return E_NOTIMPL; } -static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) { - ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); - FIXME("(%p, %s, %d, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_SetParam(IDirectMusicTrack8 *iface, REFGUID type, + MUSIC_TIME time, void *param) +{ + IDirectMusicSignPostTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %d, %p): method not implemented\n", This, debugstr_dmguid(type), time, param); + return E_NOTIMPL; } -static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) { - ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); - TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); - /* didn't find any params */ - TRACE("param unsupported\n"); - return DMUS_E_TYPE_UNSUPPORTED; +static HRESULT WINAPI IDirectMusicTrack8Impl_IsParamSupported(IDirectMusicTrack8 *iface, + REFGUID type) +{ + IDirectMusicSignPostTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(type)); + return E_NOTIMPL; } static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) { @@ -169,18 +190,24 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) { - ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); - FIXME("(%p, %s, 0x%s, %p, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType), - wine_dbgstr_longlong(rtTime), prtNext, pParam, pStateData, dwFlags); - return S_OK; -} - -static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) { - ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface); - FIXME("(%p, %s, 0x%s, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType), - wine_dbgstr_longlong(rtTime), pParam, pStateData, dwFlags); - return S_OK; +static HRESULT WINAPI IDirectMusicTrack8Impl_GetParamEx(IDirectMusicTrack8 *iface, REFGUID type, + REFERENCE_TIME time, REFERENCE_TIME *next, void *param, void *state, DWORD flags) +{ + IDirectMusicSignPostTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %s, %p, %p, %p, %x): method not implemented\n", This, debugstr_dmguid(type), + wine_dbgstr_longlong(time), next, param, state, flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectMusicTrack8Impl_SetParamEx(IDirectMusicTrack8 *iface, REFGUID type, + REFERENCE_TIME time, void *param, void *state, DWORD flags) +{ + IDirectMusicSignPostTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %s, %p, %p, %x): method not implemented\n", This, debugstr_dmguid(type), + wine_dbgstr_longlong(time), param, state, flags); + return E_NOTIMPL; } static HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) { @@ -196,24 +223,24 @@ } static const IDirectMusicTrack8Vtbl DirectMusicSignPostTrack_Track_Vtbl = { - IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface, - IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef, - IDirectMusicSignPostTrack_IDirectMusicTrack_Release, - IDirectMusicSignPostTrack_IDirectMusicTrack_Init, - IDirectMusicSignPostTrack_IDirectMusicTrack_InitPlay, - IDirectMusicSignPostTrack_IDirectMusicTrack_EndPlay, - IDirectMusicSignPostTrack_IDirectMusicTrack_Play, - IDirectMusicSignPostTrack_IDirectMusicTrack_GetParam, - IDirectMusicSignPostTrack_IDirectMusicTrack_SetParam, - IDirectMusicSignPostTrack_IDirectMusicTrack_IsParamSupported, - IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType, - IDirectMusicSignPostTrack_IDirectMusicTrack_RemoveNotificationType, - IDirectMusicSignPostTrack_IDirectMusicTrack_Clone, - IDirectMusicSignPostTrack_IDirectMusicTrack_PlayEx, - IDirectMusicSignPostTrack_IDirectMusicTrack_GetParamEx, - IDirectMusicSignPostTrack_IDirectMusicTrack_SetParamEx, - IDirectMusicSignPostTrack_IDirectMusicTrack_Compose, - IDirectMusicSignPostTrack_IDirectMusicTrack_Join + IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface, + IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef, + IDirectMusicSignPostTrack_IDirectMusicTrack_Release, + IDirectMusicSignPostTrack_IDirectMusicTrack_Init, + IDirectMusicSignPostTrack_IDirectMusicTrack_InitPlay, + IDirectMusicSignPostTrack_IDirectMusicTrack_EndPlay, + IDirectMusicSignPostTrack_IDirectMusicTrack_Play, + IDirectMusicTrack8Impl_GetParam, + IDirectMusicTrack8Impl_SetParam, + IDirectMusicTrack8Impl_IsParamSupported, + IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType, + IDirectMusicSignPostTrack_IDirectMusicTrack_RemoveNotificationType, + IDirectMusicSignPostTrack_IDirectMusicTrack_Clone, + IDirectMusicSignPostTrack_IDirectMusicTrack_PlayEx, + IDirectMusicTrack8Impl_GetParamEx, + IDirectMusicTrack8Impl_SetParamEx, + IDirectMusicSignPostTrack_IDirectMusicTrack_Compose, + IDirectMusicSignPostTrack_IDirectMusicTrack_Join }; /* IDirectMusicSignPostTrack IPersistStream part: */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/tests/dmcompos.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/tests/dmcompos.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmcompos/tests/dmcompos.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmcompos/tests/dmcompos.c 2015-06-28 16:51:28.000000000 +0000 @@ -261,6 +261,143 @@ while (IDirectMusicChordMap_Release(dmcm)); } +static void test_chordmaptrack(void) +{ + IDirectMusicTrack8 *dmt8; + IPersistStream *ps; + CLSID class; + ULARGE_INTEGER size; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicChordMapTrack, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicTrack8, (void**)&dmt8); + ok(hr == S_OK, "DirectMusicChordMapTrack create failed: %08x, expected S_OK\n", hr); + + /* IDirectMusicTrack8 */ + hr = IDirectMusicTrack8_Init(dmt8, NULL); + ok(hr == S_OK, "IDirectMusicTrack8_Init failed: %08x\n", hr); + hr = IDirectMusicTrack8_InitPlay(dmt8, NULL, NULL, NULL, 0, 0); + ok(hr == S_OK, "IDirectMusicTrack8_InitPlay failed: %08x\n", hr); + hr = IDirectMusicTrack8_EndPlay(dmt8, NULL); + ok(hr == S_OK, "IDirectMusicTrack8_EndPlay failed: %08x\n", hr); + hr = IDirectMusicTrack8_Play(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == S_OK, "IDirectMusicTrack8_Play failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_GetParam(dmt8, NULL, 0, NULL, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_GetParam failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParam(dmt8, NULL, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_SetParam failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_IsParamSupported(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_IsParamSupported failed: %08x\n", hr); + hr = IDirectMusicTrack8_AddNotificationType(dmt8, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_AddNotificationType failed: %08x\n", hr); + hr = IDirectMusicTrack8_RemoveNotificationType(dmt8, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_RemoveNotificationType failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_Clone(dmt8, 0, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Clone failed: %08x\n", hr); + hr = IDirectMusicTrack8_PlayEx(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_PlayEx failed: %08x\n", hr); + hr = IDirectMusicTrack8_GetParamEx(dmt8, NULL, 0, NULL, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_GetParamEx failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParamEx(dmt8, NULL, 0, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_SetParamEx failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_Compose(dmt8, NULL, 0, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_Compose failed: %08x\n", hr); + hr = IDirectMusicTrack8_Join(dmt8, NULL, 0, NULL, 0, NULL); + todo_wine ok(hr == E_POINTER, "IDirectMusicTrack8_Join failed: %08x\n", hr); + + /* IPersistStream */ + hr = IDirectMusicTrack8_QueryInterface(dmt8, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &class); + todo_wine ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + todo_wine ok(IsEqualGUID(&class, &CLSID_DirectMusicChordMapTrack), + "Expected class CLSID_DirectMusicChordMapTrack got %s\n", wine_dbgstr_guid(&class)); + + /* Unimplemented IPersistStream methods */ + hr = IPersistStream_IsDirty(ps); + todo_wine ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + hr = IPersistStream_GetSizeMax(ps, &size); + ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); + hr = IPersistStream_Save(ps, NULL, TRUE); + ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %08x\n", hr); + + while (IDirectMusicTrack8_Release(dmt8)); +} + +static void test_signposttrack(void) +{ + IDirectMusicTrack8 *dmt8; + IPersistStream *ps; + CLSID class; + ULARGE_INTEGER size; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicSignPostTrack, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicTrack8, (void**)&dmt8); + ok(hr == S_OK, "DirectMusicSignPostTrack create failed: %08x, expected S_OK\n", hr); + + /* IDirectMusicTrack8 */ + hr = IDirectMusicTrack8_Init(dmt8, NULL); + ok(hr == S_OK, "IDirectMusicTrack8_Init failed: %08x\n", hr); + if (0) { + /* Crashes on Windows */ + hr = IDirectMusicTrack8_InitPlay(dmt8, NULL, NULL, NULL, 0, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_InitPlay failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_EndPlay(dmt8, NULL); + ok(hr == S_OK, "IDirectMusicTrack8_EndPlay failed: %08x\n", hr); + hr = IDirectMusicTrack8_Play(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == S_OK, "IDirectMusicTrack8_Play failed: %08x\n", hr); + hr = IDirectMusicTrack8_GetParam(dmt8, NULL, 0, NULL, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_GetParam failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParam(dmt8, NULL, 0, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_SetParam failed: %08x\n", hr); + hr = IDirectMusicTrack8_IsParamSupported(dmt8, NULL); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_IsParamSupported failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_AddNotificationType(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_AddNotificationType failed: %08x\n", hr); + hr = IDirectMusicTrack8_RemoveNotificationType(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_RemoveNotificationType failed: %08x\n", hr); + hr = IDirectMusicTrack8_Clone(dmt8, 0, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Clone failed: %08x\n", hr); + hr = IDirectMusicTrack8_PlayEx(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0); + ok(hr == E_POINTER, "IDirectMusicTrack8_PlayEx failed: %08x\n", hr); + } + hr = IDirectMusicTrack8_GetParamEx(dmt8, NULL, 0, NULL, NULL, NULL, 0); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_GetParamEx failed: %08x\n", hr); + hr = IDirectMusicTrack8_SetParamEx(dmt8, NULL, 0, NULL, NULL, 0); + ok(hr == E_NOTIMPL, "IDirectMusicTrack8_SetParamEx failed: %08x\n", hr); + todo_wine { + hr = IDirectMusicTrack8_Compose(dmt8, NULL, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Compose failed: %08x\n", hr); + hr = IDirectMusicTrack8_Join(dmt8, NULL, 0, NULL, 0, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_Join failed: %08x\n", hr); + } + + /* IPersistStream */ + hr = IDirectMusicTrack8_QueryInterface(dmt8, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &class); + todo_wine ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + todo_wine ok(IsEqualGUID(&class, &CLSID_DirectMusicSignPostTrack), + "Expected class CLSID_DirectMusicSignPostTrack got %s\n", wine_dbgstr_guid(&class)); + hr = IPersistStream_Save(ps, NULL, TRUE); + todo_wine ok(hr == E_POINTER, "IPersistStream_Save failed: %08x\n", hr); + + /* Unimplemented IPersistStream methods */ + hr = IPersistStream_IsDirty(ps); + todo_wine ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + hr = IPersistStream_GetSizeMax(ps, &size); + ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); + + while (IDirectMusicTrack8_Release(dmt8)); +} + START_TEST(dmcompos) { CoInitialize(NULL); @@ -276,6 +413,8 @@ test_COM_template(); test_COM_track(); test_chordmap(); + test_chordmaptrack(); + test_signposttrack(); CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/audiopath.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/audiopath.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/audiopath.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/audiopath.c 2015-06-28 16:51:28.000000000 +0000 @@ -18,19 +18,15 @@ */ #include "dmime_private.h" +#include "dmobject.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); WINE_DECLARE_DEBUG_CHANNEL(dmfile); struct IDirectMusicAudioPathImpl { IDirectMusicAudioPath IDirectMusicAudioPath_iface; - IDirectMusicObject IDirectMusicObject_iface; - IPersistStream IPersistStream_iface; + struct dmobject dmobj; LONG ref; - - /* IDirectMusicAudioPathImpl fields */ - LPDMUS_OBJECTDESC pDesc; - IDirectMusicPerformance8* pPerf; IDirectMusicGraph* pToolGraph; IDirectSoundBuffer* pDSBuffer; @@ -46,12 +42,12 @@ static inline struct IDirectMusicAudioPathImpl *impl_from_IDirectMusicObject(IDirectMusicObject *iface) { - return CONTAINING_RECORD(iface, struct IDirectMusicAudioPathImpl, IDirectMusicObject_iface); + return CONTAINING_RECORD(iface, struct IDirectMusicAudioPathImpl, dmobj.IDirectMusicObject_iface); } static inline struct IDirectMusicAudioPathImpl *impl_from_IPersistStream(IPersistStream *iface) { - return CONTAINING_RECORD(iface, struct IDirectMusicAudioPathImpl, IPersistStream_iface); + return CONTAINING_RECORD(iface, struct IDirectMusicAudioPathImpl, dmobj.IPersistStream_iface); } void set_audiopath_perf_pointer(IDirectMusicAudioPath *iface, IDirectMusicPerformance8 *performance) @@ -86,9 +82,9 @@ if (IsEqualIID (riid, &IID_IDirectMusicAudioPath) || IsEqualIID (riid, &IID_IUnknown)) *ppobj = &This->IDirectMusicAudioPath_iface; else if (IsEqualIID (riid, &IID_IDirectMusicObject)) - *ppobj = &This->IDirectMusicObject_iface; + *ppobj = &This->dmobj.IDirectMusicObject_iface; else if (IsEqualIID (riid, &IID_IPersistStream)) - *ppobj = &This->IPersistStream_iface; + *ppobj = &This->dmobj.IPersistStream_iface; if (*ppobj) { IUnknown_AddRef((IUnknown*)*ppobj); @@ -267,69 +263,6 @@ }; /* IDirectMusicObject */ -static HRESULT WINAPI DirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, void **ppobj) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicAudioPath_QueryInterface(&This->IDirectMusicAudioPath_iface, riid, ppobj); -} - -static ULONG WINAPI DirectMusicObject_AddRef(IDirectMusicObject *iface) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicAudioPath_AddRef(&This->IDirectMusicAudioPath_iface); -} - -static ULONG WINAPI DirectMusicObject_Release(IDirectMusicObject *iface) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicAudioPath_Release(&This->IDirectMusicAudioPath_iface); -} - -static HRESULT WINAPI DirectMusicObject_GetDescriptor(IDirectMusicObject *iface, LPDMUS_OBJECTDESC pDesc) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); - TRACE("(%p, %p)\n", This, pDesc); - /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */ - memcpy (pDesc, This->pDesc, This->pDesc->dwSize); - return S_OK; -} - -static HRESULT WINAPI DirectMusicObject_SetDescriptor(IDirectMusicObject *iface, LPDMUS_OBJECTDESC pDesc) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); - - TRACE("(%p, %p): setting descriptor:\n%s\n", This, pDesc, debugstr_DMUS_OBJECTDESC (pDesc)); - - /* According to MSDN, we should copy only given values, not whole struct */ - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) - This->pDesc->guidObject = pDesc->guidObject; - if (pDesc->dwValidData & DMUS_OBJ_CLASS) - This->pDesc->guidClass = pDesc->guidClass; - if (pDesc->dwValidData & DMUS_OBJ_NAME) - lstrcpynW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) - lstrcpynW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) - lstrcpynW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) - This->pDesc->vVersion = pDesc->vVersion; - if (pDesc->dwValidData & DMUS_OBJ_DATE) - This->pDesc->ftDate = pDesc->ftDate; - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) { - This->pDesc->llMemLength = pDesc->llMemLength; - memcpy (This->pDesc->pbMemData, pDesc->pbMemData, pDesc->llMemLength); - } - if (pDesc->dwValidData & DMUS_OBJ_STREAM) { - /* according to MSDN, we copy the stream */ - IStream_Clone (pDesc->pStream, &This->pDesc->pStream); - } - - /* add new flags */ - This->pDesc->dwValidData |= pDesc->dwValidData; - - return S_OK; -} - static HRESULT WINAPI DirectMusicObject_ParseDescriptor(IDirectMusicObject *iface, IStream *pStream, DMUS_OBJECTDESC *pDesc) { struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicObject(iface); @@ -341,7 +274,7 @@ /* FIXME: should this be determined from stream? */ pDesc->dwValidData |= DMUS_OBJ_CLASS; - pDesc->guidClass = This->pDesc->guidClass; + pDesc->guidClass = This->dmobj.desc.guidClass; IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); @@ -479,44 +412,16 @@ return S_OK; } -static const IDirectMusicObjectVtbl DirectMusicObjectVtbl = { - DirectMusicObject_QueryInterface, - DirectMusicObject_AddRef, - DirectMusicObject_Release, - DirectMusicObject_GetDescriptor, - DirectMusicObject_SetDescriptor, +static const IDirectMusicObjectVtbl dmobject_vtbl = { + dmobj_IDirectMusicObject_QueryInterface, + dmobj_IDirectMusicObject_AddRef, + dmobj_IDirectMusicObject_Release, + dmobj_IDirectMusicObject_GetDescriptor, + dmobj_IDirectMusicObject_SetDescriptor, DirectMusicObject_ParseDescriptor }; /* IPersistStream */ -static HRESULT WINAPI PersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ppobj) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicAudioPath_QueryInterface(&This->IDirectMusicAudioPath_iface, riid, ppobj); -} - -static ULONG WINAPI PersistStream_AddRef(IPersistStream *iface) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicAudioPath_AddRef(&This->IDirectMusicAudioPath_iface); -} - -static ULONG WINAPI PersistStream_Release(IPersistStream *iface) -{ - struct IDirectMusicAudioPathImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicAudioPath_Release(&This->IDirectMusicAudioPath_iface); -} - -static HRESULT WINAPI PersistStream_GetClassID(IPersistStream *iface, CLSID* pClassID) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI PersistStream_IsDirty(IPersistStream *iface) -{ - return E_NOTIMPL; -} - static HRESULT WINAPI PersistStream_Load(IPersistStream *iface, IStream *pStm) { struct IDirectMusicAudioPathImpl *This = impl_from_IPersistStream(iface); @@ -546,20 +451,20 @@ switch (chunkID) { case DMUS_FOURCC_GUID_CHUNK: { TRACE_(dmfile)(": GUID chunk\n"); - This->pDesc->dwValidData |= DMUS_OBJ_OBJECT; - IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_OBJECT; + IStream_Read (pStm, &This->dmobj.desc.guidObject, chunkSize, NULL); break; } case DMUS_FOURCC_VERSION_CHUNK: { TRACE_(dmfile)(": version chunk\n"); - This->pDesc->dwValidData |= DMUS_OBJ_VERSION; - IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_VERSION; + IStream_Read (pStm, &This->dmobj.desc.vVersion, chunkSize, NULL); break; } case DMUS_FOURCC_CATEGORY_CHUNK: { TRACE_(dmfile)(": category chunk\n"); - This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY; - IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_CATEGORY; + IStream_Read (pStm, This->dmobj.desc.wszCategory, chunkSize, NULL); break; } case FOURCC_LIST: { @@ -581,8 +486,8 @@ case mmioFOURCC('I','N','A','M'): case DMUS_FOURCC_UNAM_CHUNK: { TRACE_(dmfile)(": name chunk\n"); - This->pDesc->dwValidData |= DMUS_OBJ_NAME; - IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_NAME; + IStream_Read (pStm, This->dmobj.desc.wszName, chunkSize, NULL); break; } case mmioFOURCC('I','A','R','T'): @@ -665,25 +570,15 @@ return S_OK; } -static HRESULT WINAPI PersistStream_Save(IPersistStream *iface, IStream *pStm, BOOL fClearDirty) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI PersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *pcbSize) -{ - return E_NOTIMPL; -} - -static const IPersistStreamVtbl PersistStreamVtbl = { - PersistStream_QueryInterface, - PersistStream_AddRef, - PersistStream_Release, - PersistStream_GetClassID, - PersistStream_IsDirty, +static const IPersistStreamVtbl persiststream_vtbl = { + dmobj_IPersistStream_QueryInterface, + dmobj_IPersistStream_AddRef, + dmobj_IPersistStream_Release, + dmobj_IPersistStream_GetClassID, + unimpl_IPersistStream_IsDirty, PersistStream_Load, - PersistStream_Save, - PersistStream_GetSizeMax + unimpl_IPersistStream_Save, + unimpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ @@ -698,13 +593,11 @@ return E_OUTOFMEMORY; } obj->IDirectMusicAudioPath_iface.lpVtbl = &DirectMusicAudioPathVtbl; - obj->IDirectMusicObject_iface.lpVtbl = &DirectMusicObjectVtbl; - obj->IPersistStream_iface.lpVtbl = &PersistStreamVtbl; - obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); - DM_STRUCT_INIT(obj->pDesc); - obj->pDesc->dwValidData |= DMUS_OBJ_CLASS; - obj->pDesc->guidClass = CLSID_DirectMusicAudioPathConfig; obj->ref = 1; + dmobject_init(&obj->dmobj, &CLSID_DirectMusicAudioPathConfig, + (IUnknown *)&obj->IDirectMusicAudioPath_iface); + obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; + obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; hr = IDirectMusicAudioPath_QueryInterface(&obj->IDirectMusicAudioPath_iface, riid, ppobj); IDirectMusicAudioPath_Release(&obj->IDirectMusicAudioPath_iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmime_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmime_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmime_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmime_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -49,16 +49,6 @@ typedef struct IDirectMusicGraphImpl IDirectMusicGraphImpl; typedef struct IDirectMusicAudioPathImpl IDirectMusicAudioPathImpl; -typedef struct IDirectMusicLyricsTrack IDirectMusicLyricsTrack; -typedef struct IDirectMusicMarkerTrack IDirectMusicMarkerTrack; -typedef struct IDirectMusicParamControlTrack IDirectMusicParamControlTrack; -typedef struct IDirectMusicSegTriggerTrack IDirectMusicSegTriggerTrack; -typedef struct IDirectMusicSeqTrack IDirectMusicSeqTrack; -typedef struct IDirectMusicSysExTrack IDirectMusicSysExTrack; -typedef struct IDirectMusicTempoTrack IDirectMusicTempoTrack; -typedef struct IDirectMusicTimeSigTrack IDirectMusicTimeSigTrack; -typedef struct IDirectMusicWaveTrack IDirectMusicWaveTrack; - /***************************************************************************** * ClassFactory */ @@ -123,137 +113,6 @@ IDirectMusicPort *port; /* ... at this port */ } DMUSIC_PRIVATE_PCHANNEL, *LPDMUSIC_PRIVATE_PCHANNEL; -/***************************************************************************** - * IDirectMusicLyricsTrack implementation structure - */ -struct IDirectMusicLyricsTrack -{ - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicLyricsTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicMarkerTrack implementation structure - */ -struct IDirectMusicMarkerTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicMarkerTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicParamControlTrack implementation structure - */ -struct IDirectMusicParamControlTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicParamControlTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicSegTriggerTrack implementation structure - */ -struct IDirectMusicSegTriggerTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicSegTriggerTrack fields */ - LPDMUS_OBJECTDESC pDesc; - - struct list Items; -}; - -/***************************************************************************** - * IDirectMusicSeqTrack implementation structure - */ -struct IDirectMusicSeqTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicSeqTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicSysExTrack implementation structure - */ -struct IDirectMusicSysExTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicSysExTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicTempoTrack implementation structure - */ -struct IDirectMusicTempoTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicTempoTrack fields */ - LPDMUS_OBJECTDESC pDesc; - BOOL enabled; - struct list Items; -}; - -/***************************************************************************** - * IDirectMusicTimeSigTrack implementation structure - */ -struct IDirectMusicTimeSigTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicTimeSigTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - -/***************************************************************************** - * IDirectMusicWaveTrack implementation structure - */ -struct IDirectMusicWaveTrack { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicTrack8Vtbl *TrackVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; - LONG ref; - - /* IDirectMusicWaveTrack fields */ - LPDMUS_OBJECTDESC pDesc; -}; - /********************************************************************** * Dll lifetime tracking declaration for dmime.dll */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmobject.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmobject.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmobject.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmobject.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,185 @@ +/* + * Base IDirectMusicObject Implementation + * Keep in sync with the master in dlls/dmusic/dmobject.c + * + * Copyright (C) 2003-2004 Rok Mandeljc + * Copyright (C) 2014 Michael Stefaniuc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "objbase.h" +#include "dmusici.h" +#include "dmobject.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmobj); + +/* Generic IDirectMusicObject methods */ +static inline struct dmobject *impl_from_IDirectMusicObject(IDirectMusicObject *iface) +{ + return CONTAINING_RECORD(iface, struct dmobject, IDirectMusicObject_iface); +} + +HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, + void **ret_iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); +} + +ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_AddRef(This->outer_unk); +} + +ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + return IUnknown_Release(This->outer_unk); +} + +HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + + TRACE("(%p/%p)->(%p)\n", iface, This, desc); + + if (!desc) + return E_POINTER; + + memcpy(desc, &This->desc, This->desc.dwSize); + + return S_OK; +} + +HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) +{ + struct dmobject *This = impl_from_IDirectMusicObject(iface); + HRESULT ret = S_OK; + + TRACE("(%p, %p)\n", iface, desc); + + if (!desc) + return E_POINTER; + + /* Immutable property */ + if (desc->dwValidData & DMUS_OBJ_CLASS) + { + desc->dwValidData &= ~DMUS_OBJ_CLASS; + ret = S_FALSE; + } + /* Set only valid fields */ + if (desc->dwValidData & DMUS_OBJ_OBJECT) + This->desc.guidObject = desc->guidObject; + if (desc->dwValidData & DMUS_OBJ_NAME) + lstrcpynW(This->desc.wszName, desc->wszName, DMUS_MAX_NAME); + if (desc->dwValidData & DMUS_OBJ_CATEGORY) + lstrcpynW(This->desc.wszCategory, desc->wszCategory, DMUS_MAX_CATEGORY); + if (desc->dwValidData & DMUS_OBJ_FILENAME) + lstrcpynW(This->desc.wszFileName, desc->wszFileName, DMUS_MAX_FILENAME); + if (desc->dwValidData & DMUS_OBJ_VERSION) + This->desc.vVersion = desc->vVersion; + if (desc->dwValidData & DMUS_OBJ_DATE) + This->desc.ftDate = desc->ftDate; + if (desc->dwValidData & DMUS_OBJ_MEMORY) { + This->desc.llMemLength = desc->llMemLength; + memcpy(This->desc.pbMemData, desc->pbMemData, desc->llMemLength); + } + if (desc->dwValidData & DMUS_OBJ_STREAM) + IStream_Clone(desc->pStream, &This->desc.pStream); + + This->desc.dwValidData |= desc->dwValidData; + + return ret; +} + +/* Generic IPersistStream methods */ +static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface) +{ + return CONTAINING_RECORD(iface, struct dmobject, IPersistStream_iface); +} + +HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, + void **ret_iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); +} + +ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_AddRef(This->outer_unk); +} + +ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + return IUnknown_Release(This->outer_unk); +} + +HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) +{ + struct dmobject *This = impl_from_IPersistStream(iface); + + TRACE("(%p, %p)\n", This, class); + + if (!class) + return E_POINTER; + + *class = This->desc.guidClass; + + return S_OK; +} + +/* IPersistStream methods not implemented in native */ +HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) +{ + TRACE("(%p, %p): method not implemented\n", iface, class); + return E_NOTIMPL; +} + +HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface) +{ + TRACE("(%p): method not implemented, always returning S_FALSE\n", iface); + return S_FALSE; +} + +HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, + BOOL clear_dirty) +{ + TRACE("(%p, %p, %d): method not implemented\n", iface, stream, clear_dirty); + return E_NOTIMPL; +} + +HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size) +{ + TRACE("(%p, %p): method not implemented\n", iface, size); + return E_NOTIMPL; +} + + +void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) +{ + dmobj->outer_unk = outer_unk; + dmobj->desc.dwSize = sizeof(dmobj->desc); + dmobj->desc.dwValidData = DMUS_OBJ_CLASS; + dmobj->desc.guidClass = *class; +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmobject.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmobject.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmobject.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmobject.h 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Base IDirectMusicObject Implementation + * Keep in sync with the master in dlls/dmusic/dmobject.h + * + * Copyright (C) 2014 Michael Stefaniuc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +struct dmobject { + IDirectMusicObject IDirectMusicObject_iface; + IPersistStream IPersistStream_iface; + IUnknown *outer_unk; + DMUS_OBJECTDESC desc; +}; + +void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) DECLSPEC_HIDDEN; + +/* Generic IDirectMusicObject methods */ +HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, + void **ret_iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, + DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN; + +/* Generic IPersistStream methods */ +HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, + void **ret_iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) DECLSPEC_HIDDEN; +ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN; + +/* IPersistStream methods not implemented in native */ +HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, + CLSID *class) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, + BOOL clear_dirty) DECLSPEC_HIDDEN; +HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, + ULARGE_INTEGER *size) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmutils.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmutils.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/dmutils.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/dmutils.c 2015-06-28 16:51:28.000000000 +0000 @@ -216,7 +216,7 @@ } TRACE("** DM Reference End of Load ***\n"); - return S_OK; + return hr; } /* FOURCC to string conversion for debug messages */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/graph.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/graph.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/graph.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/graph.c 2015-06-28 16:51:28.000000000 +0000 @@ -18,18 +18,15 @@ */ #include "dmime_private.h" +#include "dmobject.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); WINE_DECLARE_DEBUG_CHANNEL(dmfile); struct IDirectMusicGraphImpl { IDirectMusicGraph IDirectMusicGraph_iface; - IDirectMusicObject IDirectMusicObject_iface; - IPersistStream IPersistStream_iface; + struct dmobject dmobj; LONG ref; - - /* IDirectMusicGraphImpl fields */ - DMUS_OBJECTDESC desc; WORD num_tools; struct list Tools; }; @@ -41,12 +38,12 @@ static inline IDirectMusicGraphImpl *impl_from_IDirectMusicObject(IDirectMusicObject *iface) { - return CONTAINING_RECORD(iface, IDirectMusicGraphImpl, IDirectMusicObject_iface); + return CONTAINING_RECORD(iface, IDirectMusicGraphImpl, dmobj.IDirectMusicObject_iface); } static inline IDirectMusicGraphImpl *impl_from_IPersistStream(IPersistStream *iface) { - return CONTAINING_RECORD(iface, IDirectMusicGraphImpl, IPersistStream_iface); + return CONTAINING_RECORD(iface, IDirectMusicGraphImpl, dmobj.IPersistStream_iface); } static HRESULT WINAPI DirectMusicGraph_QueryInterface(IDirectMusicGraph *iface, REFIID riid, void **ret_iface) @@ -63,9 +60,9 @@ *ret_iface = &This->IDirectMusicGraph_iface; } else if (IsEqualIID(riid, &IID_IDirectMusicObject)) - *ret_iface = &This->IDirectMusicObject_iface; + *ret_iface = &This->dmobj.IDirectMusicObject_iface; else if (IsEqualIID(riid, &IID_IPersistStream)) - *ret_iface = &This->IPersistStream_iface; + *ret_iface = &This->dmobj.IPersistStream_iface; if (*ret_iface) { @@ -196,68 +193,6 @@ DirectMusicGraph_RemoveTool }; -static HRESULT WINAPI DirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, void **ret_iface) -{ - IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicGraph_QueryInterface(&This->IDirectMusicGraph_iface, riid, ret_iface); -} - -static ULONG WINAPI DirectMusicObject_AddRef(IDirectMusicObject *iface) -{ - IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicGraph_AddRef(&This->IDirectMusicGraph_iface); -} - -static ULONG WINAPI DirectMusicObject_Release(IDirectMusicObject *iface) -{ - IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); - return IDirectMusicGraph_Release(&This->IDirectMusicGraph_iface); -} - -static HRESULT WINAPI DirectMusicObject_GetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc) -{ - IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); - TRACE("(%p, %p)\n", This, desc); - *desc = This->desc; - return S_OK; -} - -static HRESULT WINAPI DirectMusicObject_SetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *pDesc) -{ - IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); - - TRACE("(%p, %p): %s\n", This, pDesc, debugstr_DMUS_OBJECTDESC(pDesc)); - - /* According to MSDN, we should copy only given values, not whole struct */ - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) - This->desc.guidObject = pDesc->guidObject; - if (pDesc->dwValidData & DMUS_OBJ_CLASS) - This->desc.guidClass = pDesc->guidClass; - if (pDesc->dwValidData & DMUS_OBJ_NAME) - lstrcpynW (This->desc.wszName, pDesc->wszName, DMUS_MAX_NAME); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) - lstrcpynW (This->desc.wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) - lstrcpynW (This->desc.wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) - This->desc.vVersion = pDesc->vVersion; - if (pDesc->dwValidData & DMUS_OBJ_DATE) - This->desc.ftDate = pDesc->ftDate; - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) - { - This->desc.llMemLength = pDesc->llMemLength; - memcpy(This->desc.pbMemData, pDesc->pbMemData, pDesc->llMemLength); - } - - /* according to MSDN, we copy the stream */ - if (pDesc->dwValidData & DMUS_OBJ_STREAM) - IStream_Clone(pDesc->pStream, &This->desc.pStream); - - /* add new flags */ - This->desc.dwValidData |= pDesc->dwValidData; - return S_OK; -} - static HRESULT WINAPI DirectMusicObject_ParseDescriptor(IDirectMusicObject *iface, IStream *pStream, DMUS_OBJECTDESC *pDesc) { IDirectMusicGraphImpl *This = impl_from_IDirectMusicObject(iface); @@ -407,49 +342,15 @@ return S_OK; } -static const IDirectMusicObjectVtbl DirectMusicObjectVtbl = -{ - DirectMusicObject_QueryInterface, - DirectMusicObject_AddRef, - DirectMusicObject_Release, - DirectMusicObject_GetDescriptor, - DirectMusicObject_SetDescriptor, +static const IDirectMusicObjectVtbl dmobject_vtbl = { + dmobj_IDirectMusicObject_QueryInterface, + dmobj_IDirectMusicObject_AddRef, + dmobj_IDirectMusicObject_Release, + dmobj_IDirectMusicObject_GetDescriptor, + dmobj_IDirectMusicObject_SetDescriptor, DirectMusicObject_ParseDescriptor }; -static HRESULT WINAPI PersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ret_iface) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicGraph_QueryInterface(&This->IDirectMusicGraph_iface, riid, ret_iface); -} - -static ULONG WINAPI PersistStream_AddRef(IPersistStream *iface) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicGraph_AddRef(&This->IDirectMusicGraph_iface); -} - -static ULONG WINAPI PersistStream_Release(IPersistStream *iface) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - return IDirectMusicGraph_Release(&This->IDirectMusicGraph_iface); -} - -static HRESULT WINAPI PersistStream_GetClassID(IPersistStream *iface, CLSID *clsid) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - TRACE("(%p) %p\n", This, clsid); - *clsid = CLSID_DirectMusicGraph; - return S_OK; -} - -static HRESULT WINAPI PersistStream_IsDirty(IPersistStream *iface) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; -} - static HRESULT WINAPI PersistStream_Load(IPersistStream *iface, IStream* pStm) { IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); @@ -478,20 +379,20 @@ switch (chunkID) { case DMUS_FOURCC_GUID_CHUNK: { TRACE_(dmfile)(": GUID chunk\n"); - This->desc.dwValidData |= DMUS_OBJ_OBJECT; - IStream_Read (pStm, &This->desc.guidObject, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_OBJECT; + IStream_Read (pStm, &This->dmobj.desc.guidObject, chunkSize, NULL); break; } case DMUS_FOURCC_VERSION_CHUNK: { TRACE_(dmfile)(": version chunk\n"); - This->desc.dwValidData |= DMUS_OBJ_VERSION; - IStream_Read (pStm, &This->desc.vVersion, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_VERSION; + IStream_Read (pStm, &This->dmobj.desc.vVersion, chunkSize, NULL); break; } case DMUS_FOURCC_CATEGORY_CHUNK: { TRACE_(dmfile)(": category chunk\n"); - This->desc.dwValidData |= DMUS_OBJ_CATEGORY; - IStream_Read (pStm, This->desc.wszCategory, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_CATEGORY; + IStream_Read (pStm, This->dmobj.desc.wszCategory, chunkSize, NULL); break; } case FOURCC_LIST: { @@ -513,8 +414,8 @@ case mmioFOURCC('I','N','A','M'): case DMUS_FOURCC_UNAM_CHUNK: { TRACE_(dmfile)(": name chunk\n"); - This->desc.dwValidData |= DMUS_OBJ_NAME; - IStream_Read (pStm, This->desc.wszName, chunkSize, NULL); + This->dmobj.desc.dwValidData |= DMUS_OBJ_NAME; + IStream_Read (pStm, This->dmobj.desc.wszName, chunkSize, NULL); break; } case mmioFOURCC('I','A','R','T'): @@ -597,30 +498,15 @@ return S_OK; } -static HRESULT WINAPI PersistStream_Save(IPersistStream *iface, IStream *stream, BOOL clear_dirty) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - TRACE("(%p) %p %d\n", This, stream, clear_dirty); - return E_NOTIMPL; -} - -static HRESULT WINAPI PersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size) -{ - IDirectMusicGraphImpl *This = impl_from_IPersistStream(iface); - TRACE("(%p) %p\n", This, size); - return E_NOTIMPL; -} - -static const IPersistStreamVtbl PersistStreamVtbl = -{ - PersistStream_QueryInterface, - PersistStream_AddRef, - PersistStream_Release, - PersistStream_GetClassID, - PersistStream_IsDirty, +static const IPersistStreamVtbl persiststream_vtbl = { + dmobj_IPersistStream_QueryInterface, + dmobj_IPersistStream_AddRef, + dmobj_IPersistStream_Release, + dmobj_IPersistStream_GetClassID, + unimpl_IPersistStream_IsDirty, PersistStream_Load, - PersistStream_Save, - PersistStream_GetSizeMax + unimpl_IPersistStream_Save, + unimpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ @@ -636,12 +522,10 @@ return E_OUTOFMEMORY; obj->IDirectMusicGraph_iface.lpVtbl = &DirectMusicGraphVtbl; - obj->IDirectMusicObject_iface.lpVtbl = &DirectMusicObjectVtbl; - obj->IPersistStream_iface.lpVtbl = &PersistStreamVtbl; - DM_STRUCT_INIT(&obj->desc); - obj->desc.dwValidData |= DMUS_OBJ_CLASS; - obj->desc.guidClass = CLSID_DirectMusicGraph; obj->ref = 1; + dmobject_init(&obj->dmobj, &CLSID_DirectMusicGraph, (IUnknown *)&obj->IDirectMusicGraph_iface); + obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; + obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; list_init(&obj->Tools); hr = IDirectMusicGraph_QueryInterface(&obj->IDirectMusicGraph_iface, riid, ret_iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/lyricstrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/lyricstrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/lyricstrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/lyricstrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicLyricsTrack implementation */ +typedef struct IDirectMusicLyricsTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicLyricsTrack; + /* IDirectMusicLyricsTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicLyricsTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -4,6 +4,7 @@ C_SRCS = \ audiopath.c \ dmime_main.c \ + dmobject.c \ dmutils.c \ graph.c \ lyricstrack.c \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/markertrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/markertrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/markertrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/markertrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicMarkerTrack implementation */ +typedef struct IDirectMusicMarkerTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicMarkerTrack; + /* IDirectMusicMarkerTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicMarkerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/paramcontroltrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/paramcontroltrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/paramcontroltrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/paramcontroltrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicParamControlTrack implementation */ +typedef struct IDirectMusicParamControlTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicParamControlTrack; + /* IDirectMusicParamControlTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicParamControlTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/segment.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/segment.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/segment.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/segment.c 2015-06-28 16:51:28.000000000 +0000 @@ -19,6 +19,7 @@ */ #include "dmime_private.h" +#include "dmobject.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); WINE_DECLARE_DEBUG_CHANNEL(dmfile); @@ -28,10 +29,8 @@ */ typedef struct IDirectMusicSegment8Impl { IDirectMusicSegment8 IDirectMusicSegment8_iface; - const IDirectMusicObjectVtbl *ObjectVtbl; - const IPersistStreamVtbl *PersistStreamVtbl; + struct dmobject dmobj; LONG ref; - DMUS_OBJECTDESC *pDesc; DMUS_IO_SEGMENT_HEADER header; IDirectMusicGraph *pGraph; struct list Tracks; @@ -54,9 +53,9 @@ IsEqualIID (riid, &IID_IDirectMusicSegment8)) *ret_iface = iface; else if (IsEqualIID (riid, &IID_IDirectMusicObject)) - *ret_iface = &This->ObjectVtbl; + *ret_iface = &This->dmobj.IDirectMusicObject_iface; else if (IsEqualIID (riid, &IID_IPersistStream)) - *ret_iface = &This->PersistStreamVtbl; + *ret_iface = &This->dmobj.IPersistStream_iface; else { WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface); return E_NOINTERFACE; @@ -575,70 +574,14 @@ }; /* IDirectMusicSegment8Impl IDirectMusicObject part: */ -static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); - return IDirectMusicSegment8_QueryInterface(&This->IDirectMusicSegment8_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); - return IDirectMusicSegment8_AddRef(&This->IDirectMusicSegment8_iface); -} - -static ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); - return IDirectMusicSegment8_Release(&This->IDirectMusicSegment8_iface); -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); - TRACE("(%p, %p)\n", This, pDesc); - /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */ - memcpy (pDesc, This->pDesc, This->pDesc->dwSize); - return S_OK; -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); - TRACE("(%p, %p): setting descriptor:\n%s\n", This, pDesc, debugstr_DMUS_OBJECTDESC (pDesc)); - - /* According to MSDN, we should copy only given values, not whole struct */ - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) - This->pDesc->guidObject = pDesc->guidObject; - if (pDesc->dwValidData & DMUS_OBJ_CLASS) - This->pDesc->guidClass = pDesc->guidClass; - if (pDesc->dwValidData & DMUS_OBJ_NAME) - lstrcpynW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) - lstrcpynW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) - lstrcpynW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) - This->pDesc->vVersion = pDesc->vVersion; - if (pDesc->dwValidData & DMUS_OBJ_DATE) - This->pDesc->ftDate = pDesc->ftDate; - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) { - This->pDesc->llMemLength = pDesc->llMemLength; - memcpy (This->pDesc->pbMemData, pDesc->pbMemData, pDesc->llMemLength); - } - if (pDesc->dwValidData & DMUS_OBJ_STREAM) { - /* according to MSDN, we copy the stream */ - IStream_Clone (pDesc->pStream, &This->pDesc->pStream); - } - - /* add new flags */ - This->pDesc->dwValidData |= pDesc->dwValidData; - - return S_OK; -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); +static HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor(IDirectMusicObject *iface, + IStream *pStream, DMUS_OBJECTDESC *pDesc) +{ DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[1], ListCount[1]; LARGE_INTEGER liMove; /* used when skipping chunks */ - TRACE("(%p,%p, %p)\n", This, pStream, pDesc); + TRACE("(%p,%p, %p)\n", iface, pStream, pDesc); /* FIXME: should this be determined from stream? */ pDesc->dwValidData |= DMUS_OBJ_CLASS; @@ -803,48 +746,19 @@ return S_OK; } -static const IDirectMusicObjectVtbl DirectMusicSegment8_Object_Vtbl = { - IDirectMusicSegment8Impl_IDirectMusicObject_QueryInterface, - IDirectMusicSegment8Impl_IDirectMusicObject_AddRef, - IDirectMusicSegment8Impl_IDirectMusicObject_Release, - IDirectMusicSegment8Impl_IDirectMusicObject_GetDescriptor, - IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor, - IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescriptor +static const IDirectMusicObjectVtbl dmobject_vtbl = { + dmobj_IDirectMusicObject_QueryInterface, + dmobj_IDirectMusicObject_AddRef, + dmobj_IDirectMusicObject_Release, + dmobj_IDirectMusicObject_GetDescriptor, + dmobj_IDirectMusicObject_SetDescriptor, + IDirectMusicObjectImpl_ParseDescriptor }; /* IDirectMusicSegment8Impl IPersistStream part: */ -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - return IDirectMusicSegment8_QueryInterface(&This->IDirectMusicSegment8_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - return IDirectMusicSegment8_AddRef(&This->IDirectMusicSegment8_iface); -} - -static ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_Release (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - return IDirectMusicSegment8_Release(&This->IDirectMusicSegment8_iface); -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - TRACE("(%p, %p)\n", This, pClassID); - *pClassID = CLSID_DirectMusicSegment; - return S_OK; -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - FIXME("(%p): stub, always S_FALSE\n", This); - return S_FALSE; -} - -static HRESULT IDirectMusicSegment8Impl_IPersistStream_LoadTrack (LPPERSISTSTREAM iface, IStream* pClonedStream, IDirectMusicTrack** ppTrack, - DMUS_IO_TRACK_HEADER* pTrack_hdr) { - - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); +static HRESULT load_track(IDirectMusicSegment8Impl *This, IStream *pClonedStream, + IDirectMusicTrack **ppTrack, DMUS_IO_TRACK_HEADER *pTrack_hdr) +{ HRESULT hr = E_FAIL; IPersistStream* pPersistStream = NULL; @@ -879,9 +793,9 @@ return S_OK; } -static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseTrackForm (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) { - - /*ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface);*/ +static HRESULT parse_track_form(IDirectMusicSegment8Impl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[3]; @@ -941,8 +855,8 @@ liMove.QuadPart = 0; liMove.QuadPart -= sizeof(FOURCC) + (sizeof(FOURCC)+sizeof(DWORD)); IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL); - - hr = IDirectMusicSegment8Impl_IPersistStream_LoadTrack (iface, pClonedStream, &pTrack, &track_hdr); + + hr = load_track(This, pClonedStream, &pTrack, &track_hdr); if (FAILED(hr)) { ERR(": could not load track\n"); return hr; @@ -978,8 +892,8 @@ liMove.QuadPart = 0; liMove.QuadPart -= sizeof(FOURCC) + (sizeof(FOURCC)+sizeof(DWORD)); IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL); - - hr = IDirectMusicSegment8Impl_IPersistStream_LoadTrack (iface, pClonedStream, &pTrack, &track_hdr); + + hr = load_track(This, pClonedStream, &pTrack, &track_hdr); if (FAILED(hr)) { ERR(": could not load track\n"); return hr; @@ -1012,7 +926,7 @@ liMove.QuadPart -= (sizeof(FOURCC) + sizeof(DWORD)); IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL); - hr = IDirectMusicSegment8Impl_IPersistStream_LoadTrack (iface, pClonedStream, &pTrack, &track_hdr); + hr = load_track(This, pClonedStream, &pTrack, &track_hdr); if (FAILED(hr)) { ERR(": could not load track\n"); return hr; @@ -1039,8 +953,9 @@ return S_OK; } -static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseTrackList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicSegment8Impl* This) { - +static HRESULT parse_track_list(IDirectMusicSegment8Impl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, ListSize[3], ListCount[3]; @@ -1066,7 +981,7 @@ switch (Chunk.fccID) { case DMUS_FOURCC_TRACK_FORM: { TRACE_(dmfile)(": TRACK form\n"); - hr = IDirectMusicSegment8Impl_IPersistStream_ParseTrackForm (iface, &Chunk, pStm); + hr = parse_track_form(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -1092,8 +1007,9 @@ return S_OK; } -static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseSegmentForm (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicSegment8Impl* This) { - +static HRESULT parse_segment_form(IDirectMusicSegment8Impl *This, DMUS_PRIVATE_CHUNK *pChunk, + IStream *pStm) +{ HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; @@ -1111,8 +1027,8 @@ IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - - hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, This->pDesc); + + hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -1172,7 +1088,7 @@ ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); - hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, This->pDesc); + hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, &This->dmobj.desc); if (FAILED(hr)) return hr; if (hr == S_FALSE) { @@ -1192,7 +1108,7 @@ } case DMUS_FOURCC_TRACK_LIST: { TRACE_(dmfile)(": TRACK list\n"); - hr = IDirectMusicSegment8Impl_IPersistStream_ParseTrackList (iface, &Chunk, pStm, This); + hr = parse_track_list(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -1219,8 +1135,8 @@ return S_OK; } -static HRESULT IDirectMusicSegment8Impl_IPersistStream_LoadWave (LPPERSISTSTREAM iface, IStream* pClonedStream, IDirectMusicObject** ppWaveObject) { - +static HRESULT load_wave(IStream *pClonedStream, IDirectMusicObject **ppWaveObject) +{ HRESULT hr = E_FAIL; IPersistStream* pPersistStream = NULL; @@ -1248,9 +1164,14 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); +static inline IDirectMusicSegment8Impl *impl_from_IPersistStream(IPersistStream *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicSegment8Impl, dmobj.IPersistStream_iface); +} +static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm) +{ + IDirectMusicSegment8Impl *This = impl_from_IPersistStream(iface); HRESULT hr; DMUS_PRIVATE_CHUNK Chunk; DWORD StreamSize; @@ -1272,7 +1193,7 @@ switch (Chunk.fccID) { case DMUS_FOURCC_SEGMENT_FORM: { TRACE_(dmfile)(": segment form\n"); - hr = IDirectMusicSegment8Impl_IPersistStream_ParseSegmentForm (iface, &Chunk, pStm, This); + hr = parse_segment_form(This, &Chunk, pStm); if (FAILED(hr)) return hr; break; } @@ -1286,8 +1207,8 @@ liMove.QuadPart = - (LONGLONG)(sizeof(FOURCC) * 2 + sizeof(DWORD)); IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL); - - hr = IDirectMusicSegment8Impl_IPersistStream_LoadWave (iface, pClonedStream, &pWave); + + hr = load_wave(pClonedStream, &pWave); if (FAILED(hr)) { ERR(": could not load track\n"); return hr; @@ -1319,27 +1240,15 @@ return S_OK; } -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - FIXME("(%p): Saving not implemented yet\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { - ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); - FIXME("(%p, %p): stub\n", This, pcbSize); - return E_NOTIMPL; -} - -static const IPersistStreamVtbl DirectMusicSegment8_PersistStream_Vtbl = { - IDirectMusicSegment8Impl_IPersistStream_QueryInterface, - IDirectMusicSegment8Impl_IPersistStream_AddRef, - IDirectMusicSegment8Impl_IPersistStream_Release, - IDirectMusicSegment8Impl_IPersistStream_GetClassID, - IDirectMusicSegment8Impl_IPersistStream_IsDirty, - IDirectMusicSegment8Impl_IPersistStream_Load, - IDirectMusicSegment8Impl_IPersistStream_Save, - IDirectMusicSegment8Impl_IPersistStream_GetSizeMax +static const IPersistStreamVtbl persiststream_vtbl = { + dmobj_IPersistStream_QueryInterface, + dmobj_IPersistStream_AddRef, + dmobj_IPersistStream_Release, + dmobj_IPersistStream_GetClassID, + unimpl_IPersistStream_IsDirty, + IPersistStreamImpl_Load, + unimpl_IPersistStream_Save, + unimpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ @@ -1354,13 +1263,11 @@ return E_OUTOFMEMORY; } obj->IDirectMusicSegment8_iface.lpVtbl = &dmsegment8_vtbl; - obj->ObjectVtbl = &DirectMusicSegment8_Object_Vtbl; - obj->PersistStreamVtbl = &DirectMusicSegment8_PersistStream_Vtbl; - obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); - DM_STRUCT_INIT(obj->pDesc); - obj->pDesc->dwValidData |= DMUS_OBJ_CLASS; - obj->pDesc->guidClass = CLSID_DirectMusicSegment; obj->ref = 1; + dmobject_init(&obj->dmobj, &CLSID_DirectMusicSegment, + (IUnknown *)&obj->IDirectMusicSegment8_iface); + obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; + obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; list_init (&obj->Tracks); DMIME_LockModule(); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/segtriggertrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/segtriggertrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/segtriggertrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/segtriggertrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -26,6 +26,15 @@ /***************************************************************************** * IDirectMusicSegTriggerTrack implementation */ +typedef struct IDirectMusicSegTriggerTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; + struct list Items; +} IDirectMusicSegTriggerTrack; + /* IDirectMusicSegTriggerTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicSegTriggerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/seqtrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/seqtrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/seqtrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/seqtrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicSeqTrack implementation */ +typedef struct IDirectMusicSeqTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicSeqTrack; + /* IDirectMusicSeqTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicSeqTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/sysextrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/sysextrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/sysextrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/sysextrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicSysExTrack implementation */ +typedef struct IDirectMusicSysExTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicSysExTrack; + /* IDirectMusicSysExTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicSysExTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/tempotrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/tempotrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/tempotrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/tempotrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -26,6 +26,16 @@ /***************************************************************************** * IDirectMusicTempoTrack implementation */ +typedef struct IDirectMusicTempoTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; + BOOL enabled; + struct list Items; +} IDirectMusicTempoTrack; + /* IDirectMusicTempoTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicTempoTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/tests/dmime.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/tests/dmime.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/tests/dmime.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/tests/dmime.c 2015-06-28 16:51:28.000000000 +0000 @@ -391,13 +391,13 @@ hr = IDirectMusicObject_QueryInterface(dmo, &IID_IPersistStream, (void**)&ps); ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); hr = IPersistStream_GetClassID(ps, &class); - todo_wine ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); - todo_wine ok(IsEqualGUID(&class, &CLSID_DirectMusicAudioPathConfig), + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&class, &CLSID_DirectMusicAudioPathConfig), "Expected class CLSID_DirectMusicAudioPathConfig got %s\n", wine_dbgstr_guid(&class)); /* Unimplemented IPersistStream methods */ hr = IPersistStream_IsDirty(ps); - todo_wine ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); hr = IPersistStream_GetSizeMax(ps, &size); ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); hr = IPersistStream_Save(ps, NULL, TRUE); @@ -429,7 +429,7 @@ /* Unimplemented IPersistStream methods */ hr = IPersistStream_IsDirty(ps); - todo_wine ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); hr = IPersistStream_GetSizeMax(ps, &size); ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); hr = IPersistStream_Save(ps, NULL, TRUE); @@ -470,6 +470,72 @@ while (IDirectMusicSegment_Release(dms)); } +static void test_track(void) +{ + IDirectMusicTrack8 *dmt8; + IPersistStream *ps; + CLSID classid; + ULARGE_INTEGER size; + HRESULT hr; +#define X(class) &CLSID_ ## class, #class + const struct { + REFCLSID clsid; + const char *name; + BOOL todo; + } class[] = { + { X(DirectMusicLyricsTrack), TRUE }, + { X(DirectMusicMarkerTrack), TRUE }, + { X(DirectMusicParamControlTrack), TRUE }, + { X(DirectMusicSegmentTriggerTrack), FALSE }, + { X(DirectMusicSeqTrack), TRUE }, + { X(DirectMusicSysExTrack), TRUE }, + { X(DirectMusicTempoTrack), FALSE }, + { X(DirectMusicTimeSigTrack), TRUE }, + { X(DirectMusicWaveTrack), TRUE } + }; +#undef X + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(class); i++) { + trace("Testing %s\n", class[i].name); + hr = CoCreateInstance(class[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicTrack8, + (void**)&dmt8); + if (hr == E_NOINTERFACE && !dmt8) { + skip("%s not created with CoCreateInstance()\n", class[i].name); + continue; + } + ok(hr == S_OK, "%s create failed: %08x, expected S_OK\n", class[i].name, hr); + + /* IPersistStream */ + hr = IDirectMusicTrack8_QueryInterface(dmt8, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &classid); + if (class[i].todo) { + todo_wine { + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&classid, class[i].clsid), + "Expected class %s got %s\n", class[i].name, wine_dbgstr_guid(&classid)); + hr = IPersistStream_IsDirty(ps); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + } + } else { + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&classid, class[i].clsid), + "Expected class %s got %s\n", class[i].name, wine_dbgstr_guid(&classid)); + hr = IPersistStream_IsDirty(ps); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + } + + /* Unimplemented IPersistStream methods */ + hr = IPersistStream_GetSizeMax(ps, &size); + ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); + hr = IPersistStream_Save(ps, NULL, TRUE); + ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %08x\n", hr); + + while (IDirectMusicTrack8_Release(dmt8)); + } +} + START_TEST(dmime) { CoInitialize(NULL); @@ -489,6 +555,7 @@ test_audiopathconfig(); test_graph(); test_segment(); + test_track(); CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/timesigtrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/timesigtrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/timesigtrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/timesigtrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,14 @@ /***************************************************************************** * IDirectMusicTimeSigTrack implementation */ +typedef struct IDirectMusicTimeSigTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicTimeSigTrack; + /* IDirectMusicTimeSigTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicTimeSigTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/wavetrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/wavetrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmime/wavetrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmime/wavetrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,17 @@ /***************************************************************************** * IDirectMusicWaveTrack implementation */ +/***************************************************************************** + * IDirectMusicChordMapTrack implementation + */ +typedef struct IDirectMusicWaveTrack { + const IUnknownVtbl *UnknownVtbl; + const IDirectMusicTrack8Vtbl *TrackVtbl; + const IPersistStreamVtbl *PersistStreamVtbl; + LONG ref; + DMUS_OBJECTDESC *pDesc; +} IDirectMusicWaveTrack; + /* IDirectMusicWaveTrack IUnknown part: */ static HRESULT WINAPI IDirectMusicWaveTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/auditiontrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/auditiontrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/auditiontrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/auditiontrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -144,6 +144,10 @@ ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + /* didn't find any params */ TRACE("param unsupported\n"); return DMUS_E_TYPE_UNSUPPORTED; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/chordtrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/chordtrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/chordtrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/chordtrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -145,6 +145,10 @@ ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_BandParam) || IsEqualGUID (rguidType, &GUID_ChordParam) || IsEqualGUID (rguidType, &GUID_RhythmParam)) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/commandtrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/commandtrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/commandtrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/commandtrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -145,6 +145,10 @@ ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_CommandParam) || IsEqualGUID (rguidType, &GUID_CommandParam2) || IsEqualGUID (rguidType, &GUID_CommandParamNext)) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/motiftrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/motiftrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/motiftrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/motiftrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -144,6 +144,10 @@ ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_DisableTimeSig) || IsEqualGUID (rguidType, &GUID_EnableTimeSig) || IsEqualGUID (rguidType, &GUID_SeedVariations) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/mutetrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/mutetrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/mutetrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/mutetrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -144,6 +144,10 @@ ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_MuteParam)) { TRACE("param supported\n"); return S_OK; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/styletrack.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/styletrack.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/styletrack.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/styletrack.c 2015-06-28 16:51:28.000000000 +0000 @@ -145,6 +145,10 @@ ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType)); + + if (!rguidType) + return E_POINTER; + if (IsEqualGUID (rguidType, &GUID_DisableTimeSig) || IsEqualGUID (rguidType, &GUID_EnableTimeSig) || IsEqualGUID (rguidType, &GUID_IDirectMusicStyle) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/tests/dmstyle.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/tests/dmstyle.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmstyle/tests/dmstyle.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmstyle/tests/dmstyle.c 2015-06-28 16:51:28.000000000 +0000 @@ -239,6 +239,77 @@ while (IDirectMusicStyle_Release(dms)); } +static void test_track(void) +{ + IDirectMusicTrack8 *dmt8; + IPersistStream *ps; + CLSID classid; + ULARGE_INTEGER size; + HRESULT hr; +#define X(class) &CLSID_ ## class, #class + const struct { + REFCLSID clsid; + const char *name; + BOOL has_save; + BOOL todo; + } class[] = { + { X(DirectMusicAuditionTrack), TRUE, TRUE }, + { X(DirectMusicChordTrack), TRUE, FALSE }, + { X(DirectMusicCommandTrack), TRUE, TRUE }, + { X(DirectMusicMotifTrack), FALSE, TRUE }, + { X(DirectMusicMuteTrack), TRUE, TRUE }, + { X(DirectMusicStyleTrack), FALSE, FALSE }, + }; +#undef X + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(class); i++) { + trace("Testing %s\n", class[i].name); + hr = CoCreateInstance(class[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicTrack8, + (void**)&dmt8); + if (hr == E_NOINTERFACE && !dmt8) { + skip("%s not created with CoCreateInstance()\n", class[i].name); + continue; + } + ok(hr == S_OK, "%s create failed: %08x, expected S_OK\n", class[i].name, hr); + + /* IDirectMusicTrack8 */ + hr = IDirectMusicTrack8_IsParamSupported(dmt8, NULL); + ok(hr == E_POINTER, "IDirectMusicTrack8_IsParamSupported failed: %08x\n", hr); + + /* IPersistStream */ + hr = IDirectMusicTrack8_QueryInterface(dmt8, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &classid); + if (class[i].todo) { + todo_wine { + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&classid, class[i].clsid), + "Expected class %s got %s\n", class[i].name, wine_dbgstr_guid(&classid)); + hr = IPersistStream_IsDirty(ps); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + } + } else { + ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + ok(IsEqualGUID(&classid, class[i].clsid), + "Expected class %s got %s\n", class[i].name, wine_dbgstr_guid(&classid)); + hr = IPersistStream_IsDirty(ps); + ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr); + } + + hr = IPersistStream_GetSizeMax(ps, &size); + ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr); + + hr = IPersistStream_Save(ps, NULL, TRUE); + if (class[i].has_save) + todo_wine ok(hr == E_POINTER, "IPersistStream_Save failed: %08x\n", hr); + else + ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %08x\n", hr); + + while (IDirectMusicTrack8_Release(dmt8)); + } +} + START_TEST(dmstyle) { CoInitialize(NULL); @@ -253,6 +324,7 @@ test_COM_section(); test_COM_track(); test_dmstyle(); + test_track(); CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dmsynth/synth.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dmsynth/synth.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dmsynth/synth.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dmsynth/synth.c 2015-06-28 16:51:28.000000000 +0000 @@ -575,31 +575,37 @@ }; /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) +HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj, IUnknown *outer) { - IDirectMusicSynth8Impl *obj; - - TRACE("(%p,%p,%p)\n", lpcGUID, ppobj, pUnkOuter); - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynth8Impl)); - if (NULL == obj) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } - obj->IDirectMusicSynth8_iface.lpVtbl = &DirectMusicSynth8_Vtbl; - obj->IKsControl_iface.lpVtbl = &DMSynthImpl_IKsControl_Vtbl; - obj->ref = 0; - /* fill in caps */ - obj->pCaps.dwSize = sizeof(DMUS_PORTCAPS); - obj->pCaps.dwFlags = DMUS_PC_DLS | DMUS_PC_SOFTWARESYNTH | DMUS_PC_DIRECTSOUND | DMUS_PC_DLS2 | DMUS_PC_AUDIOPATH | DMUS_PC_WAVE; - obj->pCaps.guidPort = CLSID_DirectMusicSynth; - obj->pCaps.dwClass = DMUS_PC_OUTPUTCLASS; - obj->pCaps.dwType = DMUS_PORT_USER_MODE_SYNTH; - obj->pCaps.dwMemorySize = DMUS_PC_SYSTEMMEMORY; - obj->pCaps.dwMaxChannelGroups = 1000; - obj->pCaps.dwMaxVoices = 1000; - obj->pCaps.dwMaxAudioChannels = 2; - obj->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB; - MultiByteToWideChar (CP_ACP, 0, "Microsoft Synthesizer", -1, obj->pCaps.wszDescription, sizeof(obj->pCaps.wszDescription)/sizeof(WCHAR)); + static const WCHAR descrW[] = {'M','i','c','r','o','s','o','f','t',' ', + 'S','y','n','t','h','e','s','i','z','e','r',0}; + IDirectMusicSynth8Impl *obj; + HRESULT hr; - return IDirectMusicSynth8Impl_QueryInterface ((LPDIRECTMUSICSYNTH8)obj, lpcGUID, ppobj); + TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ppobj, outer); + + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); + if (NULL == obj) { + *ppobj = NULL; + return E_OUTOFMEMORY; + } + obj->IDirectMusicSynth8_iface.lpVtbl = &DirectMusicSynth8_Vtbl; + obj->IKsControl_iface.lpVtbl = &DMSynthImpl_IKsControl_Vtbl; + obj->ref = 1; + /* fill in caps */ + obj->pCaps.dwSize = sizeof(DMUS_PORTCAPS); + obj->pCaps.dwFlags = DMUS_PC_DLS | DMUS_PC_SOFTWARESYNTH | DMUS_PC_DIRECTSOUND | DMUS_PC_DLS2 | DMUS_PC_AUDIOPATH | DMUS_PC_WAVE; + obj->pCaps.guidPort = CLSID_DirectMusicSynth; + obj->pCaps.dwClass = DMUS_PC_OUTPUTCLASS; + obj->pCaps.dwType = DMUS_PORT_USER_MODE_SYNTH; + obj->pCaps.dwMemorySize = DMUS_PC_SYSTEMMEMORY; + obj->pCaps.dwMaxChannelGroups = 1000; + obj->pCaps.dwMaxVoices = 1000; + obj->pCaps.dwMaxAudioChannels = 2; + obj->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB; + strcpyW(obj->pCaps.wszDescription, descrW); + + hr = IDirectMusicSynth8_QueryInterface(&obj->IDirectMusicSynth8_iface, riid, ppobj); + IDirectMusicSynth8_Release(&obj->IDirectMusicSynth8_iface); + return hr; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dpnet/address.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dpnet/address.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dpnet/address.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dpnet/address.c 2015-06-28 16:51:28.000000000 +0000 @@ -232,9 +232,32 @@ { struct component *entry = This->components[i]; - hr = IDirectPlay8Address_AddComponent(dup, entry->name, &entry->data, entry->size, entry->type); + switch (entry->type) + { + case DPNA_DATATYPE_DWORD: + hr = IDirectPlay8Address_AddComponent(dup, entry->name, &entry->data.value, entry->size, entry->type); + break; + case DPNA_DATATYPE_GUID: + hr = IDirectPlay8Address_AddComponent(dup, entry->name, &entry->data.guid, entry->size, entry->type); + break; + case DPNA_DATATYPE_STRING: + hr = IDirectPlay8Address_AddComponent(dup, entry->name, entry->data.string, entry->size, entry->type); + break; + case DPNA_DATATYPE_STRING_ANSI: + hr = IDirectPlay8Address_AddComponent(dup, entry->name, entry->data.ansi, entry->size, entry->type); + break; + case DPNA_DATATYPE_BINARY: + hr = IDirectPlay8Address_AddComponent(dup, entry->name, entry->data.binary, entry->size, entry->type); + break; + } + if(hr != S_OK) + { + IDirectPlay8Address_Release(dup); + dup = NULL; ERR("Failed to copy component: %s - 0x%08x\n", debugstr_w(entry->name), hr); + break; + } } *ppdpaNewAddress = dup; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dpnet/tests/address.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dpnet/tests/address.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dpnet/tests/address.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dpnet/tests/address.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,7 @@ /* {6733C6E8-A0D6-450E-8C18-CEACF331DC27} */ static const GUID IID_Random = {0x6733c6e8, 0xa0d6, 0x450e, { 0x8c, 0x18, 0xce, 0xac, 0xf3, 0x31, 0xdc, 0x27 } }; +static const WCHAR localhost[] = {'l','o','c','a','l','h','o','s','t',0}; static void create_directplay_address(void) { @@ -70,7 +71,6 @@ static void address_addcomponents(void) { static const WCHAR UNKNOWN[] = { 'u','n','k','n','o','w','n',0 }; - static const WCHAR localhost[] = {'l','o','c','a','l','h','o','s','t',0}; static const char testing[] = "testing"; HRESULT hr; IDirectPlay8Address *localaddr = NULL; @@ -309,14 +309,20 @@ hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, &localhost, sizeof(localhost), DPNA_DATATYPE_STRING); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDirectPlay8Address_GetNumComponents(localaddr, &components); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(components == 1, "components=%d\n", components); + ok(components == 2, "components=%d\n", components); hr = IDirectPlay8Address_Duplicate(localaddr, &duplicate); ok(hr == S_OK, "got 0x%08x\n", hr); if(SUCCEEDED(hr)) { + DWORD size, type; + WCHAR buffer[256]; + hr = IDirectPlay8Address_GetSP(duplicate, &guid); ok(hr == S_OK, "got 0x%08x\n", hr); ok(IsEqualGUID(&guid, &CLSID_DP8SP_TCPIP), "wrong guid\n"); @@ -325,6 +331,12 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ok(components == dupcomps, "expected %d got %d\n", components, dupcomps); + size = sizeof(buffer); + hr = IDirectPlay8Address_GetComponentByName(duplicate, DPNA_KEY_HOSTNAME, buffer, &size, &type); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(type == DPNA_DATATYPE_STRING, "incorrect type %d\n", type); + ok(!lstrcmpW(buffer, localhost), "Invalid string: %s\n", wine_dbgstr_w(buffer)); + IDirectPlay8Address_Release(duplicate); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/dwrite_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/dwrite_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/dwrite_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/dwrite_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -103,7 +103,7 @@ FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; extern HRESULT create_gdicompat_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,FLOAT,const DWRITE_MATRIX*,BOOL,IDWriteTextLayout**) DECLSPEC_HIDDEN; -extern HRESULT create_trimmingsign(IDWriteInlineObject**) DECLSPEC_HIDDEN; +extern HRESULT create_trimmingsign(IDWriteFactory2*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN; extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN; extern HRESULT create_gdiinterop(IDWriteFactory2*,IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern void release_gdiinterop(IDWriteGdiInterop*) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/font.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/font.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/font.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/font.c 2015-06-28 16:51:28.000000000 +0000 @@ -523,6 +523,9 @@ if (is_sideways) FIXME("sideways mode is not supported.\n"); + if (count) + ID2D1SimplifiedGeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + for (g = 0; g < count; g++) { FLOAT xoffset = 0.0, yoffset = 0.0; struct glyph_outline *outline; @@ -703,9 +706,11 @@ DWRITE_OUTLINE_THRESHOLD threshold, DWRITE_MEASURING_MODE measuring_mode, DWRITE_RENDERING_MODE *rendering_mode) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p)->(%f %f %f %p %d %d %d %p): stub\n", This, font_emsize, dpiX, dpiY, transform, is_sideways, + DWRITE_GRID_FIT_MODE gridfitmode; + TRACE("(%p)->(%.2f %.2f %.2f %p %d %d %d %p)\n", This, font_emsize, dpiX, dpiY, transform, is_sideways, threshold, measuring_mode, rendering_mode); - return E_NOTIMPL; + return IDWriteFontFace2_GetRecommendedRenderingMode(iface, font_emsize, dpiX, dpiY, transform, is_sideways, + threshold, measuring_mode, NULL, rendering_mode, &gridfitmode); } static HRESULT WINAPI dwritefontface1_GetVerticalGlyphVariants(IDWriteFontFace2 *iface, UINT32 glyph_count, @@ -1435,10 +1440,10 @@ for (i = 0; i < collection->family_count; i++) { IDWriteLocalizedStrings *family_name = collection->family_data[i]->familyname; + UINT32 j, count = IDWriteLocalizedStrings_GetCount(family_name); HRESULT hr; - int j; - for (j = 0; j < IDWriteLocalizedStrings_GetCount(family_name); j++) { + for (j = 0; j < count; j++) { WCHAR buffer[255]; hr = IDWriteLocalizedStrings_GetString(family_name, j, buffer, 255); if (SUCCEEDED(hr) && !strcmpiW(buffer, name)) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/layout.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/layout.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/layout.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/layout.c 2015-06-28 16:51:28.000000000 +0000 @@ -72,7 +72,8 @@ LAYOUT_RANGE_ATTR_PAIR_KERNING, LAYOUT_RANGE_ATTR_FONTCOLL, LAYOUT_RANGE_ATTR_LOCALE, - LAYOUT_RANGE_ATTR_FONTFAMILY + LAYOUT_RANGE_ATTR_FONTFAMILY, + LAYOUT_RANGE_ATTR_SPACING }; struct layout_range_attr_value { @@ -90,12 +91,15 @@ IDWriteFontCollection *collection; const WCHAR *locale; const WCHAR *fontfamily; + FLOAT spacing[3]; /* in arguments order - leading, trailing, advance */ } u; }; enum layout_range_kind { LAYOUT_RANGE_REGULAR, - LAYOUT_RANGE_STRIKETHROUGH + LAYOUT_RANGE_STRIKETHROUGH, + LAYOUT_RANGE_EFFECT, + LAYOUT_RANGE_SPACING }; struct layout_range_header { @@ -111,7 +115,6 @@ FLOAT fontsize; DWRITE_FONT_STRETCH stretch; IDWriteInlineObject *object; - IUnknown *effect; BOOL underline; BOOL pair_kerning; IDWriteFontCollection *collection; @@ -124,6 +127,18 @@ BOOL value; }; +struct layout_range_effect { + struct layout_range_header h; + IUnknown *effect; +}; + +struct layout_range_spacing { + struct layout_range_header h; + FLOAT leading; + FLOAT trailing; + FLOAT min_advance; +}; + enum layout_run_kind { LAYOUT_RUN_REGULAR, LAYOUT_RUN_INLINE @@ -153,7 +168,8 @@ struct inline_object_run object; struct regular_layout_run regular; } u; - IUnknown *effect; + FLOAT baseline; + FLOAT height; }; struct layout_effective_run { @@ -165,15 +181,18 @@ FLOAT origin_x; /* baseline X position */ FLOAT origin_y; /* baseline Y position */ UINT16 *clustermap; /* effective clustermap, allocated separately, is not reused from nominal map */ + UINT32 line; }; struct layout_effective_inline { struct list entry; IDWriteInlineObject *object; + IUnknown *effect; FLOAT origin_x; FLOAT origin_y; BOOL is_sideways; BOOL is_rtl; + UINT32 line; }; struct layout_strikethrough { @@ -207,6 +226,8 @@ FLOAT maxwidth; FLOAT maxheight; struct list strike_ranges; + struct list effects; + struct list spacing; struct list ranges; struct list runs; /* lists ready to use by Draw() */ @@ -243,6 +264,8 @@ struct dwrite_trimmingsign { IDWriteInlineObject IDWriteInlineObject_iface; LONG ref; + + IDWriteTextLayout *layout; }; struct dwrite_typography { @@ -461,21 +484,20 @@ } static inline void init_cluster_metrics(const struct dwrite_textlayout *layout, const struct regular_layout_run *run, - UINT16 start_glyph, UINT16 stop_glyph, UINT32 stop_position, DWRITE_CLUSTER_METRICS *metrics) + UINT16 start_glyph, UINT16 stop_glyph, UINT32 stop_position, UINT16 length, DWRITE_CLUSTER_METRICS *metrics) { UINT8 breakcondition; UINT32 position; UINT16 j; - metrics->width = 0.0; - - /* For clusters on control chars we report zero glyphs, and we need zero cluster + /* For clusters made of control chars we report zero glyphs, and we need zero cluster width as well; advances are already computed at this point and are not necessary zero. */ + metrics->width = 0.0; if (run->run.glyphCount) { for (j = start_glyph; j < stop_glyph; j++) metrics->width += run->run.glyphAdvances[j]; } - metrics->length = 0; + metrics->length = length; position = stop_position; if (stop_glyph == run->glyphcount) @@ -488,10 +510,10 @@ metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK || breakcondition == DWRITE_BREAK_CONDITION_MUST_BREAK; if (metrics->length == 1) { - WORD type; + WORD type = 0; GetStringTypeW(CT_CTYPE1, &layout->str[position], 1, &type); - metrics->isWhitespace = type == C1_SPACE; + metrics->isWhitespace = !!(type & C1_SPACE); metrics->isNewline = FALSE /* FIXME */; metrics->isSoftHyphen = layout->str[position] == 0x00ad /* Unicode Soft Hyphen */; } @@ -523,8 +545,8 @@ BOOL end = i == run->descr.stringLength - 1; if (run->descr.clusterMap[start] != run->descr.clusterMap[i]) { - init_cluster_metrics(layout, run, run->descr.clusterMap[start], run->descr.clusterMap[i], i, metrics); - metrics->length = i - start; + init_cluster_metrics(layout, run, run->descr.clusterMap[start], run->descr.clusterMap[i], i, + i - start, metrics); c->position = start; c->run = r; @@ -535,8 +557,8 @@ } if (end) { - init_cluster_metrics(layout, run, run->descr.clusterMap[start], run->glyphcount, i, metrics); - metrics->length = i - start + 1; + init_cluster_metrics(layout, run, run->descr.clusterMap[start], run->glyphcount, i, + i - start + 1, metrics); c->position = start; c->run = r; @@ -555,6 +577,11 @@ return layout->len - range->h.range.startPosition; } +static inline FLOAT get_scaled_font_metric(UINT32 metric, FLOAT emSize, const DWRITE_FONT_METRICS *metrics) +{ + return (FLOAT)metric * emSize / (FLOAT)metrics->designUnitsPerEm; +} + static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) { IDWriteTextAnalyzer *analyzer; @@ -599,7 +626,6 @@ r->u.object.object = range->object; r->u.object.length = get_clipped_range_length(layout, range); - r->effect = range->effect; list_add_tail(&layout->runs, &r->entry); continue; } @@ -622,6 +648,7 @@ DWRITE_SHAPING_GLYPH_PROPERTIES *glyph_props = NULL; DWRITE_SHAPING_TEXT_PROPERTIES *text_props = NULL; struct regular_layout_run *run = &r->u.regular; + DWRITE_FONT_METRICS fontmetrics = { 0 }; IDWriteFontFamily *family; UINT32 index, max_count; IDWriteFont *font; @@ -652,6 +679,8 @@ hr = S_OK; } metrics->width = inlinemetrics.width; + r->baseline = inlinemetrics.baseline; + r->height = inlinemetrics.height; /* FIXME: use resolved breakpoints in this case too */ @@ -659,7 +688,6 @@ } range = get_layout_range_by_pos(layout, run->descr.textPosition); - r->effect = range->effect; hr = IDWriteFontCollection_FindFamilyName(range->collection, range->fontfamily, &index, &exists); if (FAILED(hr) || !exists) { @@ -762,6 +790,22 @@ run->run.glyphCount = 0; else run->run.glyphCount = run->glyphcount; + + /* baseline derived from font metrics */ + if (layout->gdicompatible) { + /* FIXME: check return value when it's actually implemented */ + IDWriteFontFace_GetGdiCompatibleMetrics(run->run.fontFace, + run->run.fontEmSize, + layout->pixels_per_dip, + &layout->transform, + &fontmetrics); + } + else + IDWriteFontFace_GetMetrics(run->run.fontFace, &fontmetrics); + + r->baseline = get_scaled_font_metric(fontmetrics.ascent, run->run.fontEmSize, &fontmetrics); + r->height = get_scaled_font_metric(fontmetrics.ascent + fontmetrics.descent, run->run.fontEmSize, &fontmetrics); + layout_set_cluster_metrics(layout, r, &cluster); continue; @@ -842,10 +886,29 @@ return width; } +static struct layout_range_header *get_layout_range_header_by_pos(struct list *ranges, UINT32 pos) +{ + struct layout_range_header *cur; + + LIST_FOR_EACH_ENTRY(cur, ranges, struct layout_range_header, entry) { + DWRITE_TEXT_RANGE *r = &cur->range; + if (r->startPosition <= pos && pos < r->startPosition + r->length) + return cur; + } + + return NULL; +} + +static inline IUnknown *layout_get_effect_from_pos(struct dwrite_textlayout *layout, UINT32 pos) +{ + struct layout_range_header *h = get_layout_range_header_by_pos(&layout->effects, pos); + return ((struct layout_range_effect*)h)->effect; +} + /* Effective run is built from consecutive clusters of a single nominal run, 'first_cluster' is 0 based cluster index, 'cluster_count' indicates how many clusters to add, including first one. */ static HRESULT layout_add_effective_run(struct dwrite_textlayout *layout, const struct layout_run *r, UINT32 first_cluster, - UINT32 cluster_count, FLOAT origin_x, BOOL strikethrough) + UINT32 cluster_count, UINT32 line, FLOAT origin_x, BOOL strikethrough) { UINT32 i, start, length, last_cluster; struct layout_effective_run *run; @@ -865,6 +928,11 @@ different ranges which differ in reading direction). */ inlineobject->is_sideways = FALSE; inlineobject->is_rtl = FALSE; + inlineobject->line = line; + + /* effect assigned from start position and on is used for inline objects */ + inlineobject->effect = layout_get_effect_from_pos(layout, layout->clusters[first_cluster].position); + list_add_tail(&layout->inlineobjects, &inlineobject->entry); return S_OK; } @@ -889,21 +957,22 @@ run->start = start = layout->clusters[first_cluster].position; run->length = length; run->origin_x = origin_x; - run->origin_y = 0.0; /* FIXME: set after line is built */ + run->origin_y = 0.0; /* set after line is built */ + run->line = line; if (r->u.regular.run.glyphCount) { /* trim from the left */ run->glyphcount = r->u.regular.run.glyphCount - r->u.regular.clustermap[start]; /* trim from the right */ - if (length < r->u.regular.descr.stringLength) - run->glyphcount -= r->u.regular.clustermap[start + length]; + if (start + length < r->u.regular.descr.stringLength - 1) + run->glyphcount -= r->u.regular.run.glyphCount - r->u.regular.clustermap[start + length]; } else run->glyphcount = 0; /* cluster map needs to be shifted */ for (i = 0; i < length; i++) - run->clustermap[i] = r->u.regular.clustermap[start] - start; + run->clustermap[i] = r->u.regular.clustermap[start + i] - r->u.regular.clustermap[start]; list_add_tail(&layout->eruns, &run->entry); @@ -968,30 +1037,47 @@ return S_OK; } -static struct layout_range_header *get_layout_range_header_by_pos(struct list *ranges, UINT32 pos) +static inline BOOL layout_get_strikethrough_from_pos(struct dwrite_textlayout *layout, UINT32 pos) { - struct layout_range_header *cur; + struct layout_range_header *h = get_layout_range_header_by_pos(&layout->strike_ranges, pos); + return ((struct layout_range_bool*)h)->value; +} - LIST_FOR_EACH_ENTRY(cur, ranges, struct layout_range_header, entry) { - DWRITE_TEXT_RANGE *r = &cur->range; - if (r->startPosition <= pos && pos < r->startPosition + r->length) - return cur; - } +static inline struct layout_effective_run *layout_get_next_erun(struct dwrite_textlayout *layout, + const struct layout_effective_run *cur) +{ + struct list *e; - return NULL; + if (!cur) + e = list_head(&layout->eruns); + else + e = list_next(&layout->eruns, &cur->entry); + if (!e) + return NULL; + return LIST_ENTRY(e, struct layout_effective_run, entry); } -static inline BOOL layout_get_strikethrough_from_pos(struct dwrite_textlayout *layout, UINT32 pos) +static inline struct layout_effective_inline *layout_get_next_inline_run(struct dwrite_textlayout *layout, + const struct layout_effective_inline *cur) { - struct layout_range_header *h = get_layout_range_header_by_pos(&layout->strike_ranges, pos); - return ((struct layout_range_bool*)h)->value; + struct list *e; + + if (!cur) + e = list_head(&layout->inlineobjects); + else + e = list_next(&layout->inlineobjects, &cur->entry); + if (!e) + return NULL; + return LIST_ENTRY(e, struct layout_effective_inline, entry); } static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout) { - DWRITE_LINE_METRICS metrics; + struct layout_effective_inline *inrun; + struct layout_effective_run *erun; const struct layout_run *run; - FLOAT width, origin_x; + DWRITE_LINE_METRICS metrics; + FLOAT width, origin_x, origin_y; UINT32 i, start, line, textpos; HRESULT hr; BOOL s[2]; @@ -1011,14 +1097,14 @@ s[0] = s[1] = layout_get_strikethrough_from_pos(layout, 0); for (i = 0, start = 0, textpos = 0, width = 0.0; i < layout->cluster_count; i++) { - BOOL can_wrap_after = layout->clustermetrics[i].canWrapLineAfter; + BOOL overflow; s[1] = layout_get_strikethrough_from_pos(layout, textpos); /* switched to next nominal run, at this point all previous pending clusters are already checked for layout line overflow, so new effective run will fit in current line */ if (run != layout->clusters[i].run || s[0] != s[1]) { - hr = layout_add_effective_run(layout, run, start, i - start, origin_x, s[0]); + hr = layout_add_effective_run(layout, run, start, i - start, line, origin_x, s[0]); if (FAILED(hr)) return hr; origin_x += get_cluster_range_width(layout, start, i); @@ -1026,15 +1112,25 @@ start = i; } - /* check if we got new line */ - if (((can_wrap_after && (width + layout->clustermetrics[i].width > layout->maxwidth)) || - layout->clustermetrics[i].isNewline || /* always wrap on new line */ - i == layout->cluster_count - 1)) /* end of the text */ { - - UINT32 strlength = metrics.length, index = i; + overflow = layout->clustermetrics[i].canWrapLineAfter && + (width + layout->clustermetrics[i].width > layout->maxwidth); + /* check if we got new */ + if (overflow || + layout->clustermetrics[i].isNewline || /* always wrap on new line */ + i == layout->cluster_count - 1) /* end of the text */ { + + UINT32 strlength, last_cluster = i, index; + FLOAT descent; + + if (!overflow) { + metrics.length += layout->clustermetrics[i].length; + last_cluster = i; + } + else + last_cluster = i ? i - 1 : i; if (i >= start) { - hr = layout_add_effective_run(layout, run, start, i - start + 1, origin_x, s[0]); + hr = layout_add_effective_run(layout, run, start, i - start + 1, line, origin_x, s[0]); if (FAILED(hr)) return hr; /* we don't need to update origin for next run as we're going to wrap */ @@ -1042,6 +1138,8 @@ /* take a look at clusters we got for this line in reverse order to set trailing properties for current line */ + strlength = metrics.length; + index = last_cluster; while (strlength) { DWRITE_CLUSTER_METRICS *cluster = &layout->clustermetrics[index]; @@ -1060,8 +1158,27 @@ index--; } - metrics.height = 0.0; /* FIXME */ - metrics.baseline = 0.0; /* FIXME */ + /* look for max baseline and descent for this line */ + strlength = metrics.length; + index = last_cluster; + metrics.baseline = 0.0; + descent = 0.0; + while (strlength) { + DWRITE_CLUSTER_METRICS *cluster = &layout->clustermetrics[index]; + const struct layout_run *cur = layout->clusters[index].run; + FLOAT cur_descent = cur->height - cur->baseline; + + if (cur->baseline > metrics.baseline) + metrics.baseline = cur->baseline; + + if (cur_descent > descent) + descent = cur_descent; + + strlength -= cluster->length; + index--; + } + metrics.height = descent + metrics.baseline; + metrics.isTrimmed = width > layout->maxwidth; hr = layout_set_line_metrics(layout, &metrics, &line); if (FAILED(hr)) @@ -1082,12 +1199,41 @@ } layout->line_count = line; + + /* Now all line info is here, update effective runs positions in flow direction */ + erun = layout_get_next_erun(layout, NULL); + inrun = layout_get_next_inline_run(layout, NULL); + + origin_y = 0.0; + for (line = 0; line < layout->line_count; line++) { + + origin_y += layout->lines[line].baseline; + + /* For all runs on this line */ + while (erun && erun->line == line) { + erun->origin_y = origin_y; + erun = layout_get_next_erun(layout, erun); + if (!erun) + break; + } + + /* Same for inline runs */ + while (inrun && inrun->line == line) { + inrun->origin_y = origin_y; + inrun = layout_get_next_inline_run(layout, inrun); + if (!inrun) + break; + } + } + layout->recompute &= ~RECOMPUTE_EFFECTIVE_RUNS; return hr; } static BOOL is_same_layout_attrvalue(struct layout_range_header const *h, enum layout_range_attr_kind attr, struct layout_range_attr_value *value) { + struct layout_range_spacing const *range_spacing = (struct layout_range_spacing*)h; + struct layout_range_effect const *range_effect = (struct layout_range_effect*)h; struct layout_range_bool const *range_bool = (struct layout_range_bool*)h; struct layout_range const *range = (struct layout_range*)h; @@ -1103,7 +1249,7 @@ case LAYOUT_RANGE_ATTR_INLINE: return range->object == value->u.object; case LAYOUT_RANGE_ATTR_EFFECT: - return range->effect == value->u.effect; + return range_effect->effect == value->u.effect; case LAYOUT_RANGE_ATTR_UNDERLINE: return range->underline == value->u.underline; case LAYOUT_RANGE_ATTR_STRIKETHROUGH: @@ -1116,6 +1262,10 @@ return strcmpW(range->locale, value->u.locale) == 0; case LAYOUT_RANGE_ATTR_FONTFAMILY: return strcmpW(range->fontfamily, value->u.fontfamily) == 0; + case LAYOUT_RANGE_ATTR_SPACING: + return range_spacing->leading == value->u.spacing[0] && + range_spacing->trailing == value->u.spacing[1] && + range_spacing->min_advance == value->u.spacing[2]; default: ; } @@ -1136,7 +1286,6 @@ left->stretch == right->stretch && left->fontsize == right->fontsize && left->object == right->object && - left->effect == right->effect && left->underline == right->underline && left->pair_kerning == right->pair_kerning && left->collection == right->collection && @@ -1149,6 +1298,20 @@ struct layout_range_bool const *right = (struct layout_range_bool const*)hright; return left->value == right->value; } + case LAYOUT_RANGE_EFFECT: + { + struct layout_range_effect const *left = (struct layout_range_effect const*)hleft; + struct layout_range_effect const *right = (struct layout_range_effect const*)hright; + return left->effect == right->effect; + } + case LAYOUT_RANGE_SPACING: + { + struct layout_range_spacing const *left = (struct layout_range_spacing const*)hleft; + struct layout_range_spacing const *right = (struct layout_range_spacing const*)hright; + return left->leading == right->leading && + left->trailing == right->trailing && + left->min_advance == right->min_advance; + } default: FIXME("unknown range kind %d\n", hleft->kind); return FALSE; @@ -1180,7 +1343,6 @@ range->stretch = layout->format.stretch; range->fontsize = layout->format.fontsize; range->object = NULL; - range->effect = NULL; range->underline = FALSE; range->pair_kerning = FALSE; @@ -1209,6 +1371,30 @@ h = &range->h; break; } + case LAYOUT_RANGE_EFFECT: + { + struct layout_range_effect *range; + + range = heap_alloc(sizeof(*range)); + if (!range) return NULL; + + range->effect = NULL; + h = &range->h; + break; + } + case LAYOUT_RANGE_SPACING: + { + struct layout_range_spacing *range; + + range = heap_alloc(sizeof(*range)); + if (!range) return NULL; + + range->leading = 0.0; + range->trailing = 0.0; + range->min_advance = 0.0; + h = &range->h; + break; + } default: FIXME("unknown range kind %d\n", kind); return NULL; @@ -1242,8 +1428,6 @@ /* update refcounts */ if (range->object) IDWriteInlineObject_AddRef(range->object); - if (range->effect) - IUnknown_AddRef(range->effect); if (range->collection) IDWriteFontCollection_AddRef(range->collection); ret = &range->h; @@ -1258,6 +1442,26 @@ ret = &strike->h; break; } + case LAYOUT_RANGE_EFFECT: + { + struct layout_range_effect *effect = heap_alloc(sizeof(*effect)); + if (!effect) return NULL; + + *effect = *(struct layout_range_effect*)h; + if (effect->effect) + IUnknown_AddRef(effect->effect); + ret = &effect->h; + break; + } + case LAYOUT_RANGE_SPACING: + { + struct layout_range_spacing *spacing = heap_alloc(sizeof(*spacing)); + if (!spacing) return NULL; + + *spacing = *(struct layout_range_spacing*)h; + ret = &spacing->h; + break; + } default: FIXME("unknown range kind %d\n", h->kind); return NULL; @@ -1272,16 +1476,28 @@ if (!h) return; - if (h->kind == LAYOUT_RANGE_REGULAR) { + switch (h->kind) + { + case LAYOUT_RANGE_REGULAR: + { struct layout_range *range = (struct layout_range*)h; if (range->object) IDWriteInlineObject_Release(range->object); - if (range->effect) - IUnknown_Release(range->effect); if (range->collection) IDWriteFontCollection_Release(range->collection); heap_free(range->fontfamily); + break; + } + case LAYOUT_RANGE_EFFECT: + { + struct layout_range_effect *effect = (struct layout_range_effect*)h; + if (effect->effect) + IUnknown_Release(effect->effect); + break; + } + default: + ; } heap_free(h); @@ -1300,6 +1516,16 @@ list_remove(&cur->entry); free_layout_range(cur); } + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &layout->effects, struct layout_range_header, entry) { + list_remove(&cur->entry); + free_layout_range(cur); + } + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &layout->spacing, struct layout_range_header, entry) { + list_remove(&cur->entry); + free_layout_range(cur); + } } static struct layout_range_header *find_outer_range(struct list *ranges, const DWRITE_TEXT_RANGE *range) @@ -1349,6 +1575,8 @@ static BOOL set_layout_range_attrval(struct layout_range_header *h, enum layout_range_attr_kind attr, struct layout_range_attr_value *value) { + struct layout_range_spacing *dest_spacing = (struct layout_range_spacing*)h; + struct layout_range_effect *dest_effect = (struct layout_range_effect*)h; struct layout_range_bool *dest_bool = (struct layout_range_bool*)h; struct layout_range *dest = (struct layout_range*)h; @@ -1375,7 +1603,7 @@ changed = set_layout_range_iface_attr((IUnknown**)&dest->object, (IUnknown*)value->u.object); break; case LAYOUT_RANGE_ATTR_EFFECT: - changed = set_layout_range_iface_attr((IUnknown**)&dest->effect, (IUnknown*)value->u.effect); + changed = set_layout_range_iface_attr((IUnknown**)&dest_effect->effect, (IUnknown*)value->u.effect); break; case LAYOUT_RANGE_ATTR_UNDERLINE: changed = dest->underline != value->u.underline; @@ -1404,6 +1632,14 @@ dest->fontfamily = heap_strdupW(value->u.fontfamily); } break; + case LAYOUT_RANGE_ATTR_SPACING: + changed = dest_spacing->leading != value->u.spacing[0] || + dest_spacing->trailing != value->u.spacing[1] || + dest_spacing->min_advance != value->u.spacing[2]; + dest_spacing->leading = value->u.spacing[0]; + dest_spacing->trailing = value->u.spacing[1]; + dest_spacing->min_advance = value->u.spacing[2]; + break; default: ; } @@ -1442,7 +1678,6 @@ case LAYOUT_RANGE_ATTR_STYLE: case LAYOUT_RANGE_ATTR_STRETCH: case LAYOUT_RANGE_ATTR_FONTSIZE: - case LAYOUT_RANGE_ATTR_EFFECT: case LAYOUT_RANGE_ATTR_INLINE: case LAYOUT_RANGE_ATTR_UNDERLINE: case LAYOUT_RANGE_ATTR_PAIR_KERNING: @@ -1454,6 +1689,12 @@ case LAYOUT_RANGE_ATTR_STRIKETHROUGH: ranges = &layout->strike_ranges; break; + case LAYOUT_RANGE_ATTR_EFFECT: + ranges = &layout->effects; + break; + case LAYOUT_RANGE_ATTR_SPACING: + ranges = &layout->spacing; + break; default: FIXME("unknown attr kind %d\n", attr); return E_FAIL; @@ -2189,14 +2430,11 @@ UINT32 position, IUnknown **effect, DWRITE_TEXT_RANGE *r) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - struct layout_range *range; + struct layout_range_effect *range; TRACE("(%p)->(%u %p %p)\n", This, position, effect, r); - if (position >= This->len) - return S_OK; - - range = get_layout_range_by_pos(This, position); + range = (struct layout_range_effect*)get_layout_range_header_by_pos(&This->effects, position); *effect = range->effect; if (*effect) IUnknown_AddRef(*effect); @@ -2295,7 +2533,7 @@ DWRITE_MEASURING_MODE_NATURAL, &glyph_run, &descr, - run->run->effect); + NULL); } /* 2. Inline objects */ @@ -2307,7 +2545,7 @@ inlineobject->object, inlineobject->is_sideways, inlineobject->is_rtl, - run->run->effect); + inlineobject->effect); } /* TODO: 3. Underlines */ @@ -2319,7 +2557,7 @@ s->run->origin_x, s->run->origin_y, &s->s, - s->run->run->effect); + NULL); } return S_OK; @@ -2497,20 +2735,38 @@ return return_range(&range->h, r); } -static HRESULT WINAPI dwritetextlayout1_SetCharacterSpacing(IDWriteTextLayout2 *iface, FLOAT leading_spacing, FLOAT trailing_spacing, - FLOAT minimum_advance_width, DWRITE_TEXT_RANGE range) +static HRESULT WINAPI dwritetextlayout1_SetCharacterSpacing(IDWriteTextLayout2 *iface, FLOAT leading, FLOAT trailing, + FLOAT min_advance, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - FIXME("(%p)->(%f %f %f %s): stub\n", This, leading_spacing, trailing_spacing, minimum_advance_width, debugstr_range(&range)); - return E_NOTIMPL; + struct layout_range_attr_value value; + + TRACE("(%p)->(%.2f %.2f %.2f %s)\n", This, leading, trailing, min_advance, debugstr_range(&range)); + + if (min_advance < 0.0) + return E_INVALIDARG; + + value.range = range; + value.u.spacing[0] = leading; + value.u.spacing[1] = trailing; + value.u.spacing[2] = min_advance; + return set_layout_range_attr(This, LAYOUT_RANGE_ATTR_SPACING, &value); } -static HRESULT WINAPI dwritetextlayout1_GetCharacterSpacing(IDWriteTextLayout2 *iface, UINT32 position, FLOAT* leading_spacing, - FLOAT* trailing_spacing, FLOAT* minimum_advance_width, DWRITE_TEXT_RANGE *range) +static HRESULT WINAPI dwritetextlayout1_GetCharacterSpacing(IDWriteTextLayout2 *iface, UINT32 position, FLOAT *leading, + FLOAT *trailing, FLOAT *min_advance, DWRITE_TEXT_RANGE *r) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - FIXME("(%p)->(%u %p %p %p %p): stub\n", This, position, leading_spacing, trailing_spacing, minimum_advance_width, range); - return E_NOTIMPL; + struct layout_range_spacing *range; + + TRACE("(%p)->(%u %p %p %p %p)\n", This, position, leading, trailing, min_advance, r); + + range = (struct layout_range_spacing*)get_layout_range_header_by_pos(&This->spacing, position); + *leading = range->leading; + *trailing = range->trailing; + *min_advance = range->min_advance; + + return return_range(&range->h, r); } static HRESULT WINAPI dwritetextlayout2_GetMetrics(IDWriteTextLayout2 *iface, DWRITE_TEXT_METRICS1 *metrics) @@ -3084,7 +3340,7 @@ /* reduce existing run */ cur->run.bidiLevel = resolvedLevel; - cur->descr.stringLength -= length; + cur->descr.stringLength = length; list_add_after(&cur_run->entry, &run->entry); break; @@ -3252,7 +3508,7 @@ static HRESULT init_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, struct dwrite_textlayout *layout) { - struct layout_range_header *range, *strike; + struct layout_range_header *range, *strike, *effect, *spacing; DWRITE_TEXT_RANGE r = { 0, ~0u }; HRESULT hr; @@ -3280,6 +3536,8 @@ list_init(&layout->runs); list_init(&layout->ranges); list_init(&layout->strike_ranges); + list_init(&layout->effects); + list_init(&layout->spacing); memset(&layout->format, 0, sizeof(layout->format)); layout->gdicompatible = FALSE; @@ -3299,15 +3557,21 @@ range = alloc_layout_range(layout, &r, LAYOUT_RANGE_REGULAR); strike = alloc_layout_range(layout, &r, LAYOUT_RANGE_STRIKETHROUGH); - if (!range || !strike) { + effect = alloc_layout_range(layout, &r, LAYOUT_RANGE_EFFECT); + spacing = alloc_layout_range(layout, &r, LAYOUT_RANGE_SPACING); + if (!range || !strike || !effect || !spacing) { free_layout_range(range); free_layout_range(strike); + free_layout_range(effect); + free_layout_range(spacing); hr = E_OUTOFMEMORY; goto fail; } list_add_head(&layout->ranges, &range->entry); list_add_head(&layout->strike_ranges, &strike->entry); + list_add_head(&layout->effects, &effect->entry); + list_add_head(&layout->spacing, &spacing->entry); return S_OK; fail: @@ -3371,7 +3635,6 @@ *obj = NULL; return E_NOINTERFACE; - } static ULONG WINAPI dwritetrimmingsign_AddRef(IDWriteInlineObject *iface) @@ -3389,18 +3652,24 @@ TRACE("(%p)->(%d)\n", This, ref); - if (!ref) + if (!ref) { + IDWriteTextLayout_Release(This->layout); heap_free(This); + } return ref; } static HRESULT WINAPI dwritetrimmingsign_Draw(IDWriteInlineObject *iface, void *context, IDWriteTextRenderer *renderer, - FLOAT originX, FLOAT originY, BOOL is_sideways, BOOL is_rtl, IUnknown *drawing_effect) + FLOAT originX, FLOAT originY, BOOL is_sideways, BOOL is_rtl, IUnknown *effect) { struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); - FIXME("(%p)->(%p %p %f %f %d %d %p): stub\n", This, context, renderer, originX, originY, is_sideways, is_rtl, drawing_effect); - return E_NOTIMPL; + DWRITE_TEXT_RANGE range = { 0, ~0u }; + + TRACE("(%p)->(%p %p %.2f %.2f %d %d %p)\n", This, context, renderer, originX, originY, is_sideways, is_rtl, effect); + + IDWriteTextLayout_SetDrawingEffect(This->layout, effect, range); + return IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY); } static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *metrics) @@ -3439,18 +3708,63 @@ dwritetrimmingsign_GetBreakConditions }; -HRESULT create_trimmingsign(IDWriteInlineObject **sign) +static inline BOOL is_reading_direction_horz(DWRITE_READING_DIRECTION direction) +{ + return (direction == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT) || + (direction == DWRITE_READING_DIRECTION_RIGHT_TO_LEFT); +} + +static inline BOOL is_reading_direction_vert(DWRITE_READING_DIRECTION direction) +{ + return (direction == DWRITE_READING_DIRECTION_TOP_TO_BOTTOM) || + (direction == DWRITE_READING_DIRECTION_BOTTOM_TO_TOP); +} + +static inline BOOL is_flow_direction_horz(DWRITE_FLOW_DIRECTION direction) { + return (direction == DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT) || + (direction == DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT); +} + +static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction) +{ + return (direction == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM) || + (direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP); +} + +HRESULT create_trimmingsign(IDWriteFactory2 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign) +{ + static const WCHAR ellipsisW = 0x2026; struct dwrite_trimmingsign *This; + DWRITE_READING_DIRECTION reading; + DWRITE_FLOW_DIRECTION flow; + HRESULT hr; *sign = NULL; - This = heap_alloc(sizeof(struct dwrite_trimmingsign)); - if (!This) return E_OUTOFMEMORY; + /* Validate reading/flow direction here, layout creation won't complain about + invalid combinations. */ + reading = IDWriteTextFormat_GetReadingDirection(format); + flow = IDWriteTextFormat_GetFlowDirection(format); + + if ((is_reading_direction_horz(reading) && is_flow_direction_horz(flow)) || + (is_reading_direction_vert(reading) && is_flow_direction_vert(flow))) + return DWRITE_E_FLOWDIRECTIONCONFLICTS; + + This = heap_alloc(sizeof(*This)); + if (!This) + return E_OUTOFMEMORY; This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl; This->ref = 1; + hr = IDWriteFactory2_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0, 0.0, &This->layout); + if (FAILED(hr)) { + heap_free(This); + return hr; + } + + IDWriteTextLayout_SetWordWrapping(This->layout, DWRITE_WORD_WRAPPING_NO_WRAP); *sign = &This->IDWriteInlineObject_iface; return S_OK; @@ -3503,7 +3817,12 @@ static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat1 *iface, DWRITE_TEXT_ALIGNMENT alignment) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d)\n", This, alignment); + + if ((UINT32)alignment > DWRITE_TEXT_ALIGNMENT_JUSTIFIED) + return E_INVALIDARG; + This->format.textalignment = alignment; return S_OK; } @@ -3511,7 +3830,12 @@ static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat1 *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d)\n", This, alignment); + + if ((UINT32)alignment > DWRITE_PARAGRAPH_ALIGNMENT_CENTER) + return E_INVALIDARG; + This->format.paralign = alignment; return S_OK; } @@ -3519,7 +3843,12 @@ static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat1 *iface, DWRITE_WORD_WRAPPING wrapping) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d)\n", This, wrapping); + + if ((UINT32)wrapping > DWRITE_WORD_WRAPPING_CHARACTER) + return E_INVALIDARG; + This->format.wrapping = wrapping; return S_OK; } @@ -3527,7 +3856,12 @@ static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat1 *iface, DWRITE_READING_DIRECTION direction) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d)\n", This, direction); + + if ((UINT32)direction > DWRITE_READING_DIRECTION_BOTTOM_TO_TOP) + return E_INVALIDARG; + This->format.readingdir = direction; return S_OK; } @@ -3535,7 +3869,12 @@ static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat1 *iface, DWRITE_FLOW_DIRECTION direction) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d)\n", This, direction); + + if ((UINT32)direction > DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT) + return E_INVALIDARG; + This->format.flow = direction; return S_OK; } @@ -3566,7 +3905,12 @@ FLOAT spacing, FLOAT baseline) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); + TRACE("(%p)->(%d %f %f)\n", This, method, spacing, baseline); + + if (spacing < 0.0 || (UINT32)method > DWRITE_LINE_SPACING_METHOD_UNIFORM) + return E_INVALIDARG; + This->format.spacingmethod = method; This->format.spacing = spacing; This->format.baseline = baseline; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/main.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/main.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/main.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/main.c 2015-06-28 16:51:28.000000000 +0000 @@ -1051,8 +1051,8 @@ IDWriteInlineObject **trimming_sign) { struct dwritefactory *This = impl_from_IDWriteFactory2(iface); - FIXME("(%p)->(%p %p): semi-stub\n", This, format, trimming_sign); - return create_trimmingsign(trimming_sign); + TRACE("(%p)->(%p %p)\n", This, format, trimming_sign); + return create_trimmingsign(iface, format, trimming_sign); } static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory2 *iface, IDWriteTextAnalyzer **analyzer) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/analyzer.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/analyzer.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/analyzer.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/analyzer.c 2015-06-28 16:51:28.000000000 +0000 @@ -523,8 +523,8 @@ }, { /* Arabic */ - {0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,0}, 1, - { { 0, 7, DWRITE_SCRIPT_SHAPES_DEFAULT }} + {0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,0x0661,0}, 1, + { { 0, 8, DWRITE_SCRIPT_SHAPES_DEFAULT }} }, { /* Arabic */ @@ -1819,6 +1819,65 @@ IDWriteTextAnalyzer2_Release(analyzer2); } +static void test_GetBaseline(void) +{ + DWRITE_SCRIPT_ANALYSIS sa = { 0 }; + IDWriteTextAnalyzer1 *analyzer1; + IDWriteTextAnalyzer *analyzer; + IDWriteFontFace *fontface; + INT32 baseline; + BOOL exists; + HRESULT hr; + + hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); + IDWriteTextAnalyzer_Release(analyzer); + if (hr != S_OK) { + win_skip("GetBaseline() is not supported.\n"); + return; + } + + fontface = create_fontface(); + + /* Tahoma doesn't have BASE table, it doesn't work even with simulation enabled */ + exists = TRUE; + baseline = 456; + hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, + fontface, + DWRITE_BASELINE_DEFAULT, + FALSE, + TRUE, + sa, + NULL, + &baseline, + &exists); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(baseline == 0, "got %d\n", baseline); + ok(exists == FALSE, "got %d\n", exists); +} + exists = TRUE; + baseline = 456; + hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, + fontface, + DWRITE_BASELINE_ROMAN, + FALSE, + TRUE, + sa, + NULL, + &baseline, + &exists); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(baseline == 0, "got %d\n", baseline); + ok(exists == FALSE, "got %d\n", exists); +} + IDWriteFontFace_Release(fontface); + IDWriteTextAnalyzer1_Release(analyzer1); +} + START_TEST(analyzer) { HRESULT hr; @@ -1844,6 +1903,7 @@ test_GetGlyphPlacements(); test_ApplyCharacterSpacing(); test_GetGlyphOrientationTransform(); + test_GetBaseline(); IDWriteFactory_Release(factory); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/font.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/font.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/font.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/font.c 2015-06-28 16:51:28.000000000 +0000 @@ -37,6 +37,35 @@ #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0) + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +#define CLEAR_CALLED(func) \ + expect_ ## func = called_ ## func = FALSE + +DEFINE_EXPECT(setfillmode); + #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { @@ -457,6 +486,7 @@ static void WINAPI test_geometrysink_SetFillMode(ID2D1SimplifiedGeometrySink *iface, D2D1_FILL_MODE mode) { + CHECK_EXPECT(setfillmode); ok(mode == D2D1_FILL_MODE_WINDING, "fill mode %d\n", mode); } @@ -508,7 +538,44 @@ test_geometrysink_Close }; +static void WINAPI test_geometrysink2_BeginFigure(ID2D1SimplifiedGeometrySink *iface, + D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) +{ + ok(0, "unexpected call\n"); +} + +static void WINAPI test_geometrysink2_AddLines(ID2D1SimplifiedGeometrySink *iface, + const D2D1_POINT_2F *points, UINT32 count) +{ + ok(0, "unexpected call\n"); +} + +static void WINAPI test_geometrysink2_AddBeziers(ID2D1SimplifiedGeometrySink *iface, + const D2D1_BEZIER_SEGMENT *beziers, UINT32 count) +{ + ok(0, "unexpected call\n"); +} + +static void WINAPI test_geometrysink2_EndFigure(ID2D1SimplifiedGeometrySink *iface, D2D1_FIGURE_END figureEnd) +{ + ok(0, "unexpected call\n"); +} + +static const ID2D1SimplifiedGeometrySinkVtbl test_geometrysink2_vtbl = { + test_geometrysink_QueryInterface, + test_geometrysink_AddRef, + test_geometrysink_Release, + test_geometrysink_SetFillMode, + test_geometrysink_SetSegmentFlags, + test_geometrysink2_BeginFigure, + test_geometrysink2_AddLines, + test_geometrysink2_AddBeziers, + test_geometrysink2_EndFigure, + test_geometrysink_Close +}; + static ID2D1SimplifiedGeometrySink test_geomsink = { &test_geometrysink_vtbl }; +static ID2D1SimplifiedGeometrySink test_geomsink2 = { &test_geometrysink2_vtbl }; static void test_CreateFontFromLOGFONT(void) { @@ -2991,6 +3058,7 @@ /* default advances, no offsets */ memset(g_startpoints, 0, sizeof(g_startpoints)); g_startpoint_count = 0; + SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, FALSE, &test_geomsink); ok(hr == S_OK, "got 0x%08x\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); @@ -2999,10 +3067,12 @@ ok(g_startpoints[0].x == 229.5 && g_startpoints[0].y == -629.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); ok(g_startpoints[1].x == 729.5 && g_startpoints[1].y == -629.0, "1: got (%.2f,%.2f)\n", g_startpoints[1].x, g_startpoints[1].y); } + CHECK_CALLED(setfillmode); /* default advances, no offsets, RTL */ memset(g_startpoints, 0, sizeof(g_startpoints)); g_startpoint_count = 0; + SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, TRUE, &test_geomsink); ok(hr == S_OK, "got 0x%08x\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); @@ -3011,10 +3081,12 @@ ok(g_startpoints[0].x == -270.5 && g_startpoints[0].y == -629.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); ok(g_startpoints[1].x == -770.5 && g_startpoints[1].y == -629.0, "1: got (%.2f,%.2f)\n", g_startpoints[1].x, g_startpoints[1].y); } + CHECK_CALLED(setfillmode); /* default advances, additional offsets */ memset(g_startpoints, 0, sizeof(g_startpoints)); g_startpoint_count = 0; + SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, FALSE, &test_geomsink); ok(hr == S_OK, "got 0x%08x\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); @@ -3023,10 +3095,12 @@ ok(g_startpoints[0].x == 230.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); ok(g_startpoints[1].x == 729.5 && g_startpoints[1].y == -629.0, "1: got (%.2f,%.2f)\n", g_startpoints[1].x, g_startpoints[1].y); } + CHECK_CALLED(setfillmode); /* default advances, additional offsets, RTL */ memset(g_startpoints, 0, sizeof(g_startpoints)); g_startpoint_count = 0; + SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, TRUE, &test_geomsink); ok(hr == S_OK, "got 0x%08x\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); @@ -3034,10 +3108,12 @@ ok(g_startpoints[0].x == -271.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); ok(g_startpoints[1].x == -770.5 && g_startpoints[1].y == -629.0, "1: got (%.2f,%.2f)\n", g_startpoints[1].x, g_startpoints[1].y); } + CHECK_CALLED(setfillmode); /* custom advances and offsets, offset turns total advance value to zero */ memset(g_startpoints, 0, sizeof(g_startpoints)); g_startpoint_count = 0; + SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, advances, offsets, 2, FALSE, FALSE, &test_geomsink); ok(hr == S_OK, "got 0x%08x\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); @@ -3045,11 +3121,33 @@ ok(g_startpoints[0].x == 230.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); ok(g_startpoints[1].x == 230.5 && g_startpoints[1].y == -629.0, "1: got (%.2f,%.2f)\n", g_startpoints[1].x, g_startpoints[1].y); } + CHECK_CALLED(setfillmode); - IDWriteFontFace_Release(face); - IDWriteFactory_Release(factory); + /* 0 glyph count */ + hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 0, FALSE, FALSE, &test_geomsink2); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFactory_Release(factory); + IDWriteFontFace_Release(face); DELETE_FONTFILE(path); + + /* space glyph */ + factory = create_factory(); + face = create_fontface(factory); + + codepoint = ' '; + glyphs[0] = 0; + hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(glyphs[0] > 0, "got %u\n", glyphs[0]); + + SET_EXPECT(setfillmode); + hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 1, FALSE, FALSE, &test_geomsink2); + ok(hr == S_OK, "got 0x%08x\n", hr); + CHECK_CALLED(setfillmode); + + IDWriteFactory_Release(factory); + IDWriteFontFace_Release(face); } static void test_GetEudcFontCollection(void) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/layout.c wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/layout.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/dwrite/tests/layout.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/dwrite/tests/layout.c 2015-06-28 16:51:28.000000000 +0000 @@ -215,18 +215,39 @@ ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); } +enum drawcall_modifiers_kind { + DRAW_EFFECT = 0x1000 +}; + enum drawcall_kind { - DRAW_GLYPHRUN = 0, - DRAW_UNDERLINE, - DRAW_STRIKETHROUGH, - DRAW_INLINE, - DRAW_LAST_KIND + DRAW_GLYPHRUN = 0, + DRAW_UNDERLINE = 1, + DRAW_STRIKETHROUGH = 2, + DRAW_INLINE = 3, + DRAW_LAST_KIND = 4, + DRAW_TOTAL_KINDS = 5, + DRAW_KINDS_MASK = 0xff }; -static const char *get_draw_kind_name(enum drawcall_kind kind) +static const char *get_draw_kind_name(unsigned short kind) { - static const char *kind_names[] = { "GLYPH_RUN", "UNDERLINE", "STRIKETHROUGH", "INLINE", "END_OF_SEQ" }; - return kind > DRAW_LAST_KIND ? "unknown" : kind_names[kind]; + static const char *kind_names[] = { + "GLYPH_RUN", + "UNDERLINE", + "STRIKETHROUGH", + "INLINE", + "END_OF_SEQ", + + "GLYPH_RUN|EFFECT", + "UNDERLINE|EFFECT", + "STRIKETHROUGH|EFFECT", + "INLINE|EFFECT", + "END_OF_SEQ" + }; + if ((kind & DRAW_KINDS_MASK) > DRAW_LAST_KIND) + return "unknown"; + return (kind & DRAW_EFFECT) ? kind_names[(kind & DRAW_KINDS_MASK) + DRAW_TOTAL_KINDS] : + kind_names[kind]; } struct drawcall_entry { @@ -242,7 +263,7 @@ }; struct drawtestcontext { - enum drawcall_kind kind; + unsigned short kind; BOOL todo; int *failcount; const char *file; @@ -327,7 +348,7 @@ ok_(file, line) (0, "%s: call %s was expected, but got call %s instead\n", context, get_draw_kind_name(expected->kind), get_draw_kind_name(actual->kind)); } - else if (expected->kind == DRAW_GLYPHRUN) { + else if ((expected->kind & DRAW_KINDS_MASK) == DRAW_GLYPHRUN) { int cmp = lstrcmpW(expected->string, actual->string); if (cmp != 0 && todo) { failcount++; @@ -406,20 +427,15 @@ static HRESULT WINAPI testrenderer_GetCurrentTransform(IDWriteTextRenderer *iface, void *client_drawingcontext, DWRITE_MATRIX *transform) { - transform->m11 = 1.0; - transform->m12 = 0.0; - transform->m21 = 0.0; - transform->m22 = 1.0; - transform->dx = 0.0; - transform->dy = 0.0; - return S_OK; + ok(0, "unexpected call\n"); + return E_NOTIMPL; } static HRESULT WINAPI testrenderer_GetPixelsPerDip(IDWriteTextRenderer *iface, void *client_drawingcontext, FLOAT *pixels_per_dip) { - *pixels_per_dip = 1.0; - return S_OK; + ok(0, "unexpected call\n"); + return E_NOTIMPL; } static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface, @@ -429,7 +445,7 @@ DWRITE_MEASURING_MODE mode, DWRITE_GLYPH_RUN const *run, DWRITE_GLYPH_RUN_DESCRIPTION const *descr, - IUnknown *drawing_effect) + IUnknown *effect) { struct drawcall_entry entry; DWRITE_SCRIPT_ANALYSIS sa; @@ -457,6 +473,8 @@ } entry.kind = DRAW_GLYPHRUN; + if (effect) + entry.kind |= DRAW_EFFECT; add_call(sequences, RENDERER_ID, &entry); return S_OK; } @@ -466,10 +484,12 @@ FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_UNDERLINE const* underline, - IUnknown *drawing_effect) + IUnknown *effect) { struct drawcall_entry entry; entry.kind = DRAW_UNDERLINE; + if (effect) + entry.kind |= DRAW_EFFECT; add_call(sequences, RENDERER_ID, &entry); return S_OK; } @@ -479,10 +499,12 @@ FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_STRIKETHROUGH const* strikethrough, - IUnknown *drawing_effect) + IUnknown *effect) { struct drawcall_entry entry; entry.kind = DRAW_STRIKETHROUGH; + if (effect) + entry.kind |= DRAW_EFFECT; add_call(sequences, RENDERER_ID, &entry); return S_OK; } @@ -494,10 +516,12 @@ IDWriteInlineObject *object, BOOL is_sideways, BOOL is_rtl, - IUnknown *drawing_effect) + IUnknown *effect) { struct drawcall_entry entry; entry.kind = DRAW_INLINE; + if (effect) + entry.kind |= DRAW_EFFECT; add_call(sequences, RENDERER_ID, &entry); return S_OK; } @@ -580,6 +604,36 @@ static IDWriteInlineObject testinlineobj = { &testinlineobjvtbl }; static IDWriteInlineObject testinlineobj2 = { &testinlineobjvtbl }; +static HRESULT WINAPI testeffect_QI(IUnknown *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown)) { + *obj = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI testeffect_AddRef(IUnknown *iface) +{ + return 2; +} + +static ULONG WINAPI testeffect_Release(IUnknown *iface) +{ + return 1; +} + +static const IUnknownVtbl testeffectvtbl = { + testeffect_QI, + testeffect_AddRef, + testeffect_Release +}; + +static IUnknown testeffect = { &testeffectvtbl }; + static void test_CreateTextLayout(void) { static const WCHAR strW[] = {'s','t','r','i','n','g',0}; @@ -795,12 +849,21 @@ hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_JUSTIFIED+1); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_NEAR); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER+1); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_WRAP); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_CHARACTER+1); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -810,6 +873,15 @@ hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0, -10.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, -10.0, 0.0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_UNIFORM+1, 0.0, 0.0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -861,12 +933,18 @@ IDWriteFactory_Release(factory); } +static const struct drawcall_entry drawellipsis_seq[] = { + { DRAW_GLYPHRUN, {0x2026, 0} }, + { DRAW_LAST_KIND } +}; + static void test_CreateEllipsisTrimmingSign(void) { DWRITE_BREAK_CONDITION before, after; IDWriteTextFormat *format; IDWriteInlineObject *sign; IDWriteFactory *factory; + IUnknown *unk; HRESULT hr; factory = create_factory(); @@ -880,6 +958,9 @@ ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(format, 1); + hr = IDWriteInlineObject_QueryInterface(sign, &IID_IDWriteTextLayout, (void**)&unk); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + if (0) /* crashes on native */ hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL); @@ -889,7 +970,24 @@ ok(before == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", before); ok(after == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", after); + /* Draw tests */ + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0, 0.0, FALSE, FALSE, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw test", FALSE); IDWriteInlineObject_Release(sign); + + /* non-orthogonal flow/reading combination */ + hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista, win7 */, "got 0x%08x\n", hr); + if (hr == S_OK) { + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); + ok(hr == DWRITE_E_FLOWDIRECTIONCONFLICTS, "got 0x%08x\n", hr); + } + IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); } @@ -1135,7 +1233,7 @@ static const struct drawcall_entry draw_seq[] = { { DRAW_GLYPHRUN, {'s',0} }, { DRAW_GLYPHRUN, {'r','i',0} }, - { DRAW_GLYPHRUN, {'n',0} }, + { DRAW_GLYPHRUN|DRAW_EFFECT, {'n',0} }, { DRAW_GLYPHRUN, {'g',0} }, { DRAW_INLINE }, { DRAW_UNDERLINE }, @@ -1174,7 +1272,12 @@ { DRAW_LAST_KIND } }; -static const struct drawcall_entry draw_seq6[] = { +static const struct drawcall_entry empty_seq[] = { + { DRAW_LAST_KIND } +}; + +static const struct drawcall_entry draw_single_run_seq[] = { + { DRAW_GLYPHRUN, {'s','t','r','i','n','g',0} }, { DRAW_LAST_KIND } }; @@ -1183,12 +1286,12 @@ static const WCHAR strW[] = {'s','t','r','i','n','g',0}; static const WCHAR str2W[] = {0x202a,0x202c,'a','b',0}; static const WCHAR ruW[] = {'r','u',0}; - IDWriteInlineObject *inlineobj; IDWriteTextFormat *format; IDWriteTextLayout *layout; DWRITE_TEXT_RANGE range; IDWriteFactory *factory; + DWRITE_MATRIX m; HRESULT hr; factory = create_factory(); @@ -1285,7 +1388,44 @@ flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, RENDERER_ID, draw_seq6, "draw test 6", FALSE); + ok_sequence(sequences, RENDERER_ID, empty_seq, "draw test 6", FALSE); + IDWriteTextLayout_Release(layout); + + /* different parameter combinations with gdi-compatible layout */ + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, NULL, TRUE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE); + IDWriteTextLayout_Release(layout); + + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 8", FALSE); + IDWriteTextLayout_Release(layout); + + m.m11 = m.m22 = 2.0; + m.m12 = m.m21 = m.dx = m.dy = 0.0; + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, &m, TRUE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 9", FALSE); + IDWriteTextLayout_Release(layout); + + m.m11 = m.m22 = 2.0; + m.m12 = m.m21 = m.dx = m.dy = 0.0; + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, &m, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 10", FALSE); IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); @@ -1343,8 +1483,10 @@ static void test_GetClusterMetrics(void) { + static const WCHAR str3W[] = {0x2066,')',')',0x661,'(',0x627,')',0}; static const WCHAR str2W[] = {0x202a,0x202c,'a',0}; static const WCHAR strW[] = {'a','b','c','d',0}; + static const WCHAR str4W[] = {'a',' ',0}; DWRITE_INLINE_OBJECT_METRICS inline_metrics; DWRITE_CLUSTER_METRICS metrics[4]; IDWriteTextLayout1 *layout1; @@ -1362,6 +1504,13 @@ DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_CreateTextLayout(factory, str3W, 7, format, 1000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(count == 7, "got %u\n", count); + IDWriteTextLayout_Release(layout); + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1387,17 +1536,23 @@ DWRITE_TEXT_RANGE r; leading = trailing = min_advance = 2.0; + hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 500, &leading, &trailing, + &min_advance, &r); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0, + "got %.2f, %.2f, %.2f\n", leading, trailing, min_advance); + ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); + + leading = trailing = min_advance = 2.0; hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 0, &leading, &trailing, &min_advance, NULL); -todo_wine { ok(hr == S_OK, "got 0x%08x\n", hr); ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0, "got %.2f, %.2f, %.2f\n", leading, trailing, min_advance); -} + r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 10.0, 15.0, 0.0, r); -todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); count = 0; @@ -1415,9 +1570,14 @@ r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, 0.0, r); -todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + /* negative advance limit */ + r.startPosition = 0; + r.length = 4; + hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, -10.0, r); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + IDWriteTextLayout1_Release(layout1); } else @@ -1557,6 +1717,19 @@ ok(count == 0, "got %u\n", count); IDWriteTextLayout_Release(layout); + /* whitespace */ + hr = IDWriteFactory_CreateTextLayout(factory, str4W, 2, format, 1000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 2, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 2, "got %u\n", count); + ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); + ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace); + IDWriteTextLayout_Release(layout); + IDWriteInlineObject_Release(trimm); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -1836,6 +2009,7 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } static void test_SetFontSize(void) @@ -1927,6 +2101,7 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } static void test_SetFontFamilyName(void) @@ -2007,6 +2182,7 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } static void test_SetFontStyle(void) @@ -2094,6 +2270,7 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } static void test_SetFontStretch(void) @@ -2188,6 +2365,7 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } static void test_SetStrikethrough(void) @@ -2249,6 +2427,372 @@ IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + +static void test_GetMetrics(void) +{ + static const WCHAR str2W[] = {0x2066,')',')',0x661,'(',0x627,')',0}; + static const WCHAR strW[] = {'a','b','c','d',0}; + DWRITE_TEXT_METRICS metrics; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFactory *factory; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(&metrics, 0xcc, sizeof(metrics)); + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == 0.0, "got %.2f\n", metrics.left); + ok(metrics.top == 0.0, "got %.2f\n", metrics.top); + ok(metrics.width > 0.0, "got %.2f\n", metrics.width); + ok(metrics.widthIncludingTrailingWhitespace > 0.0, "got %.2f\n", metrics.widthIncludingTrailingWhitespace); + ok(metrics.height > 0.0, "got %.2f\n", metrics.height); + ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth); + ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight); + ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth); + ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount); +} + IDWriteTextLayout_Release(layout); + + /* a string with more complex bidi sequence */ + hr = IDWriteFactory_CreateTextLayout(factory, str2W, 7, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(&metrics, 0xcc, sizeof(metrics)); + metrics.maxBidiReorderingDepth = 0; + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == 0.0, "got %.2f\n", metrics.left); + ok(metrics.top == 0.0, "got %.2f\n", metrics.top); + ok(metrics.width > 0.0, "got %.2f\n", metrics.width); + ok(metrics.widthIncludingTrailingWhitespace > 0.0, "got %.2f\n", metrics.widthIncludingTrailingWhitespace); + ok(metrics.height > 0.0, "got %.2f\n", metrics.height); + ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth); + ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight); + ok(metrics.maxBidiReorderingDepth > 1, "got %u\n", metrics.maxBidiReorderingDepth); + ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount); +} + IDWriteTextLayout_Release(layout); + + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + +static void test_SetFlowDirection(void) +{ + static const WCHAR strW[] = {'a','b','c','d',0}; + DWRITE_READING_DIRECTION reading; + DWRITE_FLOW_DIRECTION flow; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFactory *factory; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flow = IDWriteTextFormat_GetFlowDirection(format); + ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow); + + reading = IDWriteTextFormat_GetReadingDirection(format); + ok(reading == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", reading); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + + hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista,win7 */, "got 0x%08x\n", hr); + if (hr == S_OK) { + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + + hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_TOP_TO_BOTTOM); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + } + else + win_skip("DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT is not supported\n"); + + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + +static const struct drawcall_entry draweffect_seq[] = { + { DRAW_GLYPHRUN|DRAW_EFFECT, {'a','e',0x0300,0} }, + { DRAW_GLYPHRUN, {'d',0} }, + { DRAW_LAST_KIND } +}; + +static const struct drawcall_entry draweffect2_seq[] = { + { DRAW_GLYPHRUN|DRAW_EFFECT, {'a','e',0} }, + { DRAW_GLYPHRUN, {'c','d',0} }, + { DRAW_LAST_KIND } +}; + +static const struct drawcall_entry draweffect3_seq[] = { + { DRAW_INLINE|DRAW_EFFECT }, + { DRAW_LAST_KIND } +}; + +static const struct drawcall_entry draweffect4_seq[] = { + { DRAW_INLINE }, + { DRAW_LAST_KIND } +}; + +static void test_SetDrawingEffect(void) +{ + static const WCHAR strW[] = {'a','e',0x0300,'d',0}; /* accent grave */ + static const WCHAR str2W[] = {'a','e','c','d',0}; + IDWriteInlineObject *sign; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFactory *factory; + DWRITE_TEXT_RANGE r; + IUnknown *unk; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* string with combining mark */ + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* set effect past the end of text */ + r.startPosition = 100; + r.length = 10; + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + r.startPosition = r.length = 0; + hr = IDWriteTextLayout_GetDrawingEffect(layout, 101, &unk, &r); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(r.startPosition == 100 && r.length == 10, "got %u, %u\n", r.startPosition, r.length); + + r.startPosition = r.length = 0; + unk = (void*)0xdeadbeef; + hr = IDWriteTextLayout_GetDrawingEffect(layout, 1000, &unk, &r); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(r.startPosition == 110 && r.length == ~0u-110, "got %u, %u\n", r.startPosition, r.length); + ok(unk == NULL, "got %p\n", unk); + + /* effect is applied to clusters, not individual text positions */ + r.startPosition = 0; + r.length = 2; + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draweffect_seq, "effect draw test", TRUE); + IDWriteTextLayout_Release(layout); + + /* simple string */ + hr = IDWriteFactory_CreateTextLayout(factory, str2W, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + r.startPosition = 0; + r.length = 2; + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draweffect2_seq, "effect draw test 2", TRUE); + IDWriteTextLayout_Release(layout); + + /* Inline object - effect set for same range */ + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, str2W, 4, format, 500.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + r.startPosition = 0; + r.length = 4; + hr = IDWriteTextLayout_SetInlineObject(layout, sign, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 3", FALSE); + + /* now set effect somewhere inside a range replaced by inline object */ + hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + r.startPosition = 1; + r.length = 1; + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* no effect is reported in this case */ + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draweffect4_seq, "effect draw test 4", FALSE); + + r.startPosition = 0; + r.length = 4; + hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + r.startPosition = 0; + r.length = 1; + hr = IDWriteTextLayout_SetDrawingEffect(layout, &testeffect, r); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* first range position is all that matters for inline ranges */ + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 5", FALSE); + + IDWriteTextLayout_Release(layout); + + IDWriteInlineObject_Release(sign); + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + +static IDWriteFontFace *get_fontface_from_format(IDWriteTextFormat *format) +{ + IDWriteFontCollection *collection; + IDWriteFontFamily *family; + IDWriteFontFace *fontface; + IDWriteFont *font; + WCHAR nameW[255]; + UINT32 index; + BOOL exists; + HRESULT hr; + + hr = IDWriteTextFormat_GetFontCollection(format, &collection); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_GetFontFamilyName(format, nameW, sizeof(nameW)/sizeof(WCHAR)); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontCollection_FindFamilyName(collection, nameW, &index, &exists); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontCollection_GetFontFamily(collection, index, &family); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFontCollection_Release(collection); + + hr = IDWriteFontFamily_GetFirstMatchingFont(family, + IDWriteTextFormat_GetFontWeight(format), + IDWriteTextFormat_GetFontStretch(format), + IDWriteTextFormat_GetFontStyle(format), + &font); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IDWriteFont_Release(font); + IDWriteFontFamily_Release(family); + + return fontface; +} + +static void test_GetLineMetrics(void) +{ + static const WCHAR strW[] = {'a','b','c','d',' ',0}; + static const WCHAR str2W[] = {'a','b','\r','c','d',0}; + DWRITE_FONT_METRICS fontmetrics; + DWRITE_LINE_METRICS metrics[2]; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + UINT32 count; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 2048.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 5, format, 30000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 0, &count); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(count == 1, "got count %u\n", count); + + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics[0].length == 5, "got %u\n", metrics[0].length); + ok(metrics[0].trailingWhitespaceLength == 1, "got %u\n", metrics[0].trailingWhitespaceLength); + + ok(metrics[0].newlineLength == 0, "got %u\n", metrics[0].newlineLength); + ok(metrics[0].isTrimmed == FALSE, "got %d\n", metrics[0].isTrimmed); + + /* Tahoma doesn't provide BASE table, so baseline is calculated from font metrics */ + fontface = get_fontface_from_format(format); + ok(fontface != NULL, "got %p\n", fontface); + IDWriteFontFace_GetMetrics(fontface, &fontmetrics); + + ok(metrics[0].baseline == fontmetrics.ascent, "got %.2f, expected %d\n", metrics[0].baseline, + fontmetrics.ascent); + ok(metrics[0].height == fontmetrics.ascent + fontmetrics.descent, "got %.2f, expected %d\n", + metrics[0].height, fontmetrics.ascent + fontmetrics.descent); + IDWriteTextLayout_Release(layout); + + /* force 2 lines */ + hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 10000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(metrics, 0, sizeof(metrics)); + count = 2; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 2, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine { + ok(count == 2, "got %u\n", count); + /* baseline is relative to a line, and is not accumulated */ + ok(metrics[0].baseline == metrics[1].baseline, "got %.2f, %.2f\n", metrics[0].baseline, + metrics[1].baseline); +} + IDWriteTextLayout_Release(layout); + + IDWriteFontFace_Release(fontface); + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); } START_TEST(layout) @@ -2287,6 +2831,10 @@ test_SetFontStyle(); test_SetFontStretch(); test_SetStrikethrough(); + test_GetMetrics(); + test_SetFlowDirection(); + test_SetDrawingEffect(); + test_GetLineMetrics(); IDWriteFactory_Release(factory); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/fltlib/fltlib.c wine-staging-1.7.46~ubuntu14.10.1/dlls/fltlib/fltlib.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/fltlib/fltlib.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/fltlib/fltlib.c 2015-06-28 16:51:28.000000000 +0000 @@ -79,13 +79,22 @@ } /********************************************************************** + * FilterLoad (FLTLIB.@) + */ +HRESULT WINAPI FilterLoad(LPCWSTR filtername) +{ + FIXME("(%s) stub\n", debugstr_w(filtername)); + return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); +} + +/********************************************************************** * FilterUnload (FLTLIB.@) */ -HRESULT WINAPI FilterUnload(LPCWSTR lpFilterName) +HRESULT WINAPI FilterUnload(LPCWSTR filtername) { - FIXME("(%s) stub\n", debugstr_w(lpFilterName)); + FIXME("(%s) stub\n", debugstr_w(filtername)); - if (!lpFilterName) + if (!filtername) return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); return S_OK; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/fltlib/fltlib.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/fltlib/fltlib.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/fltlib/fltlib.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/fltlib/fltlib.spec 2015-06-28 16:51:28.000000000 +0000 @@ -16,7 +16,7 @@ @ stub FilterInstanceFindFirst @ stub FilterInstanceFindNext @ stub FilterInstanceGetInformation -@ stub FilterLoad +@ stdcall FilterLoad(wstr) @ stub FilterReplyMessage @ stub FilterSendMessage @ stdcall FilterUnload(wstr) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/gdi32/freetype.c wine-staging-1.7.46~ubuntu14.10.1/dlls/gdi32/freetype.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/gdi32/freetype.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/gdi32/freetype.c 2015-06-28 16:51:28.000000000 +0000 @@ -1511,6 +1511,14 @@ return ERROR_SUCCESS; } +static LONG reg_load_ftlong(HKEY hkey, const WCHAR *value, FT_Long *data) +{ + DWORD dw; + LONG ret = reg_load_dword(hkey, value, &dw); + *data = dw; + return ret; +} + static inline LONG reg_save_dword(HKEY hkey, const WCHAR *value, DWORD data) { return RegSetValueExW(hkey, value, 0, REG_DWORD, (BYTE*)&data, sizeof(DWORD)); @@ -1541,10 +1549,10 @@ else face->FullName = NULL; - reg_load_dword(hkey_face, face_index_value, (DWORD*)&face->face_index); + reg_load_ftlong(hkey_face, face_index_value, &face->face_index); reg_load_dword(hkey_face, face_ntmflags_value, &face->ntmFlags); - reg_load_dword(hkey_face, face_version_value, (DWORD*)&face->font_version); - reg_load_dword(hkey_face, face_flags_value, (DWORD*)&face->flags); + reg_load_ftlong(hkey_face, face_version_value, &face->font_version); + reg_load_dword(hkey_face, face_flags_value, &face->flags); needed = sizeof(face->fs); RegQueryValueExW(hkey_face, face_font_sig_value, NULL, NULL, (BYTE*)&face->fs, &needed); @@ -1558,9 +1566,9 @@ { face->scalable = FALSE; reg_load_dword(hkey_face, face_width_value, (DWORD*)&face->size.width); - reg_load_dword(hkey_face, face_size_value, (DWORD*)&face->size.size); - reg_load_dword(hkey_face, face_x_ppem_value, (DWORD*)&face->size.x_ppem); - reg_load_dword(hkey_face, face_y_ppem_value, (DWORD*)&face->size.y_ppem); + reg_load_ftlong(hkey_face, face_size_value, &face->size.size); + reg_load_ftlong(hkey_face, face_x_ppem_value, &face->size.x_ppem); + reg_load_ftlong(hkey_face, face_y_ppem_value, &face->size.y_ppem); reg_load_dword(hkey_face, face_internal_leading_value, (DWORD*)&face->size.internal_leading); TRACE("Adding bitmap size h %d w %d size %ld x_ppem %ld y_ppem %ld\n", diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/gdi32/tests/font.c wine-staging-1.7.46~ubuntu14.10.1/dlls/gdi32/tests/font.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/gdi32/tests/font.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/gdi32/tests/font.c 2015-06-28 16:51:28.000000000 +0000 @@ -5704,9 +5704,11 @@ { int charset, weight, height, height_pixels, dpi; const char face_name[LF_FACESIZE]; - } td[][11] = + WORD lang_id; + } td[][12] = { { /* ANSI_FIXED_FONT */ + { ANSI_CHARSET, FW_NORMAL, 12, 12, 96, "Courier", LANG_ARABIC }, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 96, "Courier" }, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 120, "Courier" }, { 0 } @@ -5735,6 +5737,7 @@ { 0 } }, { /* DEFAULT_GUI_FONT */ + { SHIFTJIS_CHARSET, FW_NORMAL, -11, 13, 96, "MS Shell Dlg" }, { SHIFTJIS_CHARSET, FW_NORMAL, -12, 15, 96, "?MS UI Gothic" }, { SHIFTJIS_CHARSET, FW_NORMAL, -15, 18, 120, "?MS UI Gothic" }, { HANGEUL_CHARSET, FW_NORMAL, -12, 15, 96, "?Gulim" }, @@ -5769,7 +5772,9 @@ for (j = 0; td[i][j].face_name[0] != 0; j++) { - if (lf.lfCharSet != td[i][j].charset && td[i][j].charset != DEFAULT_CHARSET) + if ((lf.lfCharSet != td[i][j].charset && td[i][j].charset != DEFAULT_CHARSET) || + (system_lang_id != td[i][j].lang_id && td[i][j].lang_id != LANG_NEUTRAL) || + (td[i][j].face_name[0] != '?' && strcmp(lf.lfFaceName, td[i][j].face_name))) { continue; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/gdiplus/region.c wine-staging-1.7.46~ubuntu14.10.1/dlls/gdiplus/region.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/gdiplus/region.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/gdiplus/region.c 2015-06-28 16:51:28.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Google (Lei Zhang) + * Copyright (C) 2013 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -76,6 +77,28 @@ #define FLAGS_NOFLAGS 0x0 #define FLAGS_INTPATH 0x4000 +struct memory_buffer +{ + const BYTE *buffer; + INT size, pos; +}; + +struct region_header +{ + DWORD size; + DWORD checksum; + DWORD magic; + DWORD num_children; +}; + +struct path_header +{ + DWORD size; + DWORD magic; + DWORD count; + DWORD flags; +}; + /* Header size as far as header->size is concerned. This doesn't include * header->size or header->checksum */ @@ -729,15 +752,9 @@ { INT i; const GpPath* path = element->elementdata.path; - struct _pathheader - { - DWORD size; - DWORD magic; - DWORD count; - DWORD flags; - } *pathheader; + struct path_header *pathheader; - pathheader = (struct _pathheader *)(buffer + *filled); + pathheader = (struct path_header *)(buffer + *filled); pathheader->flags = is_integer_path(path) ? FLAGS_INTPATH : FLAGS_NOFLAGS; /* 3 for headers, once again size doesn't count itself */ @@ -778,14 +795,6 @@ } } -struct region_header -{ - DWORD size; - DWORD checksum; - DWORD magic; - DWORD num_children; -}; - /***************************************************************************** * GdipGetRegionData [GDIPLUS.@] * @@ -856,36 +865,190 @@ return Ok; } -static inline GpStatus read_dword(DWORD **buffer, INT *size, DWORD *ret) +static inline void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size) { - if (*size < sizeof(DWORD)) - return GenericError; + mbuf->buffer = buffer; + mbuf->size = size; + mbuf->pos = 0; +} - *ret = **buffer; - (*buffer)++; - (*size) -= sizeof(DWORD); - return Ok; +static inline const void *buffer_read(struct memory_buffer *mbuf, INT size) +{ + if (mbuf->size - mbuf->pos >= size) + { + const void *data = mbuf->buffer + mbuf->pos; + mbuf->pos += size; + return data; + } + return NULL; } -static GpStatus read_element(GpRegion *region, region_element *element, DWORD **buffer, INT *size) +static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, region_element *node, INT *count) { GpStatus status; + const DWORD *type; - status = read_dword(buffer, size, &element->type); - if (status != Ok) + type = buffer_read(mbuf, sizeof(*type)); + if (!type) return Ok; + + TRACE("type %#x\n", *type); + + node->type = *type; + + switch (node->type) + { + case CombineModeReplace: + case CombineModeIntersect: + case CombineModeUnion: + case CombineModeXor: + case CombineModeExclude: + case CombineModeComplement: + { + region_element *left, *right; + + left = GdipAlloc(sizeof(region_element)); + if (!left) return OutOfMemory; + right = GdipAlloc(sizeof(region_element)); + if (!right) + { + GdipFree(left); + return OutOfMemory; + } + + status = read_element(mbuf, region, left, count); + if (status == Ok) + { + status = read_element(mbuf, region, right, count); + if (status == Ok) + { + node->elementdata.combine.left = left; + node->elementdata.combine.right = right; + region->num_children += 2; + return Ok; + } + } + + GdipFree(left); + GdipFree(right); return status; + } - switch (element->type) + case RegionDataRect: { - case RegionDataInfiniteRect: + const GpRectF *rc; + + rc = buffer_read(mbuf, sizeof(*rc)); + if (!rc) + { + ERR("failed to read rect data\n"); + return InvalidParameter; + } + + node->elementdata.rect = *rc; + *count += 1; + return Ok; + } + + case RegionDataPath: + { + GpPath *path; + const struct path_header *path_header; + const BYTE *types; + + path_header = buffer_read(mbuf, sizeof(*path_header)); + if (!path_header) + { + ERR("failed to read path header\n"); + return InvalidParameter; + } + if (path_header->magic != VERSION_MAGIC) + { + ERR("invalid path header magic %#x\n", path_header->magic); + return InvalidParameter; + } + + /* Windows always fails to create an empty path in a region */ + if (!path_header->count) + { + TRACE("refusing to create an empty path in a region\n"); + return GenericError; + } + + status = GdipCreatePath(FillModeAlternate, &path); + if (status) return status; + + node->elementdata.path = path; + + if (!lengthen_path(path, path_header->count)) + return OutOfMemory; + + path->pathdata.Count = path_header->count; + + if (path_header->flags & ~FLAGS_INTPATH) + FIXME("unhandled path flags %#x\n", path_header->flags); + + if (path_header->flags & FLAGS_INTPATH) + { + const packed_point *pt; + DWORD i; + + pt = buffer_read(mbuf, sizeof(*pt) * path_header->count); + if (!pt) + { + ERR("failed to read packed %u path points\n", path_header->count); + return InvalidParameter; + } + + for (i = 0; i < path_header->count; i++) + { + path->pathdata.Points[i].X = (REAL)pt[i].X; + path->pathdata.Points[i].Y = (REAL)pt[i].Y; + } + } + else + { + const GpPointF *ptf; + + ptf = buffer_read(mbuf, sizeof(*ptf) * path_header->count); + if (!ptf) + { + ERR("failed to read %u path points\n", path_header->count); + return InvalidParameter; + } + memcpy(path->pathdata.Points, ptf, sizeof(*ptf) * path_header->count); + } + + types = buffer_read(mbuf, path_header->count); + if (!types) + { + ERR("failed to read %u path types\n", path_header->count); + return InvalidParameter; + } + memcpy(path->pathdata.Types, types, path_header->count); + if (path_header->count & 3) + { + if (!buffer_read(mbuf, 4 - (path_header->count & 3))) + { + ERR("failed to read rounding %u bytes\n", 4 - (path_header->count & 3)); + return InvalidParameter; + } + } + + *count += 1; + return Ok; + } + case RegionDataEmptyRect: - break; + case RegionDataInfiniteRect: + *count += 1; + return Ok; + default: - FIXME("region element type 0x%08x not supported\n", element->type); - return NotImplemented; + FIXME("element type %#x is not supported\n", *type); + break; } - return Ok; + return InvalidParameter; } /***************************************************************************** @@ -893,28 +1056,32 @@ */ GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRegion **region) { - struct region_header *region_header; - DWORD *buffer = (DWORD*)data; + const struct region_header *region_header; + struct memory_buffer mbuf; GpStatus status; + INT count; TRACE("(%p, %d, %p)\n", data, size, region); - if (!data || size < sizeof(*region_header) || !region) + if (!data || !size) return InvalidParameter; - region_header = (struct region_header *)buffer; - if (region_header->magic != VERSION_MAGIC && region_header->magic != VERSION_MAGIC2) + init_memory_buffer(&mbuf, data, size); + + region_header = buffer_read(&mbuf, sizeof(*region_header)); + if (!region_header || (region_header->magic != VERSION_MAGIC && + region_header->magic != VERSION_MAGIC2)) return InvalidParameter; status = GdipCreateRegion(region); if (status != Ok) return status; - /* skip header */ - buffer += 4; - size -= sizeof(*region_header); + count = 0; + status = read_element(&mbuf, *region, &(*region)->node, &count); + if (status == Ok && !count) + status = InvalidParameter; - status = read_element(*region, &(*region)->node, &buffer, &size); if (status != Ok) { GdipDeleteRegion(*region); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/gdiplus/tests/region.c wine-staging-1.7.46~ubuntu14.10.1/dlls/gdiplus/tests/region.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/gdiplus/tests/region.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/gdiplus/tests/region.c 2015-06-28 16:51:28.000000000 +0000 @@ -102,6 +102,56 @@ rgn.data.rdh.rcBound.left, rgn.data.rdh.rcBound.top, rgn.data.rdh.rcBound.right, rgn.data.rdh.rcBound.bottom); } +static void test_region_data(DWORD *data, UINT size, INT line) +{ + GpStatus status; + GpRegion *region; + DWORD buf[256]; + UINT needed, i; + + status = GdipCreateRegionRgnData((BYTE *)data, size, ®ion); + /* Windows always fails to create an empty path in a region */ + if (data[4] == RGNDATA_PATH) + { + struct path_header + { + DWORD size; + DWORD magic; + DWORD count; + DWORD flags; + } *path_header = (struct path_header *)(data + 5); + if (!path_header->count) + { + ok_(__FILE__, line)(status == GenericError, "expected GenericError, got %d\n", status); + return; + } + } + + ok_(__FILE__, line)(status == Ok, "GdipCreateRegionRgnData error %d\n", status); + if (status != Ok) return; + + needed = 0; + status = GdipGetRegionDataSize(region, &needed); + ok_(__FILE__, line)(status == Ok, "status %d\n", status); + ok_(__FILE__, line)(needed == size, "data size mismatch: %u != %u\n", needed, size); + + memset(buf, 0xee, sizeof(buf)); + needed = 0; + status = GdipGetRegionData(region, (BYTE *)buf, sizeof(buf), &needed); + ok_(__FILE__, line)(status == Ok, "status %08x\n", status); + ok_(__FILE__, line)(needed == size, "data size mismatch: %u != %u\n", needed, size); + + size /= sizeof(DWORD); + for (i = 0; i < size - 1; i++) + { + if (i == 1) continue; /* data[1] never matches */ + ok_(__FILE__, line)(data[i] == buf[i], "off %u: %#x != %#x\n", i, data[i], buf[i]); + } + /* some Windows versions fail to properly clear the aligned DWORD */ + ok_(__FILE__, line)(data[size - 1] == buf[size - 1] || broken(data[size - 1] != buf[size - 1]), + "off %u: %#x != %#x\n", size - 1, data[size - 1], buf[size - 1]); +} + static void test_getregiondata(void) { GpStatus status; @@ -143,6 +193,7 @@ expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); expect_dword(buf + 6, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipSetEmpty(region); ok(status == Ok, "status %08x\n", status); @@ -160,6 +211,7 @@ expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_EMPTY_RECT); expect_dword(buf + 6, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipSetInfinite(region); ok(status == Ok, "status %08x\n", status); @@ -177,6 +229,7 @@ expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); expect_dword(buf + 6, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); @@ -205,6 +258,7 @@ expect_float(buf + 7, 100.0); expect_float(buf + 8, 200.0); expect_dword(buf + 10, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); rect.X = 50; rect.Y = 30; @@ -290,6 +344,7 @@ expect_float(buf + 37, 22.0); expect_float(buf + 38, 55.0); expect_dword(buf + 39, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeleteRegion(region2); ok(status == Ok, "status %08x\n", status); @@ -331,6 +386,7 @@ expect_float(buf + 16, 28.0); expect_dword(buf + 17, 0x81010100); expect_dword(buf + 18, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); rect.X = 50; rect.Y = 30; @@ -371,6 +427,7 @@ expect_float(buf + 22, 10.0); expect_float(buf + 23, 20.0); expect_dword(buf + 24, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); @@ -403,6 +460,7 @@ ok(*(buf + 8) == 0x4000 /* before win7 */ || *(buf + 8) == 0, "expected 0x4000 or 0, got %08x\n", *(buf + 8)); expect_dword(buf + 10, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); /* Transform an empty region */ status = GdipCreateMatrix(&matrix); @@ -453,6 +511,7 @@ expect(6, point[3].Y); expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ expect_dword(buf + 14, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipTranslateRegion(region, 0.6, 0.8); expect(Ok, status); @@ -480,6 +539,7 @@ expect_float(buf + 16, 6.8); expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ expect_dword(buf + 18, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); @@ -522,6 +582,7 @@ expect_float(buf + 16, 6.2); expect_dword(buf + 17, 0x01010100); expect_dword(buf + 18, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); @@ -584,6 +645,7 @@ ok(*(buf + 28) == 0x00000101 || *(buf + 28) == 0x43050101 /* Win 7 */, "expected 00000101 or 43050101 got %08x\n", *(buf + 28)); expect_dword(buf + 29, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); @@ -627,6 +689,7 @@ expect(23, point[3].Y); expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ expect_dword(buf + 14, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); @@ -669,6 +732,7 @@ expect_float(buf + 16, 2300.0); expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ expect_dword(buf + 18, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); @@ -732,6 +796,7 @@ *(buf + 33) == 0x43030303 /* 32-bit win7 */ || *(buf + 33) == 0x4c030303 /* 64-bit win7 */, "expected 0x00030303 or 0x43030303 or 0x4c030303 got %08x\n", *(buf + 33)); expect_dword(buf + 34, 0xeeeeeeee); + test_region_data(buf, needed, __LINE__); status = GdipDeletePath(path); expect(Ok, status); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/hidd.c wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/hidd.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/hidd.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/hidd.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * Human Input Devices + * + * Copyright (C) 2006 Kevin Koltzau + * Copyright (C) 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#include "wine/debug.h" + +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "winioctl.h" +#include "ddk/wdm.h" + +#include "ddk/hidclass.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hid); + +BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) +{ + TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); + return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_FEATURE, NULL, 0, ReportBuffer, ReportBufferLength, NULL, NULL); +} + +void WINAPI HidD_GetHidGuid(LPGUID guid) +{ + TRACE("(%p)\n", guid); + *guid = GUID_DEVINTERFACE_HID; +} + +BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) +{ + TRACE("(%p %p %u) \n", HidDeviceObject, Buffer, BufferLength); + return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_MANUFACTURER_STRING, NULL, 0, Buffer, BufferLength, NULL, NULL); +} + +BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) +{ + TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); + return DeviceIoControl(HidDeviceObject, IOCTL_HID_SET_FEATURE, ReportBuffer, ReportBufferLength, NULL, 0, NULL, NULL); +} + +BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) +{ + TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength); + return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, Buffer, BufferLength, NULL, NULL); +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/main.c wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/main.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/main.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/main.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,14 +24,10 @@ #include "windef.h" #include "winbase.h" -#include "ddk/hidsdi.h" #include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(hid); - #include "initguid.h" -DEFINE_GUID(HID_GUID, 0x4D1E55B2, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30); +#include "ddk/hidclass.h" /***********************************************************************/ @@ -47,35 +43,3 @@ } return TRUE; } - -BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) -{ - static int count = 0; - if (!count++) - FIXME("(%p %p %u) stub\n", HidDeviceObject, ReportBuffer, ReportBufferLength); - return FALSE; -} - -void WINAPI HidD_GetHidGuid(LPGUID guid) -{ - TRACE("(%p)\n", guid); - *guid = HID_GUID; -} - -BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) -{ - FIXME("(%p %p %u) stub\n", HidDeviceObject, Buffer, BufferLength); - return FALSE; -} - -BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) -{ - FIXME("(%p %p %u) stub\n", HidDeviceObject, ReportBuffer, ReportBufferLength); - return FALSE; -} - -BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) -{ - FIXME("(%p %p %u) stub\n", HidDeviceObject, Buffer, BufferLength); - return FALSE; -} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/hid/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/hid/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -2,6 +2,7 @@ IMPORTLIB = hid C_SRCS = \ + hidd.c \ main.c RC_SRCS = version.rc diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ieframe/tests/intshcut.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ieframe/tests/intshcut.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ieframe/tests/intshcut.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ieframe/tests/intshcut.c 2015-06-28 16:51:28.000000000 +0000 @@ -156,13 +156,14 @@ todo_wine ok_(__FILE__,line)(!lstrcmpA(output, expectedOutput), "unexpected URL change %s -> %s (expected %s)\n", input, output, expectedOutput); - CoTaskMemFree(output); }else { todo_wine ok_(__FILE__,line)(hr == S_FALSE, "GetUrl failed, hr=0x%x\n", hr); todo_wine ok_(__FILE__,line)(!output, "GetUrl returned %s\n", output); } + if (hr == S_OK) + CoTaskMemFree(output); } static void test_ReadAndWriteProperties(void) @@ -252,7 +253,7 @@ hr = urlAFromFile->lpVtbl->GetURL(urlAFromFile, &url); ok(hr == S_OK, "Unable to get url from file, hr=0x%x\n", hr); ok(lstrcmpA(url, testurl) == 0, "Wrong url read from file: %s\n",url); - + CoTaskMemFree(url); hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPropertySetStorage, (void **) &pPropSetStg); ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hr); @@ -381,6 +382,7 @@ ok(hres == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hres); if(FAILED(hres)) return; + url->lpVtbl->Release(url); test_Aggregability(); test_QueryInterface(); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/file.c wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/file.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/file.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/file.c 2015-06-28 16:51:28.000000000 +0000 @@ -1040,6 +1040,16 @@ return FALSE; } +/************************************************************************** + * SetFileCompletionNotificationModes (KERNEL32.@) + */ +BOOL WINAPI SetFileCompletionNotificationModes( HANDLE handle, UCHAR flags ) +{ + FIXME("%p %x - stub\n", handle, flags); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + /*********************************************************************** * SetFileInformationByHandle (KERNEL32.@) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/kernel32.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/kernel32.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/kernel32.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/kernel32.spec 2015-06-28 16:51:28.000000000 +0000 @@ -1284,7 +1284,7 @@ @ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext @ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace @ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory -# @ stub -arch=x86_64 RtlCopyMemory +@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory @ cdecl -arch=arm,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr ptr) ntdll.RtlInstallFunctionTableCallback @@ -1393,7 +1393,7 @@ # @ stub SetFileAttributesTransactedW @ stdcall SetFileAttributesW(wstr long) # @ stub SetFileBandwidthReservation -# @ stub SetFileCompletionNotificationModes +@ stdcall SetFileCompletionNotificationModes(long long) @ stdcall SetFileInformationByHandle(long long ptr long) # @ stub SetFileIoOverlappedRange @ stdcall SetFilePointer(long long ptr long) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/tests/virtual.c wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/tests/virtual.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/tests/virtual.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/tests/virtual.c 2015-06-28 16:51:28.000000000 +0000 @@ -1093,25 +1093,25 @@ size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - todo_wine ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); - if (status == STATUS_SUCCESS) - { - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - todo_wine ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); - if (status == STATUS_SUCCESS) - { - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } + + ptr2 = (char *)ptr + 0x1001; + size = 0; + offset.QuadPart = 0; + status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); + ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 1; + status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); + ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 ) || !is_wow64)) @@ -1129,7 +1129,6 @@ offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - todo_wine ok( status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %x\n", status ); /* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */ @@ -1138,12 +1137,10 @@ offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - todo_wine ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); ok( (char *)ptr2 == (char *)ptr + 0x1000, "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2 ); status = pNtUnmapViewOfSection( hProcess, ptr2 ); - todo_wine ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); /* the address is rounded down if not on a page boundary */ @@ -1152,13 +1149,10 @@ offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - todo_wine ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - todo_wine ok( (char *)ptr2 == (char *)ptr + 0x1000, "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2 ); status = pNtUnmapViewOfSection( hProcess, ptr2 ); - todo_wine ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); ptr2 = (char *)ptr + 0x2000; @@ -1166,12 +1160,10 @@ offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - todo_wine ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); ok( (char *)ptr2 == (char *)ptr + 0x2000, "expected address %p, got %p\n", (char *)ptr + 0x2000, ptr2 ); status = pNtUnmapViewOfSection( hProcess, ptr2 ); - todo_wine ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); } else diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/tests/volume.c wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/tests/volume.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/kernel32/tests/volume.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/kernel32/tests/volume.c 2015-06-28 16:51:28.000000000 +0000 @@ -54,6 +54,7 @@ static UINT (WINAPI *pGetLogicalDriveStringsW)(UINT,LPWSTR); static BOOL (WINAPI *pGetVolumeInformationA)(LPCSTR, LPSTR, DWORD, LPDWORD, LPDWORD, LPDWORD, LPSTR, DWORD); static BOOL (WINAPI *pGetVolumePathNameA)(LPCSTR, LPSTR, DWORD); +static BOOL (WINAPI *pGetVolumePathNameW)(LPWSTR, LPWSTR, DWORD); static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameA)(LPCSTR, LPSTR, DWORD, LPDWORD); static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameW)(LPCWSTR, LPWSTR, DWORD, LPDWORD); @@ -591,82 +592,291 @@ static void test_GetVolumePathNameA(void) { - BOOL ret; - char volume[MAX_PATH]; - char expected[] = "C:\\", pathC1[] = "C:\\", pathC2[] = "C::"; + char volume_path[MAX_PATH], cwd[MAX_PATH]; + struct { + const char *file_name; + const char *path_name; + DWORD path_len; + DWORD error; + DWORD broken_error; + } test_paths[] = { + { /* test 0: NULL parameters, 0 output length */ + NULL, NULL, 0, + ERROR_INVALID_PARAMETER, 0xdeadbeef /* winxp */ + }, + { /* test 1: empty input, NULL output, 0 output length */ + "", NULL, 0, + ERROR_INVALID_PARAMETER, 0xdeadbeef /* winxp */ + }, + { /* test 2: valid input, NULL output, 0 output length */ + "C:\\", NULL, 0, + ERROR_INVALID_PARAMETER, ERROR_FILENAME_EXCED_RANGE /* winxp */ + }, + { /* test 3: valid input, valid output, 0 output length */ + "C:\\", "C:\\", 0, + ERROR_INVALID_PARAMETER, ERROR_FILENAME_EXCED_RANGE /* winxp */ + }, + { /* test 4: valid input, valid output, 1 output length */ + "C:\\", "C:\\", 1, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 5: valid input, valid output, valid output length */ + "C:\\", "C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 6: lowercase input, uppercase output, valid output length */ + "c:\\", "C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 7: poor quality input, valid output, valid output length */ + "C::", "C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 8: really bogus input, valid output, 1 output length */ + "\\\\$$$", "C:\\", 1, + ERROR_INVALID_NAME, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 9: a reasonable DOS path that is guaranteed to exist */ + "C:\\windows\\system32", "C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 10: a reasonable DOS path that shouldn't exist */ + "C:\\windows\\system32\\AnInvalidFolder", "C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 11: a reasonable NT-converted DOS path that shouldn't exist */ + "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 12: an unreasonable NT-converted DOS path */ + "\\\\?\\InvalidDrive:\\AnInvalidFolder", "\\\\?\\InvalidDrive:\\" /* win2k, winxp */, + sizeof(volume_path), + ERROR_INVALID_NAME, NO_ERROR + }, + { /* test 13: an unreasonable NT volume path */ + "\\\\?\\Volume{00000000-00-0000-0000-000000000000}\\AnInvalidFolder", + "\\\\?\\Volume{00000000-00-0000-0000-000000000000}\\" /* win2k, winxp */, + sizeof(volume_path), + ERROR_INVALID_NAME, NO_ERROR + }, + { /* test 14: an unreasonable NT-ish path */ + "\\\\ReallyBogus\\InvalidDrive:\\AnInvalidFolder", + "\\\\ReallyBogus\\InvalidDrive:\\" /* win2k, winxp */, sizeof(volume_path), + ERROR_INVALID_NAME, NO_ERROR + }, + { /* test 15: poor quality input, valid output, valid output length, different drive */ + "D::", "D:\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 16: unused drive letter */ + "M::", "C:\\", 4, + ERROR_FILE_NOT_FOUND, ERROR_MORE_DATA + }, + { /* test 17: an unreasonable DOS path */ + "InvalidDrive:\\AnInvalidFolder", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 18: a reasonable device path */ + "\\??\\CdRom0", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 19: an unreasonable device path */ + "\\??\\ReallyBogus", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 20 */ + "C:", "C:", 2, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 21 */ + "C:", "C:", 3, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 22 */ + "C:\\", "C:", 2, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 23 */ + "C:\\", "C:", 3, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 24 */ + "C::", "C:", 2, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 25 */ + "C::", "C:", 3, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 26 */ + "C::", "C:\\", 4, + NO_ERROR, ERROR_MORE_DATA + }, + { /* test 27 */ + "C:\\windows\\system32\\AnInvalidFolder", "C:", 3, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 28 */ + "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 3, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 29 */ + "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 6, + ERROR_FILENAME_EXCED_RANGE, NO_ERROR + }, + { /* test 30 */ + "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 7, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 31 */ + "\\\\?\\c:\\AnInvalidFolder", "\\\\?\\c:", 7, + NO_ERROR, ERROR_FILENAME_EXCED_RANGE + }, + { /* test 32 */ + "C:/", "C:\\", 4, + NO_ERROR, ERROR_MORE_DATA + }, + { /* test 33 */ + "M:/", "", 4, + ERROR_FILE_NOT_FOUND, ERROR_MORE_DATA + }, + { /* test 34 */ + "C:ABC:DEF:\\AnInvalidFolder", "C:\\", 4, + NO_ERROR, ERROR_MORE_DATA + }, + { /* test 35 */ + "?:ABC:DEF:\\AnInvalidFolder", "?:\\" /* win2k, winxp */, sizeof(volume_path), + ERROR_FILE_NOT_FOUND, NO_ERROR + }, + { /* test 36 */ + "relative/path", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 37 */ + "/unix-style/absolute/path", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 38 */ + "\\??\\C:\\NonExistent", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 39 */ + "\\??\\M:\\NonExistent", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 40 */ + "somefile:def", "%CurrentDrive%\\", sizeof(volume_path), + NO_ERROR, NO_ERROR + }, + { /* test 41 */ + "s:omefile", "S:\\" /* win2k, winxp */, sizeof(volume_path), + ERROR_FILE_NOT_FOUND, NO_ERROR + }, + }; + BOOL ret, success; DWORD error; + UINT i; + /* GetVolumePathNameA is not present before w2k */ if (!pGetVolumePathNameA) { win_skip("required functions not found\n"); return; } - SetLastError( 0xdeadbeef ); - ret = pGetVolumePathNameA(NULL, NULL, 0); - error = GetLastError(); - ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER - || broken( error == 0xdeadbeef) /* <=XP */, - "expected ERROR_INVALID_PARAMETER got %u\n", error); + /* Obtain the drive of the working directory */ + ret = GetCurrentDirectoryA( sizeof(cwd), cwd ); + ok( ret, "Failed to obtain the current working directory.\n" ); + cwd[2] = 0; + ret = SetEnvironmentVariableA( "CurrentDrive", cwd ); + ok( ret, "Failed to set an environment variable for the current working drive.\n" ); - SetLastError( 0xdeadbeef ); - ret = pGetVolumePathNameA("", NULL, 0); - error = GetLastError(); - ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER - || broken( error == 0xdeadbeef) /* <=XP */, - "expected ERROR_INVALID_PARAMETER got %u\n", error); - - SetLastError( 0xdeadbeef ); - ret = pGetVolumePathNameA(pathC1, NULL, 0); - error = GetLastError(); - ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER - || broken(error == ERROR_FILENAME_EXCED_RANGE) /* <=XP */, - "expected ERROR_INVALID_PARAMETER got %u\n", error); + for (i=0; i= 'a' && tolowerW(p[0]) <= 'z' && p[1] ==':' && p[2] == '\\') + last_pos = pos = strlenW( filename ); + /* allocate enough memory for searching the path (need room for a slash and a NULL terminator) */ + if (!(volumenameW = HeapAlloc( GetProcessHeap(), 0, (pos + 2) * sizeof(WCHAR) ))) { - if (buflen < 4) + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; + } + strcpyW( volumenameW, filename ); + stop_pos = 0; + /* stop searching slashes early for NT-type and nearly NT-type paths */ + if (strncmpW(ntprefixW, filename, strlenW(ntprefixW)) == 0) + stop_pos = strlenW(ntprefixW)-1; + else if (strncmpW(ntprefixW, filename, 2) == 0) + stop_pos = 2; + + do + { + volumenameW[pos+0] = '\\'; + volumenameW[pos+1] = '\0'; + if (!RtlDosPathNameToNtPathName_U( volumenameW, &nt_name, NULL, NULL )) + goto cleanup; + volumenameW[pos] = '\0'; + status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE ); + RtlFreeUnicodeString( &nt_name ); + if (status == STATUS_SUCCESS) + { + if (stat( unix_name.Buffer, &st ) != 0) + { + RtlFreeAnsiString( &unix_name ); + status = STATUS_OBJECT_NAME_INVALID; + goto cleanup; + } + if (first_run) + { + first_run = FALSE; + search_dev = st.st_dev; + } + else if (st.st_dev != search_dev) + { + /* folder is on a new filesystem, return the last folder */ + RtlFreeAnsiString( &unix_name ); + break; + } + } + RtlFreeAnsiString( &unix_name ); + last_pos = pos; + c = strrchrW( volumenameW, '\\' ); + if (c != NULL) + pos = c-volumenameW; + } while (c != NULL && pos > stop_pos); + + if (status != STATUS_SUCCESS) + { + WCHAR cwdW[MAX_PATH]; + + /* the path was completely invalid */ + if (filename[0] == '\\' && strncmpW(deviceprefixW, filename, strlenW(deviceprefixW)) != 0) + { + /* NT-style paths (that are not device paths) fail */ + status = STATUS_OBJECT_NAME_INVALID; + goto cleanup; + } + + /* DOS-style paths (anything not beginning with a slash) have fallback replies */ + if (filename[1] == ':') + { + /* if the path is semi-sane (X:) then use the given drive letter (if it is mounted) */ + fallbackpathW[0] = filename[0]; + if (!isalphaW(filename[0]) || GetDriveTypeW( fallbackpathW ) == DRIVE_NO_ROOT_DIR) + { + status = STATUS_OBJECT_NAME_NOT_FOUND; + goto cleanup; + } + } + else if (GetCurrentDirectoryW( sizeof(cwdW)/sizeof(cwdW[0]), cwdW )) { - SetLastError(ERROR_FILENAME_EXCED_RANGE); - return FALSE; + /* if the path is completely bogus then revert to the drive of the working directory */ + fallbackpathW[0] = cwdW[0]; } - volumepathname[0] = p[0]; - volumepathname[1] = ':'; - volumepathname[2] = '\\'; - volumepathname[3] = 0; - return TRUE; + else + { + status = STATUS_OBJECT_NAME_INVALID; + goto cleanup; + } + last_pos = strlenW(fallbackpathW) - 1; /* points to \\ */ + filename = fallbackpathW; + status = STATUS_SUCCESS; } - SetLastError(ERROR_INVALID_NAME); - return FALSE; + if (last_pos + 1 <= buflen) + { + WCHAR *p; + memcpy(volumepathname, filename, last_pos * sizeof(WCHAR)); + if (last_pos + 2 <= buflen) volumepathname[last_pos++] = '\\'; + volumepathname[last_pos] = '\0'; + + /* Normalize path */ + for (p = volumepathname; *p; p++) if (*p == '/') *p = '\\'; + + /* DOS-style paths always return upper-case drive letters */ + if (volumepathname[1] == ':') + volumepathname[0] = toupperW(volumepathname[0]); + + TRACE("Successfully translated path %s to mount-point %s\n", + debugstr_w(filename), debugstr_w(volumepathname)); + } + else + status = STATUS_NAME_TOO_LONG; + +cleanup: + HeapFree( GetProcessHeap(), 0, volumenameW ); + + if (status != STATUS_SUCCESS) + SetLastError( RtlNtStatusToDosError(status) ); + return (status == STATUS_SUCCESS); } + /*********************************************************************** * GetVolumePathNamesForVolumeNameA (KERNEL32.@) */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/events.c wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/events.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/events.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/events.c 2015-06-28 16:51:28.000000000 +0000 @@ -1854,7 +1854,7 @@ ok(V_DISPATCH(&v) == (IDispatch*)&img_onerror_obj, "V_DISPATCH(onerror) != onerrorFunc\n"); VariantClear(&v); - str = a2bstr("https://www.winehq.org/images/winehq_logo_text.png"); + str = a2bstr("http://test.winehq.org/tests/winehq_snapshot/index_files/winehq_logo_text.png"); hres = IHTMLImgElement_put_src(img, str); ok(hres == S_OK, "put_src failed: %08x\n", hres); SysFreeString(str); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -9,7 +9,8 @@ misc.c \ protocol.c \ script.c \ - style.c + style.c \ + xmlhttprequest.c IDL_SRCS = test_tlb.idl diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/xmlhttprequest.c wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/xmlhttprequest.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/tests/xmlhttprequest.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/tests/xmlhttprequest.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,625 @@ +/* + * Copyright 2015 Zhenbo Li + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "mshtml.h" + +static BSTR a2bstr(const char *str) +{ + BSTR ret; + int len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = SysAllocStringLen(NULL, len); + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + + return ret; +} + +static int strcmp_wa(LPCWSTR strw, const char *stra) +{ + CHAR buf[512]; + WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL); + return lstrcmpA(stra, buf); +} + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0) + +#define CHECK_EXPECT2(func) \ + do { \ + trace(#func "\n"); \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +static IHTMLXMLHttpRequest *xhr = NULL; + +DEFINE_EXPECT(xmlhttprequest_onreadystatechange_opened); +DEFINE_EXPECT(xmlhttprequest_onreadystatechange_headers_received); +DEFINE_EXPECT(xmlhttprequest_onreadystatechange_loading); +DEFINE_EXPECT(xmlhttprequest_onreadystatechange_done); + +#define test_disp(u,id) _test_disp(__LINE__,u,id) +static void _test_disp(unsigned line, IUnknown *unk, const IID *diid) +{ + IDispatchEx *dispex; + ITypeInfo *typeinfo; + UINT ticnt; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (void**)&dispex); + ok_(__FILE__,line) (hres == S_OK, "Could not get IDispatch: %08x\n", hres); + if(FAILED(hres)) + return; + + ticnt = 0xdeadbeef; + hres = IDispatchEx_GetTypeInfoCount(dispex, &ticnt); + ok_(__FILE__,line) (hres == S_OK, "GetTypeInfoCount failed: %08x\n", hres); + ok_(__FILE__,line) (ticnt == 1, "ticnt=%u\n", ticnt); + + hres = IDispatchEx_GetTypeInfo(dispex, 0, 0, &typeinfo); + ok_(__FILE__,line) (hres == S_OK, "GetTypeInfo failed: %08x\n", hres); + + if(SUCCEEDED(hres)) { + TYPEATTR *type_attr; + + hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr); + ok_(__FILE__,line) (hres == S_OK, "GetTypeAttr failed: %08x\n", hres); + ok_(__FILE__,line) (IsEqualGUID(&type_attr->guid, diid), "unexpected guid %s\n", + wine_dbgstr_guid(&type_attr->guid)); + + ITypeInfo_ReleaseTypeAttr(typeinfo, type_attr); + ITypeInfo_Release(typeinfo); + } + + IDispatchEx_Release(dispex); +} + +#define test_event_args(a,b,c,d,e,f,g) _test_event_args(__LINE__,a,b,c,d,e,f,g) +static void _test_event_args(unsigned line, const IID *dispiid, DISPID id, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + ok_(__FILE__,line) (id == DISPID_VALUE, "id = %d\n", id); + ok_(__FILE__,line) (wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags); + ok_(__FILE__,line) (pdp != NULL, "pdp == NULL\n"); + ok_(__FILE__,line) (pdp->cArgs == 1, "pdp->cArgs = %d\n", pdp->cArgs); + ok_(__FILE__,line) (pdp->cNamedArgs == 1, "pdp->cNamedArgs = %d\n", pdp->cNamedArgs); + ok_(__FILE__,line) (pdp->rgdispidNamedArgs[0] == DISPID_THIS, "pdp->rgdispidNamedArgs[0] = %d\n", + pdp->rgdispidNamedArgs[0]); + ok_(__FILE__,line) (V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(rgvarg) = %d\n", V_VT(pdp->rgvarg)); + ok_(__FILE__,line) (pvarRes != NULL, "pvarRes == NULL\n"); + ok_(__FILE__,line) (pei != NULL, "pei == NULL"); + ok_(__FILE__,line) (!pspCaller, "pspCaller != NULL\n"); + + if(dispiid) + _test_disp(line, (IUnknown*)V_DISPATCH(pdp->rgvarg), dispiid); +} + +static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IDispatch) + || IsEqualGUID(riid, &IID_IDispatchEx)) + *ppv = iface; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; + } + + return S_OK; +} + +static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface) +{ + return 2; +} + +static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface) +{ + return 1; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI xmlhttprequest_onreadystatechange(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + LONG val; + HRESULT hres; + + test_event_args(&DIID_DispHTMLXMLHttpRequest, id, wFlags, pdp, pvarRes, pei, pspCaller); + + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + + switch(val) { + case 1: + CHECK_EXPECT(xmlhttprequest_onreadystatechange_opened); + break; + case 2: + CHECK_EXPECT(xmlhttprequest_onreadystatechange_headers_received); + break; + case 3: + CHECK_EXPECT(xmlhttprequest_onreadystatechange_loading); + break; + case 4: + CHECK_EXPECT(xmlhttprequest_onreadystatechange_done); + break; + default: + ok(0, "unexpected readyState: %d\n", val); + } + return S_OK; +} + +static IDispatchExVtbl xmlhttprequest_onreadystatechangeFuncVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + xmlhttprequest_onreadystatechange, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; +static IDispatchEx xmlhttprequest_onreadystatechange_obj = { &xmlhttprequest_onreadystatechangeFuncVtbl }; + +static void pump_msgs(BOOL *b) +{ + MSG msg; + + if(b) { + while(!*b && GetMessageW(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + }else { + while(PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } +} + +static const char EXPECT_RESPONSE_TEXT[] = "\nTEST\n"; + +static void create_xmlhttprequest(IHTMLDocument2 *doc) +{ + IHTMLWindow2 *window; + IHTMLWindow5 *window5; + VARIANT var; + IHTMLXMLHttpRequestFactory *factory; + HRESULT hres; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08x\n", hres); + ok(window != NULL, "window == NULL\n"); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow5, (void**)&window5); + IHTMLWindow2_Release(window); + if(FAILED(hres)) { + win_skip("IHTMLWindow5 not supported\n"); + return; + } + + hres = IHTMLWindow5_get_XMLHttpRequest(window5, &var); + IHTMLWindow5_Release(window5); + ok(hres == S_OK, "get_XMLHttpRequest failed: %08x\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(&var) is %08x, expected VT_DISPATCH\n", V_VT(&var)); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLXMLHttpRequestFactory, (void**)&factory); + VariantClear(&var); + ok(hres == S_OK, "QueryInterface(IID_IHTMLXMLHttpRequestFactory) failed: %08x\n", hres); + ok(factory != NULL, "factory == NULL\n"); + + hres = IHTMLXMLHttpRequestFactory_create(factory, &xhr); + IHTMLXMLHttpRequestFactory_Release(factory); + ok(hres == S_OK, "create failed: %08x\n", hres); + ok(xhr != NULL, "xhr == NULL\n"); +} + +static void test_sync_xhr(IHTMLDocument2 *doc, const char *xml_url) +{ + VARIANT vbool, vempty, var; + BSTR method, url; + BSTR text; + LONG val; + HRESULT hres; + + create_xmlhttprequest(doc); + if(!xhr) + return; + + V_VT(&var) = VT_EMPTY; + hres = IHTMLXMLHttpRequest_get_onreadystatechange(xhr, &var); + ok(hres == S_OK, "get_onreadystatechange failed: %08x\n", hres); + ok(V_VT(&var) == VT_NULL, "V_VT(onreadystatechange) = %d\n", V_VT(&var)); + + V_VT(&var) = VT_DISPATCH; + V_DISPATCH(&var) = (IDispatch*)&xmlhttprequest_onreadystatechange_obj; + hres = IHTMLXMLHttpRequest_put_onreadystatechange(xhr, var); + ok(hres == S_OK, "put_onreadystatechange failed: %08x\n", hres); + + V_VT(&var) = VT_EMPTY; + hres = IHTMLXMLHttpRequest_get_onreadystatechange(xhr, &var); + ok(hres == S_OK, "get_onreadystatechange failed: %08x\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(onreadystatechange) = %d\n", V_VT(&var)); + ok(V_DISPATCH(&var) == (IDispatch*)&xmlhttprequest_onreadystatechange_obj, "unexpected onreadystatechange value\n"); + + hres = IHTMLXMLHttpRequest_get_readyState(xhr, NULL); + todo_wine ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + todo_wine ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + todo_wine ok(val == 0, "Expect UNSENT, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_status(xhr, NULL); + todo_wine ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + todo_wine ok(val == 0, "Expect 0, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, NULL); + todo_wine ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + todo_wine ok(text == NULL, "Expect NULL, got %p\n", text); + + method = a2bstr("GET"); + url = a2bstr(xml_url); + V_VT(&vbool) = VT_BOOL; + V_BOOL(&vbool) = VARIANT_FALSE; + V_VT(&vempty) = VT_EMPTY; + + SET_EXPECT(xmlhttprequest_onreadystatechange_opened); + hres = IHTMLXMLHttpRequest_open(xhr, method, url, vbool, vempty, vempty); + todo_wine ok(hres == S_OK, "open failed: %08x\n", hres); /* Gecko 30+ only supports async */ + todo_wine CHECK_CALLED(xmlhttprequest_onreadystatechange_opened); + + SysFreeString(method); + SysFreeString(url); + + if(FAILED(hres)) { + IHTMLXMLHttpRequest_Release(xhr); + xhr = NULL; + return; + } + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(val == 0, "Expect 0, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(text == NULL, "Expect NULL, got %p\n", text); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + ok(val == 1, "Expect OPENED, got %d\n", val); + + SET_EXPECT(xmlhttprequest_onreadystatechange_opened); + SET_EXPECT(xmlhttprequest_onreadystatechange_headers_received); + SET_EXPECT(xmlhttprequest_onreadystatechange_loading); + SET_EXPECT(xmlhttprequest_onreadystatechange_done); + hres = IHTMLXMLHttpRequest_send(xhr, vempty); + ok(hres == S_OK, "send failed: %08x\n", hres); + CHECK_CALLED(xmlhttprequest_onreadystatechange_opened); + CHECK_CALLED(xmlhttprequest_onreadystatechange_headers_received); + CHECK_CALLED(xmlhttprequest_onreadystatechange_loading); + CHECK_CALLED(xmlhttprequest_onreadystatechange_done); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + ok(hres == S_OK, "get_status failed: %08x\n", hres); + ok(val == 200, "Expect 200, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + ok(hres == S_OK, "get_statusText failed: %08x\n", hres); + ok(text != NULL, "text == NULL\n"); + ok(!strcmp_wa(text, "OK"), + "Expected \"OK\", got %s\n", wine_dbgstr_w(text)); + SysFreeString(text); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + ok(val == 4, "Expect DONE, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_responseText(xhr, &text); + ok(hres == S_OK, "get_responseText failed: %08x\n", hres); + ok(text != NULL, "test == NULL\n"); + ok(!strcmp_wa(text, EXPECT_RESPONSE_TEXT), "expect %s, got %s\n", + EXPECT_RESPONSE_TEXT, wine_dbgstr_w(text)); + SysFreeString(text); + + IHTMLXMLHttpRequest_Release(xhr); + xhr = NULL; +} + +static void test_async_xhr(IHTMLDocument2 *doc, const char *xml_url) +{ + VARIANT vbool, vempty, var; + BSTR method, url; + BSTR text; + LONG val; + HRESULT hres; + + create_xmlhttprequest(doc); + if(!xhr) + return; + + V_VT(&var) = VT_DISPATCH; + V_DISPATCH(&var) = (IDispatch*)&xmlhttprequest_onreadystatechange_obj; + hres = IHTMLXMLHttpRequest_put_onreadystatechange(xhr, var); + ok(hres == S_OK, "put_onreadystatechange failed: %08x\n", hres); + + V_VT(&var) = VT_EMPTY; + hres = IHTMLXMLHttpRequest_get_onreadystatechange(xhr, &var); + ok(hres == S_OK, "get_onreadystatechange failed: %08x\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(onreadystatechange) = %d\n", V_VT(&var)); + ok(V_DISPATCH(&var) == (IDispatch*)&xmlhttprequest_onreadystatechange_obj, "unexpected onreadystatechange value\n"); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + todo_wine ok(val == 0, "Expect 0, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + todo_wine ok(text == NULL, "Expect NULL, got %p\n", text); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + todo_wine ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + todo_wine ok(val == 0, "Expect UNSENT, got %d\n", val); + + method = a2bstr("GET"); + url = a2bstr(xml_url); + V_VT(&vbool) = VT_BOOL; + V_BOOL(&vbool) = VARIANT_TRUE; + V_VT(&vempty) = VT_EMPTY; + + SET_EXPECT(xmlhttprequest_onreadystatechange_opened); + hres = IHTMLXMLHttpRequest_open(xhr, method, url, vbool, vempty, vempty); + todo_wine ok(hres == S_OK, "open failed: %08x\n", hres); + todo_wine CHECK_CALLED(xmlhttprequest_onreadystatechange_opened); + + SysFreeString(method); + SysFreeString(url); + + if(FAILED(hres)) { + IHTMLXMLHttpRequest_Release(xhr); + xhr = NULL; + return; + } + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(val == 0, "Expect 0, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(text == NULL, "Expect NULL, got %p\n", text); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + ok(val == 1, "Expect OPENED, got %d\n", val); + + SET_EXPECT(xmlhttprequest_onreadystatechange_opened); + SET_EXPECT(xmlhttprequest_onreadystatechange_headers_received); + SET_EXPECT(xmlhttprequest_onreadystatechange_loading); + SET_EXPECT(xmlhttprequest_onreadystatechange_done); + hres = IHTMLXMLHttpRequest_send(xhr, vempty); + ok(hres == S_OK, "send failed: %08x\n", hres); + + pump_msgs(&called_xmlhttprequest_onreadystatechange_done); + todo_wine CHECK_CALLED(xmlhttprequest_onreadystatechange_opened); + todo_wine CHECK_CALLED(xmlhttprequest_onreadystatechange_headers_received); + todo_wine CHECK_CALLED(xmlhttprequest_onreadystatechange_loading); + CHECK_CALLED(xmlhttprequest_onreadystatechange_done); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_status(xhr, &val); + ok(hres == S_OK, "get_status failed: %08x\n", hres); + todo_wine ok(val == 200, "Expect 200, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); + ok(hres == S_OK, "get_statusText failed: %08x\n", hres); + todo_wine ok(text != NULL, "text == NULL\n"); + todo_wine ok(!strcmp_wa(text, "OK"), + "Expected \"OK\", got %s\n", wine_dbgstr_w(text)); + SysFreeString(text); + + val = 0xdeadbeef; + hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + ok(val == 4, "Expect DONE, got %d\n", val); + + hres = IHTMLXMLHttpRequest_get_responseText(xhr, &text); + ok(hres == S_OK, "get_responseText failed: %08x\n", hres); + ok(text != NULL, "test == NULL\n"); + ok(!strcmp_wa(text, EXPECT_RESPONSE_TEXT), "expect %s, got %s\n", + EXPECT_RESPONSE_TEXT, wine_dbgstr_w(text)); + SysFreeString(text); + + IHTMLXMLHttpRequest_Release(xhr); + xhr = NULL; +} + +static IHTMLDocument2 *create_doc_from_url(const char *start_url) +{ + BSTR url; + IBindCtx *bc; + IMoniker *url_mon; + IPersistMoniker *persist_mon; + IHTMLDocument2 *doc; + HRESULT hres; + + hres = CreateBindCtx(0, &bc); + ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres); + + url = a2bstr(start_url); + hres = CreateURLMoniker(NULL, url, &url_mon); + ok(hres == S_OK, "CreateURLMoniker failed: 0x%08x\n", hres); + + hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, + CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, &IID_IHTMLDocument2, + (void**)&doc); + ok(hres == S_OK, "CoCreateInstance failed: 0x%08x\n", hres); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IPersistMoniker, + (void**)&persist_mon); + ok(hres == S_OK, "IHTMLDocument2_QueryInterface failed: 0x%08x\n", hres); + + hres = IPersistMoniker_Load(persist_mon, FALSE, url_mon, bc, + STGM_SHARE_EXCLUSIVE | STGM_READWRITE); + ok(hres == S_OK, "IPersistMoniker_Load failed: 0x%08x\n", hres); + + IPersistMoniker_Release(persist_mon); + IMoniker_Release(url_mon); + IBindCtx_Release(bc); + SysFreeString(url); + + return doc; +} + +START_TEST(xmlhttprequest) +{ + IHTMLDocument2 *doc; + static const char start_url[] = "http://test.winehq.org/tests/hello.html"; + static const char xml_url[] = "http://test.winehq.org/tests/xmltest.xml"; + + CoInitialize(NULL); + + doc = create_doc_from_url(start_url); + if(doc) { + test_sync_xhr(doc, xml_url); + test_async_xhr(doc, xml_url); + IHTMLDocument2_Release(doc); + } + + CoUninitialize(); +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/xmlhttprequest.c wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/xmlhttprequest.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/mshtml/xmlhttprequest.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/mshtml/xmlhttprequest.c 2015-06-28 16:51:28.000000000 +0000 @@ -17,6 +17,7 @@ */ #include +#include #define COBJMACROS @@ -28,6 +29,7 @@ #include "wine/debug.h" #include "mshtml_private.h" +#include "htmlevent.h" WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -169,15 +171,19 @@ static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT v) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, &v); } static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT *p) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, p); } static HRESULT WINAPI HTMLXMLHttpRequest_abort(IHTMLXMLHttpRequest *iface) @@ -246,12 +252,35 @@ HTMLXMLHttpRequest_setRequestHeader }; +static inline HTMLXMLHttpRequest *impl_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, event_target.dispex); +} + +static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, int eid) +{ + HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex); + + FIXME("(%p)\n", This); + + assert(eid == EVENTID_READYSTATECHANGE); +} + +static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl = { + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLXMLHttpRequest_bind_event +}; + static const tid_t HTMLXMLHttpRequest_iface_tids[] = { IHTMLXMLHttpRequest_tid, 0 }; static dispex_static_data_t HTMLXMLHttpRequest_dispex = { - NULL, + &HTMLXMLHttpRequest_dispex_vtbl, DispHTMLXMLHttpRequest_tid, NULL, HTMLXMLHttpRequest_iface_tids diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/action.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/action.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/action.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/action.c 2015-06-28 16:51:28.000000000 +0000 @@ -1313,9 +1313,10 @@ const WCHAR *cabinet = MSI_RecordGetString( row, 4 ); /* FIXME: load external cabinets and directory sources too */ - if (!cabinet || cabinet[0] != '#') return ERROR_SUCCESS; - msi_add_cabinet_stream( package, disk_id, package->db->storage, cabinet ); - return ERROR_SUCCESS; + if (!cabinet || cabinet[0] != '#' || disk_id >= MSI_INITIAL_MEDIA_TRANSFORM_DISKID) + return ERROR_SUCCESS; + + return msi_add_cabinet_stream( package, disk_id, package->db->storage, cabinet ); } static UINT load_all_media( MSIPACKAGE *package ) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/media.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/media.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/media.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/media.c 2015-06-28 16:51:28.000000000 +0000 @@ -220,28 +220,39 @@ { MSICABINETSTREAM *cab; IStream *stream; - WCHAR *encoded; - HRESULT hr; - cab = msi_get_cabinet_stream( package_disk.package, package_disk.id ); - if (!cab) + if (!(cab = msi_get_cabinet_stream( package_disk.package, package_disk.id ))) { WARN("failed to get cabinet stream\n"); return -1; } - if (!cab->stream[0] || !(encoded = encode_streamname( FALSE, cab->stream + 1 ))) + if (cab->storage == package_disk.package->db->storage) { - WARN("failed to encode stream name\n"); - return -1; + UINT r = msi_get_stream( package_disk.package->db, cab->stream + 1, &stream ); + if (r != ERROR_SUCCESS) + { + WARN("failed to get stream %u\n", r); + return -1; + } } - hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream ); - if (FAILED(hr)) + else /* patch storage */ { - WARN("failed to open stream 0x%08x\n", hr); + HRESULT hr; + WCHAR *encoded; + + if (!(encoded = encode_streamname( FALSE, cab->stream + 1 ))) + { + WARN("failed to encode stream name\n"); + return -1; + } + hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream ); msi_free( encoded ); - return -1; + if (FAILED(hr)) + { + WARN("failed to open stream 0x%08x\n", hr); + return -1; + } } - msi_free( encoded ); return (INT_PTR)stream; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/tests/install.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/tests/install.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/tests/install.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/tests/install.c 2015-06-28 16:51:28.000000000 +0000 @@ -2656,6 +2656,11 @@ /* published, reinstall */ r = MsiInstallProductA(msifile, NULL); + if (r == ERROR_INSTALL_FAILURE) /* win2k3 */ + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); @@ -2932,6 +2937,12 @@ if (r == ERROR_INSTALL_PACKAGE_REJECTED) { skip("Not enough rights to perform tests\n"); + goto error; + } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; } else { @@ -3014,6 +3025,7 @@ ok(delete_pf("msitest", FALSE), "Directory not created\n"); } +error: delete_cab_files(); DeleteFileA(msifile); } @@ -3131,6 +3143,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n"); @@ -3242,6 +3259,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(file_matches(path), "Expected file to be overwritten\n"); ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); @@ -3294,6 +3316,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); memset( buf, 0, sizeof(buf) ); @@ -3337,6 +3364,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n"); ok(delete_cf("msitest", FALSE), "Directory not created\n"); @@ -3378,6 +3410,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); @@ -3614,6 +3651,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n"); ok(!delete_pf("msitest", FALSE), "Directory created\n"); @@ -3661,6 +3703,12 @@ sprintf(path, "..\\%s", msifile); r = MsiInstallProductA(path, NULL); + if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } + todo_wine { ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); @@ -3675,6 +3723,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); @@ -3747,6 +3800,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n"); ok(!delete_pf("msitest", FALSE), "Directory created\n"); @@ -3825,6 +3883,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File installed\n"); ok(delete_pf("msitest", FALSE), "Directory created\n"); @@ -3883,6 +3946,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); @@ -3990,6 +4058,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File installed\n"); ok(delete_pf("msitest", FALSE), "Directory created\n"); @@ -4034,6 +4107,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n"); ok(!delete_pf("msitest\\beta", TRUE), "File installed\n"); @@ -4512,6 +4590,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); ok(pf_exists("msitest\\helium"), "File not installed\n"); @@ -4560,6 +4643,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File installed\n"); ok(delete_pf("msitest", FALSE), "Directory created\n"); @@ -4624,6 +4712,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); @@ -4678,6 +4771,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); @@ -4777,6 +4875,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); @@ -4835,6 +4938,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n"); @@ -4893,6 +5001,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); r = MsiInstallProductA(msifile, "FULL=1"); @@ -4944,6 +5057,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); @@ -5147,6 +5265,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r); ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n"); CloseHandle(file); @@ -5209,6 +5332,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r); ok(!file_matches_data(path, "maximus"), "Expected file not to match\n"); CloseHandle(file); @@ -5263,6 +5391,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(pf_exists("msitest\\override.txt"), "file not installed\n"); @@ -5420,6 +5553,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n"); ok(delete_pf("msitest", FALSE), "directory does not exist\n"); @@ -5648,6 +5786,11 @@ skip("Not enough rights to perform tests\n"); goto error; } + else if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey); @@ -5790,11 +5933,17 @@ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); r = MsiInstallProductA(msifile, NULL); + if (r == ERROR_INSTALL_FAILURE) + { + win_skip("broken result\n"); + goto error; + } ok(r == ERROR_SUCCESS, "got %u\n", r); r = MsiInstallProductA(msifile, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "got %u\n", r); +error: DeleteFileA("msitest\\volumeprop.txt"); RemoveDirectoryA("msitest"); DeleteFileA(msifile); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/tests/patch.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/tests/patch.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msi/tests/patch.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msi/tests/patch.c 2015-06-28 16:51:28.000000000 +0000 @@ -969,6 +969,29 @@ return r; } +static UINT find_entryW( MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry ) +{ + static const WCHAR fmt[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','%','s','`',' ', + 'W','H','E','R','E',' ','`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0}; + WCHAR query[0x100]; + MSIHANDLE hview, hrec; + UINT r; + + wsprintfW( query, fmt, table, entry ); + r = MsiDatabaseOpenViewW( hdb, query, &hview ); + ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + + r = MsiViewExecute( hview, 0 ); + ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + + r = MsiViewFetch( hview, &hrec ); + MsiViewClose( hview ); + MsiCloseHandle( hview ); + MsiCloseHandle( hrec ); + return r; +} + static INT get_integer( MSIHANDLE hdb, UINT field, const char *query) { UINT r; @@ -1032,11 +1055,13 @@ static void test_system_tables( void ) { + static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7"; + static const WCHAR streamsW[] = {'_','S','t','r','e','a','m','s',0}; + static const WCHAR CAB_msitest_encodedW[] = {0x3a8c,0x47cb,0x45b0,0x45ec,0x45a8,0x4837,0}; UINT r; char *cr; const char *query; MSIHANDLE hproduct, hdb, hview, hrec; - static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7"; if (!pMsiApplyPatchA) { @@ -1138,6 +1163,9 @@ r = find_entry( hdb, "_Streams", "\5SummaryInformation" ); ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r ); + r = find_entryW( hdb, streamsW, CAB_msitest_encodedW ); + ok( r == ERROR_NO_MORE_ITEMS, "failed to find entry %u\n", r ); + query = "SELECT * FROM `_Storages`"; r = MsiDatabaseOpenViewA( hdb, query, &hview ); ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msimtf/activeimmapp.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msimtf/activeimmapp.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msimtf/activeimmapp.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msimtf/activeimmapp.c 2015-06-28 16:51:28.000000000 +0000 @@ -42,6 +42,7 @@ typedef struct tagActiveIMMApp { IActiveIMMApp IActiveIMMApp_iface; + IActiveIMMMessagePumpOwner IActiveIMMMessagePumpOwner_iface; LONG refCount; } ActiveIMMApp; @@ -66,6 +67,10 @@ { *ppvOut = This; } + else if (IsEqualIID(iid, &IID_IActiveIMMMessagePumpOwner)) + { + *ppvOut = &This->IActiveIMMMessagePumpOwner_iface; + } if (*ppvOut) { @@ -812,6 +817,80 @@ ActiveIMMApp_EnumInputContext }; +static inline ActiveIMMApp *impl_from_IActiveIMMMessagePumpOwner(IActiveIMMMessagePumpOwner *iface) +{ + return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMMessagePumpOwner_iface); +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_QueryInterface(IActiveIMMMessagePumpOwner* iface, + REFIID iid, LPVOID *ppvOut) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + return IActiveIMMApp_QueryInterface(&This->IActiveIMMApp_iface, iid, ppvOut); +} + +static ULONG WINAPI ActiveIMMMessagePumpOwner_AddRef(IActiveIMMMessagePumpOwner* iface) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + return IActiveIMMApp_AddRef(&This->IActiveIMMApp_iface); +} + +static ULONG WINAPI ActiveIMMMessagePumpOwner_Release(IActiveIMMMessagePumpOwner* iface) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + return IActiveIMMApp_Release(&This->IActiveIMMApp_iface); +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_Start(IActiveIMMMessagePumpOwner* iface) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + FIXME("(%p)->(): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_End(IActiveIMMMessagePumpOwner* iface) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + FIXME("(%p)->(): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_OnTranslateMessage(IActiveIMMMessagePumpOwner* iface, + const MSG *msg) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + FIXME("(%p)->(%p): stub\n", This, msg); + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_Pause(IActiveIMMMessagePumpOwner* iface, + DWORD *cookie) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + FIXME("(%p)->(%p): stub\n", This, cookie); + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveIMMMessagePumpOwner_Resume(IActiveIMMMessagePumpOwner* iface, + DWORD cookie) +{ + ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface); + FIXME("(%p)->(%u): stub\n", This, cookie); + return E_NOTIMPL; +} + +static const IActiveIMMMessagePumpOwnerVtbl ActiveIMMMessagePumpOwnerVtbl = +{ + ActiveIMMMessagePumpOwner_QueryInterface, + ActiveIMMMessagePumpOwner_AddRef, + ActiveIMMMessagePumpOwner_Release, + ActiveIMMMessagePumpOwner_Start, + ActiveIMMMessagePumpOwner_End, + ActiveIMMMessagePumpOwner_OnTranslateMessage, + ActiveIMMMessagePumpOwner_Pause, + ActiveIMMMessagePumpOwner_Resume, +}; + DECLSPEC_HIDDEN HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) { ActiveIMMApp *This; @@ -823,6 +902,7 @@ return E_OUTOFMEMORY; This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl; + This->IActiveIMMMessagePumpOwner_iface.lpVtbl = &ActiveIMMMessagePumpOwnerVtbl; This->refCount = 1; TRACE("returning %p\n",This); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,6 @@ +MODULE = msscript.ocx +RC_SRCS = msscript.rc +IDL_SRCS = msscript.idl + +C_SRCS = \ + msscript.c diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.c 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "windows.h" +#include "initguid.h" +#include "ole2.h" +#include "rpcproxy.h" +#include "msscript.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msscript); + +static HINSTANCE msscript_instance; + +HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) +{ + FIXME("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +/****************************************************************** + * DllMain (msscript.ocx.@) + */ +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID lpv) +{ + TRACE("(%p %d %p)\n", instance, reason, lpv); + + switch(reason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + msscript_instance = instance; + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv); + *ppv = iface; + }else if(IsEqualGUID(&IID_IClassFactory, riid)) { + TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv); + *ppv = iface; + } + + if(*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 1; +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) +{ + TRACE("(%p)->(%x)\n", iface, fLock); + return S_OK; +} + +static const IClassFactoryVtbl ScriptControlFactoryVtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ScriptControl_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory ScriptControlFactory = { &ScriptControlFactoryVtbl }; + +/*********************************************************************** + * DllGetClassObject (msscript.ocx.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ + if(IsEqualGUID(&CLSID_ScriptControl, rclsid)) { + TRACE("(CLSID_ScriptControl %s %p)\n", debugstr_guid(riid), ppv); + return IClassFactory_QueryInterface(&ScriptControlFactory, riid, ppv); + } + + FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllCanUnloadNow (msscript.ocx.@) + */ +HRESULT WINAPI DllCanUnloadNow(void) +{ + TRACE("\n"); + return S_FALSE; +} + +/*********************************************************************** + * DllRegisterServer (msscript.ocx.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + TRACE("()\n"); + return __wine_register_resources(msscript_instance); +} + +/*********************************************************************** + * DllUnregisterServer (msscript.ocx.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + TRACE("()\n"); + return __wine_unregister_resources(msscript_instance); +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.idl wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.idl --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.idl 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,306 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep regtypelib + +import "oaidl.idl"; + +[ + helpstring("Microsoft Script Control 1.0"), + uuid(0e59f1d2-1fbe-11d0-8ff2-00a0d10038bc), + version(1.0) +] +library MSScriptControl +{ + importlib("stdole2.tlb"); + + typedef enum { + Initialized = 0, + Connected = 1 + } ScriptControlStates; + + [ + dual, + uuid(70841c73-067d-11d0-95d8-00a02463ab28), + odl, + hidden, + nonextensible, + oleautomation + ] + interface IScriptProcedure : IDispatch { + [id(DISPID_VALUE), propget] + HRESULT Name([out, retval] BSTR *pbstrName); + + [id(0x0064), propget] + HRESULT NumArgs([out, retval] long *pcArgs); + + [id(0x0065), propget] + HRESULT HasReturnValue([out, retval] VARIANT_BOOL *pfHasReturnValue); + } + + [ + dual, + uuid(70841c71-067d-11d0-95d8-00a02463ab28), + odl, + hidden, + nonextensible, + oleautomation + ] + interface IScriptProcedureCollection : IDispatch { + [id(DISPID_NEWENUM), propget] + HRESULT _NewEnum([out, retval] IUnknown *ppenumProcedures); + + [id(DISPID_VALUE), propget] + HRESULT Item( + [in] VARIANT Index, + [out, retval] IScriptProcedure **ppdispProcedure); + + [id(1), propget] + HRESULT Count([out, retval] long *plCount); + } + + [ + dual, + uuid(70841c70-067d-11d0-95d8-00a02463ab28), + odl, + hidden, + nonextensible, + oleautomation + ] + interface IScriptModule : IDispatch { + [id(DISPID_VALUE), propget] + HRESULT Name([out, retval] BSTR *pbstrName); + + [id(0x03e8), propget] + HRESULT CodeObject([out, retval] IDispatch *ppdispObject); + + [id(0x03e9), propget] + HRESULT Procedures([out, retval] IScriptProcedureCollection **ppdispProcedures); + + [id(0x07d0)] + HRESULT AddCode([in] BSTR Code); + + [id(0x07d1)] + HRESULT Eval( + [in] BSTR Expression, + [out, retval] VARIANT *pvarResult); + + [id(0x07d2)] + HRESULT ExecuteStatement([in] BSTR Statement); + + [id(0x07d3)] + HRESULT Run( + [in] BSTR ProcedureName, + [in] SAFEARRAY(VARIANT) *Parameters, + [out, retval] VARIANT *pvarResult); + } + + [ + dual, + uuid(70841c6f-067d-11d0-95d8-00a02463ab28), + odl, + hidden, + nonextensible, + oleautomation + ] + interface IScriptModuleCollection : IDispatch { + [id(DISPID_NEWENUM), propget] + HRESULT _NewEnum([out, retval] IUnknown *ppenumContexts); + + [id(DISPID_VALUE), propget] + HRESULT Item( + [in] VARIANT Index, + [out, retval] IScriptModule **ppmod); + + [id(1), propget] + HRESULT Count([out, retval] long *plCount); + + [id(2)] + HRESULT Add( + [in] BSTR Name, + [in, optional] VARIANT *Object, + [out, retval] IScriptModule **ppmod); + } + + [ + dual, + uuid(70841c78-067d-11d0-95d8-00a02463ab28), + odl, + helpstring("Provides access to scripting error information"), + helpcontext(0x00113eb6), + hidden, + nonextensible, + oleautomation + ] + interface IScriptError : IDispatch { + [id(0x00c9), propget] + HRESULT Number([out, retval] long *plNumber); + + [id(0x00ca), propget] + HRESULT Source([out, retval] BSTR *pbstrSource); + + [id(0x00cb), propget] + HRESULT Description([out, retval] BSTR *pbstrDescription); + + [id(0x00cc), propget] + HRESULT HelpFile([out, retval] BSTR *pbstrHelpFile); + + [id(0x00cd), propget] + HRESULT HelpContext([out, retval] long *plHelpContext); + + [id(0xfffffdfb), propget] + HRESULT Text([out, retval] BSTR *pbstrText); + + [id(0x00ce), propget] + HRESULT Line([out, retval] long *plLine); + + [id(0xfffffdef), propget] + HRESULT Column([out, retval] long *plColumn); + + [id(0x00d0)] + HRESULT Clear(); + } + + [ + dual, + uuid(0e59f1d3-1fbe-11d0-8ff2-00a0d10038bc), + odl, + hidden, + nonextensible, + oleautomation + ] + interface IScriptControl : IDispatch { + [id(0x05dc), propget] HRESULT Language([out, retval] BSTR *pbstrLanguage); + [id(0x05dc), propput] HRESULT Language([in] BSTR pbstrLanguage); + + [id(0x05dd), propget] HRESULT State([out, retval] ScriptControlStates *pssState); + [id(0x05dd), propput] HRESULT State([in] ScriptControlStates pssState); + + [id(0x05de), propput] HRESULT SitehWnd([in] long rhs); + [id(0x05de), propget] HRESULT SitehWnd([out, retval] long *rhs); + + [id(0x05df), propget] HRESULT Timeout([out, retval] long *plMilleseconds); + [id(0x05df), propput] HRESULT Timeout([in] long plMilleseconds); + + [id(0x05e0), propget] HRESULT AllowUI([out, retval] VARIANT_BOOL *pfAllowUI); + [id(0x05e0), propput] HRESULT AllowUI([in] VARIANT_BOOL pfAllowUI); + + [id(0x05e1), propget] HRESULT UseSafeSubset([out, retval] VARIANT_BOOL *pfUseSafeSubset); + [id(0x05e1), propput] HRESULT UseSafeSubset([in] VARIANT_BOOL pfUseSafeSubset); + + [id(0x05e2), propget] HRESULT Modules([out, retval] IScriptModuleCollection **ppmods); + + [id(0x05e3), propget] HRESULT Error([out, retval] IScriptError **ppse); + + [id(0x03e8), propget] HRESULT CodeObject([out, retval] IDispatch *ppdispObject); + + [id(0x03e9), propget] HRESULT Procedures([out, retval] IScriptProcedureCollection **ppdispProcedures); + + [id(0xfffffdd8)] + HRESULT _AboutBox(); + + [id(0x09c4)] + HRESULT AddObject( + [in] BSTR Name, + [in] IDispatch *Object, + [in, optional, defaultvalue(0)] VARIANT_BOOL AddMembers); + + [id(0x09c5)] + HRESULT Reset(); + + [id(0x07d0)] + HRESULT AddCode([in] BSTR Code); + + [id(0x07d1)] + HRESULT Eval( + [in] BSTR Expression, + [out, retval] VARIANT *pvarResult); + + [id(0x07d2)] + HRESULT ExecuteStatement([in] BSTR Statement); + + [id(0x07d3)] + HRESULT Run( + [in] BSTR ProcedureName, + [in] SAFEARRAY(VARIANT) *Parameters, + [out, retval] VARIANT *pvarResult); + } + + [ + uuid(8b167d60-8605-11d0-abcb-00a0c90fffc0), + hidden + ] + dispinterface DScriptControlSource { + properties: + methods: + [id(0x0bb8)] void Error(); + [id(0x0bb9)] void Timeout(); + } + + [ + uuid(0e59f1da-1fbe-11d0-8ff2-00a0d10038bc), + noncreatable + ] + coclass Procedure { + [default] interface IScriptProcedure; + } + + [ + uuid(0e59f1db-1fbe-11d0-8ff2-00a0d10038bc), + noncreatable + ] + coclass Procedures { + [default] interface IScriptProcedureCollection; + } + + [ + uuid(0e59f1dc-1fbe-11d0-8ff2-00a0d10038bc), + noncreatable + ] + coclass Module { + [default] interface IScriptModule; + } + + [ + uuid(0e59f1dd-1fbe-11d0-8ff2-00a0d10038bc), + noncreatable + ] + coclass Modules { + [default] interface IScriptModuleCollection; + } + + [ + uuid(0e59f1de-1fbe-11d0-8ff2-00a0d10038bc), + noncreatable + ] + coclass Error { + [default] interface IScriptError; + } + + [ + helpstring("ScriptControl Object"), + uuid(0e59f1d5-1fbe-11d0-8ff2-00a0d10038bc), + threading(apartment), + progid("MSScriptControl.ScriptControl.1"), + vi_progid("MSScriptControl.ScriptControl") + ] + coclass ScriptControl { + [default] interface IScriptControl; + [default, source] dispinterface DScriptControlSource; + } +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.ocx.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.ocx.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.ocx.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.ocx.spec 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,5 @@ +@ stub DLLGetDocumentation +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.rc wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.rc --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.rc 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.rc 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,20 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* @makedep: msscript.rgs */ +2 WINE_REGISTRY msscript.rgs diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.rgs wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.rgs --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msscript.ocx/msscript.rgs 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msscript.ocx/msscript.rgs 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,27 @@ +HKCR +{ + NoRemove CLSID + { + '{0e59f1d5-1fbe-11d0-8ff2-00a0d10038bc}' + { + 'Implemented Categories' + { + '{0de86a52-2baa-11cf-a229-00aa003d7352}' + '{0de86a53-2baa-11cf-a229-00aa003d7352}' + '{0de86a57-2baa-11cf-a229-00aa003d7352}' + '{40fc6ed4-2438-11cf-a3db-080036f12502}' + '{40fc6ed5-2438-11cf-a3db-080036f12502}' + } + Control + MiscStatus = s '0' + { + '1' = s '132499' + } + } + } + 'ScriptControl' = s 'ScriptControl Object' + { + CLSID = s '{0e59f1d5-1fbe-11d0-8ff2-00a0d10038bc}' + CurVer = s 'MSScriptControl.ScriptControl.1' + } +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/msvcirt.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/msvcirt.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/msvcirt.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/msvcirt.c 2015-06-28 16:51:28.000000000 +0000 @@ -36,7 +36,7 @@ const vtable_ptr *vtable; int allocated; int unbuffered; - int unknown; + int stored_char; char *base; char *ebuf; char *pbase; @@ -98,7 +98,7 @@ TRACE("(%p %p %d)\n", this, buffer, length); this->vtable = &MSVCP_streambuf_vtable; this->allocated = 0; - this->unknown = -1; + this->stored_char = EOF; this->do_lock = -1; this->base = NULL; streambuf_setbuf(this, buffer, length); @@ -355,8 +355,10 @@ /* Unexported */ DEFINE_THISCALL_WRAPPER(streambuf_overflow, 8) +#define call_streambuf_overflow(this, c) CALL_VTBL_FUNC(this, 28, int, (streambuf*, int), (this, c)) int __thiscall streambuf_overflow(streambuf *this, int c) { + ERR("overflow is not implemented in streambuf\n"); return EOF; } @@ -480,8 +482,10 @@ /* Unexported */ DEFINE_THISCALL_WRAPPER(streambuf_underflow, 4) +#define call_streambuf_underflow(this) CALL_VTBL_FUNC(this, 32, int, (streambuf*), (this)) int __thiscall streambuf_underflow(streambuf *this) { + ERR("underflow is not implemented in streambuf\n"); return EOF; } @@ -498,19 +502,157 @@ /* ?xsgetn@streambuf@@UAEHPADH@Z */ /* ?xsgetn@streambuf@@UEAAHPEADH@Z */ DEFINE_THISCALL_WRAPPER(streambuf_xsgetn, 12) +#define call_streambuf_xsgetn(this, buffer, count) CALL_VTBL_FUNC(this, 24, int, (streambuf*, char*, int), (this, buffer, count)) int __thiscall streambuf_xsgetn(streambuf *this, char *buffer, int count) { - FIXME("(%p %p %d): stub\n", this, buffer, count); - return 0; + int copied = 0, chunk; + + TRACE("(%p %p %d)\n", this, buffer, count); + + if (this->unbuffered) { + if (this->stored_char == EOF) + this->stored_char = call_streambuf_underflow(this); + while (copied < count && this->stored_char != EOF) { + buffer[copied++] = this->stored_char; + this->stored_char = call_streambuf_underflow(this); + } + } else { + while (copied < count) { + if (call_streambuf_underflow(this) == EOF) + break; + chunk = this->egptr - this->gptr; + if (chunk > count - copied) + chunk = count - copied; + memcpy(buffer+copied, this->gptr, chunk); + this->gptr += chunk; + copied += chunk; + } + } + return copied; } /* ?xsputn@streambuf@@UAEHPBDH@Z */ /* ?xsputn@streambuf@@UEAAHPEBDH@Z */ DEFINE_THISCALL_WRAPPER(streambuf_xsputn, 12) +#define call_streambuf_xsputn(this, data, length) CALL_VTBL_FUNC(this, 20, int, (streambuf*, const char*, int), (this, data, length)) int __thiscall streambuf_xsputn(streambuf *this, const char *data, int length) { - FIXME("(%p %p %d): stub\n", this, data, length); - return 0; + int copied = 0, chunk; + + TRACE("(%p %p %d)\n", this, data, length); + + while (copied < length) { + if (this->unbuffered || this->pptr == this->epptr) { + if (call_streambuf_overflow(this, data[copied]) == EOF) + break; + copied++; + } else { + chunk = this->epptr - this->pptr; + if (chunk > length - copied) + chunk = length - copied; + memcpy(this->pptr, data+copied, chunk); + this->pptr += chunk; + copied += chunk; + } + } + return copied; +} + +/* ?sgetc@streambuf@@QAEHXZ */ +/* ?sgetc@streambuf@@QEAAHXZ */ +DEFINE_THISCALL_WRAPPER(streambuf_sgetc, 4) +int __thiscall streambuf_sgetc(streambuf *this) +{ + TRACE("(%p)\n", this); + if (this->unbuffered) { + if (this->stored_char == EOF) + this->stored_char = call_streambuf_underflow(this); + return this->stored_char; + } else + return call_streambuf_underflow(this); +} + +/* ?sputc@streambuf@@QAEHH@Z */ +/* ?sputc@streambuf@@QEAAHH@Z */ +DEFINE_THISCALL_WRAPPER(streambuf_sputc, 8) +int __thiscall streambuf_sputc(streambuf *this, int ch) +{ + TRACE("(%p %d)\n", this, ch); + return (this->pptr < this->epptr) ? *this->pptr++ = ch : call_streambuf_overflow(this, ch); +} + +/* ?sgetn@streambuf@@QAEHPADH@Z */ +/* ?sgetn@streambuf@@QEAAHPEADH@Z */ +DEFINE_THISCALL_WRAPPER(streambuf_sgetn, 12) +int __thiscall streambuf_sgetn(streambuf *this, char *buffer, int count) +{ + return call_streambuf_xsgetn(this, buffer, count); +} + +/* ?sputn@streambuf@@QAEHPBDH@Z */ +/* ?sputn@streambuf@@QEAAHPEBDH@Z */ +DEFINE_THISCALL_WRAPPER(streambuf_sputn, 12) +int __thiscall streambuf_sputn(streambuf *this, const char *data, int length) +{ + return call_streambuf_xsputn(this, data, length); +} + +/* ?snextc@streambuf@@QAEHXZ */ +/* ?snextc@streambuf@@QEAAHXZ */ +DEFINE_THISCALL_WRAPPER(streambuf_snextc, 4) +int __thiscall streambuf_snextc(streambuf *this) +{ + TRACE("(%p)\n", this); + if (this->unbuffered) { + if (this->stored_char == EOF) + call_streambuf_underflow(this); + return this->stored_char = call_streambuf_underflow(this); + } else { + if (this->gptr >= this->egptr) + call_streambuf_underflow(this); + this->gptr++; + return (this->gptr < this->egptr) ? *this->gptr : call_streambuf_underflow(this); + } +} + +/* ?sbumpc@streambuf@@QAEHXZ */ +/* ?sbumpc@streambuf@@QEAAHXZ */ +DEFINE_THISCALL_WRAPPER(streambuf_sbumpc, 4) +int __thiscall streambuf_sbumpc(streambuf *this) +{ + int ret; + + TRACE("(%p)\n", this); + + if (this->unbuffered) { + ret = this->stored_char; + this->stored_char = EOF; + if (ret == EOF) + ret = call_streambuf_underflow(this); + } else { + ret = (this->gptr < this->egptr) ? *this->gptr : call_streambuf_underflow(this); + this->gptr++; + } + return ret; +} + +/* ?stossc@streambuf@@QAEXXZ */ +/* ?stossc@streambuf@@QEAAXXZ */ +DEFINE_THISCALL_WRAPPER(streambuf_stossc, 4) +void __thiscall streambuf_stossc(streambuf *this) +{ + TRACE("(%p)\n", this); + if (this->unbuffered) { + if (this->stored_char == EOF) + call_streambuf_underflow(this); + else + this->stored_char = EOF; + } else { + if (this->gptr >= this->egptr) + call_streambuf_underflow(this); + if (this->gptr < this->egptr) + this->gptr++; + } } /****************************************************************** diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/msvcirt.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/msvcirt.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/msvcirt.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/msvcirt.spec 2015-06-28 16:51:28.000000000 +0000 @@ -637,8 +637,8 @@ @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEADH@Z @ stub -arch=win32 ?read@istream@@QAEAAV1@PAEH@Z # class istream & __thiscall istream::read(unsigned char *,int) @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEAEH@Z -@ stub -arch=win32 ?sbumpc@streambuf@@QAEHXZ # int __thiscall streambuf::sbumpc(void) -@ stub -arch=win64 ?sbumpc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?sbumpc@streambuf@@QAEHXZ(ptr) streambuf_sbumpc +@ cdecl -arch=win64 ?sbumpc@streambuf@@QEAAHXZ(ptr) streambuf_sbumpc @ stub -arch=win32 ?seekg@istream@@QAEAAV1@J@Z # class istream & __thiscall istream::seekg(long) @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekg@istream@@QAEAAV1@JW4seek_dir@ios@@@Z # class istream & __thiscall istream::seekg(long,enum ios::seek_dir) @@ -693,25 +693,25 @@ @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) streambuf_setp @ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z # int __thiscall stdiobuf::setrwbuf(int,int) @ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z -@ stub -arch=win32 ?sgetc@streambuf@@QAEHXZ # int __thiscall streambuf::sgetc(void) -@ stub -arch=win64 ?sgetc@streambuf@@QEAAHXZ -@ stub -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z # int __thiscall streambuf::sgetn(char *,int) -@ stub -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z +@ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) streambuf_sgetc +@ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) streambuf_sgetc +@ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) streambuf_sgetn +@ cdecl -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z(ptr ptr long) streambuf_sgetn # @ extern ?sh_none@filebuf@@2HB # static int const filebuf::sh_none # @ extern ?sh_read@filebuf@@2HB # static int const filebuf::sh_read # @ extern ?sh_write@filebuf@@2HB # static int const filebuf::sh_write -@ stub -arch=win32 ?snextc@streambuf@@QAEHXZ # int __thiscall streambuf::snextc(void) -@ stub -arch=win64 ?snextc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) streambuf_snextc +@ cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) streambuf_snextc @ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z # int __thiscall streambuf::sputbackc(char) @ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z -@ stub -arch=win32 ?sputc@streambuf@@QAEHH@Z # int __thiscall streambuf::sputc(int) -@ stub -arch=win64 ?sputc@streambuf@@QEAAHH@Z -@ stub -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z # int __thiscall streambuf::sputn(char const *,int) -@ stub -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z +@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) streambuf_sputc +@ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) streambuf_sputc +@ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) streambuf_sputn +@ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) streambuf_sputn @ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ # struct _iobuf * __thiscall stdiobuf::stdiofile(void) @ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ -@ stub -arch=win32 ?stossc@streambuf@@QAEXXZ # void __thiscall streambuf::stossc(void) -@ stub -arch=win64 ?stossc@streambuf@@QEAAXXZ +@ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) streambuf_stossc +@ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) streambuf_stossc @ stub -arch=win32 ?str@istrstream@@QAEPADXZ # char * __thiscall istrstream::str(void) @ stub -arch=win64 ?str@istrstream@@QEAAPEADXZ @ stub -arch=win32 ?str@ostrstream@@QAEPADXZ # char * __thiscall ostrstream::str(void) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/tests/msvcirt.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/tests/msvcirt.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcirt/tests/msvcirt.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcirt/tests/msvcirt.c 2015-06-28 16:51:28.000000000 +0000 @@ -28,7 +28,7 @@ const vtable_ptr *vtable; int allocated; int unbuffered; - int unknown; + int stored_char; char *base; char *ebuf; char *pbase; @@ -58,11 +58,18 @@ static void (*__thiscall p_streambuf_gbump)(streambuf*, int); static void (*__thiscall p_streambuf_lock)(streambuf*); static void (*__thiscall p_streambuf_pbump)(streambuf*, int); +static int (*__thiscall p_streambuf_sbumpc)(streambuf*); static void (*__thiscall p_streambuf_setb)(streambuf*, char*, char*, int); static void (*__thiscall p_streambuf_setlock)(streambuf*); static streambuf* (*__thiscall p_streambuf_setbuf)(streambuf*, char*, int); +static int (*__thiscall p_streambuf_sgetc)(streambuf*); +static int (*__thiscall p_streambuf_snextc)(streambuf*); +static int (*__thiscall p_streambuf_sputc)(streambuf*, int); +static void (*__thiscall p_streambuf_stossc)(streambuf*); static int (*__thiscall p_streambuf_sync)(streambuf*); static void (*__thiscall p_streambuf_unlock)(streambuf*); +static int (*__thiscall p_streambuf_xsgetn)(streambuf*, char*, int); +static int (*__thiscall p_streambuf_xsputn)(streambuf*, const char*, int); /* Emulate a __thiscall */ #ifdef __i386__ @@ -142,11 +149,18 @@ SET(p_streambuf_gbump, "?gbump@streambuf@@IEAAXH@Z"); SET(p_streambuf_lock, "?lock@streambuf@@QEAAXXZ"); SET(p_streambuf_pbump, "?pbump@streambuf@@IEAAXH@Z"); + SET(p_streambuf_sbumpc, "?sbumpc@streambuf@@QEAAHXZ"); SET(p_streambuf_setb, "?setb@streambuf@@IEAAXPEAD0H@Z"); SET(p_streambuf_setbuf, "?setbuf@streambuf@@UEAAPEAV1@PEADH@Z"); SET(p_streambuf_setlock, "?setlock@streambuf@@QEAAXXZ"); + SET(p_streambuf_sgetc, "?sgetc@streambuf@@QEAAHXZ"); + SET(p_streambuf_snextc, "?snextc@streambuf@@QEAAHXZ"); + SET(p_streambuf_sputc, "?sputc@streambuf@@QEAAHH@Z"); + SET(p_streambuf_stossc, "?stossc@streambuf@@QEAAXXZ"); SET(p_streambuf_sync, "?sync@streambuf@@UEAAHXZ"); SET(p_streambuf_unlock, "?unlock@streambuf@@QEAAXXZ"); + SET(p_streambuf_xsgetn, "?xsgetn@streambuf@@UEAAHPEADH@Z"); + SET(p_streambuf_xsputn, "?xsputn@streambuf@@UEAAHPEBDH@Z"); } else { SET(p_streambuf_reserve_ctor, "??0streambuf@@IAE@PADH@Z"); SET(p_streambuf_ctor, "??0streambuf@@IAE@XZ"); @@ -157,17 +171,59 @@ SET(p_streambuf_gbump, "?gbump@streambuf@@IAEXH@Z"); SET(p_streambuf_lock, "?lock@streambuf@@QAEXXZ"); SET(p_streambuf_pbump, "?pbump@streambuf@@IAEXH@Z"); + SET(p_streambuf_sbumpc, "?sbumpc@streambuf@@QAEHXZ"); SET(p_streambuf_setb, "?setb@streambuf@@IAEXPAD0H@Z"); SET(p_streambuf_setbuf, "?setbuf@streambuf@@UAEPAV1@PADH@Z"); SET(p_streambuf_setlock, "?setlock@streambuf@@QAEXXZ"); + SET(p_streambuf_sgetc, "?sgetc@streambuf@@QAEHXZ"); + SET(p_streambuf_snextc, "?snextc@streambuf@@QAEHXZ"); + SET(p_streambuf_sputc, "?sputc@streambuf@@QAEHH@Z"); + SET(p_streambuf_stossc, "?stossc@streambuf@@QAEXXZ"); SET(p_streambuf_sync, "?sync@streambuf@@UAEHXZ"); SET(p_streambuf_unlock, "?unlock@streambuf@@QAEXXZ"); + SET(p_streambuf_xsgetn, "?xsgetn@streambuf@@UAEHPADH@Z"); + SET(p_streambuf_xsputn, "?xsputn@streambuf@@UAEHPBDH@Z"); } init_thiscall_thunk(); return TRUE; } +static int overflow_count, underflow_count; +static streambuf *test_this; +static char test_get_buffer[24]; +static int buffer_pos, get_end; + +#ifdef __i386__ +static int __thiscall test_streambuf_overflow(int ch) +#else +static int __thiscall test_streambuf_overflow(streambuf *this, int ch) +#endif +{ + overflow_count++; + if (ch == 'L') /* simulate a failure */ + return EOF; + if (!test_this->unbuffered) + test_this->pptr = test_this->pbase + 5; + return ch; +} + +#ifdef __i386__ +static int __thiscall test_streambuf_underflow(void) +#else +static int __thiscall test_streambuf_underflow(streambuf *this) +#endif +{ + underflow_count++; + if (test_this->unbuffered) { + return (buffer_pos < 23) ? test_get_buffer[buffer_pos++] : EOF; + } else if (test_this->gptr < test_this->egptr) { + return *test_this->gptr; + } else { + return get_end ? EOF : *(test_this->gptr = test_this->eback); + } +} + struct streambuf_lock_arg { streambuf *sb; @@ -197,6 +253,7 @@ static void test_streambuf(void) { streambuf sb, sb2, sb3, *psb; + vtable_ptr test_streambuf_vtbl[11]; struct streambuf_lock_arg lock_arg; HANDLE thread; char reserve[16]; @@ -226,6 +283,15 @@ ok(sb3.base == NULL, "wrong base pointer, expected %p got %p\n", NULL, sb3.base); ok(sb3.ebuf == NULL, "wrong ebuf pointer, expected %p got %p\n", NULL, sb3.ebuf); + memcpy(test_streambuf_vtbl, sb.vtable, sizeof(test_streambuf_vtbl)); + test_streambuf_vtbl[7] = (vtable_ptr)&test_streambuf_overflow; + test_streambuf_vtbl[8] = (vtable_ptr)&test_streambuf_underflow; + sb2.vtable = test_streambuf_vtbl; + sb3.vtable = test_streambuf_vtbl; + overflow_count = underflow_count = 0; + strcpy(test_get_buffer, "CompuGlobalHyperMegaNet"); + buffer_pos = get_end = 0; + /* setlock */ ok(sb.do_lock == -1, "expected do_lock value -1, got %d\n", sb.do_lock); call_func1(p_streambuf_setlock, &sb); @@ -386,6 +452,243 @@ ret = (int) call_func1(p_streambuf_sync, &sb3); ok(ret == 0, "sync failed, expected 0 got %d\n", ret); + /* sgetc */ + strcpy(sb2.eback, "WorstTestEver"); + test_this = &sb2; + ret = (int) call_func1(p_streambuf_sgetc, &sb2); + ok(ret == 'W', "expected 'W' got '%c'\n", ret); + ok(underflow_count == 1, "expected call to underflow\n"); + ok(sb2.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb2.stored_char); + sb2.gptr++; + ret = (int) call_func1(p_streambuf_sgetc, &sb2); + ok(ret == 'o', "expected 'o' got '%c'\n", ret); + ok(underflow_count == 2, "expected call to underflow\n"); + ok(sb2.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb2.stored_char); + sb2.gptr = sb2.egptr; + test_this = &sb3; + ret = (int) call_func1(p_streambuf_sgetc, &sb3); + ok(ret == 'C', "expected 'C' got '%c'\n", ret); + ok(underflow_count == 3, "expected call to underflow\n"); + ok(sb3.stored_char == 'C', "wrong stored character, expected 'C' got %c\n", sb3.stored_char); + sb3.stored_char = 'b'; + ret = (int) call_func1(p_streambuf_sgetc, &sb3); + ok(ret == 'b', "expected 'b' got '%c'\n", ret); + ok(underflow_count == 3, "no call to underflow expected\n"); + ok(sb3.stored_char == 'b', "wrong stored character, expected 'b' got %c\n", sb3.stored_char); + + /* sputc */ + *sb.pbase = 'a'; + ret = (int) call_func2(p_streambuf_sputc, &sb, 'c'); + ok(ret == 'c', "wrong return value, expected 'c' got %d\n", ret); + ok(overflow_count == 0, "no call to overflow expected\n"); + ok(*sb.pbase == 'c', "expected 'c' in the put area, got %c\n", *sb.pbase); + ok(sb.pptr == sb.pbase + 1, "wrong put pointer, expected %p got %p\n", sb.pbase + 1, sb.pptr); + test_this = &sb2; + ret = (int) call_func2(p_streambuf_sputc, &sb2, 'c'); + ok(ret == 'c', "wrong return value, expected 'c' got %d\n", ret); + ok(overflow_count == 1, "expected call to overflow\n"); + ok(sb2.pptr == sb2.pbase + 5, "wrong put pointer, expected %p got %p\n", sb2.pbase + 5, sb2.pptr); + test_this = &sb3; + ret = (int) call_func2(p_streambuf_sputc, &sb3, 'c'); + ok(ret == 'c', "wrong return value, expected 'c' got %d\n", ret); + ok(overflow_count == 2, "expected call to overflow\n"); + sb3.pbase = sb3.pptr = sb3.base; + sb3.epptr = sb3.ebuf; + ret = (int) call_func2(p_streambuf_sputc, &sb3, 'c'); + ok(ret == 'c', "wrong return value, expected 'c' got %d\n", ret); + ok(overflow_count == 2, "no call to overflow expected\n"); + ok(*sb3.pbase == 'c', "expected 'c' in the put area, got %c\n", *sb3.pbase); + sb3.pbase = sb3.pptr = sb3.epptr = NULL; + + /* xsgetn */ + sb2.gptr = sb2.egptr = sb2.eback + 13; + test_this = &sb2; + ret = (int) call_func3(p_streambuf_xsgetn, &sb2, reserve, 5); + ok(ret == 5, "wrong return value, expected 5 got %d\n", ret); + ok(!strncmp(reserve, "Worst", 5), "expected 'Worst' got %s\n", reserve); + ok(sb2.gptr == sb2.eback + 5, "wrong get pointer, expected %p got %p\n", sb2.eback + 5, sb2.gptr); + ok(underflow_count == 4, "expected call to underflow\n"); + ret = (int) call_func3(p_streambuf_xsgetn, &sb2, reserve, 4); + ok(ret == 4, "wrong return value, expected 4 got %d\n", ret); + ok(!strncmp(reserve, "Test", 4), "expected 'Test' got %s\n", reserve); + ok(sb2.gptr == sb2.eback + 9, "wrong get pointer, expected %p got %p\n", sb2.eback + 9, sb2.gptr); + ok(underflow_count == 5, "expected call to underflow\n"); + get_end = 1; + ret = (int) call_func3(p_streambuf_xsgetn, &sb2, reserve, 16); + ok(ret == 4, "wrong return value, expected 4 got %d\n", ret); + ok(!strncmp(reserve, "Ever", 4), "expected 'Ever' got %s\n", reserve); + ok(sb2.gptr == sb2.egptr, "wrong get pointer, expected %p got %p\n", sb2.egptr, sb2.gptr); + ok(underflow_count == 7, "expected 2 calls to underflow, got %d\n", underflow_count - 5); + test_this = &sb3; + ret = (int) call_func3(p_streambuf_xsgetn, &sb3, reserve, 11); + ok(ret == 11, "wrong return value, expected 11 got %d\n", ret); + ok(!strncmp(reserve, "bompuGlobal", 11), "expected 'bompuGlobal' got %s\n", reserve); + ok(sb3.stored_char == 'H', "wrong stored character, expected 'H' got %c\n", sb3.stored_char); + ok(underflow_count == 18, "expected 11 calls to underflow, got %d\n", underflow_count - 7); + ret = (int) call_func3(p_streambuf_xsgetn, &sb3, reserve, 16); + ok(ret == 12, "wrong return value, expected 12 got %d\n", ret); + ok(!strncmp(reserve, "HyperMegaNet", 12), "expected 'HyperMegaNet' got %s\n", reserve); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 30, "expected 12 calls to underflow, got %d\n", underflow_count - 18); + ret = (int) call_func3(p_streambuf_xsgetn, &sb3, reserve, 3); + ok(ret == 0, "wrong return value, expected 0 got %d\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 31, "expected call to underflow\n"); + buffer_pos = 0; + ret = (int) call_func3(p_streambuf_xsgetn, &sb3, reserve, 5); + ok(ret == 5, "wrong return value, expected 5 got %d\n", ret); + ok(!strncmp(reserve, "Compu", 5), "expected 'Compu' got %s\n", reserve); + ok(sb3.stored_char == 'G', "wrong stored character, expected 'G' got %c\n", sb3.stored_char); + ok(underflow_count == 37, "expected 6 calls to underflow, got %d\n", underflow_count - 31); + + /* xsputn */ + ret = (int) call_func3(p_streambuf_xsputn, &sb, "Test\0ing", 8); + ok(ret == 8, "wrong return value, expected 8 got %d\n", ret); + ok(sb.pptr == sb.pbase + 9, "wrong put pointer, expected %p got %p\n", sb.pbase + 9, sb.pptr); + test_this = &sb2; + sb2.pptr = sb2.epptr - 7; + ret = (int) call_func3(p_streambuf_xsputn, &sb2, "Testing", 7); + ok(ret == 7, "wrong return value, expected 7 got %d\n", ret); + ok(sb2.pptr == sb2.epptr, "wrong put pointer, expected %p got %p\n", sb2.epptr, sb2.pptr); + ok(overflow_count == 2, "no call to overflow expected\n"); + sb2.pptr = sb2.epptr - 5; + sb2.pbase[5] = 'a'; + ret = (int) call_func3(p_streambuf_xsputn, &sb2, "Testing", 7); + ok(ret == 7, "wrong return value, expected 7 got %d\n", ret); + ok(sb2.pbase[5] == 'g', "expected 'g' got %c\n", sb2.pbase[5]); + ok(sb2.pptr == sb2.pbase + 6, "wrong put pointer, expected %p got %p\n", sb2.pbase + 6, sb2.pptr); + ok(overflow_count == 3, "expected call to overflow\n"); + sb2.pptr = sb2.epptr - 4; + ret = (int) call_func3(p_streambuf_xsputn, &sb2, "TestLing", 8); + ok(ret == 4, "wrong return value, expected 4 got %d\n", ret); + ok(sb2.pptr == sb2.epptr, "wrong put pointer, expected %p got %p\n", sb2.epptr, sb2.pptr); + ok(overflow_count == 4, "expected call to overflow\n"); + test_this = &sb3; + ret = (int) call_func3(p_streambuf_xsputn, &sb3, "Testing", 7); + ok(ret == 7, "wrong return value, expected 7 got %d\n", ret); + ok(sb3.stored_char == 'G', "wrong stored character, expected 'G' got %c\n", sb3.stored_char); + ok(overflow_count == 11, "expected 7 calls to overflow, got %d\n", overflow_count - 4); + ret = (int) call_func3(p_streambuf_xsputn, &sb3, "TeLephone", 9); + ok(ret == 2, "wrong return value, expected 2 got %d\n", ret); + ok(sb3.stored_char == 'G', "wrong stored character, expected 'G' got %c\n", sb3.stored_char); + ok(overflow_count == 14, "expected 3 calls to overflow, got %d\n", overflow_count - 11); + + /* snextc */ + strcpy(sb.eback, "Test"); + ret = (int) call_func1(p_streambuf_snextc, &sb); + ok(ret == 'e', "expected 'e' got '%c'\n", ret); + ok(sb.gptr == sb.eback + 1, "wrong get pointer, expected %p got %p\n", sb.eback + 1, sb.gptr); + test_this = &sb2; + ret = (int) call_func1(p_streambuf_snextc, &sb2); + ok(ret == EOF, "expected EOF got '%c'\n", ret); + ok(sb2.gptr == sb2.egptr + 1, "wrong get pointer, expected %p got %p\n", sb2.egptr + 1, sb2.gptr); + ok(underflow_count == 39, "expected 2 calls to underflow, got %d\n", underflow_count - 37); + sb2.gptr = sb2.egptr - 1; + ret = (int) call_func1(p_streambuf_snextc, &sb2); + ok(ret == EOF, "expected EOF got '%c'\n", ret); + ok(sb2.gptr == sb2.egptr, "wrong get pointer, expected %p got %p\n", sb2.egptr, sb2.gptr); + ok(underflow_count == 40, "expected call to underflow\n"); + get_end = 0; + ret = (int) call_func1(p_streambuf_snextc, &sb2); + ok(ret == 'o', "expected 'o' got '%c'\n", ret); + ok(sb2.gptr == sb2.eback + 1, "wrong get pointer, expected %p got %p\n", sb2.eback + 1, sb2.gptr); + ok(underflow_count == 41, "expected call to underflow\n"); + sb2.gptr = sb2.egptr - 1; + ret = (int) call_func1(p_streambuf_snextc, &sb2); + ok(ret == 'W', "expected 'W' got '%c'\n", ret); + ok(sb2.gptr == sb2.eback, "wrong get pointer, expected %p got %p\n", sb2.eback, sb2.gptr); + ok(underflow_count == 42, "expected call to underflow\n"); + sb2.gptr = sb2.egptr; + test_this = &sb3; + ret = (int) call_func1(p_streambuf_snextc, &sb3); + ok(ret == 'l', "expected 'l' got '%c'\n", ret); + ok(sb3.stored_char == 'l', "wrong stored character, expected 'l' got %c\n", sb3.stored_char); + ok(underflow_count == 43, "expected call to underflow\n"); + buffer_pos = 22; + ret = (int) call_func1(p_streambuf_snextc, &sb3); + ok(ret == 't', "expected 't' got '%c'\n", ret); + ok(sb3.stored_char == 't', "wrong stored character, expected 't' got %c\n", sb3.stored_char); + ok(underflow_count == 44, "expected call to underflow\n"); + ret = (int) call_func1(p_streambuf_snextc, &sb3); + ok(ret == EOF, "expected EOF got '%c'\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 45, "expected call to underflow\n"); + buffer_pos = 0; + ret = (int) call_func1(p_streambuf_snextc, &sb3); + ok(ret == 'o', "expected 'o' got '%c'\n", ret); + ok(sb3.stored_char == 'o', "wrong stored character, expected 'o' got %c\n", sb3.stored_char); + ok(underflow_count == 47, "expected 2 calls to underflow, got %d\n", underflow_count - 45); + sb3.stored_char = EOF; + ret = (int) call_func1(p_streambuf_snextc, &sb3); + ok(ret == 'p', "expected 'p' got '%c'\n", ret); + ok(sb3.stored_char == 'p', "wrong stored character, expected 'p' got %c\n", sb3.stored_char); + ok(underflow_count == 49, "expected 2 calls to underflow, got %d\n", underflow_count - 47); + + /* sbumpc */ + ret = (int) call_func1(p_streambuf_sbumpc, &sb); + ok(ret == 'e', "expected 'e' got '%c'\n", ret); + ok(sb.gptr == sb.eback + 2, "wrong get pointer, expected %p got %p\n", sb.eback + 2, sb.gptr); + test_this = &sb2; + ret = (int) call_func1(p_streambuf_sbumpc, &sb2); + ok(ret == 'W', "expected 'W' got '%c'\n", ret); + ok(sb2.gptr == sb2.eback + 1, "wrong get pointer, expected %p got %p\n", sb2.eback + 1, sb2.gptr); + ok(underflow_count == 50, "expected call to underflow\n"); + sb2.gptr = sb2.egptr - 1; + *sb2.gptr = 't'; + ret = (int) call_func1(p_streambuf_sbumpc, &sb2); + ok(ret == 't', "expected 't' got '%c'\n", ret); + ok(sb2.gptr == sb2.egptr, "wrong get pointer, expected %p got %p\n", sb2.egptr, sb2.gptr); + ok(underflow_count == 50, "no call to underflow expected\n"); + get_end = 1; + ret = (int) call_func1(p_streambuf_sbumpc, &sb2); + ok(ret == EOF, "expected EOF got '%c'\n", ret); + ok(sb2.gptr == sb2.egptr + 1, "wrong get pointer, expected %p got %p\n", sb2.egptr + 1, sb2.gptr); + ok(underflow_count == 51, "expected call to underflow\n"); + sb2.gptr = sb2.egptr; + test_this = &sb3; + ret = (int) call_func1(p_streambuf_sbumpc, &sb3); + ok(ret == 'p', "expected 'p' got '%c'\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 51, "no call to underflow expected\n"); + ret = (int) call_func1(p_streambuf_sbumpc, &sb3); + ok(ret == 'u', "expected 'u' got '%c'\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 52, "expected call to underflow\n"); + buffer_pos = 23; + ret = (int) call_func1(p_streambuf_sbumpc, &sb3); + ok(ret == EOF, "expected EOF got '%c'\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 53, "expected call to underflow\n"); + buffer_pos = 0; + ret = (int) call_func1(p_streambuf_sbumpc, &sb3); + ok(ret == 'C', "expected 'C' got '%c'\n", ret); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 54, "expected call to underflow\n"); + + /* stossc */ + call_func1(p_streambuf_stossc, &sb); + ok(sb.gptr == sb.eback + 3, "wrong get pointer, expected %p got %p\n", sb.eback + 3, sb.gptr); + test_this = &sb2; + call_func1(p_streambuf_stossc, &sb2); + ok(sb2.gptr == sb2.egptr, "wrong get pointer, expected %p got %p\n", sb2.egptr, sb2.gptr); + ok(underflow_count == 55, "expected call to underflow\n"); + get_end = 0; + call_func1(p_streambuf_stossc, &sb2); + ok(sb2.gptr == sb2.eback + 1, "wrong get pointer, expected %p got %p\n", sb2.eback + 1, sb2.gptr); + ok(underflow_count == 56, "expected call to underflow\n"); + sb2.gptr = sb2.egptr - 1; + call_func1(p_streambuf_stossc, &sb2); + ok(sb2.gptr == sb2.egptr, "wrong get pointer, expected %p got %p\n", sb2.egptr, sb2.gptr); + ok(underflow_count == 56, "no call to underflow expected\n"); + test_this = &sb3; + call_func1(p_streambuf_stossc, &sb3); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 57, "expected call to underflow\n"); + sb3.stored_char = 'a'; + call_func1(p_streambuf_stossc, &sb3); + ok(sb3.stored_char == EOF, "wrong stored character, expected EOF got %c\n", sb3.stored_char); + ok(underflow_count == 57, "no call to underflow expected\n"); + SetEvent(lock_arg.test[3]); WaitForSingleObject(thread, INFINITE); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp110/msvcp110.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp110/msvcp110.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp110/msvcp110.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp110/msvcp110.spec 2015-06-28 16:51:28.000000000 +0000 @@ -1167,12 +1167,12 @@ @ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEBD0_N@Z @ stub -arch=win32 ?_Copy_file@sys@tr2@std@@YAHPB_W0_N@Z @ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z -@ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPADPAD@Z -@ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADPEAD@Z +@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPADPAD@Z(ptr) tr2_sys__Current_get +@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADPEAD@Z(ptr) tr2_sys__Current_get @ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WPA_W@Z @ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WPEA_W@Z -@ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z -@ stub -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z +@ cdecl -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Current_set +@ cdecl -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Current_set @ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPB_W@Z @ stub -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEB_W@Z @ cdecl -arch=arm ?_Decref@facet@locale@std@@UAAPAV_Facet_base@3@XZ(ptr) locale_facet__Decref @@ -1196,8 +1196,8 @@ @ cdecl -arch=arm ?_Empty@?$_Yarn@_W@std@@QBA_NXZ(ptr) _Yarn_wchar__Empty @ thiscall -arch=i386 ?_Empty@?$_Yarn@_W@std@@QBE_NXZ(ptr) _Yarn_wchar__Empty @ cdecl -arch=win64 ?_Empty@?$_Yarn@_W@std@@QEBA_NXZ(ptr) _Yarn_wchar__Empty -@ stub -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPBD0@Z -@ stub -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z +@ cdecl -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPBD0@Z(str str) tr2_sys__Equivalent +@ cdecl -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z(str str) tr2_sys__Equivalent @ stub -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPB_W0@Z @ stub -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEB_W0@Z @ cdecl -arch=win32 ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADDH@Z(ptr ptr long long) num_put_char__Ffmt @@ -1206,8 +1206,8 @@ @ cdecl -arch=win64 ?_Ffmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAPEADPEADDH@Z(ptr ptr long long) num_put_wchar__Ffmt @ cdecl -arch=win32 ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADDH@Z(ptr ptr long long) num_put_wchar__Ffmt @ cdecl -arch=win64 ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADDH@Z(ptr ptr long long) num_put_wchar__Ffmt -@ stub -arch=win32 ?_File_size@sys@tr2@std@@YA_KPBD@Z -@ stub -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEBD@Z +@ cdecl -ret64 -arch=win32 ?_File_size@sys@tr2@std@@YA_KPBD@Z(str) tr2_sys__File_size +@ cdecl -ret64 -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEBD@Z(str) tr2_sys__File_size @ stub -arch=win32 ?_File_size@sys@tr2@std@@YA_KPB_W@Z @ stub -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEB_W@Z @ cdecl -arch=arm ?_Findarr@ios_base@std@@AAAAAU_Iosarray@12@H@Z(ptr long) ios_base_Findarr @@ -1617,8 +1617,8 @@ @ stub -arch=win64 ?_MP_Mul@std@@YAXQEA_K_K1@Z @ stub -arch=win32 ?_MP_Rem@std@@YAXQA_K_K@Z @ stub -arch=win64 ?_MP_Rem@std@@YAXQEA_K_K@Z -@ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z -@ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z +@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z(str) tr2_sys__Make_dir +@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z(str) tr2_sys__Make_dir @ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z @ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z @ cdecl -arch=win32 ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc @@ -1718,8 +1718,8 @@ @ stub -arch=arm ?_Release@_Pad@std@@QAAXXZ @ stub -arch=i386 ?_Release@_Pad@std@@QAEXXZ @ stub -arch=win64 ?_Release@_Pad@std@@QEAAXXZ -@ stub -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z -@ stub -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z +@ cdecl -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Remove_dir +@ cdecl -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Remove_dir @ stub -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPB_W@Z @ stub -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEB_W@Z @ stub -arch=win32 ?_Rename@sys@tr2@std@@YAHPBD0@Z diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp120/msvcp120.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp120/msvcp120.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp120/msvcp120.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp120/msvcp120.spec 2015-06-28 16:51:28.000000000 +0000 @@ -1132,12 +1132,12 @@ @ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEBD0_N@Z @ stub -arch=win32 ?_Copy_file@sys@tr2@std@@YAHPB_W0_N@Z @ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z -@ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z -@ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z +@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z(ptr) tr2_sys__Current_get +@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z(ptr) tr2_sys__Current_get @ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z @ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z -@ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z -@ stub -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z +@ cdecl -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Current_set +@ cdecl -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Current_set @ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPB_W@Z @ stub -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEB_W@Z @ cdecl -arch=arm ?_Decref@facet@locale@std@@UAAPAV_Facet_base@3@XZ(ptr) locale_facet__Decref @@ -1161,8 +1161,8 @@ @ cdecl -arch=arm ?_Empty@?$_Yarn@_W@std@@QBA_NXZ(ptr) _Yarn_wchar__Empty @ thiscall -arch=i386 ?_Empty@?$_Yarn@_W@std@@QBE_NXZ(ptr) _Yarn_wchar__Empty @ cdecl -arch=win64 ?_Empty@?$_Yarn@_W@std@@QEBA_NXZ(ptr) _Yarn_wchar__Empty -@ stub -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPBD0@Z -@ stub -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z +@ cdecl -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPBD0@Z(str str) tr2_sys__Equivalent +@ cdecl -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z(str str) tr2_sys__Equivalent @ stub -arch=win32 ?_Equivalent@sys@tr2@std@@YAHPB_W0@Z @ stub -arch=win64 ?_Equivalent@sys@tr2@std@@YAHPEB_W0@Z @ cdecl -arch=win32 ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADDH@Z(ptr ptr long long) num_put_char__Ffmt @@ -1171,8 +1171,8 @@ @ cdecl -arch=win64 ?_Ffmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAPEADPEADDH@Z(ptr ptr long long) num_put_wchar__Ffmt @ cdecl -arch=win32 ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADDH@Z(ptr ptr long long) num_put_wchar__Ffmt @ cdecl -arch=win64 ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADDH@Z(ptr ptr long long) num_put_wchar__Ffmt -@ stub -arch=win32 ?_File_size@sys@tr2@std@@YA_KPBD@Z -@ stub -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEBD@Z +@ cdecl -ret64 -arch=win32 ?_File_size@sys@tr2@std@@YA_KPBD@Z(str) tr2_sys__File_size +@ cdecl -ret64 -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEBD@Z(str) tr2_sys__File_size @ stub -arch=win32 ?_File_size@sys@tr2@std@@YA_KPB_W@Z @ stub -arch=win64 ?_File_size@sys@tr2@std@@YA_KPEB_W@Z @ cdecl -arch=arm ?_Findarr@ios_base@std@@AAAAAU_Iosarray@12@H@Z(ptr long) ios_base_Findarr @@ -1578,8 +1578,8 @@ @ stub -arch=win64 ?_MP_Mul@std@@YAXQEA_K_K1@Z @ stub -arch=win32 ?_MP_Rem@std@@YAXQA_K_K@Z @ stub -arch=win64 ?_MP_Rem@std@@YAXQEA_K_K@Z -@ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z -@ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z +@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z(str) tr2_sys__Make_dir +@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z(str) tr2_sys__Make_dir @ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z @ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z @ cdecl -arch=win32 ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc @@ -1679,8 +1679,8 @@ @ stub -arch=arm ?_Release@_Pad@std@@QAAXXZ @ stub -arch=i386 ?_Release@_Pad@std@@QAEXXZ @ stub -arch=win64 ?_Release@_Pad@std@@QEAAXXZ -@ stub -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z -@ stub -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z +@ cdecl -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Remove_dir +@ cdecl -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Remove_dir @ stub -arch=win32 ?_Remove_dir@sys@tr2@std@@YA_NPB_W@Z @ stub -arch=win64 ?_Remove_dir@sys@tr2@std@@YA_NPEB_W@Z @ stub -arch=win32 ?_Rename@sys@tr2@std@@YAHPBD0@Z diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp120/tests/msvcp120.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp120/tests/msvcp120.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcp120/tests/msvcp120.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcp120/tests/msvcp120.c 2015-06-28 16:51:28.000000000 +0000 @@ -17,11 +17,13 @@ */ #include +#include #include "wine/test.h" #include "winbase.h" typedef int MSVCRT_long; +typedef unsigned char MSVCP_bool; /* xtime */ typedef struct { @@ -36,6 +38,16 @@ BYTE isleadbyte[32]; } _Cvtvec; +static inline const char* debugstr_longlong(ULONGLONG ll) +{ + static char string[17]; + if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) + sprintf(string, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll); + else + sprintf(string, "%lx", (unsigned long)ll); + return string; +} + static char* (__cdecl *p_setlocale)(int, const char*); static int (__cdecl *p__setmbcp)(int); static int (__cdecl *p_isleadbyte)(int); @@ -47,8 +59,17 @@ static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv); static void (CDECL *p__Do_call)(void *this); -static HMODULE msvcp; +/* filesystem */ +static ULONGLONG(__cdecl *p_tr2_sys__File_size)(char const*); +static int (__cdecl *p_tr2_sys__Equivalent)(char const*, char const*); +static char* (__cdecl *p_tr2_sys__Current_get)(char *); +static MSVCP_bool (__cdecl *p_tr2_sys__Current_set)(char const*); +static int (__cdecl *p_tr2_sys__Make_dir)(char const*); +static MSVCP_bool (__cdecl *p_tr2_sys__Remove_dir)(char const*); +static HMODULE msvcp; +#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) +#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) static BOOL init(void) { HANDLE msvcr; @@ -60,12 +81,45 @@ return FALSE; } - p__Xtime_diff_to_millis2 = (void*)GetProcAddress(msvcp, "_Xtime_diff_to_millis2"); - p_xtime_get = (void*)GetProcAddress(msvcp, "xtime_get"); - p__Getcvt = (void*)GetProcAddress(msvcp, "_Getcvt"); - p__Call_once = (void*)GetProcAddress(msvcp, "_Call_once"); - p__Call_onceEx = (void*)GetProcAddress(msvcp, "_Call_onceEx"); - p__Do_call = (void*)GetProcAddress(msvcp, "_Do_call"); + SET(p__Xtime_diff_to_millis2, + "_Xtime_diff_to_millis2"); + SET(p_xtime_get, + "xtime_get"); + SET(p__Getcvt, + "_Getcvt"); + SET(p__Call_once, + "_Call_once"); + SET(p__Call_onceEx, + "_Call_onceEx"); + SET(p__Do_call, + "_Do_call"); + if(sizeof(void*) == 8) { /* 64-bit initialization */ + SET(p_tr2_sys__File_size, + "?_File_size@sys@tr2@std@@YA_KPEBD@Z"); + SET(p_tr2_sys__Equivalent, + "?_Equivalent@sys@tr2@std@@YAHPEBD0@Z"); + SET(p_tr2_sys__Current_get, + "?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z"); + SET(p_tr2_sys__Current_set, + "?_Current_set@sys@tr2@std@@YA_NPEBD@Z"); + SET(p_tr2_sys__Make_dir, + "?_Make_dir@sys@tr2@std@@YAHPEBD@Z"); + SET(p_tr2_sys__Remove_dir, + "?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z"); + } else { + SET(p_tr2_sys__File_size, + "?_File_size@sys@tr2@std@@YA_KPBD@Z"); + SET(p_tr2_sys__Equivalent, + "?_Equivalent@sys@tr2@std@@YAHPBD0@Z"); + SET(p_tr2_sys__Current_get, + "?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z"); + SET(p_tr2_sys__Current_set, + "?_Current_set@sys@tr2@std@@YA_NPBD@Z"); + SET(p_tr2_sys__Make_dir, + "?_Make_dir@sys@tr2@std@@YAHPBD@Z"); + SET(p_tr2_sys__Remove_dir, + "?_Remove_dir@sys@tr2@std@@YA_NPBD@Z"); + } msvcr = GetModuleHandleA("msvcr120.dll"); p_setlocale = (void*)GetProcAddress(msvcr, "setlocale"); @@ -271,6 +325,207 @@ ok(cnt == 1, "func was not called\n"); } +static void test_tr2_sys__File_size(void) +{ + ULONGLONG val; + HANDLE file; + LARGE_INTEGER file_size = {{7, 0}}; + CreateDirectoryA("tr2_test_dir", NULL); + + file = CreateFileA("tr2_test_dir/f1", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(SetFilePointerEx(file, file_size, NULL, FILE_BEGIN), "SetFilePointerEx failed\n"); + ok(SetEndOfFile(file), "SetEndOfFile failed\n"); + CloseHandle(file); + val = p_tr2_sys__File_size("tr2_test_dir/f1"); + ok(val == 7, "file_size is %s\n", debugstr_longlong(val)); + + file = CreateFileA("tr2_test_dir/f2", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + val = p_tr2_sys__File_size("tr2_test_dir/f2"); + ok(val == 0, "file_size is %s\n", debugstr_longlong(val)); + + val = p_tr2_sys__File_size("tr2_test_dir"); + ok(val == 0, "file_size is %s\n", debugstr_longlong(val)); + + errno = 0xdeadbeef; + val = p_tr2_sys__File_size("tr2_test_dir/not_exists_file"); + ok(val == 0, "file_size is %s\n", debugstr_longlong(val)); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + + errno = 0xdeadbeef; + val = p_tr2_sys__File_size(NULL); + ok(val == 0, "file_size is %s\n", debugstr_longlong(val)); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + + ok(DeleteFileA("tr2_test_dir/f1"), "Expected tr2_test_dir/f1 to exist\n"); + ok(DeleteFileA("tr2_test_dir/f2"), "Expected tr2_test_dir/f2 to exist\n"); + ok(RemoveDirectoryA("tr2_test_dir"), "Expected tr2_test_dir to exist\n"); +} + +static void test_tr2_sys__Equivalent(void) +{ + int val, i; + HANDLE file; + char temp_path[MAX_PATH], current_path[MAX_PATH]; + struct { + char const *path1; + char const *path2; + int equivalent; + } tests[] = { + { NULL, NULL, -1 }, + { NULL, "f1", -1 }, + { "f1", NULL, -1 }, + { "f1", "tr2_test_dir", -1 }, + { "tr2_test_dir", "f1", -1 }, + { "tr2_test_dir", "tr2_test_dir", -1 }, + { "tr2_test_dir/./f1", "tr2_test_dir/f2", 0 }, + { "tr2_test_dir/f1" , "tr2_test_dir/f1", 1 }, + { "not_exists_file" , "tr2_test_dir/f1", 0 }, + { "tr2_test_dir\\f1" , "tr2_test_dir/./f1", 1 }, + { "not_exists_file" , "not_exists_file", -1 }, + { "tr2_test_dir/f1" , "not_exists_file", 0 }, + { "tr2_test_dir/../tr2_test_dir/f1", "tr2_test_dir/f1", 1 } + }; + + memset(current_path, 0, MAX_PATH); + GetCurrentDirectoryA(MAX_PATH, current_path); + memset(temp_path, 0, MAX_PATH); + GetTempPathA(MAX_PATH, temp_path); + ok(SetCurrentDirectoryA(temp_path), "SetCurrentDirectoryA to temp_path failed\n"); + CreateDirectoryA("tr2_test_dir", NULL); + + file = CreateFileA("tr2_test_dir/f1", 0, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + file = CreateFileA("tr2_test_dir/f2", 0, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + + for(i=0; i>"), "p_tr2_sys__Current_set to ??invalid_name>> succeed\n"); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + + ok(p_tr2_sys__Current_set(origin_path), "p_tr2_sys__Current_set to origin_path failed\n"); + memset(current_path, 0, MAX_PATH); + temp = p_tr2_sys__Current_get(current_path); + ok(temp == current_path, "p_tr2_sys__Current_get returned different buffer\n"); + ok(!strcmp(origin_path, current_path), "test_tr2_sys__Current_get(): expect: %s, got %s\n", origin_path, current_path); +} + +static void test_tr2_sys__Make_dir(void) +{ + int ret, i; + struct { + char const *path; + int val; + } tests[] = { + { "tr2_test_dir", 1 }, + { "tr2_test_dir", 0 }, + { NULL, -1 }, + { "??invalid_name>>", -1 } + }; + + for(i=0; i>", FALSE } + }; + + ok(p_tr2_sys__Make_dir("tr2_test_dir"), "tr2_sys__Make_dir() failed\n"); + + for(i=0; i= 110 -static LCID* ___lc_handle_func(void) -{ - LCID *ret; - - _locale_t loc = _get_current_locale(); - ret = loc->locinfo->lc_handle; - _free_locale(loc); - return ret; -} +wchar_t ** __cdecl ___lc_locale_name_func(void); #else LCID* __cdecl ___lc_handle_func(void); #endif @@ -128,8 +120,13 @@ } _Locinfo; typedef struct { +#if _MSVCP_VER < 110 LCID handle; +#endif unsigned page; +#if _MSVCP_VER >= 110 + wchar_t *lc_name; +#endif } _Collvec; typedef struct { @@ -663,7 +660,11 @@ TRACE("\n"); ret.collvec.page = ___lc_collate_cp_func(); +#if _MSVCP_VER < 110 ret.collvec.handle = ___lc_handle_func()[LC_COLLATE]; +#else + ret.collvec.lc_name = ___lc_locale_name_func()[LC_COLLATE]; +#endif return ret.ull; } @@ -688,8 +689,7 @@ #if _MSVCP_VER < 110 ret->handle = ___lc_handle_func()[LC_COLLATE]; #else - /* FIXME: use ___lc_locale_name_func() */ - ret->name = NULL; + ret->name = ___lc_locale_name_func()[LC_COLLATE]; #endif ret->delfl = TRUE; table = malloc(sizeof(short[256])); @@ -761,9 +761,15 @@ { WCHAR date_fmt[2]; +#if _MSVCP_VER < 110 if(!GetLocaleInfoW(___lc_handle_func()[LC_TIME], LOCALE_ILDATE, date_fmt, sizeof(date_fmt)/sizeof(*date_fmt))) return DATEORDER_no_order; +#else + if(!GetLocaleInfoEx(___lc_locale_name_func()[LC_TIME], LOCALE_ILDATE, + date_fmt, sizeof(date_fmt)/sizeof(*date_fmt))) + return DATEORDER_no_order; +#endif if(*date_fmt == '0') return DATEORDER_mdy; if(*date_fmt == '1') return DATEORDER_dmy; @@ -1085,10 +1091,11 @@ TRACE("(%s %s)\n", debugstr_an(first1, last1-first1), debugstr_an(first2, last2-first2)); - if(coll) - lcid = coll->handle; - else - lcid = ___lc_handle_func()[LC_COLLATE]; +#if _MSVCP_VER < 110 + lcid = (coll ? coll->handle : ___lc_handle_func()[LC_COLLATE]); +#else + lcid = LocaleNameToLCID(coll ? coll->lc_name : ___lc_locale_name_func()[LC_COLLATE], 0); +#endif return CompareStringA(lcid, 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL; } @@ -1419,15 +1426,15 @@ int __cdecl _Wcscoll(const wchar_t *first1, const wchar_t *last1, const wchar_t *first2, const wchar_t *last2, const _Collvec *coll) { - LCID lcid; - TRACE("(%s %s)\n", debugstr_wn(first1, last1-first1), debugstr_wn(first2, last2-first2)); - if(coll) - lcid = coll->handle; - else - lcid = ___lc_handle_func()[LC_COLLATE]; - return CompareStringW(lcid, 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL; +#if _MSVCP_VER < 110 + return CompareStringW(coll ? coll->handle : ___lc_handle_func()[LC_COLLATE], + 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL; +#else + return CompareStringEx(coll ? coll->lc_name : ___lc_locale_name_func()[LC_COLLATE], + 0, first1, last1-first1, first2, last2-first2, NULL, NULL, 0)-CSTR_EQUAL; +#endif } /* ?do_compare@?$collate@_W@std@@MBEHPB_W000@Z */ @@ -9959,6 +9966,9 @@ return call_time_get_char_do_get_year(this, ret, s, e, base, err, t); } +/* ??_7_Locimp@locale@std@@6B@ */ +extern const vtable_ptr MSVCP_locale__Locimp_vtable; + /* ??0_Locimp@locale@std@@AAE@_N@Z */ /* ??0_Locimp@locale@std@@AEAA@_N@Z */ DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor_transparent, 8) @@ -9968,6 +9978,7 @@ memset(this, 0, sizeof(locale__Locimp)); locale_facet_ctor_refs(&this->facet, 1); + this->facet.vtable = &MSVCP_locale__Locimp_vtable; this->transparent = transparent; locale_string_char_ctor_cstr(&this->name, "*"); return this; @@ -9994,6 +10005,7 @@ _Lockit_ctor_locktype(&lock, _LOCK_LOCALE); memcpy(this, copy, sizeof(locale__Locimp)); locale_facet_ctor_refs(&this->facet, 1); + this->facet.vtable = &MSVCP_locale__Locimp_vtable; if(copy->facetvec) { this->facetvec = MSVCRT_operator_new(copy->facet_cnt*sizeof(locale_facet*)); if(!this->facetvec) { @@ -10553,11 +10565,6 @@ return locimp; } -/* ??_7_Locimp@locale@std@@6B@ */ -const vtable_ptr MSVCP_locale__Locimp_vtable[] = { - (vtable_ptr)THISCALL_NAME(locale__Locimp_vector_dtor) -}; - /* ??0locale@std@@AAE@PAV_Locimp@01@@Z */ /* ??0locale@std@@AEAA@PEAV_Locimp@01@@Z */ DEFINE_THISCALL_WRAPPER(locale_ctor_locimp, 8) @@ -11059,6 +11066,7 @@ DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@") +DEFINE_RTTI_DATA1(locale__Locimp, 0, &locale_facet_rtti_base_descriptor, ".?AV_Locimp@locale@std@@") DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@") DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@") DEFINE_RTTI_DATA1(collate_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@G@std@@") @@ -11095,6 +11103,13 @@ VTABLE_ADD_FUNC(locale_facet__Decref) #endif ); + __ASM_VTABLE(locale__Locimp, + VTABLE_ADD_FUNC(locale__Locimp_vector_dtor) +#if _MSVCP_VER >= 110 + VTABLE_ADD_FUNC(locale_facet__Incref) + VTABLE_ADD_FUNC(locale_facet__Decref) +#endif + ); __ASM_VTABLE(collate_char, VTABLE_ADD_FUNC(collate_char_vector_dtor) #if _MSVCP_VER >= 110 @@ -11418,6 +11433,7 @@ { #ifdef __x86_64__ init_locale_facet_rtti(base); + init_locale__Locimp_rtti(base); init_collate_char_rtti(base); init_collate_wchar_rtti(base); init_collate_short_rtti(base); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr100/msvcr100.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr100/msvcr100.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr100/msvcr100.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr100/msvcr100.spec 2015-06-28 16:51:28.000000000 +0000 @@ -907,10 +907,10 @@ @ stub _getsystime(ptr) @ cdecl _getw(ptr) MSVCRT__getw @ cdecl _getwc_nolock(ptr) MSVCRT__fgetwc_nolock -@ stub _getwch -@ stub _getwch_nolock -@ stub _getwche -@ stub _getwche_nolock +@ cdecl _getwch() +@ cdecl _getwch_nolock() +@ cdecl _getwche() +@ cdecl _getwche_nolock() @ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s @ cdecl -arch=i386 _global_unwind2(ptr) @@ -1239,8 +1239,8 @@ @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw @ cdecl _putwc_nolock(long ptr) MSVCRT__fputwc_nolock -@ cdecl _putwch(long) MSVCRT__putwch -@ stub _putwch_nolock +@ cdecl _putwch(long) +@ cdecl _putwch_nolock(long) @ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype @ cdecl _read(long ptr long) MSVCRT__read @@ -1412,8 +1412,8 @@ @ cdecl _ungetch(long) @ cdecl _ungetch_nolock(long) @ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock -@ stub _ungetwch -@ stub _ungetwch_nolock +@ cdecl _ungetwch(long) +@ cdecl _ungetwch_nolock(long) @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr110/msvcr110.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr110/msvcr110.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr110/msvcr110.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr110/msvcr110.spec 2015-06-28 16:51:28.000000000 +0000 @@ -893,7 +893,7 @@ @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() -@ stub ___lc_locale_name_func +@ cdecl ___lc_locale_name_func() @ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func @ cdecl ___mb_cur_max_l_func(ptr) @ cdecl ___setlc_active_func() MSVCRT____setlc_active_func @@ -917,7 +917,7 @@ @ stub -arch=i386,win64 __crtFlsGetValue @ stub -arch=i386,win64 __crtFlsSetValue @ stub -arch=i386,win64 __crtGetDateFormatEx -@ stub -arch=i386,win64 __crtGetLocaleInfoEx +@ cdecl -arch=i386,win64 __crtGetLocaleInfoEx(wstr long ptr long) @ cdecl __crtGetShowWindowMode() MSVCR110__crtGetShowWindowMode @ stub -arch=i386,win64 __crtGetTimeFormatEx @ stub -arch=i386,win64 __crtGetUserDefaultLocaleName @@ -1254,10 +1254,10 @@ @ stub _getsystime(ptr) @ cdecl _getw(ptr) MSVCRT__getw @ cdecl _getwc_nolock(ptr) MSVCRT__fgetwc_nolock -@ stub _getwch -@ stub _getwch_nolock -@ stub _getwche -@ stub _getwche_nolock +@ cdecl _getwch() +@ cdecl _getwch_nolock() +@ cdecl _getwche() +@ cdecl _getwche_nolock() @ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s @ cdecl -arch=i386 _global_unwind2(ptr) @@ -1597,8 +1597,8 @@ @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw @ cdecl _putwc_nolock(long ptr) MSVCRT__fputwc_nolock -@ cdecl _putwch(long) MSVCRT__putwch -@ stub _putwch_nolock +@ cdecl _putwch(long) +@ cdecl _putwch_nolock(long) @ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype @ cdecl _read(long ptr long) MSVCRT__read @@ -1770,8 +1770,8 @@ @ cdecl _ungetch(long) @ cdecl _ungetch_nolock(long) @ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock -@ stub _ungetwch -@ stub _ungetwch_nolock +@ cdecl _ungetwch(long) +@ cdecl _ungetwch_nolock(long) @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr120/msvcr120.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr120/msvcr120.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr120/msvcr120.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr120/msvcr120.spec 2015-06-28 16:51:28.000000000 +0000 @@ -876,7 +876,7 @@ @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() -@ stub ___lc_locale_name_func +@ cdecl ___lc_locale_name_func() @ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func @ cdecl ___mb_cur_max_l_func(ptr) @ cdecl ___setlc_active_func() MSVCRT____setlc_active_func @@ -902,7 +902,7 @@ @ stub -arch=i386,win64 __crtFlsSetValue @ stub -arch=i386,win64 __crtGetDateFormatEx @ stub __crtGetFileInformationByHandleEx -@ stub -arch=i386,win64 __crtGetLocaleInfoEx +@ cdecl -arch=i386,win64 __crtGetLocaleInfoEx(wstr long ptr long) @ cdecl __crtGetShowWindowMode() MSVCR110__crtGetShowWindowMode @ stub __crtGetTickCount64 @ stub -arch=i386,win64 __crtGetTimeFormatEx @@ -1252,10 +1252,10 @@ @ stub _getsystime(ptr) @ cdecl _getw(ptr) MSVCRT__getw @ cdecl _getwc_nolock(ptr) MSVCRT__fgetwc_nolock -@ stub _getwch -@ stub _getwch_nolock -@ stub _getwche -@ stub _getwche_nolock +@ cdecl _getwch() +@ cdecl _getwch_nolock() +@ cdecl _getwche() +@ cdecl _getwche_nolock() @ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s @ cdecl -arch=i386 _global_unwind2(ptr) @@ -1605,8 +1605,8 @@ @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw @ cdecl _putwc_nolock(long ptr) MSVCRT__fputwc_nolock -@ cdecl _putwch(long) MSVCRT__putwch -@ stub _putwch_nolock +@ cdecl _putwch(long) +@ cdecl _putwch_nolock(long) @ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype @ cdecl _read(long ptr long) MSVCRT__read @@ -1784,8 +1784,8 @@ @ cdecl _ungetch(long) @ cdecl _ungetch_nolock(long) @ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock -@ stub _ungetwch -@ stub _ungetwch_nolock +@ cdecl _ungetwch(long) +@ cdecl _ungetwch_nolock(long) @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr120/tests/msvcr120.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr120/tests/msvcr120.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcr120/tests/msvcr120.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcr120/tests/msvcr120.c 2015-06-28 16:51:28.000000000 +0000 @@ -63,6 +63,7 @@ static size_t (CDECL *p_wcstombs_s)(size_t *ret, char* dest, size_t sz, const wchar_t* src, size_t max); static int (CDECL *p__dsign)(double); static int (CDECL *p__fdsign)(float); +static wchar_t** (CDECL *p____lc_locale_name_func)(void); static BOOL init(void) { @@ -80,6 +81,7 @@ p_wcstombs_s = (void*)GetProcAddress(module, "wcstombs_s"); p__dsign = (void*)GetProcAddress(module, "_dsign"); p__fdsign = (void*)GetProcAddress(module, "_fdsign"); + p____lc_locale_name_func = (void*)GetProcAddress(module, "___lc_locale_name_func"); return TRUE; } @@ -171,9 +173,58 @@ ok(ret == 0x8000, "p_fdsign(-1) = %x\n", ret); } +static void test____lc_locale_name_func(void) +{ + struct { + const char *locale; + const WCHAR name[10]; + const WCHAR broken_name[10]; + BOOL todo; + } tests[] = { + { "American", {'e','n',0}, {'e','n','-','U','S',0} }, + { "Belgian", {'n','l','-','B','E',0} }, + { "Chinese", {'z','h',0}, {'z','h','-','C','N',0}, TRUE }, + { "Dutch", {'n','l',0}, {'n','l','-','N','L',0} }, + { "English", {'e','n',0}, {'e','n','-','U','S',0} }, + { "French", {'f','r',0}, {'f','r','-','F','R',0} }, + { "German", {'d','e',0}, {'d','e','-','D','E',0} }, + { "Hungarian", {'h','u',0}, {'h','u','-','H','U',0} }, + { "Icelandic", {'i','s',0}, {'i','s','-','I','S',0} }, + { "Japanese", {'j','a',0}, {'j','a','-','J','P',0} }, + { "Korean", {'k','o',0}, {'k','o','-','K','R',0} } + }; + int i, j; + wchar_t **lc_names; + + for(i=0; iEvent.KeyEvent.wVirtualScanCode == enh_map[i].vk) + { + unsigned idx; + + if (ir->Event.KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) + idx = ALT_CHAR; + else if (ir->Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) ) + idx = CTRL_CHAR; + else if (ir->Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) + idx = SHIFT_CHAR; + else + idx = NORMAL_CHAR; + + *ch1 = enh_map[i].ch[idx][0]; + *ch2 = enh_map[i].ch[idx][1]; + return TRUE; + } + } + + WARN("Unmapped char keyState=%x vk=%x\n", + ir->Event.KeyEvent.dwControlKeyState, ir->Event.KeyEvent.wVirtualScanCode); + return FALSE; +} + /********************************************************************* * _getch_nolock (MSVCR80.@) */ @@ -137,39 +175,24 @@ do { if (ReadConsoleInputA(MSVCRT_console_in, &ir, 1, &count)) { - unsigned int i; /* Only interested in ASCII chars */ if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) { + unsigned char ch1, ch2; + if (ir.Event.KeyEvent.uChar.AsciiChar) { retval = ir.Event.KeyEvent.uChar.AsciiChar; break; } - for (i = 0; i < sizeof(enh_map) / sizeof(enh_map[0]); i++) - { - if (ir.Event.KeyEvent.wVirtualScanCode == enh_map[i].vk) break; - } - if (i < sizeof(enh_map) / sizeof(enh_map[0])) - { - unsigned idx; - - if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) - idx = ALT_CHAR; - else if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) ) - idx = CTRL_CHAR; - else if (ir.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) - idx = SHIFT_CHAR; - else - idx = NORMAL_CHAR; - retval = enh_map[i].ch[idx][0]; - __MSVCRT_console_buffer = enh_map[i].ch[idx][1]; + if (handle_enhanced_keys(&ir, &ch1, &ch2)) + { + retval = ch1; + __MSVCRT_console_buffer = ch2; break; } - WARN("Unmapped char keyState=%x vk=%x\n", - ir.Event.KeyEvent.dwControlKeyState, ir.Event.KeyEvent.wVirtualScanCode); } } else @@ -195,6 +218,73 @@ } /********************************************************************* + * _getwch_nolock (MSVCR80.@) + */ +MSVCRT_wchar_t CDECL _getwch_nolock(void) +{ + MSVCRT_wchar_t retval = MSVCRT_WEOF; + + if (__MSVCRT_console_buffer_w != MSVCRT_WEOF) + { + retval = __MSVCRT_console_buffer_w; + __MSVCRT_console_buffer_w = MSVCRT_WEOF; + } + else + { + INPUT_RECORD ir; + DWORD count; + DWORD mode = 0; + + GetConsoleMode(MSVCRT_console_in, &mode); + if(mode) + SetConsoleMode(MSVCRT_console_in, 0); + + do { + if (ReadConsoleInputW(MSVCRT_console_in, &ir, 1, &count)) + { + /* Only interested in ASCII chars */ + if (ir.EventType == KEY_EVENT && + ir.Event.KeyEvent.bKeyDown) + { + unsigned char ch1, ch2; + + if (ir.Event.KeyEvent.uChar.UnicodeChar) + { + retval = ir.Event.KeyEvent.uChar.UnicodeChar; + break; + } + + if (handle_enhanced_keys(&ir, &ch1, &ch2)) + { + retval = ch1; + __MSVCRT_console_buffer_w = ch2; + break; + } + } + } + else + break; + } while(1); + if (mode) + SetConsoleMode(MSVCRT_console_in, mode); + } + return retval; +} + +/********************************************************************* + * _getwch (MSVCRT.@) + */ +MSVCRT_wchar_t CDECL _getwch(void) +{ + MSVCRT_wchar_t ret; + + LOCK_CONSOLE; + ret = _getwch_nolock(); + UNLOCK_CONSOLE; + return ret; +} + +/********************************************************************* * _putch_nolock (MSVCR80.@) */ int CDECL _putch_nolock(int c) @@ -217,6 +307,28 @@ } /********************************************************************* + * _putwch_nolock (MSVCR80.@) + */ +MSVCRT_wchar_t CDECL _putwch_nolock(MSVCRT_wchar_t c) +{ + DWORD count; + if (WriteConsoleW(MSVCRT_console_out, &c, 1, &count, NULL) && count==1) + return c; + return MSVCRT_WEOF; +} + +/********************************************************************* + * _putwch (MSVCRT.@) + */ +MSVCRT_wchar_t CDECL _putwch(MSVCRT_wchar_t c) +{ + LOCK_CONSOLE; + c = _putwch_nolock(c); + UNLOCK_CONSOLE; + return c; +} + +/********************************************************************* * _getche_nolock (MSVCR80.@) */ int CDECL _getche_nolock(void) @@ -242,6 +354,31 @@ } /********************************************************************* + * _getwche_nolock (MSVCR80.@) + */ +MSVCRT_wchar_t CDECL _getwche_nolock(void) +{ + MSVCRT_wchar_t wch; + wch = _getch_nolock(); + if (wch == MSVCRT_WEOF) + return wch; + return _putwch_nolock(wch); +} + +/********************************************************************* + * _getwche (MSVCRT.@) + */ +MSVCRT_wchar_t CDECL _getwche(void) +{ + MSVCRT_wchar_t ret; + + LOCK_CONSOLE; + ret = _getwche_nolock(); + UNLOCK_CONSOLE; + return ret; +} + +/********************************************************************* * _cgets (MSVCRT.@) */ char* CDECL _cgets(char* str) @@ -300,6 +437,28 @@ UNLOCK_CONSOLE; return c; } + +/********************************************************************* + * _ungetwch_nolock (MSVCR80.@) + */ +MSVCRT_wchar_t CDECL _ungetwch_nolock(MSVCRT_wchar_t c) +{ + MSVCRT_wchar_t retval = MSVCRT_WEOF; + if (c != MSVCRT_WEOF && __MSVCRT_console_buffer_w == MSVCRT_WEOF) + retval = __MSVCRT_console_buffer_w = c; + return retval; +} + +/********************************************************************* + * _ungetwch (MSVCRT.@) + */ +MSVCRT_wchar_t CDECL _ungetwch(MSVCRT_wchar_t c) +{ + LOCK_CONSOLE; + c = _ungetwch_nolock(c); + UNLOCK_CONSOLE; + return c; +} /********************************************************************* * _kbhit (MSVCRT.@) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/file.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/file.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/file.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/file.c 2015-06-28 16:51:28.000000000 +0000 @@ -4631,14 +4631,6 @@ } /********************************************************************* - * _putwch (MSVCRT.@) - */ -int CDECL MSVCRT__putwch(int c) -{ - return MSVCRT_fputwc(c, MSVCRT_stdout); -} - -/********************************************************************* * puts (MSVCRT.@) */ int CDECL MSVCRT_puts(const char *s) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/locale.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/locale.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/locale.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/locale.c 2015-06-28 16:51:28.000000000 +0000 @@ -217,10 +217,17 @@ /* Internal: Find the LCID for a locale specification */ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage) { + thread_data_t *data = msvcrt_get_thread_data(); LCID lcid; locale_search_t search; const char *cp, *region; + if (!strcmp(locale, data->cached_locale)) { + if (codepage) + *codepage = data->cached_cp; + return data->cached_lcid; + } + memset(&search, 0, sizeof(locale_search_t)); cp = strchr(locale, '.'); @@ -292,6 +299,12 @@ if (codepage) *codepage = atoi(search.found_codepage); + if (strlen(locale) < sizeof(data->cached_locale)) { + strcpy(data->cached_locale, locale); + data->cached_lcid = lcid; + data->cached_cp = codepage ? *codepage : atoi(search.found_codepage); + } + return lcid; } @@ -628,6 +641,15 @@ } /********************************************************************* + * __crtGetLocaleInfoEx (MSVC110.@) + */ +int CDECL __crtGetLocaleInfoEx( const WCHAR *locale, LCTYPE type, MSVCRT_wchar_t *buffer, int len ) +{ + TRACE("(%s, %x, %p, %d)\n", debugstr_w(locale), type, buffer, len); + return GetLocaleInfoEx(locale, type, buffer, len); +} + +/********************************************************************* * btowc(MSVCRT.@) */ MSVCRT_wint_t CDECL MSVCRT_btowc(int c) @@ -684,6 +706,16 @@ } /********************************************************************* + * ___lc_locale_name_func (MSVCR110.@) + */ +#if _MSVCR_VER >= 110 +MSVCRT_wchar_t** CDECL ___lc_locale_name_func(void) +{ + return get_locinfo()->lc_name; +} +#endif + +/********************************************************************* * ___lc_codepage_func (MSVCRT.@) */ unsigned int CDECL ___lc_codepage_func(void) @@ -713,6 +745,9 @@ for(i=MSVCRT_LC_MIN+1; i<=MSVCRT_LC_MAX; i++) { MSVCRT_free(locinfo->lc_category[i].locale); MSVCRT_free(locinfo->lc_category[i].refcount); +#if _MSVCR_VER >= 110 + MSVCRT_free(locinfo->lc_name[i]); +#endif } if(locinfo->lconv) { @@ -794,6 +829,33 @@ MSVCRT_free(locale); } +#if _MSVCR_VER >= 110 +static inline BOOL set_lc_locale_name(MSVCRT__locale_t loc, int cat) +{ + LCID lcid = loc->locinfo->lc_handle[cat]; + WCHAR buf[100]; + int len; + + len = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME + |LOCALE_NOUSEROVERRIDE, buf, 100); + if(!len) return FALSE; + + if(LocaleNameToLCID(buf, 0) != lcid) + len = LCIDToLocaleName(lcid, buf, 100, 0); + + if(!len || !(loc->locinfo->lc_name[cat] = MSVCRT_malloc(len*sizeof(MSVCRT_wchar_t)))) + return FALSE; + + memcpy(loc->locinfo->lc_name[cat], buf, len*sizeof(MSVCRT_wchar_t)); + return TRUE; +} +#else +static inline BOOL set_lc_locale_name(MSVCRT__locale_t loc, int cat) +{ + return TRUE; +} +#endif + /********************************************************************* * _create_locale (MSVCRT.@) */ @@ -950,6 +1012,11 @@ } loc->locinfo->lc_collate_cp = loc->locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage; + + if(!set_lc_locale_name(loc, MSVCRT_LC_COLLATE)) { + MSVCRT__free_locale(loc); + return NULL; + } } else loc->locinfo->lc_category[MSVCRT_LC_COLLATE].locale = MSVCRT__strdup("C"); @@ -995,6 +1062,11 @@ for(i=0; cp_info.LeadByte[i+1]!=0; i+=2) for(j=cp_info.LeadByte[i]; j<=cp_info.LeadByte[i+1]; j++) loc->locinfo->ctype1[j+1] |= MSVCRT__LEADBYTE; + + if(!set_lc_locale_name(loc, MSVCRT_LC_CTYPE)) { + MSVCRT__free_locale(loc); + return NULL; + } } else { loc->locinfo->lc_clike = 1; loc->locinfo->mb_cur_max = 1; @@ -1229,6 +1301,10 @@ } #endif + if(!set_lc_locale_name(loc, MSVCRT_LC_MONETARY)) { + MSVCRT__free_locale(loc); + return NULL; + } } else { loc->locinfo->lconv->int_curr_symbol = MSVCRT_malloc(sizeof(char)); loc->locinfo->lconv->currency_symbol = MSVCRT_malloc(sizeof(char)); @@ -1358,6 +1434,10 @@ } #endif + if(!set_lc_locale_name(loc, MSVCRT_LC_NUMERIC)) { + MSVCRT__free_locale(loc); + return NULL; + } } else { loc->locinfo->lconv->decimal_point = MSVCRT_malloc(sizeof(char[2])); loc->locinfo->lconv->thousands_sep = MSVCRT_malloc(sizeof(char)); @@ -1395,6 +1475,11 @@ MSVCRT__free_locale(loc); return NULL; } + + if(!set_lc_locale_name(loc, MSVCRT_LC_TIME)) { + MSVCRT__free_locale(loc); + return NULL; + } } else loc->locinfo->lc_category[MSVCRT_LC_TIME].locale = MSVCRT__strdup("C"); @@ -1505,6 +1590,11 @@ swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].refcount, (void**)&loc->locinfo->lc_category[MSVCRT_LC_COLLATE].refcount); +#if _MSVCR_VER >= 110 + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_COLLATE], + (void**)&loc->locinfo->lc_name[MSVCRT_LC_COLLATE]); +#endif + if(category != MSVCRT_LC_ALL) break; /* fall through */ @@ -1527,6 +1617,11 @@ swap_pointers((void**)&locinfo->pclmap, (void**)&loc->locinfo->pclmap); swap_pointers((void**)&locinfo->pcumap, (void**)&loc->locinfo->pcumap); +#if _MSVCR_VER >= 110 + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_CTYPE], + (void**)&loc->locinfo->lc_name[MSVCRT_LC_CTYPE]); +#endif + if(category != MSVCRT_LC_ALL) break; /* fall through */ @@ -1577,6 +1672,11 @@ locinfo->lconv->p_sign_posn = loc->locinfo->lconv->p_sign_posn; locinfo->lconv->n_sign_posn = loc->locinfo->lconv->n_sign_posn; +#if _MSVCR_VER >= 110 + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_MONETARY], + (void**)&loc->locinfo->lc_name[MSVCRT_LC_MONETARY]); +#endif + if(category != MSVCRT_LC_ALL) break; /* fall through */ @@ -1602,6 +1702,11 @@ (void**)&loc->locinfo->lconv->_W_thousands_sep); #endif +#if _MSVCR_VER >= 110 + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_NUMERIC], + (void**)&loc->locinfo->lc_name[MSVCRT_LC_NUMERIC]); +#endif + if(category != MSVCRT_LC_ALL) break; /* fall through */ @@ -1615,6 +1720,11 @@ swap_pointers((void**)&locinfo->lc_time_curr, (void**)&loc->locinfo->lc_time_curr); +#if _MSVCR_VER >= 110 + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_TIME], + (void**)&loc->locinfo->lc_name[MSVCRT_LC_TIME]); +#endif + if(category != MSVCRT_LC_ALL) break; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/msvcrt.h wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/msvcrt.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/msvcrt.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/msvcrt.h 2015-06-28 16:51:28.000000000 +0000 @@ -159,7 +159,7 @@ MSVCRT_LC_ID lc_id[6]; struct { char *locale; - wchar_t *wlocale; + MSVCRT_wchar_t *wlocale; int *refcount; int *wrefcount; } lc_category[6]; @@ -175,6 +175,9 @@ unsigned char *pclmap; unsigned char *pcumap; MSVCRT___lc_time_data *lc_time_curr; +#if _MSVCR_VER >= 110 + MSVCRT_wchar_t *lc_name[6]; +#endif } MSVCRT_threadlocinfo; typedef struct MSVCRT_threadmbcinfostruct { @@ -234,7 +237,12 @@ void *unk6[3]; int unk7; EXCEPTION_RECORD *exc_record; - void *unk8[100]; + void *unk8[7]; + LCID cached_lcid; + int unk9[3]; + DWORD cached_cp; + char cached_locale[131]; + void *unk10[100]; }; typedef struct __thread_data thread_data_t; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/msvcrt.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/msvcrt.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt/msvcrt.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt/msvcrt.spec 2015-06-28 16:51:28.000000000 +0000 @@ -533,8 +533,8 @@ @ cdecl _getpid() _getpid @ stub _getsystime(ptr) @ cdecl _getw(ptr) MSVCRT__getw -# stub _getwch() -# stub _getwche() +@ cdecl _getwch() +@ cdecl _getwche() @ cdecl _getws(ptr) MSVCRT__getws @ cdecl -arch=i386 _global_unwind2(ptr) @ cdecl _gmtime32(ptr) MSVCRT__gmtime32 @@ -861,7 +861,7 @@ @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw -@ cdecl _putwch(long) MSVCRT__putwch +@ cdecl _putwch(long) @ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype @ cdecl _read(long ptr long) MSVCRT__read @@ -1025,7 +1025,7 @@ @ cdecl _umask(long) MSVCRT__umask # stub _umask_s(long ptr) @ cdecl _ungetch(long) -# stub _ungetwch(long) +@ cdecl _ungetwch(long) @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt20/msvcrt20.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt20/msvcrt20.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt20/msvcrt20.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt20/msvcrt20.spec 2015-06-28 16:51:28.000000000 +0000 @@ -623,8 +623,8 @@ @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEADH@Z @ stub -arch=win32 ?read@istream@@QAEAAV1@PAEH@Z @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEAEH@Z -@ stub -arch=win32 ?sbumpc@streambuf@@QAEHXZ -@ stub -arch=win64 ?sbumpc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?sbumpc@streambuf@@QAEHXZ(ptr) msvcirt.?sbumpc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?sbumpc@streambuf@@QEAAHXZ(ptr) msvcirt.?sbumpc@streambuf@@QEAAHXZ @ stub -arch=win32 ?seekg@istream@@QAEAAV1@J@Z @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekg@istream@@QAEAAV1@JW4seek_dir@ios@@@Z @@ -681,25 +681,25 @@ @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IEAAXPEAD0@Z @ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z @ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z -@ stub -arch=win32 ?sgetc@streambuf@@QAEHXZ -@ stub -arch=win64 ?sgetc@streambuf@@QEAAHXZ -@ stub -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z -@ stub -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z +@ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) msvcirt.?sgetc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QAEHPADH@Z +@ cdecl -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QEAAHPEADH@Z # @ extern ?sh_none@filebuf@@2HB # @ extern ?sh_read@filebuf@@2HB # @ extern ?sh_write@filebuf@@2HB -@ stub -arch=win32 ?snextc@streambuf@@QAEHXZ -@ stub -arch=win64 ?snextc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) msvcirt.?snextc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) msvcirt.?snextc@streambuf@@QEAAHXZ @ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z @ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z -@ stub -arch=win32 ?sputc@streambuf@@QAEHH@Z -@ stub -arch=win64 ?sputc@streambuf@@QEAAHH@Z -@ stub -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z -@ stub -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z +@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) msvcirt.?sputc@streambuf@@QAEHH@Z +@ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) msvcirt.?sputc@streambuf@@QEAAHH@Z +@ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QAEHPBDH@Z +@ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QEAAHPEBDH@Z @ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ @ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ -@ stub -arch=win32 ?stossc@streambuf@@QAEXXZ -@ stub -arch=win64 ?stossc@streambuf@@QEAAXXZ +@ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) msvcirt.?stossc@streambuf@@QAEXXZ +@ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) msvcirt.?stossc@streambuf@@QEAAXXZ @ stub -arch=win32 ?str@istrstream@@QAEPADXZ @ stub -arch=win64 ?str@istrstream@@QEAAPEADXZ @ stub -arch=win32 ?str@ostrstream@@QAEPADXZ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt40/msvcrt40.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt40/msvcrt40.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msvcrt40/msvcrt40.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msvcrt40/msvcrt40.spec 2015-06-28 16:51:28.000000000 +0000 @@ -694,8 +694,8 @@ @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEADH@Z @ stub -arch=win32 ?read@istream@@QAEAAV1@PAEH@Z @ stub -arch=win64 ?read@istream@@QEAAAEAV1@PEAEH@Z -@ stub -arch=win32 ?sbumpc@streambuf@@QAEHXZ -@ stub -arch=win64 ?sbumpc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?sbumpc@streambuf@@QAEHXZ(ptr) msvcirt.?sbumpc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?sbumpc@streambuf@@QEAAHXZ(ptr) msvcirt.?sbumpc@streambuf@@QEAAHXZ @ stub -arch=win32 ?seekg@istream@@QAEAAV1@J@Z @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekg@istream@@QAEAAV1@JW4seek_dir@ios@@@Z @@ -753,25 +753,25 @@ @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IEAAXPEAD0@Z @ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z @ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z -@ stub -arch=win32 ?sgetc@streambuf@@QAEHXZ -@ stub -arch=win64 ?sgetc@streambuf@@QEAAHXZ -@ stub -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z -@ stub -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z +@ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) msvcirt.?sgetc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QAEHPADH@Z +@ cdecl -arch=win64 ?sgetn@streambuf@@QEAAHPEADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QEAAHPEADH@Z # @ extern ?sh_none@filebuf@@2HB # @ extern ?sh_read@filebuf@@2HB # @ extern ?sh_write@filebuf@@2HB -@ stub -arch=win32 ?snextc@streambuf@@QAEHXZ -@ stub -arch=win64 ?snextc@streambuf@@QEAAHXZ +@ thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) msvcirt.?snextc@streambuf@@QAEHXZ +@ cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) msvcirt.?snextc@streambuf@@QEAAHXZ @ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z @ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z -@ stub -arch=win32 ?sputc@streambuf@@QAEHH@Z -@ stub -arch=win64 ?sputc@streambuf@@QEAAHH@Z -@ stub -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z -@ stub -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z +@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) msvcirt.?sputc@streambuf@@QAEHH@Z +@ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) msvcirt.?sputc@streambuf@@QEAAHH@Z +@ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QAEHPBDH@Z +@ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QEAAHPEBDH@Z @ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ @ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ -@ stub -arch=win32 ?stossc@streambuf@@QAEXXZ -@ stub -arch=win64 ?stossc@streambuf@@QEAAXXZ +@ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) msvcirt.?stossc@streambuf@@QAEXXZ +@ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) msvcirt.?stossc@streambuf@@QEAAXXZ @ stub -arch=win32 ?str@istrstream@@QAEPADXZ @ stub -arch=win64 ?str@istrstream@@QEAAPEADXZ @ stub -arch=win32 ?str@ostrstream@@QAEPADXZ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/msxml3/domdoc.c wine-staging-1.7.46~ubuntu14.10.1/dlls/msxml3/domdoc.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/msxml3/domdoc.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/msxml3/domdoc.c 2015-06-28 16:51:28.000000000 +0000 @@ -2140,7 +2140,13 @@ case 1: /* Only takes UTF-8 strings. * NOT NULL-terminated. */ - SafeArrayAccessData(psa, (void**)&str); + hr = SafeArrayAccessData(psa, (void**)&str); + if (FAILED(hr)) + { + This->error = hr; + WARN("failed to access array data, 0x%08x\n", hr); + break; + } SafeArrayGetUBound(psa, 1, &len); if ((xmldoc = doparse(This, str, ++len, XML_CHAR_ENCODING_UTF8))) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/cdrom.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/cdrom.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/cdrom.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/cdrom.c 2015-06-28 16:51:28.000000000 +0000 @@ -2491,6 +2491,28 @@ #endif } +static DWORD DVD_ReadStructureSize(const DVD_READ_STRUCTURE *structure, DWORD size) +{ + if (!structure || size != sizeof(DVD_READ_STRUCTURE)) + return 0; + + switch (structure->Format) + { + case DvdPhysicalDescriptor: + return sizeof(DVD_LAYER_DESCRIPTOR); + case DvdCopyrightDescriptor: + return sizeof(DVD_COPYRIGHT_DESCRIPTOR); + case DvdDiskKeyDescriptor: + return sizeof(DVD_DISK_KEY_DESCRIPTOR); + case DvdBCADescriptor: + return sizeof(DVD_BCA_DESCRIPTOR); + case DvdManufacturerDescriptor: + return sizeof(DVD_MANUFACTURER_DESCRIPTOR); + default: + return 0; + } +} + /****************************************************************** * DVD_ReadStructure * @@ -3097,7 +3119,7 @@ } break; case IOCTL_DVD_READ_STRUCTURE: - sz = sizeof(DVD_LAYER_DESCRIPTOR); + sz = DVD_ReadStructureSize(lpInBuffer, nInBufferSize); if (lpInBuffer == NULL || nInBufferSize != sizeof(DVD_READ_STRUCTURE)) status = STATUS_INVALID_PARAMETER; else if (nOutBufferSize < sz || !lpOutBuffer) status = STATUS_BUFFER_TOO_SMALL; else diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/ntdll.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/ntdll.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/ntdll.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/ntdll.spec 2015-06-28 16:51:28.000000000 +0000 @@ -474,6 +474,7 @@ # @ stub RtlConvertVariantToProperty @ stdcall RtlCopyLuid(ptr ptr) @ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr) +@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) # @ stub RtlCopyMemoryStreamTo # @ stub RtlCopyOutOfProcessMemoryStreamTo # @ stub RtlCopyRangeList diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/rtl.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/rtl.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/rtl.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/rtl.c 2015-06-28 16:51:28.000000000 +0000 @@ -534,6 +534,15 @@ } /****************************************************************************** + * RtlCopyMemory [NTDLL.@] + */ +#undef RtlCopyMemory +void WINAPI RtlCopyMemory(void *dest, const void *src, SIZE_T len) +{ + memcpy(dest, src, len); +} + +/****************************************************************************** * RtlAssert [NTDLL.@] * * Fail a debug assertion. diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/signal_arm64.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/signal_arm64.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/signal_arm64.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/signal_arm64.c 2015-06-28 16:51:28.000000000 +0000 @@ -129,7 +129,7 @@ context->Lr = LR_sig(sigcontext); /* Link register */ context->Sp = SP_sig(sigcontext); /* Stack pointer */ context->Pc = PC_sig(sigcontext); /* Program Counter */ - context->PState = PSTATE_sig(sigcontext); /* Current State Register */ + context->Cpsr = PSTATE_sig(sigcontext); /* Current State Register */ } @@ -151,7 +151,7 @@ LR_sig(sigcontext) = context->Lr; /* Link register */ SP_sig(sigcontext) = context->Sp; /* Stack pointer */ PC_sig(sigcontext) = context->Pc; /* Program Counter */ - PSTATE_sig(sigcontext) = context->PState; /* Current State Register */ + PSTATE_sig(sigcontext) = context->Cpsr; /* Current State Register */ } @@ -179,11 +179,52 @@ /*********************************************************************** * RtlCaptureContext (NTDLL.@) */ -void WINAPI RtlCaptureContext( CONTEXT *context ) -{ - FIXME( "Not implemented on ARM64\n" ); - memset( context, 0, sizeof(*context) ); -} +/* FIXME: Use the Stack instead of the actual register values? */ +__ASM_STDCALL_FUNC( RtlCaptureContext, 8, + "stp x0, x1, [sp, #-32]!\n\t" + "mov w1, #0x400000\n\t" /* CONTEXT_ARM64 */ + "add w1, w1, #0x3\n\t" /* CONTEXT_FULL */ + "str w1, [x0]\n\t" /* context->ContextFlags */ /* 32-bit, look at cpsr */ + "mrs x1, DAIF\n\t" + "str w1, [x0, #0x4]\n\t" /* context->Cpsr */ + "ldp x0, x1, [sp], #32\n\t" + "str x0, [x0, #0x8]\n\t" /* context->X0 */ + "str x1, [x0, #0x10]\n\t" /* context->X1 */ + "str x2, [x0, #0x18]\n\t" /* context->X2 */ + "str x3, [x0, #0x20]\n\t" /* context->X3 */ + "str x4, [x0, #0x28]\n\t" /* context->X4 */ + "str x5, [x0, #0x30]\n\t" /* context->X5 */ + "str x6, [x0, #0x38]\n\t" /* context->X6 */ + "str x7, [x0, #0x40]\n\t" /* context->X7 */ + "str x8, [x0, #0x48]\n\t" /* context->X8 */ + "str x9, [x0, #0x50]\n\t" /* context->X9 */ + "str x10, [x0, #0x58]\n\t" /* context->X10 */ + "str x11, [x0, #0x60]\n\t" /* context->X11 */ + "str x12, [x0, #0x68]\n\t" /* context->X12 */ + "str x13, [x0, #0x70]\n\t" /* context->X13 */ + "str x14, [x0, #0x78]\n\t" /* context->X14 */ + "str x15, [x0, #0x80]\n\t" /* context->X15 */ + "str x16, [x0, #0x88]\n\t" /* context->X16 */ + "str x17, [x0, #0x90]\n\t" /* context->X17 */ + "str x18, [x0, #0x98]\n\t" /* context->X18 */ + "str x19, [x0, #0xa0]\n\t" /* context->X19 */ + "str x20, [x0, #0xa8]\n\t" /* context->X20 */ + "str x21, [x0, #0xb0]\n\t" /* context->X21 */ + "str x22, [x0, #0xb8]\n\t" /* context->X22 */ + "str x23, [x0, #0xc0]\n\t" /* context->X23 */ + "str x24, [x0, #0xc8]\n\t" /* context->X24 */ + "str x25, [x0, #0xd0]\n\t" /* context->X25 */ + "str x26, [x0, #0xd8]\n\t" /* context->X26 */ + "str x27, [x0, #0xe0]\n\t" /* context->X27 */ + "str x28, [x0, #0xe8]\n\t" /* context->X28 */ + "str x29, [x0, #0xf0]\n\t" /* context->Fp */ + "str x30, [x0, #0xf8]\n\t" /* context->Lr */ + "mov x1, sp\n\t" + "str x1, [x0, #0x100]\n\t" /* context->Sp */ + "adr x1, 1f\n\t" + "1: str x1, [x0, #0x108]\n\t" /* context->Pc */ + "ret" + ) /*********************************************************************** * set_cpu_context @@ -209,7 +250,7 @@ to->Lr = from->Lr; to->Sp = from->Sp; to->Pc = from->Pc; - to->PState = from->PState; + to->Cpsr = from->Cpsr; } if (flags & CONTEXT_INTEGER) { @@ -241,7 +282,7 @@ to->integer.arm64_regs.x[30] = from->Lr; to->ctl.arm64_regs.sp = from->Sp; to->ctl.arm64_regs.pc = from->Pc; - to->ctl.arm64_regs.pstate = from->PState; + to->ctl.arm64_regs.pstate = from->Cpsr; } if (flags & CONTEXT_INTEGER) { @@ -274,7 +315,7 @@ to->Lr = from->integer.arm64_regs.x[30]; to->Sp = from->ctl.arm64_regs.sp; to->Pc = from->ctl.arm64_regs.pc; - to->PState = from->ctl.arm64_regs.pstate; + to->Cpsr = from->ctl.arm64_regs.pstate; } if (from->flags & SERVER_CTX_INTEGER) { @@ -758,6 +799,10 @@ pthread_key_create( &teb_key, NULL ); init_done = TRUE; } + + /* Win64/ARM applications expect the TEB pointer to be in the x18 platform register. */ + __asm__ __volatile__( "mov x18, %0" : : "r" (teb) ); + pthread_setspecific( teb_key, teb ); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/signal_arm.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/signal_arm.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/signal_arm.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/signal_arm.c 2015-06-28 16:51:28.000000000 +0000 @@ -250,9 +250,10 @@ /************************************************************************** * __chkstk (NTDLL.@) * - * Should check if we can decrement SP by the value provided in r4, but we shouldn't need that. + * Incoming r4 contains words to allocate, converting to bytes then return */ -__ASM_GLOBAL_FUNC( __chkstk, "bx lr" ) +__ASM_GLOBAL_FUNC( __chkstk, "lsl r4, r4, #2\n\t" + "bx lr" ) /*********************************************************************** * RtlCaptureContext (NTDLL.@) @@ -261,7 +262,7 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, ".arm\n\t" "stmfd SP!, {r1}\n\t" - "mov r1, #0x40\n\t" /* CONTEXT_ARM */ + "mov r1, #0x0200000\n\t"/* CONTEXT_ARM */ "add r1, r1, #0x3\n\t" /* CONTEXT_FULL */ "str r1, [r0]\n\t" /* context->ContextFlags */ "ldmfd SP!, {r1}\n\t" @@ -911,21 +912,6 @@ NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE ); } -/********************************************************************** - * set_tpidrurw - * - * Win32/ARM applications expect the TEB pointer to be in the TPIDRURW register. - */ -#ifdef __ARM_ARCH_7A__ -extern void set_tpidrurw( TEB *teb ); -__ASM_GLOBAL_FUNC( set_tpidrurw, - "mcr p15, 0, r0, c13, c0, 2\n\t" /* TEB -> TPIDRURW */ - "bx lr" ) -#else -void set_tpidrurw( TEB *teb ) -{ -} -#endif /********************************************************************** * signal_init_thread @@ -939,7 +925,12 @@ pthread_key_create( &teb_key, NULL ); init_done = TRUE; } - set_tpidrurw( teb ); + +#ifdef __ARM_ARCH_7A__ + /* Win32/ARM applications expect the TEB pointer to be in the TPIDRURW register. */ + __asm__ __volatile__( "mcr p15, 0, %0, c13, c0, 2" : : "r" (teb) ); +#endif + pthread_setspecific( teb_key, teb ); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/tests/generated.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/tests/generated.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/tests/generated.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/tests/generated.c 2015-06-28 16:51:28.000000000 +0000 @@ -839,68 +839,142 @@ static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void) { /* IMAGE_LOAD_CONFIG_DIRECTORY */ - TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 88) + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 112) TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, 8) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Size, 0) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 8) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 10) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 12) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 16) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 20) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 24) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 28) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 8) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 8) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 32) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 40) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 44) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 48) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 52) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 56) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 58) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 8) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 8) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 64) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 72) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 76) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 80) +} + +static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(void) +{ + /* IMAGE_LOAD_CONFIG_DIRECTORY32 */ + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, 88) + TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 0) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 16) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 32) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 40) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 44) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 48) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 52) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 56) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 58) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 64) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 72) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 76) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 80) +} + +static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(void) +{ + /* IMAGE_LOAD_CONFIG_DIRECTORY64 */ + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, 112) + TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 0) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 16) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 40) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 64) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 76) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 78) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 80) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 88) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 96) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 104) } static void test_pack_IMAGE_NT_HEADERS(void) @@ -2105,8 +2179,6 @@ /* PIMAGE_LOAD_CONFIG_DIRECTORY */ TEST_TYPE_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 8) TEST_TYPE_ALIGN (PIMAGE_LOAD_CONFIG_DIRECTORY, 8) - TEST_TARGET_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 88) - TEST_TARGET_ALIGN(PIMAGE_LOAD_CONFIG_DIRECTORY, 8) } static void test_pack_PIMAGE_NT_HEADERS(void) @@ -4186,66 +4258,140 @@ /* IMAGE_LOAD_CONFIG_DIRECTORY */ TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 72) TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, 4) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Size, 0) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 8) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 10) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 12) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 16) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 20) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 24) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 28) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 32) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 36) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 40) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 44) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 48) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 52) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 54) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 56) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 60) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 64) - TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) - TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) - TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 68) +} + +static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(void) +{ + /* IMAGE_LOAD_CONFIG_DIRECTORY32 */ + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, 72) + TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 0) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 16) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 32) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 36) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 40) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 44) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 48) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 52) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 54) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 56) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 60) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 64) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 68) +} + +static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(void) +{ + /* IMAGE_LOAD_CONFIG_DIRECTORY64 */ + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, 112) + TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 0) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 16) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 40) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 64) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 76) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 78) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 80) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 88) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 96) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 104) } static void test_pack_IMAGE_NT_HEADERS(void) @@ -5450,8 +5596,6 @@ /* PIMAGE_LOAD_CONFIG_DIRECTORY */ TEST_TYPE_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 4) TEST_TYPE_ALIGN (PIMAGE_LOAD_CONFIG_DIRECTORY, 4) - TEST_TARGET_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 72) - TEST_TARGET_ALIGN(PIMAGE_LOAD_CONFIG_DIRECTORY, 4) } static void test_pack_PIMAGE_NT_HEADERS(void) @@ -6822,6 +6966,8 @@ test_pack_IMAGE_IMPORT_DESCRIPTOR(); test_pack_IMAGE_LINENUMBER(); test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(); + test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(); + test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(); test_pack_IMAGE_NT_HEADERS(); test_pack_IMAGE_NT_HEADERS32(); test_pack_IMAGE_NT_HEADERS64(); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/virtual.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/virtual.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntdll/virtual.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntdll/virtual.c 2015-06-28 16:51:28.000000000 +0000 @@ -2601,6 +2601,17 @@ /* Check parameters */ + if (*addr_ptr && zero_bits) + return STATUS_INVALID_PARAMETER_4; + +#ifndef _WIN64 + if (!is_wow64 && (alloc_type & AT_ROUND_TO_PAGE)) + { + *addr_ptr = ROUND_ADDR( *addr_ptr, page_mask ); + mask = page_mask; + } +#endif + if ((offset.u.LowPart & mask) || (*addr_ptr && ((UINT_PTR)*addr_ptr & mask))) return STATUS_MAPPED_ALIGNMENT; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntoskrnl.exe/instr.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntoskrnl.exe/instr.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntoskrnl.exe/instr.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntoskrnl.exe/instr.c 2015-06-28 16:51:28.000000000 +0000 @@ -4,6 +4,7 @@ * Copyright 1995 Alexandre Julliard * Copyright 2005 Ivan Leo Puoti * Copyright 2005 Laurent Pinchart + * Copyright 2014-2015 Sebastian Lackner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,17 +24,19 @@ #include "config.h" #include "wine/port.h" -#ifdef __i386__ - #include #include "windef.h" #include "winbase.h" #include "winternl.h" +#define WIN32_NO_STATUS +#include "ddk/wdm.h" #include "excpt.h" #include "wine/debug.h" #include "wine/exception.h" +#ifdef __i386__ + WINE_DEFAULT_DEBUG_CHANNEL(int); #include "pshpack1.h" @@ -475,4 +478,299 @@ return EXCEPTION_CONTINUE_SEARCH; } -#endif /* __i386__ */ +#elif defined(__x86_64__) /* __i386__ */ + +WINE_DEFAULT_DEBUG_CHANNEL(int); + +#define REX_B 1 +#define REX_X 2 +#define REX_R 4 +#define REX_W 8 + +#define REGMODRM_MOD( regmodrm, rex ) ((regmodrm) >> 6) +#define REGMODRM_REG( regmodrm, rex ) (((regmodrm) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0) +#define REGMODRM_RM( regmodrm, rex ) (((regmodrm) & 7) | (((rex) & REX_B) ? 8 : 0)) + +#define SIB_SS( sib, rex ) ((sib) >> 6) +#define SIB_INDEX( sib, rex ) (((sib) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0) +#define SIB_BASE( sib, rex ) (((sib) & 7) | (((rex) & REX_B) ? 8 : 0)) + +/* keep in sync with dlls/ntdll/thread.c:thread_init */ +static const BYTE *wine_user_shared_data = (BYTE *)0x7ffe0000; +static const BYTE *user_shared_data = (BYTE *)0xfffff78000000000; + +static inline DWORD64 *get_int_reg( CONTEXT *context, int index ) +{ + return &context->Rax + index; /* index should be in range 0 .. 15 */ +} + +static inline int get_op_size( int long_op, int rex ) +{ + if (rex & REX_W) + return sizeof(DWORD64); + else if (long_op) + return sizeof(DWORD); + else + return sizeof(WORD); +} + +/* store an operand into a register */ +static void store_reg_word( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int long_op, int rex ) +{ + int index = REGMODRM_REG( regmodrm, rex ); + BYTE *reg = (BYTE *)get_int_reg( context, index ); + memcpy( reg, addr, get_op_size( long_op, rex ) ); +} + +/* store an operand into a byte register */ +static void store_reg_byte( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int rex ) +{ + int index = REGMODRM_REG( regmodrm, rex ); + BYTE *reg = (BYTE *)get_int_reg( context, index ); + if (!rex && index >= 4 && index < 8) reg -= (4 * sizeof(DWORD64) - 1); /* special case: ah, ch, dh, bh */ + *reg = *addr; +} + +/*********************************************************************** + * INSTR_GetOperandAddr + * + * Return the address of an instruction operand (from the mod/rm byte). + */ +static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr, + int long_addr, int rex, int segprefix, int *len ) +{ + int mod, rm, ss = 0, off, have_sib = 0; + DWORD64 base = 0, index = 0; + +#define GET_VAL( val, type ) \ + { *val = *(type *)instr; instr += sizeof(type); *len += sizeof(type); } + + *len = 0; + GET_VAL( &mod, BYTE ); + rm = REGMODRM_RM( mod, rex ); + mod = REGMODRM_MOD( mod, rex ); + + if (mod == 3) + return (BYTE *)get_int_reg( context, rm ); + + if ((rm & 7) == 4) + { + BYTE sib; + int id; + + GET_VAL( &sib, BYTE ); + rm = SIB_BASE( sib, rex ); + id = SIB_INDEX( sib, rex ); + ss = SIB_SS( sib, rex ); + + index = (id != 4) ? *get_int_reg( context, id ) : 0; + if (!long_addr) index &= 0xffffffff; + have_sib = 1; + } + + base = *get_int_reg( context, rm ); + if (!long_addr) base &= 0xffffffff; + + switch (mod) + { + case 0: + if (rm == 5) /* special case */ + { + base = have_sib ? 0 : context->Rip; + if (!long_addr) base &= 0xffffffff; + GET_VAL( &off, DWORD ); + base += (signed long)off; + } + break; + + case 1: /* 8-bit disp */ + GET_VAL( &off, BYTE ); + base += (signed char)off; + break; + + case 2: /* 32-bit disp */ + GET_VAL( &off, DWORD ); + base += (signed long)off; + break; + } + + /* FIXME: we assume that all segments have a base of 0 */ + return (BYTE *)(base + (index << ss)); +#undef GET_VAL +} + + +/*********************************************************************** + * emulate_instruction + * + * Emulate a privileged instruction. + * Returns exception continuation status. + */ +static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) +{ + int prefix, segprefix, prefixlen, len, long_op, long_addr, rex; + BYTE *instr; + + long_op = long_addr = 1; + instr = (BYTE *)context->Rip; + if (!instr) return ExceptionContinueSearch; + + /* First handle any possible prefix */ + + segprefix = -1; /* no seg prefix */ + rex = 0; /* no rex prefix */ + prefix = 1; + prefixlen = 0; + while(prefix) + { + switch(*instr) + { + case 0x2e: + segprefix = context->SegCs; + break; + case 0x36: + segprefix = context->SegSs; + break; + case 0x3e: + segprefix = context->SegDs; + break; + case 0x26: + segprefix = context->SegEs; + break; + case 0x64: + segprefix = context->SegFs; + break; + case 0x65: + segprefix = context->SegGs; + break; + case 0x66: + long_op = !long_op; /* opcode size prefix */ + break; + case 0x67: + long_addr = !long_addr; /* addr size prefix */ + break; + case 0xf0: /* lock */ + break; + case 0xf2: /* repne */ + break; + case 0xf3: /* repe */ + break; + default: + prefix = 0; /* no more prefixes */ + break; + } + if (*instr >= 0x40 && *instr < 0x50) /* rex */ + { + rex = *instr; + prefix = TRUE; + } + if (prefix) + { + instr++; + prefixlen++; + } + } + + /* Now look at the actual instruction */ + + switch(*instr) + { + case 0x0f: /* extended instruction */ + switch(instr[1]) + { + case 0xb6: /* movzx Eb, Gv */ + case 0xb7: /* movzx Ew, Gv */ + { + BYTE *data = INSTR_GetOperandAddr( context, instr + 2, long_addr, + rex, segprefix, &len ); + unsigned int data_size = (instr[1] == 0xb7) ? 2 : 1; + SIZE_T offset = data - user_shared_data; + + if (offset <= sizeof(KSHARED_USER_DATA) - data_size) + { + ULONGLONG temp = 0; + memcpy( &temp, wine_user_shared_data + offset, data_size ); + store_reg_word( context, instr[2], (BYTE *)&temp, long_op, rex ); + context->Rip += prefixlen + len + 2; + return ExceptionContinueExecution; + } + break; /* Unable to emulate it */ + } + } + break; /* Unable to emulate it */ + + case 0x8a: /* mov Eb, Gb */ + case 0x8b: /* mov Ev, Gv */ + { + BYTE *data = INSTR_GetOperandAddr( context, instr + 1, long_addr, + rex, segprefix, &len ); + unsigned int data_size = (*instr == 0x8b) ? get_op_size( long_op, rex ) : 1; + SIZE_T offset = data - user_shared_data; + + if (offset <= sizeof(KSHARED_USER_DATA) - data_size) + { + switch (*instr) + { + case 0x8a: store_reg_byte( context, instr[1], wine_user_shared_data + offset, rex ); break; + case 0x8b: store_reg_word( context, instr[1], wine_user_shared_data + offset, long_op, rex ); break; + } + context->Rip += prefixlen + len + 1; + return ExceptionContinueExecution; + } + break; /* Unable to emulate it */ + } + + case 0xa0: /* mov Ob, AL */ + case 0xa1: /* mov Ovqp, rAX */ + { + BYTE *data = (BYTE *)(long_addr ? *(DWORD64 *)(instr + 1) : *(DWORD *)(instr + 1)); + unsigned int data_size = (*instr == 0xa1) ? get_op_size( long_op, rex ) : 1; + SIZE_T offset = data - user_shared_data; + len = long_addr ? sizeof(DWORD64) : sizeof(DWORD); + + if (offset <= sizeof(KSHARED_USER_DATA) - data_size) + { + memcpy( &context->Rax, wine_user_shared_data + offset, data_size ); + context->Rip += prefixlen + len + 1; + return ExceptionContinueExecution; + } + break; /* Unable to emulate it */ + } + } + return ExceptionContinueSearch; /* Unable to emulate it */ +} + + +/*********************************************************************** + * vectored_handler + * + * Vectored exception handler used to emulate protected instructions + * from 64-bit code. + */ +LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) +{ + EXCEPTION_RECORD *record = ptrs->ExceptionRecord; + CONTEXT *context = ptrs->ContextRecord; + + if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && + record->ExceptionInformation[0] == EXCEPTION_READ_FAULT) + { + if (emulate_instruction( record, context ) == ExceptionContinueExecution) + { + TRACE( "next instruction rip=%lx\n", context->Rip ); + TRACE( " rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", + context->Rax, context->Rbx, context->Rcx, context->Rdx ); + TRACE( " rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", + context->Rsi, context->Rdi, context->Rbp, context->Rsp ); + TRACE( " r8=%016lx r9=%016lx r10=%016lx r11=%016lx\n", + context->R8, context->R9, context->R10, context->R11 ); + TRACE( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", + context->R12, context->R13, context->R14, context->R15 ); + + return EXCEPTION_CONTINUE_EXECUTION; + } + } + return EXCEPTION_CONTINUE_SEARCH; +} + +#endif /* __x86_64__ */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ntoskrnl.exe/ntoskrnl.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ntoskrnl.exe/ntoskrnl.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ntoskrnl.exe/ntoskrnl.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ntoskrnl.exe/ntoskrnl.c 2015-06-28 16:51:28.000000000 +0000 @@ -2069,7 +2069,7 @@ { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( inst ); -#ifdef __i386__ +#if defined(__i386__) || defined(__x86_64__) handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); #endif KeQueryTickCount( &count ); /* initialize the global KeTickCount */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/ole32.spec wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/ole32.spec --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/ole32.spec 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/ole32.spec 2015-06-28 16:51:28.000000000 +0000 @@ -124,10 +124,10 @@ @ stdcall HBITMAP_UserMarshal(ptr ptr ptr) @ stdcall HBITMAP_UserSize(ptr long ptr) @ stdcall HBITMAP_UserUnmarshal(ptr ptr ptr) -@ stub HBRUSH_UserFree -@ stub HBRUSH_UserMarshal -@ stub HBRUSH_UserSize -@ stub HBRUSH_UserUnmarshal +@ stdcall HBRUSH_UserFree(ptr ptr) +@ stdcall HBRUSH_UserMarshal(ptr ptr ptr) +@ stdcall HBRUSH_UserSize(ptr long ptr) +@ stdcall HBRUSH_UserUnmarshal(ptr ptr ptr) @ stdcall HDC_UserFree(ptr ptr) @ stdcall HDC_UserMarshal(ptr ptr ptr) @ stdcall HDC_UserSize(ptr long ptr) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/tests/usrmarshal.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/tests/usrmarshal.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/tests/usrmarshal.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/tests/usrmarshal.c 2015-06-28 16:51:28.000000000 +0000 @@ -44,6 +44,11 @@ unsigned char * __RPC_USER HMETAFILEPICT_UserUnmarshal(ULONG *, unsigned char *, HMETAFILEPICT *); void __RPC_USER HMETAFILEPICT_UserFree(ULONG *, HMETAFILEPICT *); +ULONG __RPC_USER HBRUSH_UserSize(ULONG *, ULONG, HBRUSH *); +unsigned char * __RPC_USER HBRUSH_UserMarshal(ULONG *, unsigned char *, HBRUSH *); +unsigned char * __RPC_USER HBRUSH_UserUnmarshal(ULONG *, unsigned char *, HBRUSH *); +void __RPC_USER HBRUSH_UserFree(ULONG *, HBRUSH *); + static BOOL g_expect_user_alloc; static void * WINAPI user_allocate(SIZE_T size) { @@ -864,6 +869,113 @@ g_expect_user_free = TRUE; SNB_UserFree(&umcb.Flags, &snb2); g_expect_user_free = FALSE; + + HeapFree(GetProcessHeap(), 0, src); +} + +static void test_marshal_HDC(void) +{ + MIDL_STUB_MESSAGE stub_msg; + HDC hdc = GetDC(0), hdc2; + USER_MARSHAL_CB umcb; + RPC_MESSAGE rpc_msg; + unsigned char *buffer; + wireHDC wirehdc; + ULONG size; + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + size = HDC_UserSize(&umcb.Flags, 0, &hdc); + ok(size == sizeof(*wirehdc), "Wrong size %d\n", size); + + buffer = HeapAlloc(GetProcessHeap(), 0, size); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HDC_UserMarshal(&umcb.Flags, buffer, &hdc); + wirehdc = (wireHDC)buffer; + ok(wirehdc->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehdc->fContext); + ok(wirehdc->u.hInproc == (LONG_PTR)hdc, "Marshaled value should be %p instead of %x\n", hdc, wirehdc->u.hRemote); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HDC_UserUnmarshal(&umcb.Flags, buffer, &hdc2); + ok(hdc == hdc2, "Didn't unmarshal properly\n"); + HeapFree(GetProcessHeap(), 0, buffer); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + HDC_UserFree(&umcb.Flags, &hdc2); + ReleaseDC(0, hdc); +} + +static void test_marshal_HICON(void) +{ + static const BYTE bmp_bits[1024]; + MIDL_STUB_MESSAGE stub_msg; + HICON hIcon, hIcon2; + USER_MARSHAL_CB umcb; + RPC_MESSAGE rpc_msg; + unsigned char *buffer; + wireHICON wirehicon; + ULONG size; + + hIcon = CreateIcon(0, 16, 16, 1, 1, bmp_bits, bmp_bits); + ok(hIcon != 0, "CreateIcon failed\n"); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + size = HICON_UserSize(&umcb.Flags, 0, &hIcon); + ok(size == sizeof(*wirehicon), "Wrong size %d\n", size); + + buffer = HeapAlloc(GetProcessHeap(), 0, size); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HICON_UserMarshal(&umcb.Flags, buffer, &hIcon); + wirehicon = (wireHICON)buffer; + ok(wirehicon->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehicon->fContext); + ok(wirehicon->u.hInproc == (LONG_PTR)hIcon, "Marshaled value should be %p instead of %x\n", hIcon, wirehicon->u.hRemote); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HICON_UserUnmarshal(&umcb.Flags, buffer, &hIcon2); + ok(hIcon == hIcon2, "Didn't unmarshal properly\n"); + HeapFree(GetProcessHeap(), 0, buffer); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + HICON_UserFree(&umcb.Flags, &hIcon2); + DestroyIcon(hIcon); +} + +static void test_marshal_HBRUSH(void) +{ + MIDL_STUB_MESSAGE stub_msg; + HBRUSH hBrush, hBrush2; + USER_MARSHAL_CB umcb; + RPC_MESSAGE rpc_msg; + unsigned char *buffer; + LOGBRUSH logbrush; + wireHBRUSH wirehbrush; + ULONG size; + + logbrush.lbStyle = BS_SOLID; + logbrush.lbColor = RGB(0, 0, 0); + logbrush.lbHatch = 0; + + hBrush = CreateBrushIndirect(&logbrush); + ok(hBrush != 0, "CreateBrushIndirect failed\n"); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + size = HBRUSH_UserSize(&umcb.Flags, 0, &hBrush); + ok(size == sizeof(*wirehbrush), "Wrong size %d\n", size); + + buffer = HeapAlloc(GetProcessHeap(), 0, size); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HBRUSH_UserMarshal(&umcb.Flags, buffer, &hBrush); + wirehbrush = (wireHBRUSH)buffer; + ok(wirehbrush->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehbrush->fContext); + ok(wirehbrush->u.hInproc == (LONG_PTR)hBrush, "Marshaled value should be %p instead of %x\n", hBrush, wirehbrush->u.hRemote); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL); + HBRUSH_UserUnmarshal(&umcb.Flags, buffer, &hBrush2); + ok(hBrush == hBrush2, "Didn't unmarshal properly\n"); + HeapFree(GetProcessHeap(), 0, buffer); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL); + HBRUSH_UserFree(&umcb.Flags, &hBrush2); + DeleteObject(hBrush); } START_TEST(usrmarshal) @@ -879,6 +991,9 @@ test_marshal_WdtpInterfacePointer(); test_marshal_STGMEDIUM(); test_marshal_SNB(); + test_marshal_HDC(); + test_marshal_HICON(); + test_marshal_HBRUSH(); CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/usrmarshal.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/usrmarshal.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ole32/usrmarshal.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ole32/usrmarshal.c 2015-06-28 16:51:28.000000000 +0000 @@ -308,7 +308,7 @@ return pBuffer + sizeof(RemotableHandle); } -static void handle_UserFree(ULONG *pFlags, HANDLE *phMenu) +static void handle_UserFree(ULONG *pFlags, HANDLE *handle) { /* nothing to do */ } @@ -341,6 +341,9 @@ IMPL_WIREM_HANDLE(HACCEL) IMPL_WIREM_HANDLE(HMENU) IMPL_WIREM_HANDLE(HWND) +IMPL_WIREM_HANDLE(HDC) +IMPL_WIREM_HANDLE(HICON) +IMPL_WIREM_HANDLE(HBRUSH) /****************************************************************************** * HGLOBAL_UserSize [OLE32.@] @@ -659,204 +662,6 @@ { FIXME(":stub\n"); } - -/****************************************************************************** - * HICON_UserSize [OLE32.@] - * - * Calculates the buffer size required to marshal an icon. - * - * PARAMS - * pFlags [I] Flags. See notes. - * StartingSize [I] Starting size of the buffer. This value is added on to - * the buffer size required for the icon. - * phIcon [I] Icon to size. - * - * RETURNS - * The buffer size required to marshal an icon plus the starting size. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is a ULONG. - * This function is only intended to be called by the RPC runtime. - */ -ULONG __RPC_USER HICON_UserSize(ULONG *pFlags, ULONG StartingSize, HICON *phIcon) -{ - FIXME(":stub\n"); - return StartingSize; -} - -/****************************************************************************** -* HICON_UserMarshal [OLE32.@] -* -* Marshals an icon into a buffer. -* -* PARAMS -* pFlags [I] Flags. See notes. -* pBuffer [I] Buffer to marshal the icon into. -* phIcon [I] Icon to marshal. -* -* RETURNS -* The end of the marshaled data in the buffer. -* -* NOTES -* Even though the function is documented to take a pointer to a ULONG in -* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which -* the first parameter is a ULONG. -* This function is only intended to be called by the RPC runtime. -*/ -unsigned char * __RPC_USER HICON_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HICON *phIcon) -{ - FIXME(":stub\n"); - return pBuffer; -} - -/****************************************************************************** - * HICON_UserUnmarshal [OLE32.@] - * - * Unmarshals an icon from a buffer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * pBuffer [I] Buffer to marshal the icon from. - * phIcon [O] Address that receive the unmarshaled icon. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to an ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is an ULONG. - * This function is only intended to be called by the RPC runtime. - */ -unsigned char * __RPC_USER HICON_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HICON *phIcon) -{ - FIXME(":stub\n"); - return pBuffer; -} - -/****************************************************************************** - * HICON_UserFree [OLE32.@] - * - * Frees an unmarshaled icon. - * - * PARAMS - * pFlags [I] Flags. See notes. - * phIcon [I] Icon to free. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of - * which the first parameter is a ULONG. - * This function is only intended to be called by the RPC runtime. - */ -void __RPC_USER HICON_UserFree(ULONG *pFlags, HICON *phIcon) -{ - FIXME(":stub\n"); -} - -/****************************************************************************** - * HDC_UserSize [OLE32.@] - * - * Calculates the buffer size required to marshal an HDC. - * - * PARAMS - * pFlags [I] Flags. See notes. - * StartingSize [I] Starting size of the buffer. This value is added on to - * the buffer size required for the clip format. - * phGlobal [I] HDC to size. - * - * RETURNS - * The buffer size required to marshal an HDC plus the starting size. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is a ULONG. - * This function is only intended to be called by the RPC runtime. - */ -ULONG __RPC_USER HDC_UserSize(ULONG *pFlags, ULONG StartingSize, HDC *phdc) -{ - FIXME(":stub\n"); - return StartingSize; -} - -/****************************************************************************** - * HDC_UserMarshal [OLE32.@] - * - * Marshals an HDC into a buffer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * pBuffer [I] Buffer to marshal the clip format into. - * phdc [I] HDC to marshal. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is a ULONG. - * This function is only intended to be called by the RPC runtime. - */ -unsigned char * __RPC_USER HDC_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc) -{ - FIXME(":stub\n"); - return pBuffer; -} - -/****************************************************************************** - * HDC_UserUnmarshal [OLE32.@] - * - * Unmarshals an HDC from a buffer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * pBuffer [I] Buffer to marshal the clip format from. - * phdc [O] Address that receive the unmarshaled HDC. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to an ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is an ULONG. - * This function is only intended to be called by the RPC runtime. - */ -unsigned char * __RPC_USER HDC_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc) -{ - FIXME(":stub\n"); - return pBuffer; -} - -/****************************************************************************** - * HDC_UserFree [OLE32.@] - * - * Frees an unmarshaled HDC. - * - * PARAMS - * pFlags [I] Flags. See notes. - * phdc [I] HDC to free. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of - * which the first parameter is a ULONG. - * This function is only intended to be called by the RPC runtime. - */ -void __RPC_USER HDC_UserFree(ULONG *pFlags, HDC *phdc) -{ - FIXME(":stub\n"); -} /****************************************************************************** * HPALETTE_UserSize [OLE32.@] diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/safearray.c wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/safearray.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/safearray.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/safearray.c 2015-06-28 16:51:28.000000000 +0000 @@ -456,11 +456,15 @@ bound.lLbound = 0; SafeArrayRedim(a, &bound); SafeArrayPtrOfIndex(a, indices, (void **)&ptr1); - ok(*(WORD *)ptr1 == 0, "Expanded area not zero-initialized\n"); + ok(*(WORD *)ptr1 == 0 || + broken(*(WORD *)ptr1 != 0), /* Win 2003 */ + "Expanded area not zero-initialized\n"); indices[1] = 1; SafeArrayPtrOfIndex(a, indices, (void **)&ptr1); - ok(*(WORD *)ptr1 == 0x55aa, "Data not preserved when resizing array\n"); + ok(*(WORD *)ptr1 == 0x55aa || + broken(*(WORD *)ptr1 != 0x55aa), /* Win 2003 */ + "Data not preserved when resizing array\n"); hres = SafeArrayDestroy(a); ok(hres == S_OK,"SAD failed with hres %x\n", hres); @@ -705,7 +709,7 @@ return; for (i=0;ifFeatures == vttypes[i].expflags,"SAADE(%d) resulted with flags %x, expected %x\n", vttypes[i].vt, a->fFeatures, vttypes[i].expflags); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/typelib.c wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/typelib.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/typelib.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/typelib.c 2015-06-28 16:51:28.000000000 +0000 @@ -5500,6 +5500,7 @@ hr = IPSFactoryBuffer_CreateStub(factory, &interfaceguid, &uk, &base_stub); ok(hr == S_OK, "got: %x, side: %04x\n", hr, side); + IRpcStubBuffer_Release(base_stub); IPSFactoryBuffer_Release(factory); next: diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/usrmarshal.c wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/usrmarshal.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/oleaut32/tests/usrmarshal.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/oleaut32/tests/usrmarshal.c 2015-06-28 16:51:28.000000000 +0000 @@ -190,11 +190,13 @@ static void * WINAPI user_allocate(SIZE_T size) { + ok(0, "unexpected user_allocate call\n"); return CoTaskMemAlloc(size); } static void WINAPI user_free(void *p) { + ok(0, "unexpected user_free call\n"); CoTaskMemFree(p); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/oledb32/datainit.c wine-staging-1.7.46~ubuntu14.10.1/dlls/oledb32/datainit.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/oledb32/datainit.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/oledb32/datainit.c 2015-06-28 16:51:28.000000000 +0000 @@ -520,6 +520,8 @@ if (FAILED(hr)) { ERR("failed to init property %s value as type %d\n", debugstr_w(pair->name), descr->type); + free_dbpropset(1, *propset); + *propset = NULL; return hr; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qcap/vfwcapture.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qcap/vfwcapture.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qcap/vfwcapture.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qcap/vfwcapture.c 2015-06-28 16:51:28.000000000 +0000 @@ -68,6 +68,16 @@ IPin * pOutputPin; } VfwCapture; +static inline VfwCapture *impl_from_BaseFilter(BaseFilter *iface) +{ + return CONTAINING_RECORD(iface, VfwCapture, filter); +} + +static inline VfwCapture *impl_from_IBaseFilter(IBaseFilter *iface) +{ + return CONTAINING_RECORD(iface, VfwCapture, filter.IBaseFilter_iface); +} + static inline VfwCapture *impl_from_IAMStreamConfig(IAMStreamConfig *iface) { return CONTAINING_RECORD(iface, VfwCapture, IAMStreamConfig_iface); @@ -94,7 +104,7 @@ static IPin* WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_BaseFilter(iface); if (pos >= 1 || pos < 0) return NULL; @@ -148,12 +158,12 @@ ObjectRefCount(TRUE); *phr = S_OK; - return (IUnknown *)pVfwCapture; + return (IUnknown *)&pVfwCapture->filter.IBaseFilter_iface; } static HRESULT WINAPI VfwCapture_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_IBaseFilter(iface); TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); *ppv = NULL; @@ -162,7 +172,7 @@ IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter)) { - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; } else if (IsEqualIID(riid, &IID_IAMStreamConfig)) *ppv = &This->IAMStreamConfig_iface; @@ -200,7 +210,7 @@ static ULONG WINAPI VfwCapture_Release(IBaseFilter * iface) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_IBaseFilter(iface); ULONG refCount = InterlockedDecrement(&This->filter.refCount); TRACE("%p->() New refcount: %d\n", This, refCount); @@ -234,7 +244,7 @@ static HRESULT WINAPI VfwCapture_Stop(IBaseFilter * iface) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_IBaseFilter(iface); TRACE("()\n"); return qcap_driver_stop(This->driver_info, &This->filter.state); @@ -242,7 +252,7 @@ static HRESULT WINAPI VfwCapture_Pause(IBaseFilter * iface) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_IBaseFilter(iface); TRACE("()\n"); return qcap_driver_pause(This->driver_info, &This->filter.state); @@ -250,7 +260,7 @@ static HRESULT WINAPI VfwCapture_Run(IBaseFilter * iface, REFERENCE_TIME tStart) { - VfwCapture *This = (VfwCapture *)iface; + VfwCapture *This = impl_from_IBaseFilter(iface); TRACE("(%x%08x)\n", (ULONG)(tStart >> 32), (ULONG)tStart); return qcap_driver_run(This->driver_info, &This->filter.state); } @@ -306,7 +316,7 @@ VfwCapture *This = impl_from_IAMStreamConfig(iface); TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_AddRef((IUnknown *)This); + return IUnknown_AddRef(&This->filter.IBaseFilter_iface); } static ULONG WINAPI AMStreamConfig_Release( IAMStreamConfig * iface ) @@ -314,7 +324,7 @@ VfwCapture *This = impl_from_IAMStreamConfig(iface); TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_Release((IUnknown *)This); + return IUnknown_Release(&This->filter.IBaseFilter_iface); } static HRESULT WINAPI @@ -417,14 +427,14 @@ { VfwCapture *This = impl_from_IAMVideoProcAmp(iface); - return IUnknown_AddRef((IUnknown *)This); + return IUnknown_AddRef(&This->filter.IBaseFilter_iface); } static ULONG WINAPI AMVideoProcAmp_Release(IAMVideoProcAmp * iface) { VfwCapture *This = impl_from_IAMVideoProcAmp(iface); - return IUnknown_Release((IUnknown *)This); + return IUnknown_Release(&This->filter.IBaseFilter_iface); } static HRESULT WINAPI @@ -494,7 +504,7 @@ TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_AddRef((IUnknown *)This); + return IUnknown_AddRef(&This->filter.IBaseFilter_iface); } static ULONG WINAPI PPB_Release(IPersistPropertyBag * iface) @@ -503,7 +513,7 @@ TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_Release((IUnknown *)This); + return IUnknown_Release(&This->filter.IBaseFilter_iface); } static HRESULT WINAPI diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/file.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/file.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/file.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/file.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,9 +24,8 @@ #include "winbase.h" #include "winuser.h" #include "winreg.h" -#include "wininet.h" +#include "winhttp.h" #define COBJMACROS -#include "urlmon.h" #include "qmgr.h" #include "wine/debug.h" @@ -123,9 +122,7 @@ TRACE("(%p)->(%p)\n", file, pVal); EnterCriticalSection(&file->owner->cs); - pVal->BytesTotal = file->fileProgress.BytesTotal; - pVal->BytesTransferred = file->fileProgress.BytesTransferred; - pVal->Completed = file->fileProgress.Completed; + *pVal = file->fileProgress; LeaveCriticalSection(&file->owner->cs); return S_OK; @@ -167,7 +164,6 @@ BackgroundCopyFileImpl **file) { BackgroundCopyFileImpl *This; - int n; TRACE("(%s, %s, %p)\n", debugstr_w(remoteName), debugstr_w(localName), file); @@ -175,24 +171,20 @@ if (!This) return E_OUTOFMEMORY; - n = (lstrlenW(remoteName) + 1) * sizeof(WCHAR); - This->info.RemoteName = HeapAlloc(GetProcessHeap(), 0, n); + This->info.RemoteName = strdupW(remoteName); if (!This->info.RemoteName) { HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->info.RemoteName, remoteName, n); - n = (lstrlenW(localName) + 1) * sizeof(WCHAR); - This->info.LocalName = HeapAlloc(GetProcessHeap(), 0, n); + This->info.LocalName = strdupW(localName); if (!This->info.LocalName) { HeapFree(GetProcessHeap(), 0, This->info.RemoteName); HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->info.LocalName, localName, n); This->IBackgroundCopyFile2_iface.lpVtbl = &BackgroundCopyFile2Vtbl; This->ref = 1; @@ -201,309 +193,292 @@ This->fileProgress.BytesTransferred = 0; This->fileProgress.Completed = FALSE; This->owner = owner; + This->read_size = 0; + This->tempFileName[0] = 0; IBackgroundCopyJob3_AddRef(&owner->IBackgroundCopyJob3_iface); *file = This; return S_OK; } -static DWORD CALLBACK copyProgressCallback(LARGE_INTEGER totalSize, - LARGE_INTEGER totalTransferred, - LARGE_INTEGER streamSize, - LARGE_INTEGER streamTransferred, - DWORD streamNum, - DWORD reason, - HANDLE srcFile, - HANDLE dstFile, - LPVOID obj) +static HRESULT error_from_http_response(DWORD code) { - BackgroundCopyFileImpl *file = obj; - BackgroundCopyJobImpl *job = file->owner; - ULONG64 diff; - - EnterCriticalSection(&job->cs); - diff = (file->fileProgress.BytesTotal == BG_SIZE_UNKNOWN - ? totalTransferred.QuadPart - : totalTransferred.QuadPart - file->fileProgress.BytesTransferred); - file->fileProgress.BytesTotal = totalSize.QuadPart; - file->fileProgress.BytesTransferred = totalTransferred.QuadPart; - job->jobProgress.BytesTransferred += diff; - LeaveCriticalSection(&job->cs); - - return (job->state == BG_JOB_STATE_TRANSFERRING - ? PROGRESS_CONTINUE - : PROGRESS_CANCEL); + switch (code) + { + case 200: return S_OK; + case 400: return BG_E_HTTP_ERROR_400; + case 401: return BG_E_HTTP_ERROR_401; + case 404: return BG_E_HTTP_ERROR_404; + case 407: return BG_E_HTTP_ERROR_407; + case 414: return BG_E_HTTP_ERROR_414; + case 501: return BG_E_HTTP_ERROR_501; + case 503: return BG_E_HTTP_ERROR_503; + case 504: return BG_E_HTTP_ERROR_504; + case 505: return BG_E_HTTP_ERROR_505; + default: + FIXME("unhandled response code %u\n", code); + return S_OK; + } } -typedef struct +static void CALLBACK progress_callback_http(HINTERNET handle, DWORD_PTR context, DWORD status, + LPVOID buf, DWORD buflen) { - IBindStatusCallback IBindStatusCallback_iface; - IHttpNegotiate IHttpNegotiate_iface; - BackgroundCopyFileImpl *file; - LONG ref; -} DLBindStatusCallback; + BackgroundCopyFileImpl *file = (BackgroundCopyFileImpl *)context; + BackgroundCopyJobImpl *job = file->owner; -static inline DLBindStatusCallback *impl_from_IBindStatusCallback(IBindStatusCallback *iface) -{ - return CONTAINING_RECORD(iface, DLBindStatusCallback, IBindStatusCallback_iface); -} + TRACE("%p, %p, %x, %p, %u\n", handle, file, status, buf, buflen); -static HRESULT WINAPI DLBindStatusCallback_QueryInterface( - IBindStatusCallback *iface, - REFIID riid, - void **ppvObject) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); + switch (status) + { + case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: + { + DWORD code, len, size; - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + size = sizeof(code); + if (WinHttpQueryHeaders(handle, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, + NULL, &code, &size, NULL)) + { + if ((job->error.code = error_from_http_response(code))) + { + EnterCriticalSection(&job->cs); + + job->error.context = BG_ERROR_CONTEXT_REMOTE_FILE; + if (job->error.file) IBackgroundCopyFile2_Release(job->error.file); + job->error.file = &file->IBackgroundCopyFile2_iface; + IBackgroundCopyFile2_AddRef(job->error.file); + + LeaveCriticalSection(&job->cs); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + } + else + { + EnterCriticalSection(&job->cs); + + job->error.context = 0; + if (job->error.file) + { + IBackgroundCopyFile2_Release(job->error.file); + job->error.file = NULL; + } - if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IBindStatusCallback)) - { - *ppvObject = &This->IBindStatusCallback_iface; + LeaveCriticalSection(&job->cs); + } + } + size = sizeof(len); + if (WinHttpQueryHeaders(handle, WINHTTP_QUERY_CONTENT_LENGTH|WINHTTP_QUERY_FLAG_NUMBER, + NULL, &len, &size, NULL)) + { + file->fileProgress.BytesTotal = len; + } + break; } - else if (IsEqualGUID(riid, &IID_IHttpNegotiate)) + case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: { - *ppvObject = &This->IHttpNegotiate_iface; + file->read_size = buflen; + break; } - else + case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: { - *ppvObject = NULL; - return E_NOINTERFACE; + WINHTTP_ASYNC_RESULT *result = (WINHTTP_ASYNC_RESULT *)buf; + job->error.code = result->dwError; + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + break; + } + default: break; } - IBindStatusCallback_AddRef(iface); - return S_OK; -} - -static ULONG WINAPI DLBindStatusCallback_AddRef(IBindStatusCallback *iface) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - return InterlockedIncrement(&This->ref); + SetEvent(job->wait); } -static ULONG WINAPI DLBindStatusCallback_Release(IBindStatusCallback *iface) +static DWORD wait_for_completion(BackgroundCopyJobImpl *job) { - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - ULONG ref = InterlockedDecrement(&This->ref); + HANDLE handles[2] = {job->wait, job->cancel}; + DWORD error = ERROR_SUCCESS; - if (ref == 0) + switch (WaitForMultipleObjects(2, handles, FALSE, INFINITE)) { - IBackgroundCopyFile2_Release(&This->file->IBackgroundCopyFile2_iface); - HeapFree(GetProcessHeap(), 0, This); + case WAIT_OBJECT_0: + break; + + case WAIT_OBJECT_0 + 1: + error = ERROR_CANCELLED; + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_CANCELLED); + break; + + default: + error = GetLastError(); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + break; } - return ref; + return error; } -static HRESULT WINAPI DLBindStatusCallback_GetBindInfo( - IBindStatusCallback *iface, - DWORD *grfBINDF, - BINDINFO *pbindinfo) +static UINT target_from_index(UINT index) { - return E_NOTIMPL; + switch (index) + { + case 0: return WINHTTP_AUTH_TARGET_SERVER; + case 1: return WINHTTP_AUTH_TARGET_PROXY; + default: + ERR("unhandled index %u\n", index); + break; + } + return 0; } -static HRESULT WINAPI DLBindStatusCallback_GetPriority( - IBindStatusCallback *iface, - LONG *pnPriority) +static UINT scheme_from_index(UINT index) { - return E_NOTIMPL; + switch (index) + { + case 0: return WINHTTP_AUTH_SCHEME_BASIC; + case 1: return WINHTTP_AUTH_SCHEME_NTLM; + case 2: return WINHTTP_AUTH_SCHEME_PASSPORT; + case 3: return WINHTTP_AUTH_SCHEME_DIGEST; + case 4: return WINHTTP_AUTH_SCHEME_NEGOTIATE; + default: + ERR("unhandled index %u\n", index); + break; + } + return 0; } -static HRESULT WINAPI DLBindStatusCallback_OnDataAvailable( - IBindStatusCallback *iface, - DWORD grfBSCF, - DWORD dwSize, - FORMATETC *pformatetc, - STGMEDIUM *pstgmed) +static BOOL set_request_credentials(HINTERNET req, BackgroundCopyJobImpl *job) { - return E_NOTIMPL; -} + UINT i, j; -static HRESULT WINAPI DLBindStatusCallback_OnLowResource( - IBindStatusCallback *iface, - DWORD reserved) -{ - return E_NOTIMPL; -} + for (i = 0; i < BG_AUTH_TARGET_PROXY; i++) + { + UINT target = target_from_index(i); + for (j = 0; j < BG_AUTH_SCHEME_PASSPORT; j++) + { + UINT scheme = scheme_from_index(j); + const WCHAR *username = job->http_options.creds[i][j].Credentials.Basic.UserName; + const WCHAR *password = job->http_options.creds[i][j].Credentials.Basic.Password; -static HRESULT WINAPI DLBindStatusCallback_OnObjectAvailable( - IBindStatusCallback *iface, - REFIID riid, - IUnknown *punk) -{ - return E_NOTIMPL; + if (!username) continue; + if (!WinHttpSetCredentials(req, target, scheme, username, password, NULL)) return FALSE; + } + } + return TRUE; } -static HRESULT WINAPI DLBindStatusCallback_OnProgress( - IBindStatusCallback *iface, - ULONG progress, - ULONG progressMax, - ULONG statusCode, - LPCWSTR statusText) +static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc, + const WCHAR *tmpfile) { - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - BackgroundCopyFileImpl *file = This->file; BackgroundCopyJobImpl *job = file->owner; - ULONG64 diff; + HANDLE handle; + HINTERNET ses, con = NULL, req = NULL; + DWORD flags = (uc->nScheme == INTERNET_SCHEME_HTTPS) ? WINHTTP_FLAG_SECURE : 0; + char buf[4096]; + BOOL ret = FALSE; - EnterCriticalSection(&job->cs); - diff = (file->fileProgress.BytesTotal == BG_SIZE_UNKNOWN - ? progress - : progress - file->fileProgress.BytesTransferred); - file->fileProgress.BytesTotal = progressMax ? progressMax : BG_SIZE_UNKNOWN; - file->fileProgress.BytesTransferred = progress; - job->jobProgress.BytesTransferred += diff; - LeaveCriticalSection(&job->cs); + transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_CONNECTING); - return S_OK; -} + if (!(ses = WinHttpOpen(NULL, 0, NULL, NULL, WINHTTP_FLAG_ASYNC))) return FALSE; + WinHttpSetStatusCallback(ses, progress_callback_http, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS, 0); + if (!WinHttpSetOption(ses, WINHTTP_OPTION_CONTEXT_VALUE, file, sizeof(file))) goto done; -static HRESULT WINAPI DLBindStatusCallback_OnStartBinding( - IBindStatusCallback *iface, - DWORD dwReserved, - IBinding *pib) -{ - return E_NOTIMPL; -} + if (!(con = WinHttpConnect(ses, uc->lpszHostName, uc->nPort, 0))) goto done; + if (!(req = WinHttpOpenRequest(con, NULL, uc->lpszUrlPath, NULL, NULL, NULL, flags))) goto done; + if (!set_request_credentials(req, job)) goto done; -static HRESULT WINAPI DLBindStatusCallback_OnStopBinding( - IBindStatusCallback *iface, - HRESULT hresult, - LPCWSTR szError) -{ - return E_NOTIMPL; -} + if (!(WinHttpSendRequest(req, job->http_options.headers, ~0u, NULL, 0, 0, (DWORD_PTR)file))) goto done; + if (wait_for_completion(job) || job->error.code) goto done; -static const IBindStatusCallbackVtbl DLBindStatusCallback_Vtbl = -{ - DLBindStatusCallback_QueryInterface, - DLBindStatusCallback_AddRef, - DLBindStatusCallback_Release, - DLBindStatusCallback_OnStartBinding, - DLBindStatusCallback_GetPriority, - DLBindStatusCallback_OnLowResource, - DLBindStatusCallback_OnProgress, - DLBindStatusCallback_OnStopBinding, - DLBindStatusCallback_GetBindInfo, - DLBindStatusCallback_OnDataAvailable, - DLBindStatusCallback_OnObjectAvailable -}; + if (!(WinHttpReceiveResponse(req, NULL))) goto done; + if (wait_for_completion(job) || job->error.code) goto done; -static inline DLBindStatusCallback *impl_from_IHttpNegotiate(IHttpNegotiate *iface) -{ - return CONTAINING_RECORD(iface, DLBindStatusCallback, IHttpNegotiate_iface); -} + transitionJobState(job, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_TRANSFERRING); -static HRESULT WINAPI http_negotiate_QueryInterface( - IHttpNegotiate *iface, REFIID riid, void **ppv) -{ - DLBindStatusCallback *callback = impl_from_IHttpNegotiate(iface); - return IBindStatusCallback_QueryInterface(&callback->IBindStatusCallback_iface, riid, ppv); -} + handle = CreateFileW(tmpfile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (handle == INVALID_HANDLE_VALUE) goto done; -static ULONG WINAPI http_negotiate_AddRef( - IHttpNegotiate *iface) -{ - DLBindStatusCallback *callback = impl_from_IHttpNegotiate(iface); - return IBindStatusCallback_AddRef(&callback->IBindStatusCallback_iface); -} + for (;;) + { + file->read_size = 0; + if (!(ret = WinHttpReadData(req, buf, sizeof(buf), NULL))) break; + if (wait_for_completion(job) || job->error.code) + { + ret = FALSE; + break; + } + if (!file->read_size) break; + if (!(ret = WriteFile(handle, buf, file->read_size, NULL, NULL))) break; -static ULONG WINAPI http_negotiate_Release( - IHttpNegotiate *iface) -{ - DLBindStatusCallback *callback = impl_from_IHttpNegotiate(iface); - return IBindStatusCallback_Release(&callback->IBindStatusCallback_iface); -} + EnterCriticalSection(&job->cs); + file->fileProgress.BytesTransferred += file->read_size; + job->jobProgress.BytesTransferred += file->read_size; + LeaveCriticalSection(&job->cs); + } -static HRESULT WINAPI http_negotiate_BeginningTransaction( - IHttpNegotiate *iface, LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR *add_headers) -{ - DLBindStatusCallback *callback = impl_from_IHttpNegotiate(iface); - FIXME("(%p)->(%s %s %u %p)\n", callback, debugstr_w(url), debugstr_w(headers), reserved, add_headers); - return E_NOTIMPL; + CloseHandle(handle); + +done: + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); + if (!ret) DeleteFileW(tmpfile); + + SetEvent(job->done); + return ret; } -static HRESULT error_from_http_response(DWORD code) +static DWORD CALLBACK progress_callback_local(LARGE_INTEGER totalSize, LARGE_INTEGER totalTransferred, + LARGE_INTEGER streamSize, LARGE_INTEGER streamTransferred, + DWORD streamNum, DWORD reason, HANDLE srcFile, + HANDLE dstFile, LPVOID obj) { - switch (code) - { - case 200: return S_OK; - case 400: return BG_E_HTTP_ERROR_400; - case 401: return BG_E_HTTP_ERROR_401; - case 404: return BG_E_HTTP_ERROR_404; - case 407: return BG_E_HTTP_ERROR_407; - case 414: return BG_E_HTTP_ERROR_414; - case 501: return BG_E_HTTP_ERROR_501; - case 503: return BG_E_HTTP_ERROR_503; - case 504: return BG_E_HTTP_ERROR_504; - case 505: return BG_E_HTTP_ERROR_505; - default: - FIXME("unhandled response code %u\n", code); - return S_OK; - } + BackgroundCopyFileImpl *file = obj; + BackgroundCopyJobImpl *job = file->owner; + ULONG64 diff; + + EnterCriticalSection(&job->cs); + diff = (file->fileProgress.BytesTotal == BG_SIZE_UNKNOWN + ? totalTransferred.QuadPart + : totalTransferred.QuadPart - file->fileProgress.BytesTransferred); + file->fileProgress.BytesTotal = totalSize.QuadPart; + file->fileProgress.BytesTransferred = totalTransferred.QuadPart; + job->jobProgress.BytesTransferred += diff; + LeaveCriticalSection(&job->cs); + + return (job->state == BG_JOB_STATE_TRANSFERRING + ? PROGRESS_CONTINUE + : PROGRESS_CANCEL); } -static HRESULT WINAPI http_negotiate_OnResponse( - IHttpNegotiate *iface, DWORD code, LPCWSTR resp_headers, LPCWSTR req_headers, LPWSTR *add_reqheaders) +static BOOL transfer_file_local(BackgroundCopyFileImpl *file, const WCHAR *tmpname) { - DLBindStatusCallback *callback = impl_from_IHttpNegotiate(iface); - BackgroundCopyJobImpl *job = callback->file->owner; + static const WCHAR fileW[] = {'f','i','l','e',':','/','/',0}; + BackgroundCopyJobImpl *job = file->owner; + const WCHAR *ptr; + BOOL ret; - TRACE("(%p)->(%d %s %s %p)\n", callback, code, debugstr_w(resp_headers), debugstr_w(req_headers), - add_reqheaders); + transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRING); - if ((job->error.code = error_from_http_response(code))) - { - job->error.context = BG_ERROR_CONTEXT_REMOTE_FILE; - if (job->error.file) IBackgroundCopyFile2_Release(job->error.file); - job->error.file = &callback->file->IBackgroundCopyFile2_iface; - IBackgroundCopyFile2_AddRef(job->error.file); - } + if (strlenW(file->info.RemoteName) > 7 && !memicmpW(file->info.RemoteName, fileW, 7)) + ptr = file->info.RemoteName + 7; else + ptr = file->info.RemoteName; + + if (!(ret = CopyFileExW(ptr, tmpname, progress_callback_local, file, NULL, 0))) { - job->error.context = 0; - if (job->error.file) - { - IBackgroundCopyFile2_Release(job->error.file); - job->error.file = NULL; - } + WARN("Local file copy failed: error %u\n", GetLastError()); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); } - *add_reqheaders = NULL; - return S_OK; -} - -static const IHttpNegotiateVtbl http_negotiate_vtbl = -{ - http_negotiate_QueryInterface, - http_negotiate_AddRef, - http_negotiate_Release, - http_negotiate_BeginningTransaction, - http_negotiate_OnResponse -}; -static DLBindStatusCallback *DLBindStatusCallbackConstructor( - BackgroundCopyFileImpl *file) -{ - DLBindStatusCallback *This = HeapAlloc(GetProcessHeap(), 0, sizeof *This); - if (!This) - return NULL; - - This->IBindStatusCallback_iface.lpVtbl = &DLBindStatusCallback_Vtbl; - This->IHttpNegotiate_iface.lpVtbl = &http_negotiate_vtbl; - IBackgroundCopyFile2_AddRef(&file->IBackgroundCopyFile2_iface); - This->file = file; - This->ref = 1; - return This; + SetEvent(job->done); + return ret; } BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) { static const WCHAR prefix[] = {'B','I','T', 0}; - DLBindStatusCallback *callbackObj; - WCHAR tmpDir[MAX_PATH]; - WCHAR tmpName[MAX_PATH]; - HRESULT hr; + WCHAR tmpDir[MAX_PATH], tmpName[MAX_PATH]; + WCHAR host[MAX_PATH], path[MAX_PATH]; + URL_COMPONENTSW uc; + BOOL ret; if (!GetTempPathW(MAX_PATH, tmpDir)) { @@ -521,14 +496,6 @@ return FALSE; } - callbackObj = DLBindStatusCallbackConstructor(file); - if (!callbackObj) - { - ERR("Out of memory\n"); - transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSIENT_ERROR); - return FALSE; - } - EnterCriticalSection(&job->cs); file->fileProgress.BytesTotal = BG_SIZE_UNKNOWN; file->fileProgress.BytesTransferred = 0; @@ -540,37 +507,35 @@ debugstr_w(tmpName), debugstr_w(file->info.LocalName)); - transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRING); - - DeleteUrlCacheEntryW(file->info.RemoteName); - hr = URLDownloadToFileW(NULL, file->info.RemoteName, tmpName, 0, - &callbackObj->IBindStatusCallback_iface); - IBindStatusCallback_Release(&callbackObj->IBindStatusCallback_iface); - if (hr == INET_E_DOWNLOAD_FAILURE) - { - TRACE("URLDownload failed, trying local file copy\n"); - if (!CopyFileExW(file->info.RemoteName, tmpName, copyProgressCallback, - file, NULL, 0)) - { - ERR("Local file copy failed: error %d\n", GetLastError()); - transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); - return FALSE; - } - } - else if (FAILED(hr)) + uc.dwStructSize = sizeof(uc); + uc.nScheme = 0; + uc.lpszScheme = NULL; + uc.dwSchemeLength = 0; + uc.lpszUserName = NULL; + uc.dwUserNameLength = 0; + uc.lpszPassword = NULL; + uc.dwPasswordLength = 0; + uc.lpszHostName = host; + uc.dwHostNameLength = sizeof(host)/sizeof(host[0]); + uc.nPort = 0; + uc.lpszUrlPath = path; + uc.dwUrlPathLength = sizeof(path)/sizeof(path[0]); + uc.lpszExtraInfo = NULL; + uc.dwExtraInfoLength = 0; + ret = WinHttpCrackUrl(file->info.RemoteName, 0, 0, &uc); + if (!ret) { - ERR("URLDownload failed: eh 0x%08x\n", hr); - transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); - return FALSE; + TRACE("WinHttpCrackUrl failed, trying local file copy\n"); + if (!transfer_file_local(file, tmpName)) return FALSE; } - else if (job->error.code) + else if (!transfer_file_http(file, &uc, tmpName)) { - ERR("transfer error: 0x%08x\n", job->error.code); - transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + WARN("HTTP transfer failed\n"); return FALSE; } - if (transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_QUEUED)) + if (transitionJobState(job, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_QUEUED) || + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_QUEUED)) { lstrcpyW(file->tempFileName, tmpName); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/job.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/job.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/job.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/job.c 2015-06-28 16:51:28.000000000 +0000 @@ -27,6 +27,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr); +BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) +{ + BOOL ret = FALSE; + + EnterCriticalSection(&globalMgr.cs); + if (job->state == from) + { + job->state = to; + ret = TRUE; + } + LeaveCriticalSection(&globalMgr.cs); + return ret; +} + struct copy_error { IBackgroundCopyError IBackgroundCopyError_iface; @@ -212,6 +226,10 @@ { *obj = &This->IBackgroundCopyJob3_iface; } + else if (IsEqualGUID(riid, &IID_IBackgroundCopyJobHttpOptions)) + { + *obj = &This->IBackgroundCopyJobHttpOptions_iface; + } else { *obj = NULL; @@ -233,7 +251,7 @@ static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) { BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - ULONG ref = InterlockedDecrement(&This->ref); + ULONG i, j, ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); @@ -245,6 +263,19 @@ IBackgroundCopyCallback2_Release(This->callback); HeapFree(GetProcessHeap(), 0, This->displayName); HeapFree(GetProcessHeap(), 0, This->description); + HeapFree(GetProcessHeap(), 0, This->http_options.headers); + for (i = 0; i < BG_AUTH_TARGET_PROXY; i++) + { + for (j = 0; j < BG_AUTH_SCHEME_PASSPORT; j++) + { + BG_AUTH_CREDENTIALS *cred = &This->http_options.creds[i][j]; + HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.UserName); + HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.Password); + } + } + CloseHandle(This->wait); + CloseHandle(This->cancel); + CloseHandle(This->done); HeapFree(GetProcessHeap(), 0, This); } @@ -351,8 +382,48 @@ IBackgroundCopyJob3 *iface) { BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + HRESULT rv = S_OK; + + TRACE("(%p)\n", This); + + EnterCriticalSection(&This->cs); + + if (is_job_done(This)) + { + rv = BG_E_INVALID_STATE; + } + else + { + BackgroundCopyFileImpl *file; + + if (This->state == BG_JOB_STATE_CONNECTING || This->state == BG_JOB_STATE_TRANSFERRING) + { + This->state = BG_JOB_STATE_CANCELLED; + SetEvent(This->cancel); + + LeaveCriticalSection(&This->cs); + WaitForSingleObject(This->done, INFINITE); + EnterCriticalSection(&This->cs); + } + + LIST_FOR_EACH_ENTRY(file, &This->files, BackgroundCopyFileImpl, entryFromJob) + { + if (file->tempFileName[0] && !DeleteFileW(file->tempFileName)) + { + WARN("Couldn't delete %s (%u)\n", debugstr_w(file->tempFileName), GetLastError()); + rv = BG_S_UNABLE_TO_DELETE_FILES; + } + if (file->info.LocalName && !DeleteFileW(file->info.LocalName)) + { + WARN("Couldn't delete %s (%u)\n", debugstr_w(file->info.LocalName), GetLastError()); + rv = BG_S_UNABLE_TO_DELETE_FILES; + } + } + This->state = BG_JOB_STATE_CANCELLED; + } + + LeaveCriticalSection(&This->cs); + return rv; } static HRESULT WINAPI BackgroundCopyJob_Complete( @@ -435,10 +506,7 @@ return E_INVALIDARG; EnterCriticalSection(&This->cs); - pVal->BytesTotal = This->jobProgress.BytesTotal; - pVal->BytesTransferred = This->jobProgress.BytesTransferred; - pVal->FilesTotal = This->jobProgress.FilesTotal; - pVal->FilesTransferred = This->jobProgress.FilesTransferred; + *pVal = This->jobProgress; LeaveCriticalSection(&This->cs); return S_OK; @@ -790,12 +858,49 @@ return E_NOTIMPL; } +static int index_from_target(BG_AUTH_TARGET target) +{ + if (!target || target > BG_AUTH_TARGET_PROXY) return -1; + return target - 1; +} + +static int index_from_scheme(BG_AUTH_SCHEME scheme) +{ + if (!scheme || scheme > BG_AUTH_SCHEME_PASSPORT) return -1; + return scheme - 1; +} + static HRESULT WINAPI BackgroundCopyJob_SetCredentials( IBackgroundCopyJob3 *iface, BG_AUTH_CREDENTIALS *cred) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p)->(%p): stub\n", This, cred); + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface); + BG_AUTH_CREDENTIALS *new_cred; + int idx_target, idx_scheme; + + TRACE("(%p)->(%p)\n", job, cred); + + if ((idx_target = index_from_target(cred->Target)) < 0) return BG_E_INVALID_AUTH_TARGET; + if ((idx_scheme = index_from_scheme(cred->Scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME; + new_cred = &job->http_options.creds[idx_target][idx_scheme]; + + EnterCriticalSection(&job->cs); + + new_cred->Target = cred->Target; + new_cred->Scheme = cred->Scheme; + + if (cred->Credentials.Basic.UserName) + { + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.UserName); + new_cred->Credentials.Basic.UserName = strdupW(cred->Credentials.Basic.UserName); + } + if (cred->Credentials.Basic.Password) + { + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.Password); + new_cred->Credentials.Basic.Password = strdupW(cred->Credentials.Basic.Password); + } + + LeaveCriticalSection(&job->cs); return S_OK; } @@ -804,8 +909,25 @@ BG_AUTH_TARGET target, BG_AUTH_SCHEME scheme) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p)->(%d %d): stub\n", This, target, scheme); + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface); + BG_AUTH_CREDENTIALS *new_cred; + int idx_target, idx_scheme; + + TRACE("(%p)->(%u %u)\n", job, target, scheme); + + if ((idx_target = index_from_target(target)) < 0) return BG_E_INVALID_AUTH_TARGET; + if ((idx_scheme = index_from_scheme(scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME; + new_cred = &job->http_options.creds[idx_target][idx_scheme]; + + EnterCriticalSection(&job->cs); + + new_cred->Target = new_cred->Scheme = 0; + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.UserName); + new_cred->Credentials.Basic.UserName = NULL; + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.Password); + new_cred->Credentials.Basic.Password = NULL; + + LeaveCriticalSection(&job->cs); return S_OK; } @@ -900,11 +1022,175 @@ BackgroundCopyJob_GetFileACLFlags }; +static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJobHttpOptions( + IBackgroundCopyJobHttpOptions *iface) +{ + return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJobHttpOptions_iface); +} + +static HRESULT WINAPI http_options_QueryInterface( + IBackgroundCopyJobHttpOptions *iface, + REFIID riid, + void **ppvObject) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_QueryInterface(&job->IBackgroundCopyJob3_iface, riid, ppvObject); +} + +static ULONG WINAPI http_options_AddRef( + IBackgroundCopyJobHttpOptions *iface) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface); +} + +static ULONG WINAPI http_options_Release( + IBackgroundCopyJobHttpOptions *iface) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); +} + +static HRESULT WINAPI http_options_SetClientCertificateByID( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION StoreLocation, + LPCWSTR StoreName, + BYTE *pCertHashBlob) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_SetClientCertificateByName( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION StoreLocation, + LPCWSTR StoreName, + LPCWSTR SubjectName) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_RemoveClientCertificate( + IBackgroundCopyJobHttpOptions *iface) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_GetClientCertificate( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION *pStoreLocation, + LPWSTR *pStoreName, + BYTE **ppCertHashBlob, + LPWSTR *pSubjectName) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_SetCustomHeaders( + IBackgroundCopyJobHttpOptions *iface, + LPCWSTR RequestHeaders) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(%s)\n", iface, debugstr_w(RequestHeaders)); + + EnterCriticalSection(&job->cs); + + if (RequestHeaders) + { + WCHAR *headers = strdupW(RequestHeaders); + if (!headers) + { + LeaveCriticalSection(&job->cs); + return E_OUTOFMEMORY; + } + HeapFree(GetProcessHeap(), 0, job->http_options.headers); + job->http_options.headers = headers; + } + else + { + HeapFree(GetProcessHeap(), 0, job->http_options.headers); + job->http_options.headers = NULL; + } + + LeaveCriticalSection(&job->cs); + return S_OK; +} + +static HRESULT WINAPI http_options_GetCustomHeaders( + IBackgroundCopyJobHttpOptions *iface, + LPWSTR *pRequestHeaders) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(%p)\n", iface, pRequestHeaders); + + EnterCriticalSection(&job->cs); + + if (job->http_options.headers) + { + WCHAR *headers = co_strdupW(job->http_options.headers); + if (!headers) + { + LeaveCriticalSection(&job->cs); + return E_OUTOFMEMORY; + } + *pRequestHeaders = headers; + LeaveCriticalSection(&job->cs); + return S_OK; + } + + *pRequestHeaders = NULL; + LeaveCriticalSection(&job->cs); + return S_FALSE; +} + +static HRESULT WINAPI http_options_SetSecurityFlags( + IBackgroundCopyJobHttpOptions *iface, + ULONG Flags) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(0x%08x)\n", iface, Flags); + + job->http_options.flags = Flags; + return S_OK; +} + +static HRESULT WINAPI http_options_GetSecurityFlags( + IBackgroundCopyJobHttpOptions *iface, + ULONG *pFlags) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(%p)\n", iface, pFlags); + + *pFlags = job->http_options.flags; + return S_OK; +} + +static const IBackgroundCopyJobHttpOptionsVtbl http_options_vtbl = +{ + http_options_QueryInterface, + http_options_AddRef, + http_options_Release, + http_options_SetClientCertificateByID, + http_options_SetClientCertificateByName, + http_options_RemoveClientCertificate, + http_options_GetClientCertificate, + http_options_SetCustomHeaders, + http_options_GetCustomHeaders, + http_options_SetSecurityFlags, + http_options_GetSecurityFlags +}; + HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID *job_id, BackgroundCopyJobImpl **job) { HRESULT hr; BackgroundCopyJobImpl *This; - int n; TRACE("(%s,%d,%p)\n", debugstr_w(displayName), type, job); @@ -913,14 +1199,14 @@ return E_OUTOFMEMORY; This->IBackgroundCopyJob3_iface.lpVtbl = &BackgroundCopyJob3Vtbl; + This->IBackgroundCopyJobHttpOptions_iface.lpVtbl = &http_options_vtbl; InitializeCriticalSection(&This->cs); This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BackgroundCopyJobImpl.cs"); This->ref = 1; This->type = type; - n = (strlenW(displayName) + 1) * sizeof *displayName; - This->displayName = HeapAlloc(GetProcessHeap(), 0, n); + This->displayName = strdupW(displayName); if (!This->displayName) { This->cs.DebugInfo->Spare[0] = 0; @@ -928,7 +1214,6 @@ HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->displayName, displayName, n); hr = CoCreateGuid(&This->jobId); if (FAILED(hr)) @@ -957,6 +1242,12 @@ This->error.code = 0; This->error.file = NULL; + memset(&This->http_options, 0, sizeof(This->http_options)); + + This->wait = CreateEventW(NULL, FALSE, FALSE, NULL); + This->cancel = CreateEventW(NULL, FALSE, FALSE, NULL); + This->done = CreateEventW(NULL, FALSE, FALSE, NULL); + *job = This; TRACE("created job %s:%p\n", debugstr_guid(&This->jobId), This); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = qmgr.dll -IMPORTS = uuid wininet urlmon ole32 advapi32 +IMPORTS = uuid winhttp ole32 advapi32 C_SRCS = \ enum_files.c \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/qmgr.h wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/qmgr.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/qmgr.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/qmgr.h 2015-06-28 16:51:28.000000000 +0000 @@ -37,6 +37,7 @@ typedef struct { IBackgroundCopyJob3 IBackgroundCopyJob3_iface; + IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface; LONG ref; LPWSTR displayName; LPWSTR description; @@ -53,10 +54,19 @@ struct list entryFromQmgr; struct { + WCHAR *headers; + ULONG flags; + BG_AUTH_CREDENTIALS creds[BG_AUTH_TARGET_PROXY][BG_AUTH_SCHEME_PASSPORT]; + } http_options; + struct + { BG_ERROR_CONTEXT context; HRESULT code; IBackgroundCopyFile2 *file; } error; + HANDLE wait; + HANDLE cancel; + HANDLE done; } BackgroundCopyJobImpl; /* Background copy file vtbl and related data */ @@ -69,6 +79,7 @@ WCHAR tempFileName[MAX_PATH]; struct list entryFromJob; BackgroundCopyJobImpl *owner; + DWORD read_size; } BackgroundCopyFileImpl; /* Background copy manager vtbl and related data */ @@ -102,14 +113,21 @@ DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN; void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN; BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN; +BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN; /* Little helper functions */ -static inline char * -qmgr_strdup(const char *s) +static inline WCHAR *strdupW(const WCHAR *src) +{ + WCHAR *dst = HeapAlloc(GetProcessHeap(), 0, (strlenW(src) + 1) * sizeof(WCHAR)); + if (dst) strcpyW(dst, src); + return dst; +} + +static inline WCHAR *co_strdupW(const WCHAR *src) { - size_t n = strlen(s) + 1; - char *d = HeapAlloc(GetProcessHeap(), 0, n); - return d ? memcpy(d, s, n) : NULL; + WCHAR *dst = CoTaskMemAlloc((strlenW(src) + 1) * sizeof(WCHAR)); + if (dst) strcpyW(dst, src); + return dst; } static inline HRESULT return_strval(const WCHAR *str, WCHAR **ret) @@ -125,19 +143,4 @@ return S_OK; } -static inline BOOL -transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE fromState, - BG_JOB_STATE toState) -{ - BOOL rv = FALSE; - EnterCriticalSection(&globalMgr.cs); - if (job->state == fromState) - { - job->state = toState; - rv = TRUE; - } - LeaveCriticalSection(&globalMgr.cs); - return rv; -} - #endif /* __QMGR_H__ */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/enum_files.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/enum_files.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/enum_files.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/enum_files.c 2015-06-28 16:51:28.000000000 +0000 @@ -24,6 +24,7 @@ #define COBJMACROS #include "wine/test.h" +#include "initguid.h" #include "bits.h" /* Globals used by many tests */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/job.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/job.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/job.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/job.c 2015-06-28 16:51:28.000000000 +0000 @@ -25,6 +25,8 @@ #include "wine/test.h" #include "bits.h" #include "initguid.h" +#include "bits2_0.h" +#include "bits2_5.h" /* Globals used by many tests */ static const WCHAR test_displayName[] = {'T', 'e', 's', 't', 0}; @@ -101,51 +103,74 @@ /* Generic test cleanup */ static void teardown(void) { + IBackgroundCopyJob_Cancel(test_job); IBackgroundCopyJob_Release(test_job); IBackgroundCopyManager_Release(test_manager); } -/* FIXME: Remove when Wine has implemented this */ -DEFINE_GUID(CLSID_BackgroundCopyManager2_0, 0x6d18ad12, 0xbde3, 0x4393, 0xb3,0x11, 0x09,0x9c,0x34,0x6e,0x6d,0xf9); - static BOOL check_bits20(void) { HRESULT hres; IBackgroundCopyManager *manager; - BOOL ret = TRUE; + IBackgroundCopyJob *job, *job3; - hres = CoCreateInstance(&CLSID_BackgroundCopyManager2_0, NULL, - CLSCTX_LOCAL_SERVER, - &IID_IBackgroundCopyManager, - (void **) &manager); + hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, + CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager, + (void **)&manager); + if (hres != S_OK) return FALSE; - if (hres == REGDB_E_CLASSNOTREG) + hres = IBackgroundCopyManager_CreateJob(manager, test_displayName, test_type, &test_jobId, &job); + if (hres != S_OK) { - ret = FALSE; + IBackgroundCopyManager_Release(manager); + return FALSE; + } - /* FIXME: Wine implements 2.0 functionality but doesn't advertise 2.0 - * - * Remove when Wine is fixed - */ - if (setup()) - { - HRESULT hres2; + hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJob3, (void **)&job3); + IBackgroundCopyJob_Cancel(job); + IBackgroundCopyJob_Release(job); + if (hres != S_OK) + { + IBackgroundCopyManager_Release(manager); + return FALSE; + } - hres2 = IBackgroundCopyJob_AddFile(test_job, test_remotePathA, - test_localPathA); - if (hres2 == S_OK) - { - trace("Running on Wine, claim 2.0 is present\n"); - ret = TRUE; - } - teardown(); - } + IBackgroundCopyJob_Release(job3); + IBackgroundCopyManager_Release(manager); + return TRUE; +} + +static BOOL check_bits25(void) +{ + HRESULT hres; + IBackgroundCopyManager *manager; + IBackgroundCopyJob *job; + IBackgroundCopyJobHttpOptions *options; + + hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, + CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager, + (void **)&manager); + if (hres != S_OK) return FALSE; + + hres = IBackgroundCopyManager_CreateJob(manager, test_displayName, test_type, &test_jobId, &job); + if (hres != S_OK) + { + IBackgroundCopyManager_Release(manager); + return FALSE; } - if (manager) + hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options); + IBackgroundCopyJob_Cancel(job); + IBackgroundCopyJob_Release(job); + if (hres != S_OK) + { IBackgroundCopyManager_Release(manager); + return FALSE; + } - return ret; + IBackgroundCopyJobHttpOptions_Release(options); + IBackgroundCopyManager_Release(manager); + return TRUE; } /* Test that the jobId is properly set */ @@ -457,6 +482,151 @@ ok(unk == NULL, "got %p\n", unk); } +static void test_Cancel(void) +{ + HRESULT hr; + BG_JOB_STATE state; + + state = BG_JOB_STATE_ERROR; + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state != BG_JOB_STATE_CANCELLED, "got %u\n", state); + + hr = IBackgroundCopyJob_Cancel(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + state = BG_JOB_STATE_ERROR; + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state == BG_JOB_STATE_CANCELLED, "got %u\n", state); + + hr = IBackgroundCopyJob_Cancel(test_job); + ok(hr == BG_E_INVALID_STATE, "got 0x%08x\n", hr); +} + +static void test_HttpOptions(void) +{ + static const WCHAR urlW[] = + {'h','t','t','p','s',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/',0}; + static const WCHAR winetestW[] = + {'W','i','n','e',':',' ','t','e','s','t','\r','\n',0}; + static const unsigned int timeout = 30; + HRESULT hr; + IBackgroundCopyJobHttpOptions *options; + IBackgroundCopyError *error; + BG_JOB_STATE state; + unsigned int i; + WCHAR *headers; + ULONG flags, orig_flags; + + DeleteFileW(test_localPathA); + hr = IBackgroundCopyJob_AddFile(test_job, urlW, test_localPathA); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJob_QueryInterface(test_job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (options) + { + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, winetestW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + { + ok(!lstrcmpW(headers, winetestW), "got %s\n", wine_dbgstr_w(headers)); + CoTaskMemFree(headers); + } + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + orig_flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &orig_flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!orig_flags, "got 0x%08x\n", orig_flags); + + hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!flags, "got 0x%08x\n", flags); + } + + hr = IBackgroundCopyJob_Resume(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + for (i = 0; i < timeout; i++) + { + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(state == BG_JOB_STATE_QUEUED || + state == BG_JOB_STATE_CONNECTING || + state == BG_JOB_STATE_TRANSFERRING || + state == BG_JOB_STATE_TRANSFERRED, "unexpected state: %u\n", state); + + if (state == BG_JOB_STATE_TRANSFERRED) break; + Sleep(1000); + } + ok(i < timeout, "BITS job timed out\n"); + if (i < timeout) + { + hr = IBackgroundCopyJob_GetError(test_job, &error); + ok(hr == BG_E_ERROR_INFORMATION_UNAVAILABLE, "got 0x%08x\n", hr); + } + + if (options) + { + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!flags, "got 0x%08x\n", flags); + + hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, orig_flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IBackgroundCopyJobHttpOptions_Release(options); + } + + hr = IBackgroundCopyJob_Complete(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state == BG_JOB_STATE_ACKNOWLEDGED, "unexpected state: %u\n", state); + + hr = IBackgroundCopyJob_Complete(test_job); + ok(hr == BG_E_INVALID_STATE, "got 0x%08x\n", hr); + + DeleteFileW(test_localPathA); +} + typedef void (*test_t)(void); START_TEST(job) @@ -478,6 +648,11 @@ test_EnumFiles, test_CompleteLocal, test_CompleteLocalURL, + test_Cancel, /* must be last */ + 0 + }; + static const test_t tests_bits25[] = { + test_HttpOptions, 0 }; const test_t *test; @@ -525,5 +700,24 @@ win_skip("Tests need BITS 2.0 or higher\n"); } + if (check_bits25()) + { + for (test = tests_bits25, i = 0; *test; ++test, ++i) + { + /* Keep state separate between tests. */ + if (!setup()) + { + ok(0, "tests_bits25:%d: Unable to setup test\n", i); + break; + } + (*test)(); + teardown(); + } + } + else + { + win_skip("Tests need BITS 2.5 or higher\n"); + } + CoUninitialize(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/qmgr.c wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/qmgr.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/qmgr/tests/qmgr.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/qmgr/tests/qmgr.c 2015-06-28 16:51:28.000000000 +0000 @@ -23,7 +23,6 @@ #define COBJMACROS #include "wine/test.h" -#include "initguid.h" #include "bits.h" static WCHAR progname[MAX_PATH]; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/acmwrapper.c wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/acmwrapper.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/acmwrapper.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/acmwrapper.c 2015-06-28 16:51:28.000000000 +0000 @@ -394,7 +394,7 @@ if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->tf.filter.IBaseFilter_iface; This->lasttime_real = This->lasttime_sent = -1; return hr; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/avidec.c wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/avidec.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/avidec.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/avidec.c 2015-06-28 16:51:28.000000000 +0000 @@ -416,7 +416,7 @@ This->pBihIn = NULL; This->pBihOut = NULL; - *ppv = This; + *ppv = &This->tf.filter.IBaseFilter_iface; return hr; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/filesource.c wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/filesource.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/filesource.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/filesource.c 2015-06-28 16:51:28.000000000 +0000 @@ -452,13 +452,13 @@ *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IFileSourceFilter)) *ppv = &This->IFileSourceFilter_iface; else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags)) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/memallocator.c wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/memallocator.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/memallocator.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/memallocator.c 2015-06-28 16:51:28.000000000 +0000 @@ -116,9 +116,9 @@ *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; + *ppv = &This->IMemAllocator_iface; else if (IsEqualIID(riid, &IID_IMemAllocator)) - *ppv = This; + *ppv = &This->IMemAllocator_iface; if (*ppv) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/tests/referenceclock.c wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/tests/referenceclock.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/quartz/tests/referenceclock.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/quartz/tests/referenceclock.c 2015-06-28 16:51:28.000000000 +0000 @@ -28,21 +28,21 @@ static void test_IReferenceClock_query_interface(const char * clockdesc, IReferenceClock * pClock) { HRESULT hr; - void *pF; + IUnknown *pF; - hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, (void**)&pF); ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF != NULL, "pF is NULL\n"); - if (SUCCEEDED(hr)) IUnknown_Release((IUnknown *)pF); + if (SUCCEEDED(hr)) IUnknown_Release(pF); - hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, (void**)&pF); ok(hr == E_NOINTERFACE, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF == NULL, "pF is not NULL\n"); - hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, (void**)&pF); ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF != NULL, "pF is NULL\n"); - if (SUCCEEDED(hr)) IReferenceClock_Release((IReferenceClock *)pF); + if (SUCCEEDED(hr)) IUnknown_Release(pF); } /* The following method expects a reference clock that will keep ticking for diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/editor.c wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/editor.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/editor.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/editor.c 2015-06-28 16:51:28.000000000 +0000 @@ -4121,6 +4121,10 @@ return 0; case WM_SETCURSOR: { + POINT cursor_pos; + if (wParam == (WPARAM)editor->hWnd && GetCursorPos(&cursor_pos) && + ScreenToClient(editor->hWnd, &cursor_pos)) + ME_LinkNotify(editor, msg, 0, MAKELPARAM(cursor_pos.x, cursor_pos.y)); return ME_SetCursor(editor); } case WM_LBUTTONDBLCLK: @@ -4135,7 +4139,7 @@ ME_CalculateClickCount(editor, msg, wParam, lParam)); ITextHost_TxSetCapture(editor->texthost, TRUE); editor->bMouseCaptured = TRUE; - ME_LinkNotify(editor,msg,wParam,lParam); + ME_LinkNotify(editor, msg, wParam, lParam); if (!ME_SetCursor(editor)) goto do_default; break; } @@ -4145,7 +4149,8 @@ return 0; if (editor->bMouseCaptured) ME_MouseMove(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)); - ME_LinkNotify(editor,msg,wParam,lParam); + else + ME_LinkNotify(editor, msg, wParam, lParam); /* Set cursor if mouse is captured, since WM_SETCURSOR won't be received. */ if (editor->bMouseCaptured) ME_SetCursor(editor); @@ -4163,15 +4168,17 @@ else { ME_SetCursor(editor); - ME_LinkNotify(editor,msg,wParam,lParam); + ME_LinkNotify(editor, msg, wParam, lParam); } break; case WM_RBUTTONUP: case WM_RBUTTONDOWN: + case WM_RBUTTONDBLCLK: ME_CommitUndo(editor); /* End coalesced undos for typed characters */ if ((editor->nEventMask & ENM_MOUSEEVENTS) && !ME_FilterEvent(editor, msg, &wParam, &lParam)) return 0; + ME_LinkNotify(editor, msg, wParam, lParam); goto do_default; case WM_CONTEXTMENU: if (!ME_ShowContextMenu(editor, (short)LOWORD(lParam), (short)HIWORD(lParam))) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/riched_tom.idl wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/riched_tom.idl --- wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/riched_tom.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/riched_tom.idl 2015-06-28 16:51:28.000000000 +0000 @@ -337,7 +337,7 @@ HRESULT Expand([in] LONG unit, [retval, out] LONG *delta); HRESULT GetIndex([in] LONG unit, [retval, out] LONG *index); HRESULT SetIndex([in] LONG unit, [in] LONG index, [in] LONG extend); - HRESULT SetRange([in] LONG active, [in] LONG other); + HRESULT SetRange([in] LONG anchor, [in] LONG active); HRESULT InRange([in] ITextRange *range, [retval, out] LONG *pb); HRESULT InStory([in] ITextRange *range, [retval, out] LONG *pb); HRESULT IsEqual([in] ITextRange *range, [retval, out] LONG *pb); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/richole.c wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/richole.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/richole.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/richole.c 2015-06-28 16:51:28.000000000 +0000 @@ -909,6 +909,35 @@ } } +static HRESULT textrange_expand(ITextRange *range, LONG unit, LONG *delta) +{ + LONG expand_start, expand_end; + + switch (unit) + { + case tomStory: + expand_start = 0; + ITextRange_GetStoryLength(range, &expand_end); + break; + default: + FIXME("unit %d is not supported\n", unit); + return E_NOTIMPL; + } + + if (delta) { + LONG start, end; + + ITextRange_GetStart(range, &start); + ITextRange_GetEnd(range, &end); + *delta = expand_end - expand_start - (end - start); + } + + ITextRange_SetStart(range, expand_start); + ITextRange_SetEnd(range, expand_end); + + return S_OK; +} + static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppvObj) { IRichEditOleImpl *This = impl_from_IUnknown(iface); @@ -1713,10 +1742,12 @@ static HRESULT WINAPI ITextRange_fnSetChar(ITextRange *me, LONG ch) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%x): stub\n", This, ch); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -1737,23 +1768,27 @@ return CreateITextRange(This->child.reole, This->start, This->end, ppRange); } -static HRESULT WINAPI ITextRange_fnGetFormattedText(ITextRange *me, ITextRange **ppRange) +static HRESULT WINAPI ITextRange_fnGetFormattedText(ITextRange *me, ITextRange **range) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, range); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnSetFormattedText(ITextRange *me, ITextRange *pRange) +static HRESULT WINAPI ITextRange_fnSetFormattedText(ITextRange *me, ITextRange *range) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, range); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -1896,14 +1931,15 @@ return create_textpara(me, para); } -static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *pPara) +static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *para) { ITextRangeImpl *This = impl_from_ITextRange(me); + FIXME("(%p)->(%p): stub\n", This, para); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -1959,44 +1995,52 @@ return range_Collapse(bStart, &This->start, &This->end); } -static HRESULT WINAPI ITextRange_fnExpand(ITextRange *me, LONG Unit, LONG *pDelta) +static HRESULT WINAPI ITextRange_fnExpand(ITextRange *me, LONG unit, LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + TRACE("(%p)->(%d %p)\n", This, unit, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); - return E_NOTIMPL; + return textrange_expand(me, unit, delta); } -static HRESULT WINAPI ITextRange_fnGetIndex(ITextRange *me, LONG Unit, LONG *pIndex) +static HRESULT WINAPI ITextRange_fnGetIndex(ITextRange *me, LONG unit, LONG *index) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %p): stub\n", This, unit, index); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Index, - LONG Extend) +static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG index, + LONG extend) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %d): stub\n", This, unit, index, extend); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG cpActive, LONG cpOther) +static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d): stub\n", This, anchor, active); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -2033,13 +2077,15 @@ return textrange_inrange(This->start, This->end, range, ret); } -static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *pb) +static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *ret) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, ret); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -2089,269 +2135,317 @@ return S_OK; } -static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG unit, LONG extend, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnEndOf(ITextRange *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnEndOf(ITextRange *me, LONG unit, LONG extend, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMove(ITextRange *me, LONG Unit, LONG Count, LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMove(ITextRange *me, LONG unit, LONG count, LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveStart(ITextRange *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveStart(ITextRange *me, LONG unit, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveEnd(ITextRange *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveEnd(ITextRange *me, LONG unit, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveWhile(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveWhile(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveStartWhile(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveStartWhile(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveEndWhile(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveEndWhile(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveUntil(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveUntil(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveStartUntil(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveStartUntil(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnMoveEndUntil(ITextRange *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnMoveEndUntil(ITextRange *me, VARIANT *charset, LONG count, + LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnFindText(ITextRange *me, BSTR bstr, LONG cch, LONG Flags, - LONG *pLength) +static HRESULT WINAPI ITextRange_fnFindText(ITextRange *me, BSTR text, LONG count, LONG flags, + LONG *length) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnFindTextStart(ITextRange *me, BSTR bstr, LONG cch, - LONG Flags, LONG *pLength) +static HRESULT WINAPI ITextRange_fnFindTextStart(ITextRange *me, BSTR text, LONG count, + LONG flags, LONG *length) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnFindTextEnd(ITextRange *me, BSTR bstr, LONG cch, - LONG Flags, LONG *pLength) +static HRESULT WINAPI ITextRange_fnFindTextEnd(ITextRange *me, BSTR text, LONG count, + LONG flags, LONG *length) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnDelete(ITextRange *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextRange_fnDelete(ITextRange *me, LONG unit, LONG count, LONG *delta) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnCut(ITextRange *me, VARIANT *pVar) +static HRESULT WINAPI ITextRange_fnCut(ITextRange *me, VARIANT *v) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, v); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnCopy(ITextRange *me, VARIANT *pVar) +static HRESULT WINAPI ITextRange_fnCopy(ITextRange *me, VARIANT *v) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, v); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnPaste(ITextRange *me, VARIANT *pVar, LONG Format) +static HRESULT WINAPI ITextRange_fnPaste(ITextRange *me, VARIANT *v, LONG format) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%s %x): stub\n", This, debugstr_variant(v), format); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnCanPaste(ITextRange *me, VARIANT *pVar, LONG Format, - LONG *pb) +static HRESULT WINAPI ITextRange_fnCanPaste(ITextRange *me, VARIANT *v, LONG format, LONG *ret) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p %x %p): stub\n", This, debugstr_variant(v), format, ret); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnCanEdit(ITextRange *me, LONG *pb) +static HRESULT WINAPI ITextRange_fnCanEdit(ITextRange *me, LONG *ret) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, ret); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnChangeCase(ITextRange *me, LONG Type) +static HRESULT WINAPI ITextRange_fnChangeCase(ITextRange *me, LONG type) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d): stub\n", This, type); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnGetPoint(ITextRange *me, LONG Type, LONG *cx, LONG *cy) +static HRESULT WINAPI ITextRange_fnGetPoint(ITextRange *me, LONG type, LONG *cx, LONG *cy) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %p %p): stub\n", This, type, cx, cy); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG Type, - LONG Extend) +static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG type, + LONG extend) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d %d %d %d): stub\n", This, x, y, type, extend); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG Value) +static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%d): stub\n", This, value); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv) { ITextRangeImpl *This = impl_from_ITextRange(me); + + FIXME("(%p)->(%p): stub\n", This, ppv); + if (!This->child.reole) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); return E_NOTIMPL; } @@ -4219,10 +4313,12 @@ static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%x): stub\n", This, ch); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } @@ -4244,19 +4340,24 @@ return CreateITextRange(This->reOle, start, end, range); } -static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **ppRange) +static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **range) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, range); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *pRange) +static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *range) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, range); + if (!This->reOle) return CO_E_RELEASED; @@ -4268,13 +4369,15 @@ { ITextSelectionImpl *This = impl_from_ITextSelection(me); LONG lim; + + TRACE("(%p)->(%p)\n", This, pcpFirst); + if (!This->reOle) return CO_E_RELEASED; if (!pcpFirst) return E_INVALIDARG; ME_GetSelectionOfs(This->reOle->editor, pcpFirst, &lim); - TRACE("%d\n", *pcpFirst); return S_OK; } @@ -4301,13 +4404,15 @@ { ITextSelectionImpl *This = impl_from_ITextSelection(me); LONG first; + + TRACE("(%p)->(%p)\n", This, pcpLim); + if (!This->reOle) return CO_E_RELEASED; if (!pcpLim) return E_INVALIDARG; ME_GetSelectionOfs(This->reOle->editor, &first, pcpLim); - TRACE("%d\n", *pcpLim); return S_OK; } @@ -4376,9 +4481,12 @@ return create_textpara((ITextRange*)me, para); } -static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pPara) +static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *para) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, para); + if (!This->reOle) return CO_E_RELEASED; @@ -4419,6 +4527,9 @@ ITextSelectionImpl *This = impl_from_ITextSelection(me); LONG start, end; HRESULT hres; + + TRACE("(%p)->(%d)\n", This, bStart); + if (!This->reOle) return CO_E_RELEASED; @@ -4429,44 +4540,52 @@ return hres; } -static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG Unit, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG unit, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + TRACE("(%p)->(%d %p)\n", This, unit, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); - return E_NOTIMPL; + return textrange_expand((ITextRange*)me, unit, delta); } -static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG Unit, LONG *pIndex) +static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG unit, LONG *index) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %p): stub\n", This, unit, index); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG Unit, LONG Index, - LONG Extend) +static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG unit, LONG index, + LONG extend) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d): stub\n", This, unit, index, extend); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG cpActive, LONG cpOther) +static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG anchor, LONG active) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d): stub\n", This, anchor, active); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } @@ -4497,13 +4616,15 @@ return textrange_inrange(start, end, range, ret); } -static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *pRange, LONG *pb) +static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *range, LONG *ret) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p %p): stub\n", This, range, ret); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } @@ -4547,130 +4668,155 @@ return S_OK; } -static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG unit, LONG extend, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG unit, LONG extend, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG Unit, LONG Count, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG unit, LONG count, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG unit, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG unit, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *Cset, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *charset, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR bstr, LONG cch, LONG Flags, - LONG *pLength) +static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR text, LONG count, LONG flags, + LONG *length) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->reOle) return CO_E_RELEASED; @@ -4678,245 +4824,291 @@ return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR bstr, LONG cch, - LONG Flags, LONG *pLength) +static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR text, LONG count, + LONG flags, LONG *length) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR bstr, LONG cch, - LONG Flags, LONG *pLength) +static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR text, LONG count, + LONG flags, LONG *length) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG Unit, LONG Count, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG unit, LONG count, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *pVar) +static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *v) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, v); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *pVar) +static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *v) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, v); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *pVar, LONG Format) +static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *v, LONG format) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %x): stub\n", This, debugstr_variant(v), format); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *pVar, LONG Format, - LONG *pb) +static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *v, LONG format, + LONG *ret) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s %x %p): stub\n", This, debugstr_variant(v), format, ret); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *pb) +static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *ret) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, ret); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG Type) +static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG type) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d): stub\n", This, type); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG Type, LONG *cx, LONG *cy) +static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG type, LONG *cx, LONG *cy) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %p %p): stub\n", This, type, cx, cy); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG Type, - LONG Extend) +static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG type, + LONG extend) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d %d): stub\n", This, x, y, type, extend); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG Value) +static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG value) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d): stub\n", This, value); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, ppv); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } /*** ITextSelection methods ***/ -static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *pFlags) +static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *flags) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, flags); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG Flags) +static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG flags) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%x): stub\n", This, flags); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *pType) +static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *type) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%p): stub\n", This, type); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG Unit, LONG Count, - LONG Extend, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG unit, LONG count, + LONG extend, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG Unit, LONG Count, - LONG Extend, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG unit, LONG count, + LONG extend, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG Unit, LONG Count, - LONG Extend, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG unit, LONG count, + LONG extend, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG Unit, LONG Count, - LONG Extend, LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG unit, LONG count, + LONG extend, LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG unit, LONG extend, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG Unit, LONG Extend, - LONG *pDelta) +static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG unit, LONG extend, + LONG *delta) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR bstr) +static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR text) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + FIXME("(%p)->(%s): stub\n", This, debugstr_w(text)); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); return E_NOTIMPL; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/tests/editor.c wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/tests/editor.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/tests/editor.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/tests/editor.c 2015-06-28 16:51:28.000000000 +0000 @@ -4425,33 +4425,36 @@ LRESULT expected_retval; int expected_getsel_start; int expected_getsel_end; - int _getsel_todo_wine; + BOOL todo; }; -const struct exsetsel_s exsetsel_tests[] = { +static const struct exsetsel_s exsetsel_tests[] = { /* sanity tests */ - {5, 10, 10, 5, 10, 0}, - {15, 17, 17, 15, 17, 0}, + {5, 10, 10, 5, 10 }, + {15, 17, 17, 15, 17 }, /* test cpMax > strlen() */ - {0, 100, 18, 0, 18, 0}, + {0, 100, 18, 0, 18 }, /* test cpMin < 0 && cpMax >= 0 after cpMax > strlen() */ - {-1, 1, 17, 17, 17, 0}, + {-1, 1, 17, 17, 17 }, /* test cpMin == cpMax */ - {5, 5, 5, 5, 5, 0}, + {5, 5, 5, 5, 5 }, /* test cpMin < 0 && cpMax >= 0 (bug 4462) */ - {-1, 0, 5, 5, 5, 0}, - {-1, 17, 5, 5, 5, 0}, - {-1, 18, 5, 5, 5, 0}, + {-1, 0, 5, 5, 5 }, + {-1, 17, 5, 5, 5 }, + {-1, 18, 5, 5, 5 }, /* test cpMin < 0 && cpMax < 0 */ - {-1, -1, 17, 17, 17, 0}, - {-4, -5, 17, 17, 17, 0}, + {-1, -1, 17, 17, 17 }, + {-4, -5, 17, 17, 17 }, /* test cpMin >=0 && cpMax < 0 (bug 6814) */ - {0, -1, 18, 0, 18, 0}, - {17, -5, 18, 17, 18, 0}, - {18, -3, 17, 17, 17, 0}, + {0, -1, 18, 0, 18 }, + {17, -5, 18, 17, 18 }, + {18, -3, 17, 17, 17 }, /* test if cpMin > cpMax */ - {15, 19, 18, 15, 18, 0}, - {19, 15, 18, 15, 18, 0}, + {15, 19, 18, 15, 18 }, + {19, 15, 18, 15, 18 }, + /* cpMin == strlen() && cpMax > cpMin */ + {17, 18, 18, 17, 18 }, + {17, 50, 18, 17, 18 }, }; static void check_EM_EXSETSEL(HWND hwnd, const struct exsetsel_s *setsel, int id) { @@ -4467,7 +4470,7 @@ SendMessageA(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM)&end); - if (setsel->_getsel_todo_wine) { + if (setsel->todo) { todo_wine { ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_EXSETSEL(%d): expected (%d,%d) actual:(%d,%d)\n", id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end); } @@ -4504,7 +4507,7 @@ SendMessageA(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM)&end); - if (setsel->_getsel_todo_wine) { + if (setsel->todo) { todo_wine { ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_SETSEL(%d): expected (%d,%d) actual:(%d,%d)\n", id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end); } @@ -4515,6 +4518,7 @@ static void test_EM_SETSEL(void) { + char buffA[32]; HWND hwndRichEdit = new_richedit(NULL); int i; const int num_tests = sizeof(exsetsel_tests)/sizeof(struct exsetsel_s); @@ -4528,6 +4532,11 @@ check_EM_SETSEL(hwndRichEdit, &exsetsel_tests[i], i); } + SendMessageA(hwndRichEdit, EM_SETSEL, 17, 18); + buffA[0] = 123; + SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffA); + ok(buffA[0] == 0, "selection text %s\n", buffA); + DestroyWindow(hwndRichEdit); } @@ -6044,26 +6053,153 @@ DestroyWindow(parent); } -static int cpMin_EN_LINK = -1; -static int cpMax_EN_LINK = -1; +static ENLINK enlink; +#define CURSOR_CLIENT_X 5 +#define CURSOR_CLIENT_Y 5 +#define WP_PARENT 1 +#define WP_CHILD 2 static LRESULT WINAPI EN_LINK_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - ENLINK* enlink = (ENLINK*)lParam; - if(message == WM_NOTIFY && enlink->nmhdr.code == EN_LINK) + if(message == WM_NOTIFY && ((NMHDR*)lParam)->code == EN_LINK) { - cpMin_EN_LINK = enlink->chrg.cpMin; - cpMax_EN_LINK = enlink->chrg.cpMax; + enlink = *(ENLINK*)lParam; } return DefWindowProcA(hwnd, message, wParam, lParam); } +static void link_notify_test(const char *desc, int i, HWND hwnd, HWND parent, + UINT msg, WPARAM wParam, LPARAM lParam, BOOL notifies) +{ + ENLINK junk_enlink; + + switch (msg) + { + case WM_LBUTTONDBLCLK: + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MOUSEHOVER: + case WM_MOUSEMOVE: + case WM_MOUSEWHEEL: + case WM_RBUTTONDBLCLK: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + lParam = MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y); + break; + case WM_SETCURSOR: + if (wParam == WP_PARENT) + wParam = (WPARAM)parent; + else if (wParam == WP_CHILD) + wParam = (WPARAM)hwnd; + break; + } + + memset(&junk_enlink, 0x23, sizeof(junk_enlink)); + enlink = junk_enlink; + + SendMessageA(hwnd, msg, wParam, lParam); + + if (notifies) + { + ok(enlink.nmhdr.hwndFrom == hwnd, + "%s test %i: Expected hwnd %p got %p\n", desc, i, hwnd, enlink.nmhdr.hwndFrom); + ok(enlink.nmhdr.idFrom == 0, + "%s test %i: Expected idFrom 0 got 0x%lx\n", desc, i, enlink.nmhdr.idFrom); + ok(enlink.msg == msg, + "%s test %i: Expected msg 0x%x got 0x%x\n", desc, i, msg, enlink.msg); + if (msg == WM_SETCURSOR) + { + ok(enlink.wParam == 0, + "%s test %i: Expected wParam 0 got 0x%lx\n", desc, i, enlink.wParam); + } + else + { + ok(enlink.wParam == wParam, + "%s test %i: Expected wParam 0x%lx got 0x%lx\n", desc, i, wParam, enlink.wParam); + } + ok(enlink.lParam == MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y), + "%s test %i: Expected lParam 0x%lx got 0x%lx\n", + desc, i, MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y), enlink.lParam); + ok(enlink.chrg.cpMin == 0 && enlink.chrg.cpMax == 31, + "%s test %i: Expected link range [0,31) got [%i,%i)\n", desc, i, enlink.chrg.cpMin, enlink.chrg.cpMax); + } + else + { + ok(memcmp(&enlink, &junk_enlink, sizeof(enlink)) == 0, + "%s test %i: Expected enlink to remain unmodified\n", desc, i); + } +} + static void test_EN_LINK(void) { - HWND parent; + HWND hwnd, parent; WNDCLASSA cls; - HWND hwndRichedit_EN_LINK; CHARFORMAT2A cf2; + POINT orig_cursor_pos; + POINT cursor_screen_pos = {CURSOR_CLIENT_X, CURSOR_CLIENT_Y}; + int i; + + static const struct + { + UINT msg; + WPARAM wParam; + LPARAM lParam; + BOOL notifies; + } + link_notify_tests[] = + { + /* hold down the left button and try some messages */ + { WM_LBUTTONDOWN, 0, 0, TRUE }, /* 0 */ + { EM_LINESCROLL, 0, 1, FALSE }, + { EM_SCROLL, SB_BOTTOM, 0, FALSE }, + { WM_LBUTTONDBLCLK, 0, 0, TRUE }, + { WM_MOUSEHOVER, 0, 0, FALSE }, + { WM_MOUSEMOVE, 0, 0, FALSE }, + { WM_MOUSEWHEEL, 0, 0, FALSE }, + { WM_RBUTTONDBLCLK, 0, 0, TRUE }, + { WM_RBUTTONDOWN, 0, 0, TRUE }, + { WM_RBUTTONUP, 0, 0, TRUE }, + { WM_SETCURSOR, 0, 0, FALSE }, + { WM_SETCURSOR, WP_PARENT, 0, FALSE }, + { WM_SETCURSOR, WP_CHILD, 0, TRUE }, + { WM_SETCURSOR, WP_CHILD, 1, TRUE }, + { WM_VSCROLL, SB_BOTTOM, 0, FALSE }, + { WM_LBUTTONUP, 0, 0, TRUE }, + /* hold down the right button and try some messages */ + { WM_RBUTTONDOWN, 0, 0, TRUE }, /* 16 */ + { EM_LINESCROLL, 0, 1, FALSE }, + { EM_SCROLL, SB_BOTTOM, 0, FALSE }, + { WM_LBUTTONDBLCLK, 0, 0, TRUE }, + { WM_LBUTTONDOWN, 0, 0, TRUE }, + { WM_LBUTTONUP, 0, 0, TRUE }, + { WM_MOUSEHOVER, 0, 0, FALSE }, + { WM_MOUSEMOVE, 0, 0, TRUE }, + { WM_MOUSEWHEEL, 0, 0, FALSE }, + { WM_RBUTTONDBLCLK, 0, 0, TRUE }, + { WM_SETCURSOR, 0, 0, FALSE }, + { WM_SETCURSOR, WP_PARENT, 0, FALSE }, + { WM_SETCURSOR, WP_CHILD, 0, TRUE }, + { WM_SETCURSOR, WP_CHILD, 1, TRUE }, + { WM_VSCROLL, SB_BOTTOM, 0, FALSE }, + { WM_RBUTTONUP, 0, 0, TRUE }, + /* try the messages with both buttons released */ + { EM_LINESCROLL, 0, 1, FALSE }, /* 32 */ + { EM_SCROLL, SB_BOTTOM, 0, FALSE }, + { WM_LBUTTONDBLCLK, 0, 0, TRUE }, + { WM_LBUTTONDOWN, 0, 0, TRUE }, + { WM_LBUTTONUP, 0, 0, TRUE }, + { WM_MOUSEHOVER, 0, 0, FALSE }, + { WM_MOUSEMOVE, 0, 0, TRUE }, + { WM_MOUSEWHEEL, 0, 0, FALSE }, + { WM_RBUTTONDBLCLK, 0, 0, TRUE }, + { WM_RBUTTONDOWN, 0, 0, TRUE }, + { WM_RBUTTONUP, 0, 0, TRUE }, + { WM_SETCURSOR, 0, 0, FALSE }, + { WM_SETCURSOR, WP_CHILD, 0, TRUE }, + { WM_SETCURSOR, WP_CHILD, 1, TRUE }, + { WM_SETCURSOR, WP_PARENT, 0, FALSE }, + { WM_VSCROLL, SB_BOTTOM, 0, FALSE } + }; /* register class to capture WM_NOTIFY */ cls.style = 0; @@ -6082,21 +6218,40 @@ 0, 0, 200, 60, NULL, NULL, NULL, NULL); ok(parent != 0, "Failed to create parent window\n"); - hwndRichedit_EN_LINK = new_richedit(parent); - ok(hwndRichedit_EN_LINK != 0, "Failed to create edit window\n"); + hwnd = new_richedit(parent); + ok(hwnd != 0, "Failed to create edit window\n"); - SendMessageA(hwndRichedit_EN_LINK, EM_SETEVENTMASK, 0, ENM_LINK); + SendMessageA(hwnd, EM_SETEVENTMASK, 0, ENM_LINK); cf2.cbSize = sizeof(CHARFORMAT2A); cf2.dwMask = CFM_LINK; cf2.dwEffects = CFE_LINK; - SendMessageA(hwndRichedit_EN_LINK, EM_SETCHARFORMAT, 0, (LPARAM)&cf2); + SendMessageA(hwnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf2); /* mixing letters and numbers causes runs to be split */ - SendMessageA(hwndRichedit_EN_LINK, WM_SETTEXT, 0, (LPARAM)"link text with at least 2 runs"); - SendMessageA(hwndRichedit_EN_LINK, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); - ok(cpMin_EN_LINK == 0 && cpMax_EN_LINK == 31, "Expected link range [0,31) got [%i,%i)\n", cpMin_EN_LINK, cpMax_EN_LINK); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"link text with at least 2 runs"); + + GetCursorPos(&orig_cursor_pos); + SetCursorPos(0, 0); - DestroyWindow(hwndRichedit_EN_LINK); + for (i = 0; i < sizeof(link_notify_tests)/sizeof(link_notify_tests[0]); i++) + { + link_notify_test("cursor position simulated", i, hwnd, parent, + link_notify_tests[i].msg, link_notify_tests[i].wParam, link_notify_tests[i].lParam, + link_notify_tests[i].msg == WM_SETCURSOR ? FALSE : link_notify_tests[i].notifies); + } + + ClientToScreen(hwnd, &cursor_screen_pos); + SetCursorPos(cursor_screen_pos.x, cursor_screen_pos.y); + + for (i = 0; i < sizeof(link_notify_tests)/sizeof(link_notify_tests[0]); i++) + { + link_notify_test("cursor position set", i, hwnd, parent, + link_notify_tests[i].msg, link_notify_tests[i].wParam, link_notify_tests[i].lParam, + link_notify_tests[i].notifies); + } + + SetCursorPos(orig_cursor_pos.x, orig_cursor_pos.y); + DestroyWindow(hwnd); DestroyWindow(parent); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/tests/richole.c wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/tests/richole.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/riched20/tests/richole.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/riched20/tests/richole.c 2015-06-28 16:51:28.000000000 +0000 @@ -3251,6 +3251,92 @@ ITextRange_Release(range); } +static void test_Expand(void) +{ + static const char test_text1[] = "TestSomeText"; + IRichEditOle *reole = NULL; + ITextDocument *doc = NULL; + ITextSelection *selection; + ITextRange *range; + LONG value; + HRESULT hr; + HWND hwnd; + + create_interfaces(&hwnd, &reole, &doc, &selection); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); + SendMessageA(hwnd, EM_SETSEL, 1, 2); + + hr = ITextDocument_Range(doc, 0, 4, &range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextRange_Expand(range, tomStory, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextRange_GetStart(range, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 0, "got %d\n", value); + hr = ITextRange_GetEnd(range, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 13, "got %d\n", value); + + hr = ITextSelection_Expand(selection, tomStory, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextSelection_GetStart(selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 0, "got %d\n", value); + hr = ITextSelection_GetEnd(selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 13, "got %d\n", value); + + hr = ITextRange_SetStart(range, 1); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextRange_SetEnd(range, 2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextSelection_SetStart(selection, 1); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextSelection_SetEnd(selection, 2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + value = 0; + hr = ITextRange_Expand(range, tomStory, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 12, "got %d\n", value); + hr = ITextRange_GetStart(range, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 0, "got %d\n", value); + hr = ITextRange_GetEnd(range, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 13, "got %d\n", value); + + value = 0; + hr = ITextSelection_Expand(selection, tomStory, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 12, "got %d\n", value); + hr = ITextSelection_GetStart(selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 0, "got %d\n", value); + hr = ITextSelection_GetEnd(selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 13, "got %d\n", value); + + release_interfaces(&hwnd, &reole, &doc, NULL); + + hr = ITextRange_Expand(range, tomStory, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextRange_Expand(range, tomStory, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextSelection_Expand(selection, tomStory, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextSelection_Expand(selection, tomStory, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + ITextSelection_Release(selection); + ITextRange_Release(range); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -3286,4 +3372,5 @@ test_InsertObject(); test_GetStoryLength(); test_ITextSelection_GetDuplicate(); + test_Expand(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/rpcrt4/rpc_transport.c wine-staging-1.7.46~ubuntu14.10.1/dlls/rpcrt4/rpc_transport.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/rpcrt4/rpc_transport.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/rpcrt4/rpc_transport.c 2015-06-28 16:51:28.000000000 +0000 @@ -2275,7 +2275,7 @@ WCHAR header[sizeof(fmtW) / sizeof(fmtW[0]) + 10]; sprintfW(header, fmtW, len); - if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_REPLACE))) return RPC_S_OK; + if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD))) return RPC_S_OK; return RPC_S_SERVER_UNAVAILABLE; } @@ -2867,7 +2867,7 @@ } if (info->scheme != RPC_C_HTTP_AUTHN_SCHEME_BASIC) - HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE); + HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); destroy_authinfo(info); return status; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/scrrun/filesystem.c wine-staging-1.7.46~ubuntu14.10.1/dlls/scrrun/filesystem.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/scrrun/filesystem.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/scrrun/filesystem.c 2015-06-28 16:51:28.000000000 +0000 @@ -633,8 +633,16 @@ static HRESULT WINAPI textstream_Close(ITextStream *iface) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + HRESULT hr = S_OK; + + TRACE("(%p)\n", This); + + if(!CloseHandle(This->file)) + hr = S_FALSE; + + This->file = NULL; + + return hr; } static const ITextStreamVtbl textstreamvtbl = { @@ -2645,8 +2653,10 @@ static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa) { struct file *This = impl_from_IFile(iface); - FIXME("(%p)->(%x)\n", This, pfa); - return E_NOTIMPL; + + TRACE("(%p)->(%x)\n", This, pfa); + + return SetFileAttributesW(This->path, pfa) ? S_OK : create_error(GetLastError()); } static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *pdate) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/scrrun/tests/filesystem.c wine-staging-1.7.46~ubuntu14.10.1/dlls/scrrun/tests/filesystem.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/scrrun/tests/filesystem.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/scrrun/tests/filesystem.c 2015-06-28 16:51:28.000000000 +0000 @@ -35,6 +35,9 @@ static IFileSystem3 *fs3; +/* w2k and 2k3 error code. */ +#define E_VAR_NOT_SET 0x800a005b + static inline ULONG get_refcount(IUnknown *iface) { IUnknown_AddRef(iface); @@ -542,7 +545,7 @@ WCHAR pathW[MAX_PATH]; FileAttribute fa; VARIANT size; - DWORD gfa; + DWORD gfa, new_gfa; IFile *file; HRESULT hr; HANDLE hf; @@ -580,10 +583,30 @@ ok(!lstrcmpW(str, pathW), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); +#define FILE_ATTR_MASK (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | \ + FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE | \ + FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED) + + hr = IFile_get_Attributes(file, &fa); + gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); + ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa); + + hr = IFile_put_Attributes(file, gfa | FILE_ATTRIBUTE_READONLY); + ok(hr == S_OK, "put_Attributes failed: %08x\n", hr); + new_gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(new_gfa == (gfa|FILE_ATTRIBUTE_READONLY), "new_gfa = %x, expected %x\n", new_gfa, gfa|FILE_ATTRIBUTE_READONLY); + + hr = IFile_get_Attributes(file, &fa); + ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); + ok(fa == new_gfa, "fa = %x, expected %x\n", fa, new_gfa); + + hr = IFile_put_Attributes(file, gfa); + ok(hr == S_OK, "put_Attributes failed: %08x\n", hr); + new_gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(new_gfa == gfa, "new_gfa = %x, expected %x\n", new_gfa, gfa); + hr = IFile_get_Attributes(file, &fa); - gfa = GetFileAttributesW(pathW) & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | - FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE | - FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED); ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa); @@ -1358,6 +1381,15 @@ hr = ITextStream_Read(stream, 1, &str); ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + hr = ITextStream_Close(stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_Read(stream, 1, &str); + ok(hr == CTL_E_BADFILEMODE || hr == E_VAR_NOT_SET, "got 0x%08x\n", hr); + + hr = ITextStream_Close(stream); + ok(hr == S_FALSE || hr == E_VAR_NOT_SET, "got 0x%08x\n", hr); + ITextStream_Release(stream); /* check it's created */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/secur32/schannel_gnutls.c wine-staging-1.7.46~ubuntu14.10.1/dlls/secur32/schannel_gnutls.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/secur32/schannel_gnutls.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/secur32/schannel_gnutls.c 2015-06-28 16:51:28.000000000 +0000 @@ -41,6 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32); WINE_DECLARE_DEBUG_CHANNEL(winediag); +/* Not present in gnutls version < 2.9.10. */ +extern int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm); + static void *libgnutls_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(gnutls_alert_get); @@ -49,6 +52,7 @@ MAKE_FUNCPTR(gnutls_certificate_free_credentials); MAKE_FUNCPTR(gnutls_certificate_get_peers); MAKE_FUNCPTR(gnutls_cipher_get); +MAKE_FUNCPTR(gnutls_cipher_get_block_size); MAKE_FUNCPTR(gnutls_cipher_get_key_size); MAKE_FUNCPTR(gnutls_credentials_set); MAKE_FUNCPTR(gnutls_deinit); @@ -75,7 +79,34 @@ MAKE_FUNCPTR(gnutls_transport_set_push_function); #undef MAKE_FUNCPTR - +#if GNUTLS_VERSION_MAJOR < 3 +#define GNUTLS_CIPHER_AES_192_CBC 92 +#define GNUTLS_CIPHER_AES_128_GCM 93 +#define GNUTLS_CIPHER_AES_256_GCM 94 +#endif + +static int compat_cipher_get_block_size(gnutls_cipher_algorithm_t cipher) +{ + switch(cipher) { + case GNUTLS_CIPHER_3DES_CBC: + return 8; + case GNUTLS_CIPHER_AES_128_CBC: + case GNUTLS_CIPHER_AES_256_CBC: + return 16; + case GNUTLS_CIPHER_ARCFOUR_128: + case GNUTLS_CIPHER_ARCFOUR_40: + return 1; + case GNUTLS_CIPHER_DES_CBC: + return 8; + case GNUTLS_CIPHER_NULL: + return 1; + case GNUTLS_CIPHER_RC2_40_CBC: + return 8; + default: + FIXME("Unknown cipher %#x, returning 1\n", cipher); + return 1; + } +} static ssize_t schan_pull_adapter(gnutls_transport_ptr_t transport, void *buff, size_t buff_len) @@ -239,37 +270,6 @@ return SEC_E_OK; } -static unsigned int schannel_get_cipher_block_size(gnutls_cipher_algorithm_t cipher) -{ - const struct - { - gnutls_cipher_algorithm_t cipher; - unsigned int block_size; - } - algorithms[] = - { - {GNUTLS_CIPHER_3DES_CBC, 8}, - {GNUTLS_CIPHER_AES_128_CBC, 16}, - {GNUTLS_CIPHER_AES_256_CBC, 16}, - {GNUTLS_CIPHER_ARCFOUR_128, 1}, - {GNUTLS_CIPHER_ARCFOUR_40, 1}, - {GNUTLS_CIPHER_DES_CBC, 8}, - {GNUTLS_CIPHER_NULL, 1}, - {GNUTLS_CIPHER_RC2_40_CBC, 8}, - }; - unsigned int i; - - for (i = 0; i < sizeof(algorithms) / sizeof(*algorithms); ++i) - { - if (algorithms[i].cipher == cipher) - return algorithms[i].block_size; - } - - FIXME("Unknown cipher %#x, returning 1\n", cipher); - - return 1; -} - static DWORD schannel_get_protocol(gnutls_protocol_t proto) { /* FIXME: currently schannel only implements client connections, but @@ -288,7 +288,7 @@ } } -static ALG_ID schannel_get_cipher_algid(gnutls_cipher_algorithm_t cipher) +static ALG_ID schannel_get_cipher_algid(int cipher) { switch (cipher) { @@ -299,7 +299,10 @@ case GNUTLS_CIPHER_DES_CBC: case GNUTLS_CIPHER_3DES_CBC: return CALG_DES; case GNUTLS_CIPHER_AES_128_CBC: - case GNUTLS_CIPHER_AES_256_CBC: return CALG_AES; + case GNUTLS_CIPHER_AES_128_GCM: return CALG_AES_128; + case GNUTLS_CIPHER_AES_192_CBC: return CALG_AES_192; + case GNUTLS_CIPHER_AES_256_GCM: + case GNUTLS_CIPHER_AES_256_CBC: return CALG_AES_256; case GNUTLS_CIPHER_RC2_40_CBC: return CALG_RC2; default: FIXME("unknown algorithm %d\n", cipher); @@ -340,8 +343,7 @@ unsigned int schan_imp_get_session_cipher_block_size(schan_imp_session session) { gnutls_session_t s = (gnutls_session_t)session; - gnutls_cipher_algorithm_t cipher = pgnutls_cipher_get(s); - return schannel_get_cipher_block_size(cipher); + return pgnutls_cipher_get_block_size(pgnutls_cipher_get(s)); } unsigned int schan_imp_get_max_message_size(schan_imp_session session) @@ -525,6 +527,12 @@ LOAD_FUNCPTR(gnutls_transport_set_push_function) #undef LOAD_FUNCPTR + if (!(pgnutls_cipher_get_block_size = wine_dlsym(libgnutls_handle, "gnutls_cipher_get_block_size", NULL, 0))) + { + WARN("gnutls_cipher_get_block_size not found\n"); + pgnutls_cipher_get_block_size = compat_cipher_get_block_size; + } + ret = pgnutls_global_init(); if (ret != GNUTLS_E_SUCCESS) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/shell32/tests/progman_dde.c wine-staging-1.7.46~ubuntu14.10.1/dlls/shell32/tests/progman_dde.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/shell32/tests/progman_dde.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/shell32/tests/progman_dde.c 2015-06-28 16:51:28.000000000 +0000 @@ -363,7 +363,7 @@ * window creation happened were not encouraging (not including * SetWindowsHookEx). */ -static void CheckWindowCreated(const char *winName, BOOL closeWindow, int testParams) +static HWND CheckWindowCreated(const char *winName, BOOL closeWindow, int testParams) { HWND window = NULL; int i; @@ -381,7 +381,9 @@ if (window != NULL && closeWindow) { SendMessageA(window, WM_SYSCOMMAND, SC_CLOSE, 0); + window = NULL; } + return window; } /* Check for Existence (or non-existence) of a file or group @@ -468,11 +470,12 @@ * if expected_result is DMLERR_NO_ERROR, test * 1. window is open */ -static void ShowGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, +static HWND ShowGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, const char *groupName, const char *windowTitle, BOOL closeAfterShowing, int testParams) { HDDEDATA hData; UINT error; + HWND hwnd = 0; DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams); /* todo_wine... Is expected to fail, wine stubbed functions DO fail */ @@ -494,8 +497,9 @@ if (error == DMLERR_NO_ERROR) { /* Check if Window is Open (polling) */ - CheckWindowCreated(windowTitle, closeAfterShowing, testParams); + hwnd = CheckWindowCreated(windowTitle, closeAfterShowing, testParams); } + return hwnd; } /* Delete Group Test. @@ -582,12 +586,13 @@ * All samples I've seen using Compound were of this form (CreateGroup, * AddItems) so this covers minimum expected functionality. */ -static void CompoundCommandTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, +static HWND CompoundCommandTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, const char *groupName, const char *windowTitle, const char *fileName1, const char *fileName2, int testParams) { HDDEDATA hData; UINT error; + HWND hwnd = 0; DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams); todo_wine @@ -601,10 +606,11 @@ { /* Check that File exists */ CheckFileExistsInProgramGroups(groupName, TRUE, TRUE, NULL, testParams); - CheckWindowCreated(windowTitle, FALSE, testParams); + hwnd = CheckWindowCreated(windowTitle, FALSE, testParams); CheckFileExistsInProgramGroups(fileName1, TRUE, FALSE, groupName, testParams); CheckFileExistsInProgramGroups(fileName2, TRUE, FALSE, groupName, testParams); } + return hwnd; } static void CreateAddItemText(char *itemtext, const char *cmdline, const char *name) @@ -626,6 +632,7 @@ char f1g1[MAX_PATH], f2g1[MAX_PATH], f3g1[MAX_PATH], f1g3[MAX_PATH], f2g3[MAX_PATH]; char itemtext[MAX_PATH + 20]; char comptext[2 * (MAX_PATH + 20) + 21]; + HWND hwnd; testnum = 1; /* Invalid Command */ @@ -658,10 +665,11 @@ ShowGroupTest(instance, hConv, "[ShowGroup(Group1)]", DMLERR_NOTPROCESSED, "Group1", Group1Title, TRUE, DDE_TEST_SHOWGROUP|testnum++); DeleteItemTest(instance, hConv, "[DeleteItem(f3g1Name)]", DMLERR_NO_ERROR, "f3g1Name.lnk", "Group1", DDE_TEST_DELETEITEM|testnum++); ShowGroupTest(instance, hConv, "[ShowGroup(Startup,0)]", DMLERR_NO_ERROR, "Startup", StartupTitle, TRUE, DDE_TEST_SHOWGROUP|testnum++); - ShowGroupTest(instance, hConv, "[ShowGroup(Group1,0)]", DMLERR_NO_ERROR, "Group1", Group1Title, FALSE, DDE_TEST_SHOWGROUP|testnum++); + hwnd = ShowGroupTest(instance, hConv, "[ShowGroup(Group1,0)]", DMLERR_NO_ERROR, "Group1", Group1Title, FALSE, DDE_TEST_SHOWGROUP|testnum++); /* DeleteGroup Test - Note that Window is Open for this test */ DeleteGroupTest(instance, hConv, "[DeleteGroup(Group1)]", DMLERR_NO_ERROR, "Group1", DDE_TEST_DELETEGROUP|testnum++); + if (hwnd) SendMessageA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); /* Compound Execute String Command */ lstrcpyA(comptext, "[CreateGroup(Group3)]"); @@ -669,9 +677,10 @@ lstrcatA(comptext, itemtext); CreateAddItemText(itemtext, f2g3, "f2g3Name"); lstrcatA(comptext, itemtext); - CompoundCommandTest(instance, hConv, comptext, DMLERR_NO_ERROR, "Group3", Group3Title, "f1g3Name.lnk", "f2g3Name.lnk", DDE_TEST_COMPOUND|testnum++); + hwnd = CompoundCommandTest(instance, hConv, comptext, DMLERR_NO_ERROR, "Group3", Group3Title, "f1g3Name.lnk", "f2g3Name.lnk", DDE_TEST_COMPOUND|testnum++); DeleteGroupTest(instance, hConv, "[DeleteGroup(Group3)]", DMLERR_NO_ERROR, "Group3", DDE_TEST_DELETEGROUP|testnum++); + if (hwnd) SendMessageA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); /* Full Parameters of Add Item */ /* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/shlwapi/ordinal.c wine-staging-1.7.46~ubuntu14.10.1/dlls/shlwapi/ordinal.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/shlwapi/ordinal.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/shlwapi/ordinal.c 2015-06-28 16:51:28.000000000 +0000 @@ -1407,9 +1407,11 @@ hr = IUnknown_QueryInterface(lpUnknown, &IID_IPersist, (void**)&persist); if (hr != S_OK) + { hr = IUnknown_QueryInterface(lpUnknown, &IID_IPersistFolder, (void**)&persist); if (hr != S_OK) return hr; + } hr = IPersist_GetClassID(persist, clsid); IPersist_Release(persist); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/urlmon/tests/url.c wine-staging-1.7.46~ubuntu14.10.1/dlls/urlmon/tests/url.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/urlmon/tests/url.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/urlmon/tests/url.c 2015-06-28 16:51:28.000000000 +0000 @@ -3851,6 +3851,32 @@ IInternetSession_Release(session); } +static BOOL can_do_https(void) +{ + HINTERNET ses, con, req; + BOOL ret; + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + ok(ses != NULL, "InternetOpen failed\n"); + + con = InternetConnectA(ses, "test.winehq.org", INTERNET_DEFAULT_HTTPS_PORT, + NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + + req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL, + INTERNET_FLAG_SECURE, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret || broken(GetLastError() == ERROR_INTERNET_CANNOT_CONNECT), + "request failed: %u\n", GetLastError()); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + return ret; +} + START_TEST(url) { HMODULE hurlmon; @@ -3930,26 +3956,35 @@ trace("file test (no callback)...\n"); test_BindToStorage(FILE_TEST, BINDTEST_NO_CALLBACK, TYMED_ISTREAM); - trace("synchronous https test (invalid CN, dialog)\n"); - onsecurityproblem_hres = S_FALSE; - http_is_first = TRUE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + if(can_do_https()) { + trace("synchronous https test (invalid CN, dialog)\n"); + onsecurityproblem_hres = S_FALSE; + http_is_first = TRUE; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; + + trace("asynchronous https test (invalid CN, fail)\n"); + onsecurityproblem_hres = E_FAIL; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + trace("asynchronous https test (invalid CN, accept)\n"); + onsecurityproblem_hres = S_OK; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + trace("asynchronous https test (invalid CN, dialog 2)\n"); + onsecurityproblem_hres = S_FALSE; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + invalid_cn_accepted = FALSE; + + trace("asynchronous https test...\n"); + test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); + }else { + win_skip("Skipping https testt\n"); + } bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; - trace("asynchronous https test (invalid CN, fail)\n"); - onsecurityproblem_hres = E_FAIL; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - - trace("asynchronous https test (invalid CN, accept)\n"); - onsecurityproblem_hres = S_OK; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - - trace("asynchronous https test (invalid CN, dialog 2)\n"); - onsecurityproblem_hres = S_FALSE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - invalid_cn_accepted = FALSE; - trace("winetest test (async switch)...\n"); test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_ASYNC_SWITCH, TYMED_ISTREAM); @@ -4003,9 +4038,6 @@ trace("winetest test (no callback)...\n"); test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM); - trace("asynchronous https test...\n"); - test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); - trace("emulated https test...\n"); test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/user32/button.c wine-staging-1.7.46~ubuntu14.10.1/dlls/user32/button.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/user32/button.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/user32/button.c 2015-06-28 16:51:28.000000000 +0000 @@ -334,7 +334,6 @@ break; } SendMessageW( hWnd, BM_SETSTATE, FALSE, 0 ); - ReleaseCapture(); GetClientRect( hWnd, &rect ); if (uMsg == WM_KEYUP || PtInRect( &rect, pt )) { @@ -354,6 +353,7 @@ } BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); } + ReleaseCapture(); break; case WM_CAPTURECHANGED: diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/user32/tests/msg.c wine-staging-1.7.46~ubuntu14.10.1/dlls/user32/tests/msg.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/user32/tests/msg.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/user32/tests/msg.c 2015-06-28 16:51:28.000000000 +0000 @@ -793,6 +793,9 @@ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_NCPAINT, sent|wparam|optional, 1 }, + { WM_ERASEBKGND, sent|optional }, + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOMOVE|SWP_NOSIZE }, { WM_ACTIVATEAPP, sent|wparam, 1 }, { WM_NCACTIVATE, sent }, { WM_ACTIVATE, sent|wparam, 1 }, @@ -5292,6 +5295,21 @@ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, { 0 } }; +static const struct message WmLButtonDownStaticSeq[] = +{ + { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, + { HCBT_SETFOCUS, hook }, + { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_CTLCOLORSTATIC, sent|defwinproc }, + { BM_SETSTATE, sent|wparam|defwinproc, TRUE }, + { WM_CTLCOLORSTATIC, sent|defwinproc }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { 0 } +}; static const struct message WmLButtonUpSeq[] = { { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, @@ -5302,12 +5320,48 @@ { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, { 0 } }; +static const struct message WmLButtonUpStaticSeq[] = +{ + { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, + { BM_SETSTATE, sent|wparam|defwinproc, FALSE }, + { WM_CTLCOLORSTATIC, sent|defwinproc }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, + { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, + { 0 } +}; +static const struct message WmLButtonUpAutoSeq[] = +{ + { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, + { BM_SETSTATE, sent|wparam|defwinproc, FALSE }, + { WM_CTLCOLORSTATIC, sent|defwinproc }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, + { BM_SETCHECK, sent|defwinproc }, + { WM_CTLCOLORSTATIC, sent|defwinproc, 0, 0 }, + { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, + { 0 } +}; +static const struct message WmLButtonUpBrokenSeq[] = +{ + { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, + { 0 } +}; static const struct message WmSetFontButtonSeq[] = { { WM_SETFONT, sent }, { WM_PAINT, sent }, { WM_ERASEBKGND, sent|defwinproc|optional }, { WM_CTLCOLORBTN, sent|defwinproc }, + { WM_CTLCOLORBTN, sent|defwinproc|optional }, /* FIXME: Wine sends it twice for BS_OWNERDRAW */ + { 0 } +}; +static const struct message WmSetFontStaticSeq[] = +{ + { WM_SETFONT, sent }, + { WM_PAINT, sent }, + { WM_ERASEBKGND, sent|defwinproc|optional }, + { WM_CTLCOLORSTATIC, sent|defwinproc }, { 0 } }; static const struct message WmSetStyleButtonSeq[] = @@ -5468,48 +5522,62 @@ { static const struct { - DWORD style; - DWORD dlg_code; - const struct message *setfocus; - const struct message *killfocus; - const struct message *setstyle; - const struct message *setstate; - const struct message *clearstate; - const struct message *setcheck; + DWORD style; + DWORD dlg_code; + const struct message *setfocus; + const struct message *killfocus; + const struct message *setstyle; + const struct message *setstate; + const struct message *clearstate; + const struct message *setcheck; + const struct message *lbuttondown; + const struct message *lbuttonup; + const struct message *setfont; } button[] = { - { BS_PUSHBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, - WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleButtonSeq, - WmSetStateButtonSeq, WmSetStateButtonSeq, WmSetCheckIgnoredSeq }, - { BS_DEFPUSHBUTTON, DLGC_BUTTON | DLGC_DEFPUSHBUTTON, - WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleButtonSeq, - WmSetStateButtonSeq, WmSetStateButtonSeq, WmSetCheckIgnoredSeq }, - { BS_CHECKBOX, DLGC_BUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_AUTOCHECKBOX, DLGC_BUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_RADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_3STATE, DLGC_BUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_AUTO3STATE, DLGC_BUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_GROUPBOX, DLGC_STATIC, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckIgnoredSeq }, - { BS_USERBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, - WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleUserSeq, - WmSetStateUserSeq, WmClearStateButtonSeq, WmSetCheckIgnoredSeq }, - { BS_AUTORADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, - WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, - WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq }, - { BS_OWNERDRAW, DLGC_BUTTON, - WmSetFocusOwnerdrawSeq, WmKillFocusOwnerdrawSeq, WmSetStyleOwnerdrawSeq, - WmSetStateOwnerdrawSeq, WmClearStateOwnerdrawSeq, WmSetCheckIgnoredSeq }, + { BS_PUSHBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, + WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleButtonSeq, + WmSetStateButtonSeq, WmSetStateButtonSeq, WmSetCheckIgnoredSeq, + WmLButtonDownSeq, WmLButtonUpSeq, WmSetFontButtonSeq }, + { BS_DEFPUSHBUTTON, DLGC_BUTTON | DLGC_DEFPUSHBUTTON, + WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleButtonSeq, + WmSetStateButtonSeq, WmSetStateButtonSeq, WmSetCheckIgnoredSeq, + WmLButtonDownSeq, WmLButtonUpSeq, WmSetFontButtonSeq }, + { BS_CHECKBOX, DLGC_BUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + WmLButtonDownStaticSeq, WmLButtonUpStaticSeq, WmSetFontStaticSeq }, + { BS_AUTOCHECKBOX, DLGC_BUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + WmLButtonDownStaticSeq, WmLButtonUpAutoSeq, WmSetFontStaticSeq }, + { BS_RADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + WmLButtonDownStaticSeq, WmLButtonUpStaticSeq, WmSetFontStaticSeq }, + { BS_3STATE, DLGC_BUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + WmLButtonDownStaticSeq, WmLButtonUpStaticSeq, WmSetFontStaticSeq }, + { BS_AUTO3STATE, DLGC_BUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + WmLButtonDownStaticSeq, WmLButtonUpAutoSeq, WmSetFontStaticSeq }, + { BS_GROUPBOX, DLGC_STATIC, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckIgnoredSeq, + WmLButtonDownStaticSeq, WmLButtonUpStaticSeq, WmSetFontStaticSeq }, + { BS_USERBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, + WmSetFocusButtonSeq, WmKillFocusButtonSeq, WmSetStyleUserSeq, + WmSetStateUserSeq, WmClearStateButtonSeq, WmSetCheckIgnoredSeq, + WmLButtonDownSeq, WmLButtonUpSeq, WmSetFontButtonSeq }, + { BS_AUTORADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, + WmSetFocusStaticSeq, WmKillFocusStaticSeq, WmSetStyleStaticSeq, + WmSetStateStaticSeq, WmSetStateStaticSeq, WmSetCheckStaticSeq, + NULL /* avoid infinite loop */, WmLButtonUpBrokenSeq, WmSetFontStaticSeq }, + { BS_OWNERDRAW, DLGC_BUTTON, + WmSetFocusOwnerdrawSeq, WmKillFocusOwnerdrawSeq, WmSetStyleOwnerdrawSeq, + WmSetStateOwnerdrawSeq, WmClearStateOwnerdrawSeq, WmSetCheckIgnoredSeq, + WmLButtonDownSeq, WmLButtonUpSeq, WmSetFontButtonSeq }, }; unsigned int i; HWND hwnd, parent; @@ -5537,12 +5605,13 @@ { MSG msg; DWORD style, state; + char desc[64]; trace("button style %08x\n", button[i].style); hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_CHILD | BS_NOTIFY, 0, 0, 50, 14, parent, (HMENU)ID_BUTTON, 0, NULL); - ok(hwnd != 0, "Failed to create button window\n"); + ok(hwnd != 0, "Failed to create button window\n"); style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY); @@ -5552,28 +5621,28 @@ else ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style); - dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); - ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code); + dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); + ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code); - ShowWindow(hwnd, SW_SHOW); - UpdateWindow(hwnd); - SetFocus(0); - flush_events(); - SetFocus(0); - flush_sequence(); + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + SetFocus(0); + flush_events(); + SetFocus(0); + flush_sequence(); log_all_parent_messages++; ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); - SetFocus(hwnd); + SetFocus(hwnd); SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE); + ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE); - SetFocus(0); + SetFocus(0); SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE); + ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE); ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); @@ -5662,39 +5731,45 @@ log_all_parent_messages--; - DestroyWindow(hwnd); - } + DestroyWindow(hwnd); - DestroyWindow(parent); + hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_POPUP | WS_VISIBLE, + 0, 0, 50, 14, 0, 0, 0, NULL); + ok(hwnd != 0, "Failed to create button window\n"); - hwnd = CreateWindowExA(0, "my_button_class", "test", BS_PUSHBUTTON | WS_POPUP | WS_VISIBLE, - 0, 0, 50, 14, 0, 0, 0, NULL); - ok(hwnd != 0, "Failed to create button window\n"); + SetForegroundWindow(hwnd); + flush_events(); - SetForegroundWindow(hwnd); - flush_events(); + SetActiveWindow(hwnd); + SetFocus(0); + flush_sequence(); - SetActiveWindow(hwnd); - SetFocus(0); - flush_sequence(); + if (button[i].lbuttondown) + { + SendMessageA(hwnd, WM_LBUTTONDOWN, 0, 0); + sprintf(desc, "button[%i]: WM_LBUTTONDOWN on a button", i); + ok_sequence(button[i].lbuttondown, desc, FALSE); + } - SendMessageA(hwnd, WM_LBUTTONDOWN, 0, 0); - ok_sequence(WmLButtonDownSeq, "WM_LBUTTONDOWN on a button", FALSE); + SendMessageA(hwnd, WM_LBUTTONUP, 0, 0); + sprintf(desc, "button[%i]: WM_LBUTTONUP on a button", i); + ok_sequence(button[i].lbuttonup, desc, FALSE); - SendMessageA(hwnd, WM_LBUTTONUP, 0, 0); - ok_sequence(WmLButtonUpSeq, "WM_LBUTTONUP on a button", FALSE); + flush_sequence(); + zfont = GetStockObject(SYSTEM_FONT); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)zfont, TRUE); + UpdateWindow(hwnd); + sprintf(desc, "button[%i]: WM_SETFONT on a button", i); + ok_sequence(button[i].setfont, desc, FALSE); - flush_sequence(); - zfont = GetStockObject(SYSTEM_FONT); - SendMessageA(hwnd, WM_SETFONT, (WPARAM)zfont, TRUE); - UpdateWindow(hwnd); - ok_sequence(WmSetFontButtonSeq, "WM_SETFONT on a button", FALSE); + DestroyWindow(hwnd); + } - DestroyWindow(hwnd); + DestroyWindow(parent); } /****************** static message test *************************/ -static const struct message WmSetFontStaticSeq[] = +static const struct message WmSetFontStaticSeq2[] = { { WM_SETFONT, sent }, { WM_PAINT, sent|defwinproc|optional }, @@ -5754,7 +5829,7 @@ const struct message *setfont; } static_ctrl[] = { { SS_LEFT, DLGC_STATIC, - WmSetFontStaticSeq } + WmSetFontStaticSeq2 } }; unsigned int i; HWND hwnd; @@ -10336,13 +10411,14 @@ { MSG msg; DWORD time; - BOOL ret, go = FALSE; + BOOL ret; time = GetTickCount(); - while (GetTickCount() - time < 200 && !go) { + while (GetTickCount() - time < 200) { ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE); - go = ret && msg.pt.x > x && msg.pt.y > y; + if (ret && msg.pt.x > x && msg.pt.y > y) break; if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, GetTickCount() - time, QS_ALLINPUT ); + else Sleep( GetTickCount() - time ); } } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wbemprox/builtin.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wbemprox/builtin.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wbemprox/builtin.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wbemprox/builtin.c 2015-06-28 16:51:28.000000000 +0000 @@ -271,6 +271,8 @@ {'P','N','P','D','e','v','i','c','e','I','D',0}; static const WCHAR prop_pprocessidW[] = {'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0}; +static const WCHAR prop_primaryW[] = + {'P','r','i','m','a','r','y',0}; static const WCHAR prop_processidW[] = {'P','r','o','c','e','s','s','I','D',0}; static const WCHAR prop_processoridW[] = @@ -349,6 +351,8 @@ {'V','o','l','u','m','e','N','a','m','e',0}; static const WCHAR prop_volumeserialnumberW[] = {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; +static const WCHAR prop_workingsetsizeW[] = + {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0}; /* column definitions must be kept in sync with record structures below */ static const struct column col_baseboard[] = @@ -480,6 +484,7 @@ { prop_oslanguageW, CIM_UINT32, VT_I4 }, { prop_osproductsuiteW, CIM_UINT32, VT_I4 }, { prop_ostypeW, CIM_UINT16, VT_I4 }, + { prop_primaryW, CIM_BOOLEAN }, { prop_serialnumberW, CIM_STRING }, { prop_servicepackmajorW, CIM_UINT16, VT_I4 }, { prop_servicepackminorW, CIM_UINT16, VT_I4 }, @@ -518,16 +523,17 @@ }; static const struct column col_process[] = { - { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_commandlineW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_handleW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_pprocessidW, CIM_UINT32, VT_I4 }, - { prop_processidW, CIM_UINT32, VT_I4 }, - { prop_threadcountW, CIM_UINT32, VT_I4 }, + { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_commandlineW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_handleW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_pprocessidW, CIM_UINT32, VT_I4 }, + { prop_processidW, CIM_UINT32, VT_I4 }, + { prop_threadcountW, CIM_UINT32, VT_I4 }, + { prop_workingsetsizeW, CIM_UINT64 }, /* methods */ - { method_getownerW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } + { method_getownerW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } }; static const struct column col_processor[] = { @@ -861,6 +867,7 @@ UINT32 oslanguage; UINT32 osproductsuite; UINT16 ostype; + int primary; const WCHAR *serialnumber; UINT16 servicepackmajor; UINT16 servicepackminor; @@ -907,6 +914,7 @@ UINT32 pprocess_id; UINT32 process_id; UINT32 thread_count; + UINT64 workingsetsize; /* methods */ class_method *get_owner; }; @@ -1586,6 +1594,8 @@ for (;;) { + heap_free( glob ); + heap_free( path ); path = pop_dir( dirstack, &len ); if (!(glob = build_glob( root[0], path, len ))) { @@ -1635,8 +1645,6 @@ FindClose( handle ); } if (!peek_dir( dirstack )) break; - heap_free( glob ); - heap_free( path ); } } @@ -1678,6 +1686,8 @@ for (;;) { + heap_free( glob ); + heap_free( path ); path = pop_dir( dirstack, &len ); if (!(glob = build_glob( root[0], path, len ))) { @@ -1728,8 +1738,6 @@ FindClose( handle ); } if (!peek_dir( dirstack )) break; - heap_free( glob ); - heap_free( path ); } } @@ -2200,16 +2208,17 @@ if (!resize_table( table, row + 1, sizeof(*rec) )) goto done; rec = (struct record_process *)(table->data + offset); - rec->caption = heap_strdupW( entry.szExeFile ); - rec->commandline = get_cmdline( entry.th32ProcessID ); - rec->description = heap_strdupW( entry.szExeFile ); + rec->caption = heap_strdupW( entry.szExeFile ); + rec->commandline = get_cmdline( entry.th32ProcessID ); + rec->description = heap_strdupW( entry.szExeFile ); sprintfW( handle, fmtW, entry.th32ProcessID ); - rec->handle = heap_strdupW( handle ); - rec->name = heap_strdupW( entry.szExeFile ); - rec->process_id = entry.th32ProcessID; - rec->pprocess_id = entry.th32ParentProcessID; - rec->thread_count = entry.cntThreads; - rec->get_owner = process_get_owner; + rec->handle = heap_strdupW( handle ); + rec->name = heap_strdupW( entry.szExeFile ); + rec->process_id = entry.th32ProcessID; + rec->pprocess_id = entry.th32ParentProcessID; + rec->thread_count = entry.cntThreads; + rec->workingsetsize = 0; + rec->get_owner = process_get_owner; if (!match_row( table, row, cond, &status )) { free_row_values( table, row ); @@ -2491,6 +2500,7 @@ rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ rec->ostype = 18; /* WINNT */ + rec->primary = -1; rec->serialnumber = os_serialnumberW; rec->servicepackmajor = 3; rec->servicepackminor = 0; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/info.c wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/info.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/info.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/info.c 2015-06-28 16:51:28.000000000 +0000 @@ -230,7 +230,7 @@ IsEqualIID(&IID_IWICBitmapCodecInfo, iid) || IsEqualIID(&IID_IWICBitmapDecoderInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICBitmapDecoderInfo_iface; } else { @@ -671,7 +671,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapDecoderInfo_iface; return S_OK; } @@ -700,7 +700,7 @@ IsEqualIID(&IID_IWICBitmapCodecInfo, iid) || IsEqualIID(&IID_IWICBitmapEncoderInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICBitmapEncoderInfo_iface; } else { @@ -962,7 +962,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapEncoderInfo_iface; return S_OK; } @@ -990,7 +990,7 @@ IsEqualIID(&IID_IWICComponentInfo, iid) || IsEqualIID(&IID_IWICFormatConverterInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICFormatConverterInfo_iface; } else { @@ -1179,7 +1179,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICFormatConverterInfo_iface; return S_OK; } @@ -1208,7 +1208,7 @@ IsEqualIID(&IID_IWICPixelFormatInfo, iid) || IsEqualIID(&IID_IWICPixelFormatInfo2 ,iid)) { - *ppv = This; + *ppv = &This->IWICPixelFormatInfo2_iface; } else { @@ -1473,7 +1473,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICPixelFormatInfo2_iface; return S_OK; } @@ -1504,7 +1504,7 @@ IsEqualIID(&IID_IWICMetadataHandlerInfo, riid) || IsEqualIID(&IID_IWICMetadataReaderInfo, riid)) { - *ppv = This; + *ppv = &This->IWICMetadataReaderInfo_iface; } else { @@ -1912,7 +1912,7 @@ This->classkey = classkey; This->clsid = *clsid; - *info = (IWICComponentInfo *)This; + *info = (IWICComponentInfo *)&This->IWICMetadataReaderInfo_iface; return S_OK; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/stream.c wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/stream.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/stream.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/stream.c 2015-06-28 16:51:28.000000000 +0000 @@ -757,7 +757,7 @@ if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IStream, iid) || IsEqualIID(&IID_ISequentialStream, iid) || IsEqualIID(&IID_IWICStream, iid)) { - *ppv = This; + *ppv = &This->IWICStream_iface; IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/tests/info.c wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/tests/info.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/windowscodecs/tests/info.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/windowscodecs/tests/info.c 2015-06-28 16:51:28.000000000 +0000 @@ -223,7 +223,7 @@ memset(value, 0xaa, 256 * sizeof(WCHAR)); hr = IWICComponentInfo_GetAuthor(info, len-1, value, NULL); ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%x\n", hr); - ok(value[0] = 0xaaaa, "string modified\n"); + ok(value[0] == 0xaaaa, "string modified\n"); len = 0xdeadbeef; memset(value, 0xaa, 256 * sizeof(WCHAR)); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/context.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/context.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/context.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/context.c 2015-06-28 16:51:28.000000000 +0000 @@ -2785,6 +2785,7 @@ /* We need to deal with frequency data! */ struct wined3d_vertex_declaration *declaration = state->vertex_declaration; BOOL use_vshader = use_vs(state); + BOOL generic_attributes = context->d3d_info->ffp_generic_attributes; unsigned int i; stream_info->use_map = 0; @@ -2829,7 +2830,7 @@ } else { - if (!element->ffp_valid) + if (!generic_attributes && !element->ffp_valid) { WARN("Skipping unsupported fixed function element of format %s and usage %s.\n", debug_d3dformat(element->format->id), debug_d3ddeclusage(element->usage)); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/directx.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/directx.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/directx.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/directx.c 2015-06-28 16:51:28.000000000 +0000 @@ -3399,13 +3399,25 @@ gl_info->supported[NV_POINT_SPRITE] = TRUE; } + if ((!gl_info->supported[EXT_BLEND_MINMAX] || !gl_info->supported[EXT_BLEND_SUBTRACT]) + && gl_version >= MAKEDWORD_VERSION(1, 4)) + { + TRACE("GL CORE: GL_EXT_blend_minmax / GL_EXT_blend_subtract support.\n"); + gl_info->supported[EXT_BLEND_MINMAX] = TRUE; + gl_info->supported[EXT_BLEND_SUBTRACT] = TRUE; + } + if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && gl_version >= MAKEDWORD_VERSION(2, 0)) { TRACE("GL CORE: GL_ARB_texture_non_power_of_two support.\n"); gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = TRUE; } - if (gl_version >= MAKEDWORD_VERSION(2, 0)) gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE; + if (gl_info->supported[EXT_BLEND_MINMAX] || gl_info->supported[EXT_BLEND_SUBTRACT]) + gl_info->supported[WINED3D_GL_BLEND_EQUATION] = TRUE; + + if (gl_version >= MAKEDWORD_VERSION(2, 0)) + gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE; if (gl_info->supported[APPLE_FENCE]) { @@ -4760,7 +4772,6 @@ WINED3DPMISCCAPS_CLIPTLVERTS | WINED3DPMISCCAPS_CLIPPLANESCALEDPOINTS | WINED3DPMISCCAPS_MASKZ | - WINED3DPMISCCAPS_BLENDOP | WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING; /* TODO: WINED3DPMISCCAPS_NULLREFERENCE @@ -4768,6 +4779,8 @@ WINED3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS WINED3DPMISCCAPS_FOGVERTEXCLAMPED */ + if (gl_info->supported[WINED3D_GL_BLEND_EQUATION]) + caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_BLENDOP; if (gl_info->supported[EXT_BLEND_EQUATION_SEPARATE] && gl_info->supported[EXT_BLEND_FUNC_SEPARATE]) caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_SEPARATEALPHABLEND; if (gl_info->supported[EXT_DRAW_BUFFERS2]) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/glsl_shader.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/glsl_shader.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/glsl_shader.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/glsl_shader.c 2015-06-28 16:51:28.000000000 +0000 @@ -63,7 +63,7 @@ struct glsl_sample_function { - const char *name; + struct wined3d_string_buffer *name; DWORD coord_mask; enum wined3d_data_type data_type; }; @@ -204,6 +204,7 @@ const struct vs_compile_args *cur_vs_args; const struct ps_compile_args *cur_ps_args; struct ps_np2fixup_info *cur_np2fixup_info; + struct wined3d_string_buffer_list *string_buffers; }; struct glsl_context_data @@ -2497,246 +2498,90 @@ static void shader_glsl_get_sample_function(const struct wined3d_shader_context *ctx, DWORD resource_idx, DWORD flags, struct glsl_sample_function *sample_function) { + static const unsigned int type_coord_size[] = + { + 0, /* WINED3D_SHADER_RESOURCE_NONE */ + 1, /* WINED3D_SHADER_RESOURCE_BUFFER */ + 1, /* WINED3D_SHADER_RESOURCE_TEXTURE_1D */ + 2, /* WINED3D_SHADER_RESOURCE_TEXTURE_2D */ + 2, /* WINED3D_SHADER_RESOURCE_TEXTURE_2DMS */ + 3, /* WINED3D_SHADER_RESOURCE_TEXTURE_3D */ + 3, /* WINED3D_SHADER_RESOURCE_TEXTURE_CUBE */ + 2, /* WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY */ + 3, /* WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY */ + 3, /* WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY */ + }; + struct shader_glsl_ctx_priv *priv = ctx->backend_data; enum wined3d_shader_resource_type resource_type = ctx->reg_maps->resource_info[resource_idx].type; const struct wined3d_gl_info *gl_info = ctx->gl_info; BOOL shadow = ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL - && (((const struct shader_glsl_ctx_priv *)ctx->backend_data)->cur_ps_args->shadow & (1 << resource_idx)); + && (priv->cur_ps_args->shadow & (1 << resource_idx)); BOOL projected = flags & WINED3D_GLSL_SAMPLE_PROJECTED; BOOL texrect = flags & WINED3D_GLSL_SAMPLE_NPOT && gl_info->supported[ARB_TEXTURE_RECTANGLE]; BOOL lod = flags & WINED3D_GLSL_SAMPLE_LOD; BOOL grad = flags & WINED3D_GLSL_SAMPLE_GRAD; + const char *base = "texture", *type_part = "", *suffix = ""; + unsigned int coord_size; sample_function->data_type = ctx->reg_maps->resource_info[resource_idx].data_type; /* Note that there's no such thing as a projected cube texture. */ + if (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_CUBE) + projected = FALSE; + + if (shadow) + base = "shadow"; + switch (resource_type) { case WINED3D_SHADER_RESOURCE_TEXTURE_1D: - if (shadow) - { - if (lod) - { - sample_function->name = projected ? "shadow1DProjLod" : "shadow1DLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "shadow1DProjGrad" : "shadow1DGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "shadow1DProjGradARB" : "shadow1DGradARB"; - else - { - FIXME("Unsupported 1D shadow grad function.\n"); - sample_function->name = "unsupported1DGrad"; - } - } - else - { - sample_function->name = projected ? "shadow1DProj" : "shadow1D"; - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1; - } - else - { - if (lod) - { - sample_function->name = projected ? "texture1DProjLod" : "texture1DLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "texture1DProjGrad" : "texture1DGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "texture1DProjGradARB" : "texture1DGradARB"; - else - { - FIXME("Unsupported 1D grad function.\n"); - sample_function->name = "unsupported1DGrad"; - } - } - else - { - sample_function->name = projected ? "texture1DProj" : "texture1D"; - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0; - } + type_part = "1D"; break; - case WINED3D_SHADER_RESOURCE_TEXTURE_2D: - if (shadow) - { - if (texrect) - { - if (lod) - { - sample_function->name = projected ? "shadow2DRectProjLod" : "shadow2DRectLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "shadow2DRectProjGrad" : "shadow2DRectGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "shadow2DRectProjGradARB" : "shadow2DRectGradARB"; - else - { - FIXME("Unsupported RECT shadow grad function.\n"); - sample_function->name = "unsupported2DRectGrad"; - } - } - else - { - sample_function->name = projected ? "shadow2DRectProj" : "shadow2DRect"; - } - } - else - { - if (lod) - { - sample_function->name = projected ? "shadow2DProjLod" : "shadow2DLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "shadow2DProjGrad" : "shadow2DGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "shadow2DProjGradARB" : "shadow2DGradARB"; - else - { - FIXME("Unsupported 2D shadow grad function.\n"); - sample_function->name = "unsupported2DGrad"; - } - } - else - { - sample_function->name = projected ? "shadow2DProj" : "shadow2D"; - } - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; - } + if (texrect) + type_part = "2DRect"; else - { - if (texrect) - { - if (lod) - { - sample_function->name = projected ? "texture2DRectProjLod" : "texture2DRectLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "texture2DRectProjGrad" : "texture2DRectGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "texture2DRectProjGradARB" : "texture2DRectGradARB"; - else - { - FIXME("Unsupported RECT grad function.\n"); - sample_function->name = "unsupported2DRectGrad"; - } - } - else - { - sample_function->name = projected ? "texture2DRectProj" : "texture2DRect"; - } - } - else - { - if (lod) - { - sample_function->name = projected ? "texture2DProjLod" : "texture2DLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "texture2DProjGrad" : "texture2DGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "texture2DProjGradARB" : "texture2DGradARB"; - else - { - FIXME("Unsupported 2D grad function.\n"); - sample_function->name = "unsupported2DGrad"; - } - } - else - { - sample_function->name = projected ? "texture2DProj" : "texture2D"; - } - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1; - } + type_part = "2D"; break; - case WINED3D_SHADER_RESOURCE_TEXTURE_3D: - if (shadow) - { - FIXME("Unsupported 3D shadow function.\n"); - sample_function->name = "unsupported3DShadow"; - sample_function->coord_mask = 0; - } - else - { - if (lod) - { - sample_function->name = projected ? "texture3DProjLod" : "texture3DLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = projected ? "texture3DProjGrad" : "texture3DGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = projected ? "texture3DProjGradARB" : "texture3DGradARB"; - else - { - FIXME("Unsupported 3D grad function.\n"); - sample_function->name = "unsupported3DGrad"; - } - } - else - { - sample_function->name = projected ? "texture3DProj" : "texture3D"; - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; - } + type_part = "3D"; break; - case WINED3D_SHADER_RESOURCE_TEXTURE_CUBE: - if (shadow) - { - FIXME("Unsupported Cube shadow function.\n"); - sample_function->name = "unsupportedCubeShadow"; - sample_function->coord_mask = 0; - } - else - { - if (lod) - { - sample_function->name = "textureCubeLod"; - } - else if (grad) - { - if (gl_info->supported[EXT_GPU_SHADER4]) - sample_function->name = "textureCubeGrad"; - else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - sample_function->name = "textureCubeGradARB"; - else - { - FIXME("Unsupported Cube grad function.\n"); - sample_function->name = "unsupportedCubeGrad"; - } - } - else - { - sample_function->name = "textureCube"; - } - sample_function->coord_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; - } + type_part = "Cube"; break; - default: - sample_function->name = ""; - sample_function->coord_mask = 0; FIXME("Unhandled resource type %#x.\n", resource_type); - break; } + + if (!lod && grad && !gl_info->supported[EXT_GPU_SHADER4]) + { + if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) + suffix = "ARB"; + else + FIXME("Unsupported grad function.\n"); + } + + sample_function->name = string_buffer_get(priv->string_buffers); + string_buffer_sprintf(sample_function->name, "%s%s%s%s%s", base, type_part, projected ? "Proj" : "", + lod ? "Lod" : grad ? "Grad" : "", suffix); + + if (resource_type >= ARRAY_SIZE(type_coord_size)) + { + ERR("Unexpected resource type %#x.\n", resource_type); + resource_type = WINED3D_SHADER_RESOURCE_TEXTURE_2D; + } + coord_size = type_coord_size[resource_type]; + if (shadow) + ++coord_size; + sample_function->coord_mask = (1 << coord_size) - 1; +} + +static void shader_glsl_release_sample_function(const struct wined3d_shader_context *ctx, + struct glsl_sample_function *sample_function) +{ + const struct shader_glsl_ctx_priv *priv = ctx->backend_data; + + string_buffer_release(priv->string_buffers, sample_function->name); } static void shader_glsl_append_fixup_arg(char *arguments, const char *reg_name, @@ -2881,7 +2726,7 @@ shader_glsl_append_dst_ext(ins->ctx->buffer, ins, &ins->dst[0], sample_function->data_type); shader_addline(ins->ctx->buffer, "%s(%s_sampler%u, ", - sample_function->name, shader_glsl_get_prefix(version->type), sampler); + sample_function->name->buffer, shader_glsl_get_prefix(version->type), sampler); for (;;) { @@ -4172,6 +4017,7 @@ "%s", coord_param.param_str); } } + shader_glsl_release_sample_function(ins->ctx, &sample_function); } static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins) @@ -4202,6 +4048,7 @@ shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, swizzle, dx_param.param_str, dy_param.param_str, NULL, "%s", coord_param.param_str); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins) @@ -4230,10 +4077,11 @@ /* Plain GLSL only supports Lod sampling functions in vertex shaders. * However, the NVIDIA drivers allow them in fragment shaders as well, * even without the appropriate extension. */ - WARN("Using %s in fragment shader.\n", sample_function.name); + WARN("Using %s in fragment shader.\n", sample_function.name->buffer); } shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, swizzle, NULL, NULL, lod_param.param_str, "%s", coord_param.param_str); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } static unsigned int shader_glsl_find_sampler(const struct wined3d_shader_sampler_map *sampler_map, @@ -4265,6 +4113,7 @@ ins->src[1].reg.idx[0].offset, ins->src[2].reg.idx[0].offset); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "%s", coord_param.param_str); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins) @@ -4362,6 +4211,7 @@ FIXME("Unexpected mask size %u\n", mask_size); break; } + shader_glsl_release_sample_function(ins->ctx, &sample_function); } /** Process the WINED3DSIO_TEXDP3 instruction in GLSL: @@ -4463,6 +4313,7 @@ /* Sample the texture using the calculated coordinates */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "tmp0.xy"); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } /** Process the WINED3DSIO_TEXM3X3TEX instruction in GLSL @@ -4483,6 +4334,7 @@ /* Sample the texture using the calculated coordinates */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "tmp0.xyz"); + shader_glsl_release_sample_function(ins->ctx, &sample_function); tex_mx->current_row = 0; } @@ -4534,6 +4386,7 @@ /* Sample the texture */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "tmp0%s", coord_mask); + shader_glsl_release_sample_function(ins->ctx, &sample_function); tex_mx->current_row = 0; } @@ -4567,6 +4420,7 @@ /* Sample the texture using the calculated coordinates */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "tmp0%s", coord_mask); + shader_glsl_release_sample_function(ins->ctx, &sample_function); tex_mx->current_row = 0; } @@ -4639,6 +4493,7 @@ dst_param.reg_name, dst_param.mask_str, luminance_param.param_str, sampler_idx, sampler_idx); } + shader_glsl_release_sample_function(ins->ctx, &sample_function); } static void shader_glsl_bem(const struct wined3d_shader_instruction *ins) @@ -4667,6 +4522,7 @@ shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "%s.wx", src0_param.reg_name); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } /** Process the WINED3DSIO_TEXREG2GB instruction in GLSL @@ -4682,6 +4538,7 @@ shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "%s.yz", src0_param.reg_name); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } /** Process the WINED3DSIO_TEXREG2RGB instruction in GLSL @@ -4698,28 +4555,36 @@ shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, "%s", src0_param.param_str); + shader_glsl_release_sample_function(ins->ctx, &sample_function); } /** Process the WINED3DSIO_TEXKILL instruction in GLSL. * If any of the first 3 components are < 0, discard this pixel */ static void shader_glsl_texkill(const struct wined3d_shader_instruction *ins) { - struct glsl_dst_param dst_param; + if (ins->ctx->reg_maps->shader_version.major >= 4) + { + struct glsl_src_param src_param; - /* The argument is a destination parameter, and no writemasks are allowed */ - shader_glsl_add_dst_param(ins, &ins->dst[0], &dst_param); - if (ins->ctx->reg_maps->shader_version.major >= 2) + shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src_param); + shader_addline(ins->ctx->buffer, "if (bool(floatBitsToUint(%s))) discard;\n", src_param.param_str); + } + else { - if (ins->ctx->reg_maps->shader_version.major >= 4) - FIXME("SM4 discard not implemented.\n"); - /* 2.0 shaders compare all 4 components in texkill */ - shader_addline(ins->ctx->buffer, "if (any(lessThan(%s.xyzw, vec4(0.0)))) discard;\n", dst_param.reg_name); - } else { - /* 1.X shaders only compare the first 3 components, probably due to the nature of the texkill - * instruction as a tex* instruction, and phase, which kills all a / w components. Even if all - * 4 components are defined, only the first 3 are used - */ - shader_addline(ins->ctx->buffer, "if (any(lessThan(%s.xyz, vec3(0.0)))) discard;\n", dst_param.reg_name); + struct glsl_dst_param dst_param; + + /* The argument is a destination parameter, and no writemasks are allowed */ + shader_glsl_add_dst_param(ins, &ins->dst[0], &dst_param); + + /* 2.0 shaders compare all 4 components in texkill. */ + if (ins->ctx->reg_maps->shader_version.major >= 2) + shader_addline(ins->ctx->buffer, "if (any(lessThan(%s.xyzw, vec4(0.0)))) discard;\n", dst_param.reg_name); + /* 1.x shaders only compare the first 3 components, probably due to + * the nature of the texkill instruction as a tex* instruction, and + * phase, which kills all .w components. Even if all 4 components are + * defined, only the first 3 are used. */ + else + shader_addline(ins->ctx->buffer, "if (any(lessThan(%s.xyz, vec3(0.0)))) discard;\n", dst_param.reg_name); } } @@ -5132,7 +4997,8 @@ /* Context activation is done by the caller. */ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + const struct wined3d_shader *shader, const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info) { const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; @@ -5146,6 +5012,7 @@ memset(&priv_ctx, 0, sizeof(priv_ctx)); priv_ctx.cur_ps_args = args; priv_ctx.cur_np2fixup_info = np2fixup_info; + priv_ctx.string_buffers = string_buffers; shader_addline(buffer, "%s\n", shader_glsl_get_version(gl_info, ®_maps->shader_version)); @@ -5196,7 +5063,8 @@ /* Context activation is done by the caller. */ static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + const struct wined3d_shader *shader, const struct vs_compile_args *args) { const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; @@ -5220,6 +5088,7 @@ memset(&priv_ctx, 0, sizeof(priv_ctx)); priv_ctx.cur_vs_args = args; + priv_ctx.string_buffers = string_buffers; /* Base Declarations */ shader_generate_glsl_declarations(context, buffer, shader, reg_maps, &priv_ctx); @@ -5275,7 +5144,8 @@ /* Context activation is done by the caller. */ static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader) + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + const struct wined3d_shader *shader) { const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -5297,6 +5167,7 @@ shader_addline(buffer, "#extension GL_EXT_gpu_shader4 : enable\n"); memset(&priv_ctx, 0, sizeof(priv_ctx)); + priv_ctx.string_buffers = string_buffers; shader_generate_glsl_declarations(context, buffer, shader, reg_maps, &priv_ctx); shader_generate_main(shader, buffer, reg_maps, function, &priv_ctx); shader_addline(buffer, "}\n"); @@ -5308,7 +5179,8 @@ } static GLuint find_glsl_pshader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, struct wined3d_shader *shader, + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + struct wined3d_shader *shader, const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info) { struct glsl_ps_compiled_shader *gl_shaders, *new_array; @@ -5376,7 +5248,7 @@ pixelshader_update_resource_types(shader, args->tex_types); string_buffer_clear(buffer); - ret = shader_glsl_generate_pshader(context, buffer, shader, args, np2fixup); + ret = shader_glsl_generate_pshader(context, buffer, string_buffers, shader, args, np2fixup); gl_shaders[shader_data->num_gl_shaders++].id = ret; return ret; @@ -5395,7 +5267,8 @@ } static GLuint find_glsl_vshader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, struct wined3d_shader *shader, + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + struct wined3d_shader *shader, const struct vs_compile_args *args) { UINT i; @@ -5454,14 +5327,15 @@ gl_shaders[shader_data->num_gl_shaders].args = *args; string_buffer_clear(buffer); - ret = shader_glsl_generate_vshader(context, buffer, shader, args); + ret = shader_glsl_generate_vshader(context, buffer, string_buffers, shader, args); gl_shaders[shader_data->num_gl_shaders++].id = ret; return ret; } static GLuint find_glsl_geometry_shader(const struct wined3d_context *context, - struct wined3d_string_buffer *buffer, struct wined3d_shader *shader) + struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, + struct wined3d_shader *shader) { struct glsl_gs_compiled_shader *gl_shaders; struct glsl_shader_private *shader_data; @@ -5492,7 +5366,7 @@ gl_shaders = shader_data->gl_shaders.gs; string_buffer_clear(buffer); - ret = shader_glsl_generate_geometry_shader(context, buffer, shader); + ret = shader_glsl_generate_geometry_shader(context, buffer, string_buffers, shader); gl_shaders[shader_data->num_gl_shaders++].id = ret; return ret; @@ -5515,8 +5389,7 @@ } static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer, - const struct wined3d_ffp_vs_settings *settings, const struct wined3d_gl_info *gl_info, - BOOL legacy_lighting) + const struct wined3d_ffp_vs_settings *settings, BOOL legacy_lighting) { const char *diffuse, *specular, *emissive, *ambient; enum wined3d_light_type light_type; @@ -5792,7 +5665,7 @@ else shader_addline(buffer, "vec3 normal = ffp_normal_matrix * ffp_attrib_normal;\n"); - shader_glsl_ffp_vertex_lighting(buffer, settings, gl_info, legacy_lighting); + shader_glsl_ffp_vertex_lighting(buffer, settings, legacy_lighting); for (i = 0; i < MAX_TEXTURES; ++i) { @@ -5860,9 +5733,10 @@ if (settings->point_size) { - shader_addline(buffer, "gl_PointSize = ffp_point.size / sqrt(ffp_point.c_att" + shader_addline(buffer, "gl_PointSize = %s / sqrt(ffp_point.c_att" " + ffp_point.l_att * length(ec_pos.xyz)" - " + ffp_point.q_att * dot(ec_pos.xyz, ec_pos.xyz));\n"); + " + ffp_point.q_att * dot(ec_pos.xyz, ec_pos.xyz));\n", + settings->per_vertex_point_size ? "ffp_attrib_psize" : "ffp_point.size"); shader_addline(buffer, "gl_PointSize = clamp(gl_PointSize, ffp_point.size_min, ffp_point.size_max);\n"); } @@ -6724,7 +6598,7 @@ && ctx_data->glsl_program->gs.id) gs_id = ctx_data->glsl_program->gs.id; else if (gshader) - gs_id = find_glsl_geometry_shader(context, &priv->shader_buffer, gshader); + gs_id = find_glsl_geometry_shader(context, &priv->shader_buffer, &priv->string_buffers, gshader); } } else if (use_vs(state)) @@ -6733,11 +6607,11 @@ vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX]; find_vs_compile_args(state, vshader, context->stream_info.swizzle_map, &vs_compile_args); - vs_id = find_glsl_vshader(context, &priv->shader_buffer, vshader, &vs_compile_args); + vs_id = find_glsl_vshader(context, &priv->shader_buffer, &priv->string_buffers, vshader, &vs_compile_args); vs_list = &vshader->linked_programs; if ((gshader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY])) - gs_id = find_glsl_geometry_shader(context, &priv->shader_buffer, gshader); + gs_id = find_glsl_geometry_shader(context, &priv->shader_buffer, &priv->string_buffers, gshader); } else if (priv->vertex_pipe == &glsl_vertex_pipe) { @@ -6763,7 +6637,7 @@ struct ps_compile_args ps_compile_args; pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; find_ps_compile_args(state, pshader, context->stream_info.position_transformed, &ps_compile_args, gl_info); - ps_id = find_glsl_pshader(context, &priv->shader_buffer, + ps_id = find_glsl_pshader(context, &priv->shader_buffer, &priv->string_buffers, pshader, &ps_compile_args, &np2fixup_info); ps_list = &pshader->linked_programs; } @@ -7893,9 +7767,6 @@ clipplane(context, state, STATE_CLIPPLANE(i)); } - if (transformed != wasrhw) - context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_PROJ; - context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX; /* Because of settings->texcoords, we have to always regenerate the diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/state.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/state.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/state.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/state.c 2015-06-28 16:51:28.000000000 +0000 @@ -273,23 +273,23 @@ WARN("Unsupported in local OpenGL implementation: glBlendEquation\n"); } -static GLenum gl_blend_op(enum wined3d_blend_op op) +static GLenum gl_blend_op(const struct wined3d_gl_info *gl_info, enum wined3d_blend_op op) { switch (op) { case WINED3D_BLEND_OP_ADD: - return GL_FUNC_ADD_EXT; + return GL_FUNC_ADD; case WINED3D_BLEND_OP_SUBTRACT: - return GL_FUNC_SUBTRACT_EXT; + return gl_info->supported[EXT_BLEND_SUBTRACT] ? GL_FUNC_SUBTRACT : GL_FUNC_ADD; case WINED3D_BLEND_OP_REVSUBTRACT: - return GL_FUNC_REVERSE_SUBTRACT_EXT; + return gl_info->supported[EXT_BLEND_SUBTRACT] ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD; case WINED3D_BLEND_OP_MIN: - return GL_MIN_EXT; + return gl_info->supported[EXT_BLEND_MINMAX] ? GL_MIN : GL_FUNC_ADD; case WINED3D_BLEND_OP_MAX: - return GL_MAX_EXT; + return gl_info->supported[EXT_BLEND_MINMAX] ? GL_MAX : GL_FUNC_ADD; default: FIXME("Unhandled blend op %#x.\n", op); - return GL_NONE; + return GL_FUNC_ADD; } } @@ -307,8 +307,8 @@ return; } - blend_equation = gl_blend_op(state->render_states[WINED3D_RS_BLENDOP]); - blend_equation_alpha = gl_blend_op(state->render_states[WINED3D_RS_BLENDOPALPHA]); + blend_equation = gl_blend_op(gl_info, state->render_states[WINED3D_RS_BLENDOP]); + blend_equation_alpha = gl_blend_op(gl_info, state->render_states[WINED3D_RS_BLENDOPALPHA]); TRACE("blend_equation %#x, blend_equation_alpha %#x.\n", blend_equation, blend_equation_alpha); if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) @@ -1698,22 +1698,6 @@ FIXME("WINED3D_RS_ZVISIBLE not implemented.\n"); } -static void state_perspective(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - const struct wined3d_gl_info *gl_info = context->gl_info; - - if (state->render_states[WINED3D_RS_TEXTUREPERSPECTIVE]) - { - gl_info->gl_ops.gl.p_glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - checkGLcall("glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)"); - } - else - { - gl_info->gl_ops.gl.p_glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - checkGLcall("glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST)"); - } -} - static void state_stippledalpha(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { if (state->render_states[WINED3D_RS_STIPPLEDALPHA]) @@ -4939,7 +4923,7 @@ { STATE_INDEXBUFFER, { STATE_INDEXBUFFER, indexbuffer }, ARB_VERTEX_BUFFER_OBJECT }, { STATE_INDEXBUFFER, { STATE_INDEXBUFFER, state_nop }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ANTIALIAS), { STATE_RENDER(WINED3D_RS_ANTIALIAS), state_antialias }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), state_perspective }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), state_nop }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZENABLE), { STATE_RENDER(WINED3D_RS_ZENABLE), state_zenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAPU), { STATE_RENDER(WINED3D_RS_WRAPU), state_wrapu }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAPV), { STATE_RENDER(WINED3D_RS_WRAPV), state_wrapv }, WINED3D_GL_EXT_NONE }, @@ -5013,7 +4997,7 @@ { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, EXT_BLEND_MINMAX }, + { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION }, { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE }, diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/surface.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/surface.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/surface.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/surface.c 2015-06-28 16:51:28.000000000 +0000 @@ -2029,29 +2029,8 @@ return WINED3DERR_INVALIDCALL; } - if (src_rect) - { - surface->overlay_srcrect = *src_rect; - } - else - { - surface->overlay_srcrect.left = 0; - surface->overlay_srcrect.top = 0; - surface->overlay_srcrect.right = surface->resource.width; - surface->overlay_srcrect.bottom = surface->resource.height; - } - - if (dst_rect) - { - surface->overlay_destrect = *dst_rect; - } - else - { - surface->overlay_destrect.left = 0; - surface->overlay_destrect.top = 0; - surface->overlay_destrect.right = dst_surface->resource.width; - surface->overlay_destrect.bottom = dst_surface->resource.height; - } + surface_get_rect(surface, src_rect, &surface->overlay_srcrect); + surface_get_rect(dst_surface, dst_rect, &surface->overlay_destrect); if (surface->overlay_dest && (surface->overlay_dest != dst_surface || flags & WINEDDOVER_HIDE)) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/utils.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/utils.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/utils.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/utils.c 2015-06-28 16:51:28.000000000 +0000 @@ -4514,6 +4514,7 @@ settings->transformed = 1; settings->point_size = state->gl_primitive_type == GL_POINTS; + settings->per_vertex_point_size = !!(si->use_map & 1 << WINED3D_FFP_PSIZE); if (!state->render_states[WINED3D_RS_FOGENABLE]) settings->fog_mode = WINED3D_FFP_VS_FOG_OFF; else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE) @@ -4539,6 +4540,7 @@ settings->lighting = !!state->render_states[WINED3D_RS_LIGHTING]; settings->localviewer = !!state->render_states[WINED3D_RS_LOCALVIEWER]; settings->point_size = state->gl_primitive_type == GL_POINTS; + settings->per_vertex_point_size = !!(si->use_map & 1 << WINED3D_FFP_PSIZE); if (state->render_states[WINED3D_RS_COLORVERTEX] && (si->use_map & (1 << WINED3D_FFP_DIFFUSE))) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/wined3d_gl.h wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/wined3d_gl.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/wined3d_gl.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/wined3d_gl.h 2015-06-28 16:51:28.000000000 +0000 @@ -160,6 +160,7 @@ WGL_EXT_SWAP_CONTROL, WGL_WINE_PIXEL_FORMAT_PASSTHROUGH, /* Internally used */ + WINED3D_GL_BLEND_EQUATION, WINED3D_GL_NORMALIZED_TEXRECT, WINED3D_GL_VERSION_2_0, diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/wined3d_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/wined3d_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wined3d/wined3d_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wined3d/wined3d_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -1894,10 +1894,11 @@ DWORD lighting : 1; DWORD localviewer : 1; DWORD point_size : 1; + DWORD per_vertex_point_size : 1; DWORD fog_mode : 2; DWORD texcoords : 8; /* MAX_TEXTURES */ DWORD ortho_fog : 1; - DWORD padding : 14; + DWORD padding : 13; DWORD texgen[MAX_TEXTURES]; }; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/cookie.c wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/cookie.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/cookie.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/cookie.c 2015-06-28 16:51:28.000000000 +0000 @@ -54,7 +54,7 @@ LIST_FOR_EACH( item, &domain->cookies ) { cookie = LIST_ENTRY( item, cookie_t, entry ); - if (!strcmpW( cookie->path, path ) && !strcmpiW( cookie->name, name )) + if (!strcmpW( cookie->path, path ) && !strcmpW( cookie->name, name )) { TRACE("found %s=%s\n", debugstr_w(cookie->name), debugstr_w(cookie->value)); return cookie; @@ -121,7 +121,7 @@ else if ((old_cookie = find_cookie( domain, path, cookie->name ))) delete_cookie( old_cookie ); cookie->path = strdupW( path ); - list_add_tail( &domain->cookies, &cookie->entry ); + list_add_head( &domain->cookies, &cookie->entry ); TRACE("domain %s path %s <- %s=%s\n", debugstr_w(domain_name), debugstr_w(cookie->path), debugstr_w(cookie->name), debugstr_w(cookie->value)); @@ -134,22 +134,14 @@ const WCHAR *p; int len; - if (!(p = strchrW( string, '=' ))) - { - WARN("no '=' in %s\n", debugstr_w(string)); - return NULL; - } - if (p == string) - { - WARN("empty cookie name in %s\n", debugstr_w(string)); - return NULL; - } + if (!(p = strchrW( string, '=' ))) p = string + strlenW( string ); + len = p - string; + while (len && string[len - 1] == ' ') len--; + if (!len) return NULL; if (!(cookie = heap_alloc_zero( sizeof(cookie_t) ))) return NULL; - list_init( &cookie->entry ); - len = p - string; if (!(cookie->name = heap_alloc( (len + 1) * sizeof(WCHAR) ))) { heap_free( cookie ); @@ -158,18 +150,20 @@ memcpy( cookie->name, string, len * sizeof(WCHAR) ); cookie->name[len] = 0; - p++; /* skip '=' */ - while (*p == ' ') p++; - - len = strlenW( p ); - if (!(cookie->value = heap_alloc( (len + 1) * sizeof(WCHAR) ))) + if (*p++ == '=') { - free_cookie( cookie ); - return NULL; - } - memcpy( cookie->value, p, len * sizeof(WCHAR) ); - cookie->value[len] = 0; + while (*p && *p == ' ') p++; + len = strlenW( p ); + while (len && p[len - 1] == ' ') len--; + if (!(cookie->value = heap_alloc( (len + 1) * sizeof(WCHAR) ))) + { + free_cookie( cookie ); + return NULL; + } + memcpy( cookie->value, p, len * sizeof(WCHAR) ); + cookie->value[len] = 0; + } return cookie; } @@ -259,17 +253,25 @@ if (strstrW( request->path, cookie->path ) == request->path) { - const WCHAR format[] = {'C','o','o','k','i','e',':',' ','%','s','=','%','s',0}; - int len; + const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' '}; + int len, len_cookie = sizeof(cookieW) / sizeof(cookieW[0]), len_name = strlenW( cookie->name ); WCHAR *header; - len = strlenW( cookie->name ) + strlenW( format ) + strlenW( cookie->value ); + len = len_cookie + len_name; + if (cookie->value) len += strlenW( cookie->value ) + 1; if (!(header = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return FALSE; - sprintfW( header, format, cookie->name, cookie->value ); + memcpy( header, cookieW, len_cookie * sizeof(WCHAR) ); + strcpyW( header + len_cookie, cookie->name ); + if (cookie->value) + { + header[len_cookie + len_name] = '='; + strcpyW( header + len_cookie + len_name + 1, cookie->value ); + } TRACE("%s\n", debugstr_w(header)); - add_request_headers( request, header, len, WINHTTP_ADDREQ_FLAG_ADD ); + add_request_headers( request, header, len, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON ); heap_free( header ); } } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/request.c wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/request.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/request.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/request.c 2015-06-28 16:51:28.000000000 +0000 @@ -327,12 +327,8 @@ q++; /* skip past colon */ while (*q == ' ') q++; - if (!*q) - { - WARN("no value in line %s\n", debugstr_w(string)); - return header; - } len = strlenW( q ); + if (!(header->value = heap_alloc( (len + 1) * sizeof(WCHAR) ))) { free_header( header ); @@ -404,76 +400,65 @@ static BOOL process_header( request_t *request, LPCWSTR field, LPCWSTR value, DWORD flags, BOOL request_only ) { int index; - header_t *header; + header_t hdr; TRACE("%s: %s 0x%08x\n", debugstr_w(field), debugstr_w(value), flags); - /* replace wins out over add */ - if (flags & WINHTTP_ADDREQ_FLAG_REPLACE) flags &= ~WINHTTP_ADDREQ_FLAG_ADD; - - if (flags & WINHTTP_ADDREQ_FLAG_ADD) index = -1; - else - index = get_header_index( request, field, 0, request_only ); - - if (index >= 0) + if ((index = get_header_index( request, field, 0, request_only )) >= 0) { if (flags & WINHTTP_ADDREQ_FLAG_ADD_IF_NEW) return FALSE; - header = &request->headers[index]; } - else if (value) + + if (flags & WINHTTP_ADDREQ_FLAG_REPLACE) { - header_t hdr; + if (index >= 0) + { + delete_header( request, index ); + if (!value || !value[0]) return TRUE; + } + else if (!(flags & WINHTTP_ADDREQ_FLAG_ADD)) + { + set_last_error( ERROR_WINHTTP_HEADER_NOT_FOUND ); + return FALSE; + } hdr.field = (LPWSTR)field; hdr.value = (LPWSTR)value; hdr.is_request = request_only; - return insert_header( request, &hdr ); } - /* no value to delete */ - else return TRUE; - - if (flags & WINHTTP_ADDREQ_FLAG_REPLACE) - { - delete_header( request, index ); - if (value) - { - header_t hdr; - - hdr.field = (LPWSTR)field; - hdr.value = (LPWSTR)value; - hdr.is_request = request_only; - - return insert_header( request, &hdr ); - } - return TRUE; - } - else if (flags & (WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA | WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON)) + else if (value) { - WCHAR sep, *tmp; - int len, orig_len, value_len; - orig_len = strlenW( header->value ); - value_len = strlenW( value ); + if ((flags & (WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA | WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON)) && + index >= 0) + { + WCHAR *tmp; + int len, len_orig, len_value; + header_t *header = &request->headers[index]; - if (flags & WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) sep = ','; - else sep = ';'; + len_orig = strlenW( header->value ); + len_value = strlenW( value ); - len = orig_len + value_len + 2; - if ((tmp = heap_realloc( header->value, (len + 1) * sizeof(WCHAR) ))) - { + len = len_orig + len_value + 2; + if (!(tmp = heap_realloc( header->value, (len + 1) * sizeof(WCHAR) ))) return FALSE; header->value = tmp; + header->value[len_orig++] = (flags & WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) ? ',' : ';'; + header->value[len_orig++] = ' '; - header->value[orig_len] = sep; - orig_len++; - header->value[orig_len] = ' '; - orig_len++; - - memcpy( &header->value[orig_len], value, value_len * sizeof(WCHAR) ); + memcpy( &header->value[len_orig], value, len_value * sizeof(WCHAR) ); header->value[len] = 0; return TRUE; } + else + { + hdr.field = (LPWSTR)field; + hdr.value = (LPWSTR)value; + hdr.is_request = request_only; + return insert_header( request, &hdr ); + } } + return TRUE; } @@ -486,7 +471,8 @@ if (len == ~0u) len = strlenW( headers ); if (!len) return TRUE; if (!(buffer = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return FALSE; - strcpyW( buffer, headers ); + memcpy( buffer, headers, len * sizeof(WCHAR) ); + buffer[len] = 0; p = buffer; do @@ -530,7 +516,7 @@ TRACE("%p, %s, 0x%x, 0x%08x\n", hrequest, debugstr_w(headers), len, flags); - if (!headers) + if (!headers || !len) { set_last_error( ERROR_INVALID_PARAMETER ); return FALSE; @@ -1251,6 +1237,8 @@ return FALSE; } + if (headers && !headers_len) headers_len = strlenW( headers ); + if (request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { send_request_t *s; @@ -1572,8 +1560,16 @@ return FALSE; auth_ptr = &request->authinfo; auth_target = attr_authorization; - username = request->connect->username; - password = request->connect->password; + if (request->creds[TARGET_SERVER][scheme].username) + { + username = request->creds[TARGET_SERVER][scheme].username; + password = request->creds[TARGET_SERVER][scheme].password; + } + else + { + username = request->connect->username; + password = request->connect->password; + } break; case WINHTTP_AUTH_TARGET_PROXY: @@ -1581,8 +1577,16 @@ return FALSE; auth_ptr = &request->proxy_authinfo; auth_target = attr_proxy_authorization; - username = request->connect->session->proxy_username; - password = request->connect->session->proxy_password; + if (request->creds[TARGET_PROXY][scheme].username) + { + username = request->creds[TARGET_PROXY][scheme].username; + password = request->creds[TARGET_PROXY][scheme].password; + } + else + { + username = request->connect->session->proxy_username; + password = request->connect->session->proxy_password; + } break; default: @@ -1766,11 +1770,12 @@ return ret; } -static BOOL set_credentials( request_t *request, DWORD target, DWORD scheme, const WCHAR *username, +static BOOL set_credentials( request_t *request, DWORD target, DWORD scheme_flag, const WCHAR *username, const WCHAR *password ) { - if ((scheme == WINHTTP_AUTH_SCHEME_BASIC || scheme == WINHTTP_AUTH_SCHEME_DIGEST) && - (!username || !password)) + enum auth_scheme scheme = scheme_from_flag( scheme_flag ); + + if (scheme == SCHEME_INVALID || ((scheme == SCHEME_BASIC || scheme == SCHEME_DIGEST) && (!username || !password))) { set_last_error( ERROR_INVALID_PARAMETER ); return FALSE; @@ -1779,24 +1784,24 @@ { case WINHTTP_AUTH_TARGET_SERVER: { - heap_free( request->connect->username ); - if (!username) request->connect->username = NULL; - else if (!(request->connect->username = strdupW( username ))) return FALSE; - - heap_free( request->connect->password ); - if (!password) request->connect->password = NULL; - else if (!(request->connect->password = strdupW( password ))) return FALSE; + heap_free( request->creds[TARGET_SERVER][scheme].username ); + if (!username) request->creds[TARGET_SERVER][scheme].username = NULL; + else if (!(request->creds[TARGET_SERVER][scheme].username = strdupW( username ))) return FALSE; + + heap_free( request->creds[TARGET_SERVER][scheme].password ); + if (!password) request->creds[TARGET_SERVER][scheme].password = NULL; + else if (!(request->creds[TARGET_SERVER][scheme].password = strdupW( password ))) return FALSE; break; } case WINHTTP_AUTH_TARGET_PROXY: { - heap_free( request->connect->session->proxy_username ); - if (!username) request->connect->session->proxy_username = NULL; - else if (!(request->connect->session->proxy_username = strdupW( username ))) return FALSE; - - heap_free( request->connect->session->proxy_password ); - if (!password) request->connect->session->proxy_password = NULL; - else if (!(request->connect->session->proxy_password = strdupW( password ))) return FALSE; + heap_free( request->creds[TARGET_PROXY][scheme].username ); + if (!username) request->creds[TARGET_PROXY][scheme].username = NULL; + else if (!(request->creds[TARGET_PROXY][scheme].username = strdupW( username ))) return FALSE; + + heap_free( request->creds[TARGET_PROXY][scheme].password ); + if (!password) request->creds[TARGET_PROXY][scheme].password = NULL; + else if (!(request->creds[TARGET_PROXY][scheme].password = strdupW( password ))) return FALSE; break; } default: @@ -2108,7 +2113,9 @@ /* we rely on the fact that the protocol is ascii */ MultiByteToWideChar( CP_ACP, 0, status_code, len, status_codeW, len ); status_codeW[len] = 0; - if (!(process_header( request, attr_status, status_codeW, WINHTTP_ADDREQ_FLAG_REPLACE, FALSE ))) return FALSE; + if (!(process_header( request, attr_status, status_codeW, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE, FALSE ))) + return FALSE; len = status_code - buffer; if (!(versionW = heap_alloc( len * sizeof(WCHAR) ))) return FALSE; @@ -2279,13 +2286,21 @@ { WCHAR *path, *p; - len = strlenW( location ) + 1; - if (location[0] != '/') len++; - if (!(p = path = heap_alloc( len * sizeof(WCHAR) ))) goto end; - - if (location[0] != '/') *p++ = '/'; - strcpyW( p, location ); - + if (location[0] == '/') + { + len = strlenW( location ); + if (!(path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + strcpyW( path, location ); + } + else + { + if ((p = strrchrW( request->path, '/' ))) *p = 0; + len = strlenW( request->path ) + 1 + strlenW( location ); + if (!(path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + strcpyW( path, request->path ); + strcatW( path, slashW ); + strcatW( path, location ); + } heap_free( request->path ); request->path = path; @@ -2330,7 +2345,7 @@ } else heap_free( hostname ); - if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; + if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; if (!(ret = open_connection( request ))) goto end; heap_free( request->path ); @@ -2694,6 +2709,7 @@ LONG send_timeout; LONG receive_timeout; WINHTTP_PROXY_INFO proxy; + BOOL async; }; static inline struct winhttp_request *impl_from_IWinHttpRequest( IWinHttpRequest *iface ) @@ -2712,8 +2728,20 @@ static void cancel_request( struct winhttp_request *request ) { if (request->state <= REQUEST_STATE_CANCELLED) return; - if (request->thread) SetEvent( request->cancel ); + + SetEvent( request->cancel ); + LeaveCriticalSection( &request->cs ); + WaitForSingleObject( request->thread, INFINITE ); + EnterCriticalSection( &request->cs ); + request->state = REQUEST_STATE_CANCELLED; + + CloseHandle( request->thread ); + request->thread = NULL; + CloseHandle( request->wait ); + request->wait = NULL; + CloseHandle( request->cancel ); + request->cancel = NULL; } /* critical section must be held */ @@ -3020,6 +3048,7 @@ request->bytes_available = 0; request->bytes_read = 0; request->error = ERROR_SUCCESS; + request->async = FALSE; request->logon_policy = WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM; request->disable_feature = 0; request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; @@ -3033,6 +3062,26 @@ request->state = REQUEST_STATE_INITIALIZED; } +static void reset_request( struct winhttp_request *request ) +{ + cancel_request( request ); + WinHttpCloseHandle( request->hrequest ); + request->hrequest = NULL; + WinHttpCloseHandle( request->hconnect ); + request->hconnect = NULL; + heap_free( request->buffer ); + request->buffer = NULL; + heap_free( request->verb ); + request->verb = NULL; + request->offset = 0; + request->bytes_available = 0; + request->bytes_read = 0; + request->error = ERROR_SUCCESS; + request->async = FALSE; + VariantClear( &request->data ); + request->state = REQUEST_STATE_INITIALIZED; +} + static HRESULT WINAPI winhttp_request_Open( IWinHttpRequest *iface, BSTR method, @@ -3047,10 +3096,9 @@ 'W','i','n','3','2',';',' ','W','i','n','H','t','t','p','.','W','i','n','H','t','t','p', 'R','e','q','u','e','s','t','.','5',')',0}; struct winhttp_request *request = impl_from_IWinHttpRequest( iface ); - HINTERNET hsession = NULL, hconnect = NULL, hrequest; URL_COMPONENTS uc; WCHAR *hostname, *path = NULL, *verb = NULL; - DWORD err = ERROR_OUTOFMEMORY, len, flags = 0, request_flags = 0; + DWORD err = ERROR_OUTOFMEMORY, len, flags = 0; TRACE("%p, %s, %s, %s\n", request, debugstr_w(method), debugstr_w(url), debugstr_variant(&async)); @@ -3066,12 +3114,9 @@ if (!WinHttpCrackUrl( url, 0, 0, &uc )) return HRESULT_FROM_WIN32( get_last_error() ); EnterCriticalSection( &request->cs ); - if (request->state != REQUEST_STATE_INITIALIZED) - { - cancel_request( request ); - free_request( request ); - initialize_request( request ); - } + if (request->state < REQUEST_STATE_INITIALIZED) initialize_request( request ); + else reset_request( request ); + if (!(hostname = heap_alloc( (uc.dwHostNameLength + 1) * sizeof(WCHAR) ))) goto error; memcpy( hostname, uc.lpszHostName, uc.dwHostNameLength * sizeof(WCHAR) ); hostname[uc.dwHostNameLength] = 0; @@ -3081,37 +3126,44 @@ path[uc.dwUrlPathLength + uc.dwExtraInfoLength] = 0; if (!(verb = strdupW( method ))) goto error; - if (SUCCEEDED( VariantChangeType( &async, &async, 0, VT_BOOL )) && V_BOOL( &async )) flags |= WINHTTP_FLAG_ASYNC; - if (!(hsession = WinHttpOpen( user_agentW, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL, flags ))) + if (SUCCEEDED( VariantChangeType( &async, &async, 0, VT_BOOL )) && V_BOOL( &async )) request->async = TRUE; + else request->async = FALSE; + + if (!request->hsession) { - err = get_last_error(); - goto error; + if (!(request->hsession = WinHttpOpen( user_agentW, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL, + WINHTTP_FLAG_ASYNC ))) + { + err = get_last_error(); + goto error; + } + if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 ))) + { + WinHttpCloseHandle( request->hsession ); + request->hsession = NULL; + err = get_last_error(); + goto error; + } } - if (!(hconnect = WinHttpConnect( hsession, hostname, uc.nPort, 0 ))) + else if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 ))) { err = get_last_error(); goto error; } + len = sizeof(httpsW) / sizeof(WCHAR); if (uc.dwSchemeLength == len && !memcmp( uc.lpszScheme, httpsW, len * sizeof(WCHAR) )) { - request_flags |= WINHTTP_FLAG_SECURE; + flags |= WINHTTP_FLAG_SECURE; } - if (!(hrequest = WinHttpOpenRequest( hconnect, method, path, NULL, NULL, acceptW, request_flags ))) + if (!(request->hrequest = WinHttpOpenRequest( request->hconnect, method, path, NULL, NULL, acceptW, flags ))) { err = get_last_error(); goto error; } - if (flags & WINHTTP_FLAG_ASYNC) - { - request->wait = CreateEventW( NULL, FALSE, FALSE, NULL ); - request->cancel = CreateEventW( NULL, FALSE, FALSE, NULL ); - WinHttpSetOption( hrequest, WINHTTP_OPTION_CONTEXT_VALUE, &request, sizeof(request) ); - } + WinHttpSetOption( request->hrequest, WINHTTP_OPTION_CONTEXT_VALUE, &request, sizeof(request) ); + request->state = REQUEST_STATE_OPEN; - request->hsession = hsession; - request->hconnect = hconnect; - request->hrequest = hrequest; request->verb = verb; heap_free( hostname ); heap_free( path ); @@ -3119,8 +3171,8 @@ return S_OK; error: - WinHttpCloseHandle( hconnect ); - WinHttpCloseHandle( hsession ); + WinHttpCloseHandle( request->hconnect ); + request->hconnect = NULL; heap_free( hostname ); heap_free( path ); heap_free( verb ); @@ -3162,7 +3214,8 @@ goto done; } sprintfW( str, fmtW, header, value ? value : emptyW ); - if (!WinHttpAddRequestHeaders( request->hrequest, str, len, WINHTTP_ADDREQ_FLAG_REPLACE )) + if (!WinHttpAddRequestHeaders( request->hrequest, str, len, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE )) { err = get_last_error(); } @@ -3282,22 +3335,14 @@ static void wait_set_status_callback( struct winhttp_request *request, DWORD status ) { - if (!request->wait) return; status |= WINHTTP_CALLBACK_STATUS_REQUEST_ERROR; WinHttpSetStatusCallback( request->hrequest, wait_status_callback, status, 0 ); } static DWORD wait_for_completion( struct winhttp_request *request ) { - HANDLE handles[2]; + HANDLE handles[2] = { request->wait, request->cancel }; - if (!request->wait) - { - request->error = ERROR_SUCCESS; - return ERROR_SUCCESS; - } - handles[0] = request->wait; - handles[1] = request->cancel; switch (WaitForMultipleObjects( 2, handles, FALSE, INFINITE )) { case WAIT_OBJECT_0: @@ -3480,6 +3525,39 @@ return request_send_and_receive( request ); } +/* critical section must be held */ +static DWORD request_wait( struct winhttp_request *request, DWORD timeout ) +{ + HANDLE thread = request->thread; + DWORD err, ret; + + LeaveCriticalSection( &request->cs ); + while ((err = MsgWaitForMultipleObjects( 1, &thread, FALSE, timeout, QS_ALLINPUT )) == WAIT_OBJECT_0 + 1) + { + MSG msg; + while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE )) + { + TranslateMessage( &msg ); + DispatchMessageW( &msg ); + } + } + switch (err) + { + case WAIT_OBJECT_0: + ret = ERROR_SUCCESS; + break; + case WAIT_TIMEOUT: + ret = ERROR_TIMEOUT; + break; + case WAIT_FAILED: + default: + ret = get_last_error(); + break; + } + EnterCriticalSection( &request->cs ); + return ret; +} + static HRESULT WINAPI winhttp_request_Send( IWinHttpRequest *iface, VARIANT body ) @@ -3501,20 +3579,22 @@ return S_OK; } VariantClear( &request->data ); - if ((hr = VariantCopyInd( &request->data, &body )) != S_OK) { + if ((hr = VariantCopyInd( &request->data, &body )) != S_OK) + { LeaveCriticalSection( &request->cs ); return hr; } - - if (request->wait) /* async request */ + if (!(request->thread = CreateThread( NULL, 0, send_and_receive_proc, request, 0, NULL ))) { - if (!(request->thread = CreateThread( NULL, 0, send_and_receive_proc, request, 0, NULL ))) - { - LeaveCriticalSection( &request->cs ); - return HRESULT_FROM_WIN32( get_last_error() ); - } + LeaveCriticalSection( &request->cs ); + return HRESULT_FROM_WIN32( get_last_error() ); + } + request->wait = CreateEventW( NULL, FALSE, FALSE, NULL ); + request->cancel = CreateEventW( NULL, FALSE, FALSE, NULL ); + if (!request->async) + { + hr = HRESULT_FROM_WIN32( request_wait( request, INFINITE ) ); } - else hr = request_send_and_receive( request ); LeaveCriticalSection( &request->cs ); return hr; } @@ -3937,39 +4017,6 @@ return hr; } -/* critical section must be held */ -static DWORD wait_for_response( struct winhttp_request *request, DWORD timeout ) -{ - HANDLE thread = request->thread; - DWORD err, ret; - - LeaveCriticalSection( &request->cs ); - while ((err = MsgWaitForMultipleObjects( 1, &thread, FALSE, timeout, QS_ALLINPUT )) == WAIT_OBJECT_0 + 1) - { - MSG msg; - while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE )) - { - TranslateMessage( &msg ); - DispatchMessageW( &msg ); - } - } - switch (err) - { - case WAIT_OBJECT_0: - ret = ERROR_SUCCESS; - break; - case WAIT_TIMEOUT: - ret = ERROR_TIMEOUT; - break; - case WAIT_FAILED: - default: - ret = get_last_error(); - break; - } - EnterCriticalSection( &request->cs ); - return ret; -} - static HRESULT WINAPI winhttp_request_WaitForResponse( IWinHttpRequest *iface, VARIANT timeout, @@ -3981,17 +4028,12 @@ TRACE("%p, %s, %p\n", request, debugstr_variant(&timeout), succeeded); EnterCriticalSection( &request->cs ); - if (!request->thread) - { - LeaveCriticalSection( &request->cs ); - return S_OK; - } if (request->state >= REQUEST_STATE_RESPONSE_RECEIVED) { LeaveCriticalSection( &request->cs ); return S_OK; } - switch ((err = wait_for_response( request, msecs ))) + switch ((err = request_wait( request, msecs ))) { case ERROR_TIMEOUT: if (succeeded) *succeeded = VARIANT_FALSE; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/session.c wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/session.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/session.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/session.c 2015-06-28 16:51:28.000000000 +0000 @@ -555,7 +555,7 @@ static void request_destroy( object_header_t *hdr ) { request_t *request = (request_t *)hdr; - unsigned int i; + unsigned int i, j; TRACE("%p\n", request); @@ -587,6 +587,14 @@ heap_free( request->headers ); for (i = 0; i < request->num_accept_types; i++) heap_free( request->accept_types[i] ); heap_free( request->accept_types ); + for (i = 0; i < TARGET_MAX; i++) + { + for (j = 0; j < SCHEME_MAX; j++) + { + heap_free( request->creds[i][j].username ); + heap_free( request->creds[i][j].password ); + } + } heap_free( request ); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/tests/winhttp.c wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/tests/winhttp.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/tests/winhttp.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/tests/winhttp.c 2015-06-28 16:51:28.000000000 +0000 @@ -410,7 +410,7 @@ BOOL ret, reverse; WCHAR buffer[MAX_PATH]; WCHAR check_buffer[MAX_PATH]; - DWORD index, len, oldlen; + DWORD err, index, len, oldlen; static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0}; static const WCHAR test_verb[] = {'P','O','S','T',0}; @@ -420,6 +420,11 @@ {'P','O','S','T',' ','h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',':','8','0','/','p','o','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0}; static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0}; + static const WCHAR test_header_name2[] = {'n','a','m','e',0}; + static const WCHAR test_header_name3[] = {'a',0}; + static const WCHAR test_header_range[] = {'R','a','n','g','e',0}; + static const WCHAR test_header_range_bytes[] = {'R','a','n','g','e',':',' ','b','y','t','e','s','=','0','-','7','7','3','\r','\n',0}; + static const WCHAR test_header_bytes[] = {'b','y','t','e','s','=','0','-','7','7','3',0}; static const WCHAR test_flag_coalesce[] = {'t','e','s','t','2',',',' ','t','e','s','t','4',0}; static const WCHAR test_flag_coalesce_reverse[] = {'t','e','s','t','3',',',' ','t','e','s','t','4',0}; @@ -435,6 +440,7 @@ static const WCHAR field[] = {'f','i','e','l','d',0}; static const WCHAR value[] = {'v','a','l','u','e',' ',0}; static const WCHAR value_nospace[] = {'v','a','l','u','e',0}; + static const WCHAR empty[] = {0}; static const WCHAR test_headers[][14] = { @@ -451,7 +457,9 @@ {':','b',0}, {'c','d',0}, {' ','e',' ',':','f',0}, - {'f','i','e','l','d',':',' ','v','a','l','u','e',' ',0} + {'f','i','e','l','d',':',' ','v','a','l','u','e',' ',0}, + {'n','a','m','e',':',' ','v','a','l','u','e',0}, + {'n','a','m','e',':',0} }; static const WCHAR test_indices[][6] = { @@ -760,6 +768,14 @@ ret = WinHttpAddRequestHeaders(request, test_headers[9], ~0u, WINHTTP_ADDREQ_FLAG_ADD); ok(ret, "WinHttpAddRequestHeaders failed\n"); + index = 0; + memset(buffer, 0xff, sizeof(buffer)); + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name3, buffer, &len, &index); + ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(!memcmp(buffer, empty, sizeof(empty)), "unexpected result\n"); + ret = WinHttpAddRequestHeaders(request, test_headers[10], ~0u, WINHTTP_ADDREQ_FLAG_ADD); ok(!ret, "WinHttpAddRequestHeaders failed\n"); @@ -780,6 +796,72 @@ ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); ok(!memcmp(buffer, value, sizeof(value)) || ! memcmp(buffer, value_nospace, sizeof(value_nospace)), "unexpected result\n"); + SetLastError(0xdeadbeef); + ret = WinHttpAddRequestHeaders(request, test_header_range_bytes, 0, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE); + err = GetLastError(); + ok(!ret, "unexpected success\n"); + ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + + ret = WinHttpAddRequestHeaders(request, test_header_range_bytes, ~0u, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE); + ok(ret, "failed to add header: %u\n", GetLastError()); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_range, buffer, &len, &index); + ok(ret, "failed to get range header %u\n", GetLastError()); + ok(!memcmp(buffer, test_header_bytes, sizeof(test_header_bytes)), "incorrect string returned\n"); + ok(len == lstrlenW(test_header_bytes) * sizeof(WCHAR), "wrong length %u\n", len); + ok(index == 1, "wrong index %u\n", index); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name2, buffer, &len, &index); + ok(!ret, "unexpected success\n"); + + SetLastError(0xdeadbeef); + ret = WinHttpAddRequestHeaders(request, test_headers[14], ~0u, WINHTTP_ADDREQ_FLAG_REPLACE); + err = GetLastError(); + ok(!ret, "unexpected success\n"); + ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", err); + + ret = WinHttpAddRequestHeaders(request, test_headers[14], ~0u, WINHTTP_ADDREQ_FLAG_ADD); + ok(ret, "got %u\n", GetLastError()); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name2, buffer, &len, &index); + ok(ret, "got %u\n", GetLastError()); + ok(index == 1, "wrong index %u\n", index); + ok(!memcmp(buffer, value_nospace, sizeof(value_nospace)), "incorrect string\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[15], ~0u, WINHTTP_ADDREQ_FLAG_REPLACE); + ok(ret, "got %u\n", GetLastError()); + + index = 0; + len = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name2, buffer, &len, &index); + err = GetLastError(); + ok(!ret, "unexpected success\n"); + ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", err); + + ret = WinHttpAddRequestHeaders(request, test_headers[14], -1L, 0); + ok(ret, "got %u\n", GetLastError()); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name2, buffer, &len, &index); + ok(ret, "got %u\n", GetLastError()); + ok(index == 1, "wrong index %u\n", index); + ok(!memcmp(buffer, value_nospace, sizeof(value_nospace)), "incorrect string\n"); + ret = WinHttpCloseHandle(request); ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: @@ -942,6 +1024,11 @@ ok(ret, "failed to send request %u\n", GetLastError()); ret = WinHttpReceiveResponse(req, NULL); + if (!ret && GetLastError() == ERROR_WINHTTP_INVALID_SERVER_RESPONSE) /* win2k */ + { + win_skip("invalid response\n"); + goto done; + } ok(ret, "failed to receive response %u\n", GetLastError()); status = 0xdeadbeef; @@ -1799,6 +1886,16 @@ "Server: winetest\r\n" "\r\n"; +static const char notokmsg[] = +"HTTP/1.1 400 Bad Request\r\n" +"\r\n"; + +static const char cookiemsg[] = +"HTTP/1.1 200 OK\r\n" +"Set-Cookie: name = value \r\n" +"Set-Cookie: NAME = value \r\n" +"\r\n"; + static const char nocontentmsg[] = "HTTP/1.1 204 No Content\r\n" "Server: winetest\r\n" @@ -1909,7 +2006,8 @@ } if (strstr(buffer, "GET /not_modified")) { - send(c, notmodified, sizeof notmodified - 1, 0); + if (strstr(buffer, "If-Modified-Since:")) send(c, notmodified, sizeof notmodified - 1, 0); + else send(c, notokmsg, sizeof(notokmsg) - 1, 0); continue; } if (strstr(buffer, "HEAD /head")) @@ -1917,6 +2015,27 @@ send(c, headmsg, sizeof headmsg - 1, 0); continue; } + if (strstr(buffer, "GET /cookie3")) + { + if (strstr(buffer, "Cookie: name=value2; NAME=value; name=value\r\n") || + broken(strstr(buffer, "Cookie: name=value2; name=value; NAME=value\r\n") != NULL)) + send(c, okmsg, sizeof(okmsg) - 1, 0); + else + send(c, notokmsg, sizeof(notokmsg) - 1, 0); + } + if (strstr(buffer, "GET /cookie2")) + { + if (strstr(buffer, "Cookie: NAME=value; name=value\r\n") || + broken(strstr(buffer, "Cookie: name=value; NAME=value\r\n") != NULL)) + send(c, okmsg, sizeof(okmsg) - 1, 0); + else + send(c, notokmsg, sizeof(notokmsg) - 1, 0); + } + else if (strstr(buffer, "GET /cookie")) + { + if (!strstr(buffer, "Cookie: name=value\r\n")) send(c, cookiemsg, sizeof(cookiemsg) - 1, 0); + else send(c, notokmsg, sizeof(notokmsg) - 1, 0); + } if (strstr(buffer, "GET /quit")) { send(c, okmsg, sizeof okmsg - 1, 0); @@ -1986,8 +2105,9 @@ static void test_basic_authentication(int port) { static const WCHAR authW[] = {'/','a','u','t','h',0}; - static const WCHAR userW[] = {'u','s','e','r',0}; - static const WCHAR passW[] = {'p','w','d',0}; + static WCHAR userW[] = {'u','s','e','r',0}; + static WCHAR passW[] = {'p','w','d',0}; + static WCHAR pass2W[] = {'p','w','d','2',0}; HINTERNET ses, con, req; DWORD status, size, error, supported, first, target; BOOL ret; @@ -2120,6 +2240,76 @@ WinHttpCloseHandle(req); WinHttpCloseHandle(con); WinHttpCloseHandle(ses); + + /* credentials set with WinHttpSetCredentials take precedence over those set through options */ + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + con = WinHttpConnect(ses, localhostW, port, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, NULL, authW, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, userW, passW, NULL); + ok(ret, "failed to set credentials %u\n", GetLastError()); + + ret = WinHttpSetOption(req, WINHTTP_OPTION_USERNAME, userW, lstrlenW(userW)); + ok(ret, "failed to set username %u\n", GetLastError()); + + ret = WinHttpSetOption(req, WINHTTP_OPTION_PASSWORD, pass2W, lstrlenW(pass2W)); + ok(ret, "failed to set password %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %u\n", GetLastError()); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed to query status code %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + con = WinHttpConnect(ses, localhostW, port, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, NULL, authW, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetOption(req, WINHTTP_OPTION_USERNAME, userW, lstrlenW(userW)); + ok(ret, "failed to set username %u\n", GetLastError()); + + ret = WinHttpSetOption(req, WINHTTP_OPTION_PASSWORD, pass2W, lstrlenW(passW)); + ok(ret, "failed to set password %u\n", GetLastError()); + + ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, userW, pass2W, NULL); + ok(ret, "failed to set credentials %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %u\n", GetLastError()); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed to query status code %u\n", GetLastError()); + ok(status == 401, "request failed unexpectedly %u\n", status); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); } static void test_no_headers(int port) @@ -2300,11 +2490,12 @@ { static const WCHAR pathW[] = {'/','n','o','t','_','m','o','d','i','f','i','e','d',0}; static const WCHAR ifmodifiedW[] = {'I','f','-','M','o','d','i','f','i','e','d','-','S','i','n','c','e',':',' '}; + static const WCHAR ifmodified2W[] = {'I','f','-','M','o','d','i','f','i','e','d','-','S','i','n','c','e',0}; BOOL ret; HINTERNET session, request, connection; - DWORD status, size, start = GetTickCount(); + DWORD index, len, status, size, start = GetTickCount(); SYSTEMTIME st; - WCHAR today[(sizeof(ifmodifiedW) + WINHTTP_TIME_FORMAT_BUFSIZE)/sizeof(WCHAR) + 3]; + WCHAR today[(sizeof(ifmodifiedW) + WINHTTP_TIME_FORMAT_BUFSIZE)/sizeof(WCHAR) + 3], buffer[32]; memcpy(today, ifmodifiedW, sizeof(ifmodifiedW)); GetSystemTime(&st); @@ -2321,12 +2512,18 @@ WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); ok(request != NULL, "WinHttpOpenrequest failed: %u\n", GetLastError()); - ret = WinHttpSendRequest(request, today, ~0u, NULL, 0, 0, 0); + ret = WinHttpSendRequest(request, today, 0, NULL, 0, 0, 0); ok(ret, "WinHttpSendRequest failed: %u\n", GetLastError()); ret = WinHttpReceiveResponse(request, NULL); ok(ret, "WinHttpReceiveResponse failed: %u\n", GetLastError()); + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + ifmodified2W, buffer, &len, &index); + ok(ret, "failed to get header %u\n", GetLastError()); + status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, @@ -2432,6 +2629,123 @@ WinHttpCloseHandle(ses); } +static void test_cookies( int port ) +{ + static const WCHAR cookieW[] = {'/','c','o','o','k','i','e',0}; + static const WCHAR cookie2W[] = {'/','c','o','o','k','i','e','2',0}; + static const WCHAR cookie3W[] = {'/','c','o','o','k','i','e','3',0}; + static const WCHAR cookieheaderW[] = + {'C','o','o','k','i','e',':',' ','n','a','m','e','=','v','a','l','u','e','2','\r','\n',0}; + HINTERNET ses, con, req; + DWORD status, size; + BOOL ret; + + ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + + con = WinHttpConnect( ses, localhostW, port, 0 ); + ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + + req = WinHttpOpenRequest( con, NULL, cookieW, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %u\n", status ); + + WinHttpCloseHandle( req ); + + req = WinHttpOpenRequest( con, NULL, cookie2W, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %u\n", status ); + + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + + con = WinHttpConnect( ses, localhostW, port, 0 ); + ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + + req = WinHttpOpenRequest( con, NULL, cookie2W, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %u\n", status ); + + WinHttpCloseHandle( req ); + + req = WinHttpOpenRequest( con, NULL, cookie3W, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + ret = WinHttpSendRequest( req, cookieheaderW, ~0u, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( status == 200 || broken(status == 400), "request failed unexpectedly %u\n", status ); + + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); + + ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + + con = WinHttpConnect( ses, localhostW, port, 0 ); + ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + + req = WinHttpOpenRequest( con, NULL, cookie2W, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( status == 400, "request failed unexpectedly %u\n", status ); + + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); +} + static void test_connection_info( int port ) { static const WCHAR basicW[] = {'/','b','a','s','i','c',0}; @@ -3407,6 +3721,7 @@ test_basic_authentication(si.port); test_bad_header(si.port); test_multiple_reads(si.port); + test_cookies(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, NULL, quitW); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/winhttp_private.h wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/winhttp_private.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/winhttp/winhttp_private.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/winhttp/winhttp_private.h 2015-06-28 16:51:28.000000000 +0000 @@ -148,6 +148,14 @@ BOOL is_request; /* part of request headers? */ } header_t; +enum auth_target +{ + TARGET_INVALID = -1, + TARGET_SERVER, + TARGET_PROXY, + TARGET_MAX +}; + enum auth_scheme { SCHEME_INVALID = -1, @@ -155,7 +163,8 @@ SCHEME_NTLM, SCHEME_PASSPORT, SCHEME_DIGEST, - SCHEME_NEGOTIATE + SCHEME_NEGOTIATE, + SCHEME_MAX }; struct authinfo @@ -206,6 +215,11 @@ HANDLE task_thread; struct list task_queue; CRITICAL_SECTION task_cs; + struct + { + WCHAR *username; + WCHAR *password; + } creds[TARGET_MAX][SCHEME_MAX]; } request_t; typedef struct _task_header_t task_header_t; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/http.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/http.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/http.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/http.c 2015-06-28 16:51:28.000000000 +0000 @@ -380,6 +380,12 @@ return ret; } +typedef enum { + BLOCKING_ALLOW, + BLOCKING_DISALLOW, + BLOCKING_WAITALL +} blocking_mode_t; + struct data_stream_vtbl_t { DWORD (*get_avail_data)(data_stream_t*,http_request_t*); BOOL (*end_of_data)(data_stream_t*,http_request_t*); @@ -408,7 +414,7 @@ destroy_data_stream(req->data_stream); req->data_stream = &req->netconn_stream.data_stream; req->read_pos = req->read_size = req->netconn_stream.content_read = 0; - req->read_chunked = req->read_gzip = FALSE; + req->read_gzip = FALSE; } static void remove_header( http_request_t *request, const WCHAR *str, BOOL from_request ) @@ -1665,7 +1671,8 @@ TRACE("Inserting authorization: %s\n", debugstr_w(authorization)); - HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + HTTP_ProcessHeader(request, header, authorization, + HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); heap_free(authorization); } else if (!strcmpW(header, szAuthorization) && (host = get_host_header(request))) @@ -1686,7 +1693,8 @@ TRACE("Inserting authorization: %s\n", debugstr_w(authorization)); - HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + HTTP_ProcessHeader(request, header, authorization, + HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); heap_free(data); heap_free(authorization); } @@ -2513,7 +2521,7 @@ if (maxlen == -1) maxlen = sizeof(req->read_buf); res = NETCON_recv( req->netconn, req->read_buf + req->read_size, - maxlen - req->read_size, BLOCKING_ALLOW, &len ); + maxlen - req->read_size, TRUE, &len ); if(res == ERROR_SUCCESS) req->read_size += len; @@ -2659,24 +2667,28 @@ { netconn_stream_t *netconn_stream = (netconn_stream_t*)stream; DWORD res = ERROR_SUCCESS; - int len = 0; + int len = 0, ret = 0; size = min(size, netconn_stream->content_length-netconn_stream->content_read); if(size && is_valid_netconn(req->netconn)) { - if((res = NETCON_recv(req->netconn, buf, size, blocking_mode, &len))) { - len = 0; - if(blocking_mode == BLOCKING_DISALLOW && res == WSAEWOULDBLOCK) - res = ERROR_SUCCESS; - else + while((res = NETCON_recv(req->netconn, buf+ret, size-ret, blocking_mode != BLOCKING_DISALLOW, &len)) == ERROR_SUCCESS) { + if(!len) { netconn_stream->content_length = netconn_stream->content_read; - }else if(!len) { - netconn_stream->content_length = netconn_stream->content_read; + break; + } + ret += len; + netconn_stream->content_read += len; + if(blocking_mode != BLOCKING_WAITALL || size == ret) + break; } + + if(ret || (blocking_mode == BLOCKING_DISALLOW && res == WSAEWOULDBLOCK)) + res = ERROR_SUCCESS; } - netconn_stream->content_read += *read = len; - TRACE("read %u bytes\n", len); + TRACE("read %u bytes\n", ret); + *read = ret; return res; } @@ -2690,7 +2702,7 @@ return TRUE; do { - if(NETCON_recv(req->netconn, buf, sizeof(buf), BLOCKING_DISALLOW, &len) != ERROR_SUCCESS) + if(NETCON_recv(req->netconn, buf, sizeof(buf), FALSE, &len) != ERROR_SUCCESS) return FALSE; netconn_stream->content_read += len; @@ -2730,7 +2742,7 @@ if (maxlen == -1) maxlen = sizeof(stream->buf); res = NETCON_recv( req->netconn, stream->buf + stream->buf_size, - maxlen - stream->buf_size, BLOCKING_ALLOW, &len ); + maxlen - stream->buf_size, TRUE, &len ); if(res == ERROR_SUCCESS) stream->buf_size += len; @@ -2866,7 +2878,7 @@ break; } - res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, BLOCKING_ALLOW, (int*)&read_bytes); + res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, TRUE, (int*)&read_bytes); if(res != ERROR_SUCCESS) break; } @@ -2955,7 +2967,6 @@ request->data_stream = &chunked_stream->data_stream; request->contentLength = ~0u; - request->read_chunked = TRUE; } if(request->decoding) { @@ -3404,7 +3415,7 @@ HTTP_ProcessHeader(request, HTTP_ACCEPT, lpszAcceptTypes[i], HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA | HTTP_ADDHDR_FLAG_REQ | - (i == 0 ? HTTP_ADDHDR_FLAG_REPLACE : 0)); + (i == 0 ? (HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD) : 0)); } } @@ -4244,7 +4255,8 @@ if(res != ERROR_SUCCESS || !cookies) return; - HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE); + HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), + HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); heap_free(cookies); } @@ -4965,7 +4977,8 @@ HTTP_FixURL(request); if (request->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION) { - HTTP_ProcessHeader(request, szConnection, szKeepAlive, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + HTTP_ProcessHeader(request, szConnection, szKeepAlive, + HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); } HTTP_InsertAuthorization(request, request->authInfo, szAuthorization); HTTP_InsertAuthorization(request, request->proxyAuthInfo, szProxy_Authorization); @@ -5982,7 +5995,7 @@ /* Add status code */ HTTP_ProcessHeader(request, szStatus, status_code, - HTTP_ADDHDR_FLAG_REPLACE); + HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); heap_free(request->version); heap_free(request->statusText); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/internet.h wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/internet.h --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/internet.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/internet.h 2015-06-28 16:51:28.000000000 +0000 @@ -68,6 +68,7 @@ { int socket; BOOL secure; + BOOL is_blocking; CtxtHandle ssl_ctx; SecPkgContext_StreamSizes ssl_sizes; server_t *server; @@ -355,7 +356,6 @@ CRITICAL_SECTION read_section; /* section to protect the following fields */ DWORD contentLength; /* total number of bytes to be read */ - BOOL read_chunked; /* are we reading in chunked mode? */ BOOL read_gzip; /* are we reading in gzip mode? */ DWORD read_pos; /* current read position in read_buf */ DWORD read_size; /* valid data size in read_buf */ @@ -416,19 +416,13 @@ DWORD dwStatusInfoLength) DECLSPEC_HIDDEN; BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) DECLSPEC_HIDDEN; -typedef enum { - BLOCKING_ALLOW, - BLOCKING_DISALLOW, - BLOCKING_WAITALL -} blocking_mode_t; - DWORD create_netconn(BOOL,server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN; void free_netconn(netconn_t*) DECLSPEC_HIDDEN; void NETCON_unload(void) DECLSPEC_HIDDEN; DWORD NETCON_secure_connect(netconn_t*,server_t*) DECLSPEC_HIDDEN; DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) DECLSPEC_HIDDEN; -DWORD NETCON_recv(netconn_t*,void*,size_t,blocking_mode_t,int*) DECLSPEC_HIDDEN; +DWORD NETCON_recv(netconn_t*,void*,size_t,BOOL,int*) DECLSPEC_HIDDEN; BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available) DECLSPEC_HIDDEN; BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN; LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/netconnection.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/netconnection.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/netconnection.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/netconnection.c 2015-06-28 16:51:28.000000000 +0000 @@ -280,10 +280,13 @@ InitOnceExecuteOnce(&init_once, winsock_startup, NULL, NULL); } -static void set_socket_blocking(int socket, blocking_mode_t mode) +static void set_socket_blocking(netconn_t *conn, BOOL is_blocking) { - ULONG arg = mode == BLOCKING_DISALLOW; - ioctlsocket(socket, FIONBIO, &arg); + if(conn->is_blocking != is_blocking) { + ULONG arg = !is_blocking; + ioctlsocket(conn->socket, FIONBIO, &arg); + } + conn->is_blocking = is_blocking; } static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD timeout) @@ -297,7 +300,7 @@ assert(server->addr_len); result = netconn->socket = socket(server->addr.ss_family, SOCK_STREAM, 0); if(result != -1) { - set_socket_blocking(netconn->socket, BLOCKING_DISALLOW); + set_socket_blocking(netconn, FALSE); result = connect(netconn->socket, (struct sockaddr*)&server->addr, server->addr_len); if(result == -1) { @@ -325,9 +328,6 @@ closesocket(netconn->socket); netconn->socket = -1; } - else { - set_socket_blocking(netconn->socket, BLOCKING_ALLOW); - } } if(result == -1) return ERROR_INTERNET_CANNOT_CONNECT; @@ -468,6 +468,8 @@ assert(status != SEC_E_OK); + set_socket_blocking(connection, TRUE); + while(status == SEC_I_CONTINUE_NEEDED || status == SEC_E_INCOMPLETE_MESSAGE) { if(out_buf.cbBuffer) { assert(status == SEC_I_CONTINUE_NEEDED); @@ -662,6 +664,9 @@ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) { + /* send is always blocking. */ + set_socket_blocking(connection, TRUE); + if(!connection->secure) { *sent = sock_send(connection->socket, msg, len, flags); @@ -688,22 +693,17 @@ } } -static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking_mode_t mode, SIZE_T *ret_size, BOOL *eof) +static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, BOOL blocking, SIZE_T *ret_size, BOOL *eof) { const SIZE_T ssl_buf_size = conn->ssl_sizes.cbHeader+conn->ssl_sizes.cbMaximumMessage+conn->ssl_sizes.cbTrailer; SecBuffer bufs[4]; SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; SSIZE_T size, buf_len = 0; - blocking_mode_t tmp_mode; int i; SECURITY_STATUS res; assert(conn->extra_len < ssl_buf_size); - /* BLOCKING_WAITALL is handled by caller */ - if(mode == BLOCKING_WAITALL) - mode = BLOCKING_ALLOW; - if(conn->extra_len) { memcpy(conn->ssl_buf, conn->extra_buf, conn->extra_len); buf_len = conn->extra_len; @@ -712,8 +712,7 @@ conn->extra_buf = NULL; } - tmp_mode = buf_len ? BLOCKING_DISALLOW : mode; - set_socket_blocking(conn->socket, tmp_mode); + set_socket_blocking(conn, blocking && !buf_len); size = sock_recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); if(size < 0) { if(!buf_len) { @@ -728,10 +727,10 @@ buf_len += size; } - *ret_size = buf_len; - if(!buf_len) { + TRACE("EOF\n"); *eof = TRUE; + *ret_size = 0; return ERROR_SUCCESS; } @@ -754,7 +753,7 @@ case SEC_E_INCOMPLETE_MESSAGE: assert(buf_len < ssl_buf_size); - set_socket_blocking(conn->socket, mode); + set_socket_blocking(conn, blocking); size = sock_recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); if(size < 1) { if(size < 0 && WSAGetLastError() == WSAEWOULDBLOCK) { @@ -817,7 +816,7 @@ * Basically calls 'recv()' unless we should use SSL * number of chars received is put in *recvd */ -DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t mode, int *recvd) +DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, int *recvd) { *recvd = 0; if (!len) @@ -825,18 +824,13 @@ if (!connection->secure) { - int flags = 0; - - if(mode == BLOCKING_WAITALL) - flags = MSG_WAITALL; - - set_socket_blocking(connection->socket, mode); - *recvd = sock_recv(connection->socket, buf, len, flags); - return *recvd == -1 ? WSAGetLastError() : ERROR_SUCCESS; + set_socket_blocking(connection, blocking); + *recvd = sock_recv(connection->socket, buf, len, 0); + return *recvd == -1 ? WSAGetLastError() : ERROR_SUCCESS; } else { - SIZE_T size = 0, cread; + SIZE_T size = 0; BOOL eof; DWORD res; @@ -850,17 +844,13 @@ heap_free(connection->peek_msg_mem); connection->peek_msg_mem = connection->peek_msg = NULL; } - /* check if we have enough data from the peek buffer */ - if(mode != BLOCKING_WAITALL || size == len) { - *recvd = size; - return ERROR_SUCCESS; - } - mode = BLOCKING_DISALLOW; + *recvd = size; + return ERROR_SUCCESS; } do { - res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, mode, &cread, &eof); + res = read_ssl_chunk(connection, (BYTE*)buf, len, blocking, &size, &eof); if(res != ERROR_SUCCESS) { if(res == WSAEWOULDBLOCK) { if(size) @@ -870,14 +860,7 @@ } break; } - - if(eof) { - TRACE("EOF\n"); - break; - } - - size += cread; - }while(!size || (mode == BLOCKING_WAITALL && size < len)); + }while(!size && !eof); TRACE("received %ld bytes\n", size); *recvd = size; @@ -916,9 +899,8 @@ int len; char b; - set_socket_blocking(netconn->socket, BLOCKING_DISALLOW); + set_socket_blocking(netconn, FALSE); len = sock_recv(netconn->socket, &b, 1, MSG_PEEK); - set_socket_blocking(netconn->socket, BLOCKING_ALLOW); return len == 1 || (len == -1 && WSAGetLastError() == WSAEWOULDBLOCK); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/tests/http.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/tests/http.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/tests/http.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/tests/http.c 2015-06-28 16:51:28.000000000 +0000 @@ -2051,6 +2051,7 @@ WSADATA wsaData; int last_request = 0; char host_header[22]; + char host_header_override[30]; static BOOL test_b = FALSE; static int test_no_cache = 0; @@ -2077,6 +2078,7 @@ SetEvent(si->hEvent); sprintf(host_header, "Host: localhost:%d", si->port); + sprintf(host_header_override, "Host: test.local:%d\r\n", si->port); do { @@ -2351,6 +2353,13 @@ else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "/test_host_override")) + { + if (strstr(buffer, host_header_override)) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } shutdown(c, 2); closesocket(c); c = -1; @@ -2946,6 +2955,105 @@ InternetCloseHandle(ses); } +static void test_header_override(int port) +{ + char buffer[128], host_header_override[30], full_url[128]; + HINTERNET ses, con, req; + DWORD size, count, err; + BOOL ret; + + sprintf(host_header_override, "Host: test.local:%d\r\n", port); + sprintf(full_url, "http://localhost:%d/test_host_override", port); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpen failed\n"); + + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + size = sizeof(buffer) - 1; + count = 0; + memset(buffer, 0, sizeof(buffer)); + ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); + err = GetLastError(); + todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); + todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + + size = sizeof(buffer) - 1; + memset(buffer, 0, sizeof(buffer)); + ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); + ok(ret, "InternetQueryOption failed\n"); + ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); + ok(ret, "HttpAddRequestHeaders failed\n"); + + size = sizeof(buffer) - 1; + count = 0; + memset(buffer, 0, sizeof(buffer)); + ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); + ok(ret, "HttpQueryInfo failed\n"); + + size = sizeof(buffer) - 1; + memset(buffer, 0, sizeof(buffer)); + ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); + ok(ret, "InternetQueryOption failed\n"); + todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code_todo(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 400); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE); + err = GetLastError(); + todo_wine ok(!ret, "HttpAddRequestHeaders succeeded\n"); + todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code_todo(req, 400); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); +} + static void test_http1_1(int port) { HINTERNET ses, con, req; @@ -4322,6 +4430,7 @@ test_basic_request(si.port, "GET", "/test6"); test_basic_request(si.port, "GET", "/testF"); test_connection_header(si.port); + test_header_override(si.port); test_http1_1(si.port); test_cookie_header(si.port); test_basic_authentication(si.port); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/tests/urlcache.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/tests/urlcache.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/tests/urlcache.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/tests/urlcache.c 2015-06-28 16:51:28.000000000 +0000 @@ -363,6 +363,7 @@ static void test_urlcacheA(void) { + static char long_url[300] = "http://www.winehq.org/"; static char ok_header[] = "HTTP/1.0 200 OK\r\n\r\n"; BOOL ret; HANDLE hFile; @@ -372,6 +373,7 @@ DWORD cbCacheEntryInfo; static const FILETIME filetime_zero; FILETIME now; + int len; ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0); ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); @@ -807,6 +809,30 @@ ret = pDeleteUrlCacheEntryA(test_hash_collisions2); ok(ret, "DeleteUrlCacheEntry failed: %d\n", GetLastError()); } + + len = strlen(long_url); + memset(long_url+len, 'a', sizeof(long_url)-len); + long_url[sizeof(long_url)-1] = 0; + ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0); + ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); + check_file_exists(filenameA); + DeleteFileA(filenameA); + + ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0); + ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); + check_file_exists(filenameA); + DeleteFileA(filenameA); + + long_url[250] = 0; + ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0); + ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); + check_file_exists(filenameA); + DeleteFileA(filenameA); + + ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0); + ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); + check_file_exists(filenameA); + DeleteFileA(filenameA); } static void test_urlcacheW(void) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/urlcache.c wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/urlcache.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/wininet/urlcache.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/wininet/urlcache.c 2015-06-28 16:51:28.000000000 +0000 @@ -979,7 +979,8 @@ LPCSTR szLocalFileName, BYTE Directory, LPWSTR wszPath, - LPLONG lpBufferSize) + LPLONG lpBufferSize, + BOOL trunc_name) { LONG nRequired; int path_len = strlenW(pContainer->path); @@ -993,6 +994,8 @@ nRequired = (path_len + file_name_len) * sizeof(WCHAR); if(Directory != CACHE_CONTAINER_NO_SUBDIR) nRequired += (DIR_LENGTH + 1) * sizeof(WCHAR); + if (trunc_name && nRequired >= *lpBufferSize) + nRequired = *lpBufferSize; if (nRequired <= *lpBufferSize) { int dir_len; @@ -1008,7 +1011,9 @@ { dir_len = 0; } - MultiByteToWideChar(CP_ACP, 0, szLocalFileName, -1, wszPath + dir_len + path_len, file_name_len); + MultiByteToWideChar(CP_ACP, 0, szLocalFileName, -1, wszPath + dir_len + path_len, + *lpBufferSize/sizeof(WCHAR)-dir_len-path_len); + wszPath[*lpBufferSize/sizeof(WCHAR)-1] = 0; *lpBufferSize = nRequired; return TRUE; } @@ -1097,7 +1102,7 @@ if(!urlcache_create_file_pathW(container, header, (LPCSTR)url_entry+url_entry->local_name_off, - url_entry->cache_dir, path, &path_size)) + url_entry->cache_dir, path, &path_size, FALSE)) goto succ; if(!GetFileAttributesExW(path, GetFileExInfoStandard, &attr)) @@ -1320,8 +1325,10 @@ LPSTR file_name; file_name = (LPSTR)entry_info+size; file_name_size = *info_size-size; - if((unicode && urlcache_create_file_pathW(container, header, (LPCSTR)url_entry+url_entry->local_name_off, url_entry->cache_dir, (LPWSTR)file_name, &file_name_size)) || - (!unicode && urlcache_create_file_pathA(container, header, (LPCSTR)url_entry+url_entry->local_name_off, url_entry->cache_dir, file_name, &file_name_size))) { + if((unicode && urlcache_create_file_pathW(container, header, (LPCSTR)url_entry+url_entry->local_name_off, + url_entry->cache_dir, (LPWSTR)file_name, &file_name_size, FALSE)) || + (!unicode && urlcache_create_file_pathA(container, header, (LPCSTR)url_entry+url_entry->local_name_off, + url_entry->cache_dir, file_name, &file_name_size))) { entry_info->lpszLocalFileName = file_name; } size += file_name_size; @@ -2613,7 +2620,7 @@ char file_name[MAX_PATH]; WCHAR extW[MAX_PATH]; BYTE cache_dir; - LONG full_path_len; + LONG full_path_len, ext_len = 0; BOOL generate_name = FALSE; DWORD error; HANDLE file; @@ -2644,6 +2651,8 @@ p--; } + if(e-p >= MAX_PATH) + e = p+MAX_PATH-1; memcpy(file_name, p, e-p); file_name[e-p] = 0; @@ -2683,7 +2692,7 @@ cache_dir = CACHE_CONTAINER_NO_SUBDIR; full_path_len = MAX_PATH * sizeof(WCHAR); - if(!urlcache_create_file_pathW(container, header, file_name, cache_dir, full_path, &full_path_len)) { + if(!urlcache_create_file_pathW(container, header, file_name, cache_dir, full_path, &full_path_len, TRUE)) { WARN("Failed to get full path for filename %s, needed %u bytes.\n", debugstr_a(file_name), full_path_len); cache_container_unlock_index(container, header); @@ -2697,7 +2706,7 @@ WCHAR *p; extW[0] = '.'; - MultiByteToWideChar(CP_ACP, 0, ext, -1, extW+1, MAX_PATH-1); + ext_len = MultiByteToWideChar(CP_ACP, 0, ext, -1, extW+1, MAX_PATH-1); for(p=extW; *p; p++) { switch(*p) { @@ -2715,6 +2724,10 @@ extW[0] = '\0'; } + if(!generate_name && full_path_len+5+ext_len>=MAX_PATH) { /* strlen("[255]") = 5 */ + full_path_len = MAX_PATH-5-ext_len-1; + } + for(i=0; i<255 && !generate_name; i++) { static const WCHAR format[] = {'[','%','u',']','%','s',0}; @@ -2728,6 +2741,9 @@ } } + if(full_path_len+8+ext_len >= MAX_PATH) + full_path_len = MAX_PATH-8-ext_len-1; + /* Try to generate random name */ GetSystemTimeAsFileTime(&ft); strcpyW(full_path+full_path_len+8, extW); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ws2_32/socket.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ws2_32/socket.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ws2_32/socket.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ws2_32/socket.c 2015-06-28 16:51:28.000000000 +0000 @@ -1096,6 +1096,14 @@ return events[bit]; } +static int _get_fd_type(int fd) +{ + int sock_type = -1; + socklen_t optlen = sizeof(sock_type); + getsockopt(fd, SOL_SOCKET, SO_TYPE, (char*) &sock_type, &optlen); + return sock_type; +} + static struct per_thread_data *get_per_thread_data(void) { struct per_thread_data * ptb = NtCurrentTeb()->WinSockData; @@ -2572,6 +2580,7 @@ WS_closesocket(as); return SOCKET_ERROR; } + TRACE("\taccepted %04lx\n", as); return as; } if (is_blocking && status == STATUS_CANT_WAIT) @@ -2777,8 +2786,6 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr ) { struct sockaddr_in *in_sock = (struct sockaddr_in *) addr; - unsigned int sock_type = 0; - socklen_t optlen = sizeof(sock_type); in_addr_t bind_addr = in_sock->sin_addr.s_addr; PIP_ADAPTER_INFO adapters = NULL, adapter; BOOL ret = FALSE; @@ -2787,7 +2794,7 @@ if (bind_addr == htonl(INADDR_ANY) || bind_addr == htonl(INADDR_LOOPBACK)) return FALSE; /* Not binding to a network adapter, special interface binding unnecessary. */ - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &sock_type, &optlen) == -1 || sock_type != SOCK_DGRAM) + if (_get_fd_type(fd) != SOCK_DGRAM) return FALSE; /* Special interface binding is only necessary for UDP datagrams. */ if (GetAdaptersInfo(NULL, &adap_size) != ERROR_BUFFER_OVERFLOW) goto cleanup; @@ -3230,12 +3237,12 @@ return; #else int ifindex; - socklen_t len = sizeof(ifindex); + socklen_t len; /* Check for IPv4, address 0.0.0.0 and UDP socket */ if (addr->sin_family != AF_INET || addr->sin_addr.s_addr != 0) return; - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &ifindex, &len) || ifindex != SOCK_DGRAM) + if (_get_fd_type(fd) != SOCK_DGRAM) return; ifindex = -1; @@ -3546,8 +3553,7 @@ case WS_SO_LINGER: { struct linger lingval; - int so_type; - socklen_t len = sizeof(struct linger), slen = sizeof(int); + socklen_t len = sizeof(struct linger); /* struct linger and LINGER have different sizes */ if (!optlen || *optlen < sizeof(LINGER) || !optval) @@ -3558,7 +3564,7 @@ if ( (fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR; - if ((getsockopt(fd, SOL_SOCKET, SO_TYPE, &so_type, &slen) == 0 && so_type == SOCK_DGRAM)) + if (_get_fd_type(fd) == SOCK_DGRAM) { SetLastError(WSAENOPROTOOPT); ret = SOCKET_ERROR; @@ -3642,6 +3648,7 @@ } case WS_SO_TYPE: { + int sock_type; if (!optlen || *optlen < sizeof(int) || !optval) { SetLastError(WSAEFAULT); @@ -3650,13 +3657,14 @@ if ( (fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR; - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, optval, (socklen_t *)optlen) != 0 ) + sock_type = _get_fd_type(fd); + if (sock_type == -1) { SetLastError(wsaErrno()); ret = SOCKET_ERROR; } else - (*(int *)optval) = convert_socktype_u2w(*(int *)optval); + (*(int *)optval) = convert_socktype_u2w(sock_type); release_sock_fd( s, fd ); return ret; @@ -4700,7 +4708,8 @@ fds[j].fd = get_sock_fd( writefds->fd_array[i], FILE_WRITE_DATA, NULL ); if (fds[j].fd == -1) goto failed; fds[j].revents = 0; - if (is_fd_bound(fds[j].fd, NULL, NULL) == 1) + if (is_fd_bound(fds[j].fd, NULL, NULL) == 1 || + _get_fd_type(fds[j].fd) == SOCK_DGRAM) { fds[j].events = POLLOUT; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/ws2_32/tests/sock.c wine-staging-1.7.46~ubuntu14.10.1/dlls/ws2_32/tests/sock.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/ws2_32/tests/sock.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/ws2_32/tests/sock.c 2015-06-28 16:51:28.000000000 +0000 @@ -3868,6 +3868,18 @@ ok(GetLastError() == WSAENOTSOCK, "expected 10038, got %d\n", GetLastError()); WaitForSingleObject (thread_handle, 1000); closesocket(fdRead); + + /* test UDP behavior of unbound sockets */ + select_timeout.tv_sec = 0; + select_timeout.tv_usec = 250000; + fdWrite = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + ok(fdWrite != INVALID_SOCKET, "socket call failed\n"); + FD_ZERO_ALL(); + FD_SET_ALL(fdWrite); + ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(FD_ISSET(fdWrite, &writefds), "fdWrite socket is not in the set\n"); + closesocket(fdWrite); } #undef FD_SET_ALL #undef FD_ZERO_ALL diff -Nru wine-staging-1.7.45~ubuntu14.10.1/dlls/xaudio2_7/xaudio_dll.c wine-staging-1.7.46~ubuntu14.10.1/dlls/xaudio2_7/xaudio_dll.c --- wine-staging-1.7.45~ubuntu14.10.1/dlls/xaudio2_7/xaudio_dll.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/dlls/xaudio2_7/xaudio_dll.c 2015-06-28 16:51:28.000000000 +0000 @@ -71,138 +71,40 @@ } typedef struct { - IClassFactory IClassFactory_iface; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, IUnknown **ppObj); -} IClassFactoryImpl; - -static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) -{ - return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); -} - -static HRESULT WINAPI XAudio2CF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) -{ - if(IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IClassFactory)) - { - IClassFactory_AddRef(iface); - *ppobj = iface; - return S_OK; - } - - *ppobj = NULL; - WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj); - return E_NOINTERFACE; -} - -static ULONG WINAPI XAudio2CF_AddRef(IClassFactory *iface) -{ - return 2; -} - -static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface) -{ - return 1; -} - -static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, - REFIID riid, void **ppobj) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - HRESULT hr; - IUnknown *punk; - - TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj); - - *ppobj = NULL; - hr = This->pfnCreateInstance(pOuter, &punk); - if (FAILED(hr)) - return hr; - - hr = IUnknown_QueryInterface(punk, riid, ppobj); - IUnknown_Release(punk); - return hr; -} - -static HRESULT WINAPI XAudio2CF_LockServer(IClassFactory *iface, BOOL dolock) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - FIXME("(%p)->(%d): stub!\n", This, dolock); - return S_OK; -} - -static const IClassFactoryVtbl XAudio2CF_Vtbl = -{ - XAudio2CF_QueryInterface, - XAudio2CF_AddRef, - XAudio2CF_Release, - XAudio2CF_CreateInstance, - XAudio2CF_LockServer -}; - -typedef struct { - IXAudio2 IXAudio2Impl_iface; + IXAudio27 IXAudio27_iface; + IXAudio2 IXAudio2_iface; LONG ref; -} IXAudio2Impl; - -static const struct IXAudio2Vtbl XAudio2_Vtbl; - -HRESULT XAudio2_create(IUnknown *pUnkOuter, IUnknown **ppObj) -{ - IXAudio2Impl *object; - TRACE("(%p, %p)\n", pUnkOuter, ppObj); - - if(pUnkOuter) - return CLASS_E_NOAGGREGATION; - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IXAudio2Impl)); - if(!object) - return E_OUTOFMEMORY; - - object->IXAudio2Impl_iface.lpVtbl = &XAudio2_Vtbl; - object->ref = 1; - - *ppObj = (IUnknown *)&object->IXAudio2Impl_iface; - - return S_OK; -} - -static IClassFactoryImpl xaudio2_cf = { { &XAudio2CF_Vtbl }, XAudio2_create }; + DWORD version; +} IXAudio2Impl; -HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) +static inline IXAudio2Impl *impl_from_IXAudio2(IXAudio2 *iface) { - IClassFactory *factory = NULL; - - TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - - if(IsEqualGUID(rclsid, &CLSID_XAudio2)) { - factory = &xaudio2_cf.IClassFactory_iface; - } - if(!factory) return CLASS_E_CLASSNOTAVAILABLE; - - return IClassFactory_QueryInterface(factory, riid, ppv); + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio2_iface); } -/*** IUnknown methods ***/ -static inline IXAudio2Impl *impl_from_IXAudio2(IXAudio2 *iface) +static inline IXAudio2Impl *impl_from_IXAudio27(IXAudio27 *iface) { - return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio2Impl_iface); + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio27_iface); } -static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, void **ppvObject) +static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, + void **ppvObject) { IXAudio2Impl *This = impl_from_IXAudio2(iface); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject); - *ppvObject = NULL; - if(IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IXAudio2)) - { - IXAudio2_AddRef(iface); - *ppvObject = iface; + IsEqualGUID(riid, &IID_IXAudio2)) + *ppvObject = &This->IXAudio2_iface; + else if(IsEqualGUID(riid, &IID_IXAudio27)) + *ppvObject = &This->IXAudio27_iface; + else + *ppvObject = NULL; + + if(*ppvObject){ + IUnknown_AddRef((IUnknown*)*ppvObject); return S_OK; } @@ -214,10 +116,9 @@ static ULONG WINAPI IXAudio2Impl_AddRef(IXAudio2 *iface) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - - TRACE("(%p)->()\n", This); - - return InterlockedIncrement(&This->ref); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; } static ULONG WINAPI IXAudio2Impl_Release(IXAudio2 *iface) @@ -225,7 +126,7 @@ IXAudio2Impl *This = impl_from_IXAudio2(iface); ULONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)->()\n", This); + TRACE("(%p)->(): Refcount now %u\n", This, ref); if (!ref) HeapFree(GetProcessHeap(), 0, This); @@ -233,35 +134,8 @@ return ref; } -/*** IXAudio2 methods ***/ -static HRESULT WINAPI IXAudio2Impl_GetDeviceCount(IXAudio2 *iface, UINT32 *pCount) -{ - IXAudio2Impl *This = impl_from_IXAudio2(iface); - - FIXME("(%p)->(%p): stub!\n", This, pCount); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IXAudio2Impl_GetDeviceDetails(IXAudio2 *iface, UINT32 index, XAUDIO2_DEVICE_DETAILS *pDeviceDetails) -{ - IXAudio2Impl *This = impl_from_IXAudio2(iface); - - FIXME("(%p)->(%u, %p): stub!\n", This, index, pDeviceDetails); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IXAudio2Impl_Initialize(IXAudio2 *iface, UINT32 flags, XAUDIO2_PROCESSOR processor) -{ - IXAudio2Impl *This = impl_from_IXAudio2(iface); - - FIXME("(%p)->(%u, %u): stub!\n", This, flags, processor); - - return S_OK; -} - -static HRESULT WINAPI IXAudio2Impl_RegisterForCallbacks(IXAudio2 *iface, IXAudio2EngineCallback *pCallback) +static HRESULT WINAPI IXAudio2Impl_RegisterForCallbacks(IXAudio2 *iface, + IXAudio2EngineCallback *pCallback) { IXAudio2Impl *This = impl_from_IXAudio2(iface); @@ -270,38 +144,57 @@ return E_NOTIMPL; } -static void WINAPI IXAudio2Impl_UnregisterForCallbacks(IXAudio2 *iface, IXAudio2EngineCallback *pCallback) +static void WINAPI IXAudio2Impl_UnregisterForCallbacks(IXAudio2 *iface, + IXAudio2EngineCallback *pCallback) { IXAudio2Impl *This = impl_from_IXAudio2(iface); FIXME("(%p)->(%p): stub!\n", This, pCallback); } -static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface, IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, UINT32 flags, float maxFrequencyRatio, IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, const XAUDIO2_EFFECT_CHAIN *pEffectChain) +static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface, + IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, + UINT32 flags, float maxFrequencyRatio, + IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(%p, %p, %u, %f, %p, %p, %p): stub!\n", This, ppSourceVoice, pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, pEffectChain); + FIXME("(%p)->(%p, %p, 0x%x, %f, %p, %p, %p): stub!\n", This, ppSourceVoice, + pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, + pEffectChain); return E_NOTIMPL; } -static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface, IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, const XAUDIO2_VOICE_SENDS *pSendList, const XAUDIO2_EFFECT_CHAIN *pEffectChain) +static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface, + IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, + const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(%p, %u, %u, %u, %u, %p, %p): stub!\n", This, ppSubmixVoice, inputChannels, inputSampleRate, flags, processingStage, pSendList, pEffectChain); + FIXME("(%p)->(%p, %u, %u, 0x%x, %u, %p, %p): stub!\n", This, ppSubmixVoice, + inputChannels, inputSampleRate, flags, processingStage, pSendList, + pEffectChain); return E_NOTIMPL; } -static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface, IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, const XAUDIO2_EFFECT_CHAIN *pEffectChain) +static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface, + IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, const WCHAR *deviceId, + const XAUDIO2_EFFECT_CHAIN *pEffectChain, + AUDIO_STREAM_CATEGORY streamCategory) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(%p, %u, %u, %u, %u, %p): stub!\n", This, ppMasteringVoice, inputChannels, inputSampleRate, flags, deviceIndex, pEffectChain); + FIXME("(%p)->(%p, %u, %u, 0x%x, %s, %p, 0x%x): stub!\n", This, + ppMasteringVoice, inputChannels, inputSampleRate, flags, + wine_dbgstr_w(deviceId), pEffectChain, streamCategory); - return S_OK; + return E_NOTIMPL; } static HRESULT WINAPI IXAudio2Impl_StartEngine(IXAudio2 *iface) @@ -320,37 +213,39 @@ FIXME("(%p)->(): stub!\n", This); } -static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface, UINT32 operationSet) +static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface, + UINT32 operationSet) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(%u): stub!\n", This, operationSet); + FIXME("(%p)->(0x%x): stub!\n", This, operationSet); return E_NOTIMPL; } -static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface, XAUDIO2_PERFORMANCE_DATA *pPerfData) +static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface, + XAUDIO2_PERFORMANCE_DATA *pPerfData) { IXAudio2Impl *This = impl_from_IXAudio2(iface); FIXME("(%p)->(%p): stub!\n", This, pPerfData); } -static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface, const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, void *pReserved) +static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface, + const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, + void *pReserved) { IXAudio2Impl *This = impl_from_IXAudio2(iface); FIXME("(%p)->(%p, %p): stub!\n", This, pDebugConfiguration, pReserved); } +/* XAudio2 2.8 */ static const IXAudio2Vtbl XAudio2_Vtbl = { IXAudio2Impl_QueryInterface, IXAudio2Impl_AddRef, IXAudio2Impl_Release, - IXAudio2Impl_GetDeviceCount, - IXAudio2Impl_GetDeviceDetails, - IXAudio2Impl_Initialize, IXAudio2Impl_RegisterForCallbacks, IXAudio2Impl_UnregisterForCallbacks, IXAudio2Impl_CreateSourceVoice, @@ -362,3 +257,238 @@ IXAudio2Impl_GetPerformanceData, IXAudio2Impl_SetDebugConfiguration }; + +static HRESULT WINAPI XA27_QueryInterface(IXAudio27 *iface, REFIID riid, + void **ppvObject) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_QueryInterface(&This->IXAudio2_iface, riid, ppvObject); +} + +static ULONG WINAPI XA27_AddRef(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_AddRef(&This->IXAudio2_iface); +} + +static ULONG WINAPI XA27_Release(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_Release(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA27_GetDeviceCount(IXAudio27 *iface, UINT32 *pCount) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + TRACE("(%p)->(%p)\n", This, pCount); + return E_NOTIMPL; +} + +static HRESULT WINAPI XA27_GetDeviceDetails(IXAudio27 *iface, UINT32 index, + XAUDIO2_DEVICE_DETAILS *pDeviceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + TRACE("(%p)->(%u, %p)\n", This, index, pDeviceDetails); + return E_NOTIMPL; +} + +static HRESULT WINAPI XA27_Initialize(IXAudio27 *iface, UINT32 flags, + XAUDIO2_PROCESSOR processor) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor); + return E_NOTIMPL; +} + +static HRESULT WINAPI XA27_RegisterForCallbacks(IXAudio27 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_RegisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static void WINAPI XA27_UnregisterForCallbacks(IXAudio27 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + IXAudio2Impl_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static HRESULT WINAPI XA27_CreateSourceVoice(IXAudio27 *iface, + IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, + UINT32 flags, float maxFrequencyRatio, + IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice, + pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA27_CreateSubmixVoice(IXAudio27 *iface, + IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, + const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice, + inputChannels, inputSampleRate, flags, processingStage, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface, + IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice, + inputChannels, inputSampleRate, flags, deviceIndex, + pEffectChain); + /* TODO: Convert DeviceIndex to DeviceId */ + return IXAudio2Impl_CreateMasteringVoice(&This->IXAudio2_iface, + ppMasteringVoice, inputChannels, inputSampleRate, flags, 0, + pEffectChain, AudioCategory_GameEffects); +} + +static HRESULT WINAPI XA27_StartEngine(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_StartEngine(&This->IXAudio2_iface); +} + +static void WINAPI XA27_StopEngine(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_StopEngine(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA27_CommitChanges(IXAudio27 *iface, UINT32 operationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_CommitChanges(&This->IXAudio2_iface, operationSet); +} + +static void WINAPI XA27_GetPerformanceData(IXAudio27 *iface, + XAUDIO2_PERFORMANCE_DATA *pPerfData) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_GetPerformanceData(&This->IXAudio2_iface, pPerfData); +} + +static void WINAPI XA27_SetDebugConfiguration(IXAudio27 *iface, + const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, + void *pReserved) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2Impl_SetDebugConfiguration(&This->IXAudio2_iface, + pDebugConfiguration, pReserved); +} + +static const IXAudio27Vtbl XAudio27_Vtbl = { + XA27_QueryInterface, + XA27_AddRef, + XA27_Release, + XA27_GetDeviceCount, + XA27_GetDeviceDetails, + XA27_Initialize, + XA27_RegisterForCallbacks, + XA27_UnregisterForCallbacks, + XA27_CreateSourceVoice, + XA27_CreateSubmixVoice, + XA27_CreateMasteringVoice, + XA27_StartEngine, + XA27_StopEngine, + XA27_CommitChanges, + XA27_GetPerformanceData, + XA27_SetDebugConfiguration +}; + +static HRESULT WINAPI XAudio2CF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) +{ + if(IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef(iface); + *ppobj = iface; + return S_OK; + } + + *ppobj = NULL; + WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI XAudio2CF_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, + REFIID riid, void **ppobj) +{ + HRESULT hr; + IXAudio2Impl *object; + + TRACE("(static)->(%p,%s,%p)\n", pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if(pOuter) + return CLASS_E_NOAGGREGATION; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if(!object) + return E_OUTOFMEMORY; + + object->IXAudio27_iface.lpVtbl = &XAudio27_Vtbl; + object->IXAudio2_iface.lpVtbl = &XAudio2_Vtbl; + + if(IsEqualGUID(riid, &IID_IXAudio27)) + object->version = 27; + else + object->version = 28; + + hr = IXAudio2_QueryInterface(&object->IXAudio2_iface, riid, ppobj); + if(FAILED(hr)) + HeapFree(GetProcessHeap(), 0, object); + return hr; +} + +static HRESULT WINAPI XAudio2CF_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("(static)->(%d): stub!\n", dolock); + return S_OK; +} + +static const IClassFactoryVtbl XAudio2CF_Vtbl = +{ + XAudio2CF_QueryInterface, + XAudio2CF_AddRef, + XAudio2CF_Release, + XAudio2CF_CreateInstance, + XAudio2CF_LockServer +}; + +static IClassFactory xaudio2_cf = { &XAudio2CF_Vtbl }; + +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) +{ + IClassFactory *factory = NULL; + + TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + + if(IsEqualGUID(rclsid, &CLSID_XAudio2)) { + factory = &xaudio2_cf; + } + if(!factory) return CLASS_E_CLASSNOTAVAILABLE; + + return IClassFactory_QueryInterface(factory, riid, ppv); +} diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/audiosessiontypes.h wine-staging-1.7.46~ubuntu14.10.1/include/audiosessiontypes.h --- wine-staging-1.7.45~ubuntu14.10.1/include/audiosessiontypes.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/audiosessiontypes.h 2015-06-28 16:51:28.000000000 +0000 @@ -45,4 +45,16 @@ AudioSessionStateExpired, } AudioSessionState; +typedef enum _AUDIO_STREAM_CATEGORY +{ + AudioCategory_Other = 0, + AudioCategory_ForegroundOnlyMedia, + AudioCategory_BackgroundCapableMedia, + AudioCategory_Communications, + AudioCategory_Alerts, + AudioCategory_SoundEffects, + AudioCategory_GameEffects, + AudioCategory_GameMedia +} AUDIO_STREAM_CATEGORY; + #endif diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/d2d1.idl wine-staging-1.7.46~ubuntu14.10.1/include/d2d1.idl --- wine-staging-1.7.45~ubuntu14.10.1/include/d2d1.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/d2d1.idl 2015-06-28 16:51:28.000000000 +0000 @@ -1216,7 +1216,7 @@ [out] ID2D1TransformedGeometry **transformed_geometry ); HRESULT CreatePathGeometry( - [out] ID2D1PathGeometry *geometry + [out] ID2D1PathGeometry **geometry ); HRESULT CreateStrokeStyle( [in] const D2D1_STROKE_STYLE_PROPERTIES *desc, diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidclass.h wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidclass.h --- wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidclass.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidclass.h 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __HIDCLASS_H +#define __HIDCLASS_H + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID (GUID_DEVINTERFACE_HID, \ + 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30); + +#define HID_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS) +#define HID_BUFFER_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define HID_IN_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define HID_OUT_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_GET_PHYSICAL_DESCRIPTOR HID_OUT_CTL_CODE(102) +#define IOCTL_HID_FLUSH_QUEUE HID_CTL_CODE(101) +#define IOCTL_HID_GET_COLLECTION_DESCRIPTOR HID_CTL_CODE(100) +#define IOCTL_HID_GET_COLLECTION_INFORMATION HID_BUFFER_CTL_CODE(106) +#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100) +#define IOCTL_HID_GET_HARDWARE_ID HID_OUT_CTL_CODE(103) +#define IOCTL_HID_GET_INDEXED_STRING HID_OUT_CTL_CODE(120) +#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104) +#define IOCTL_HID_GET_MANUFACTURER_STRING HID_OUT_CTL_CODE(110) +#define IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(104) +#define IOCTL_HID_GET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(102) +#define IOCTL_HID_GET_PRODUCT_STRING HID_OUT_CTL_CODE(111) +#define IOCTL_HID_GET_SERIALNUMBER_STRING HID_OUT_CTL_CODE(112) +#define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100) +#define IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(105) +#define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101) +#define IOCTL_HID_SET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(103) + +#define IOCTL_HID_GET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(100) +#define IOCTL_HID_SET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(101) +#define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR HID_OUT_CTL_CODE(121) + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDCLASS_H */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidpi.h wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidpi.h --- wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidpi.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidpi.h 2015-06-28 16:51:28.000000000 +0000 @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __HIDPI_H__ +#define __HIDPI_H__ + +typedef enum _HIDP_REPORT_TYPE +{ + HidP_Input, + HidP_Output, + HidP_Feature +} HIDP_REPORT_TYPE; + +typedef struct _HIDP_BUTTON_CAPS +{ + USAGE UsagePage; + UCHAR ReportID; + BOOLEAN IsAlias; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; + + BOOLEAN IsRange; + BOOLEAN IsStringRange; + BOOLEAN IsDesignatorRange; + BOOLEAN IsAbsolute; + ULONG Reserved[10]; + union { + struct { + USAGE UsageMin; + USAGE UsageMax; + USHORT StringMin; + USHORT StringMax; + USHORT DesignatorMin; + USHORT DesignatorMax; + USHORT DataIndexMin; + USHORT DataIndexMax; + } Range; + struct { + USAGE Usage; + USAGE Reserved1; + USHORT StringIndex; + USHORT Reserved2; + USHORT DesignatorIndex; + USHORT Reserved3; + USHORT DataIndex; + USHORT Reserved4; + } NotRange; + } DUMMYUNIONNAME; +} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS; + +typedef struct _HIDP_VALUE_CAPS +{ + USAGE UsagePage; + UCHAR ReportID; + BOOLEAN IsAlias; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; + + BOOLEAN IsRange; + BOOLEAN IsStringRange; + BOOLEAN IsDesignatorRange; + BOOLEAN IsAbsolute; + BOOLEAN HasNull; + UCHAR Reserved; + USHORT BitSize; + USHORT ReportCount; + USHORT Reserved2[5]; + ULONG UnitsExp; + ULONG Units; + LONG LogicalMin; + LONG LogicalMax; + LONG PhysicalMin; + LONG PhysicalMax; + union { + struct { + USAGE UsageMin; + USAGE UsageMax; + USHORT StringMin; + USHORT StringMax; + USHORT DesignatorMin; + USHORT DesignatorMax; + USHORT DataIndexMin; + USHORT DataIndexMax; + } Range; + struct { + USAGE Usage; + USAGE Reserved1; + USHORT StringIndex; + USHORT Reserved2; + USHORT DesignatorIndex; + USHORT Reserved3; + USHORT DataIndex; + USHORT Reserved4; + } NotRange; + } DUMMYUNIONNAME; +} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS; + +typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA; + +typedef struct _HIDP_CAPS +{ + USAGE Usage; + USAGE UsagePage; + USHORT InputReportByteLength; + USHORT OutputReportByteLength; + USHORT FeatureReportByteLength; + USHORT Reserved[17]; + USHORT NumberLinkCollectionNodes; + USHORT NumberInputButtonCaps; + USHORT NumberInputValueCaps; + USHORT NumberInputDataIndices; + USHORT NumberOutputButtonCaps; + USHORT NumberOutputValueCaps; + USHORT NumberOutputDataIndices; + USHORT NumberFeatureButtonCaps; + USHORT NumberFeatureValueCaps; + USHORT NumberFeatureDataIndices; +} HIDP_CAPS, *PHIDP_CAPS; + +NTSTATUS WINAPI HidP_GetCaps(PHIDP_PREPARSED_DATA PreparsedData, PHIDP_CAPS Capabilities); + +#ifndef FACILITY_HID_ERROR_CODE +#define FACILITY_HID_ERROR_CODE 0x11 +#endif + +#define HIDP_ERROR_CODES(sev, code) ((NTSTATUS)(((sev) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (code))) + +#define HIDP_STATUS_SUCCESS (HIDP_ERROR_CODES(0x0,0x00)) +#define HIDP_STATUS_NULL (HIDP_ERROR_CODES(0x8,0x01)) +#define HIDP_STATUS_INVALID_PREPARSED_DATA (HIDP_ERROR_CODES(0xc,0x01)) +#define HIDP_STATUS_INVALID_REPORT_TYPE (HIDP_ERROR_CODES(0xc,0x02)) +#define HIDP_STATUS_INVALID_REPORT_LENGTH (HIDP_ERROR_CODES(0xc,0x03)) +#define HIDP_STATUS_USAGE_NOT_FOUND (HIDP_ERROR_CODES(0xc,0x04)) +#define HIDP_STATUS_VALUE_OUT_OF_RANGE (HIDP_ERROR_CODES(0xc,0x05)) +#define HIDP_STATUS_BAD_LOG_PHY_VALUES (HIDP_ERROR_CODES(0xc,0x06)) +#define HIDP_STATUS_BUFFER_TOO_SMALL (HIDP_ERROR_CODES(0xc,0x07)) +#define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xc,0x08)) +#define HIDP_STATUS_I8242_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xc,0x09)) +#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xc,0x0a)) +#define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xc,0x0b)) +#define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xc,0x0c)) +#define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xc,0x0d)) +#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xc,0x0e)) +#define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xc,0x0f)) +#define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xc,0x10)) +#define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xc,0x20)) + +#endif /* __HIDPI_H__ */ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidsdi.h wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidsdi.h --- wine-staging-1.7.45~ubuntu14.10.1/include/ddk/hidsdi.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/ddk/hidsdi.h 2015-06-28 16:51:28.000000000 +0000 @@ -20,7 +20,7 @@ #define __WINE_HIDSDI_H #include "hidusage.h" -/* FIXME: #include "hidpi.h" */ +#include "hidpi.h" #ifndef WINE_NTSTATUS_DECLARED #define WINE_NTSTATUS_DECLARED diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/dimm.idl wine-staging-1.7.46~ubuntu14.10.1/include/dimm.idl --- wine-staging-1.7.45~ubuntu14.10.1/include/dimm.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/dimm.idl 2015-06-28 16:51:28.000000000 +0000 @@ -579,6 +579,20 @@ } [ + object, + uuid(b5cf2cfa-8aeb-11d1-9364-0060b067b86e), + pointer_default(unique) +] +interface IActiveIMMMessagePumpOwner : IUnknown +{ + HRESULT Start(); + HRESULT End(); + HRESULT OnTranslateMessage([in] const MSG *msg); + HRESULT Pause([out] DWORD *cookie); + HRESULT Resume([in] DWORD cookie); +} + +[ uuid(4955dd33-b159-11d0-8fcf-00aa006bcc59) ] coclass CActiveIMM @@ -586,5 +600,5 @@ [default] interface IActiveIMMApp; /* interface IActiveIMMIME; */ /* interface IActiveIMMRegistrar; */ - /* interface IActiveIMMMessagePumpOwner; */ + interface IActiveIMMMessagePumpOwner; } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/include/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/include/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -252,6 +252,8 @@ ddeml.h \ ddk/compstui.h \ ddk/csq.h \ + ddk/hidclass.h \ + ddk/hidpi.h \ ddk/hidsdi.h \ ddk/imm.h \ ddk/mountmgr.h \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/objidl.idl wine-staging-1.7.46~ubuntu14.10.1/include/objidl.idl --- wine-staging-1.7.45~ubuntu14.10.1/include/objidl.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/objidl.idl 2015-06-28 16:51:28.000000000 +0000 @@ -2441,6 +2441,16 @@ HRESULT Query([in] GLOBALOPT_PROPERTIES property, [out ] ULONG_PTR *value); } +[ + object, + pointer_default(unique), + uuid(947990de-cc28-11d2-a0f7-00805f858fb1) +] +interface IDummyHICONIncluder : IUnknown +{ + HRESULT Dummy([in] HICON hIcon, [in] HDC hdc); +} + cpp_quote("#ifdef USE_COM_CONTEXT_DEF") typedef DWORD CPFLAGS; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/shellapi.h wine-staging-1.7.46~ubuntu14.10.1/include/shellapi.h --- wine-staging-1.7.45~ubuntu14.10.1/include/shellapi.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/shellapi.h 2015-06-28 16:51:28.000000000 +0000 @@ -250,12 +250,6 @@ /****************************************** * ShellExecute */ -#define SE_ERR_SHARE 26 -#define SE_ERR_ASSOCINCOMPLETE 27 -#define SE_ERR_DDETIMEOUT 28 -#define SE_ERR_DDEFAIL 29 -#define SE_ERR_DDEBUSY 30 -#define SE_ERR_NOASSOC 31 HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT); HINSTANCE WINAPI ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/tom.idl wine-staging-1.7.46~ubuntu14.10.1/include/tom.idl --- wine-staging-1.7.45~ubuntu14.10.1/include/tom.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/tom.idl 2015-06-28 16:51:28.000000000 +0000 @@ -267,7 +267,7 @@ HRESULT Expand([in]LONG Unit, [retval, out]LONG *pDelta); HRESULT GetIndex([in]LONG Unit, [retval, out]LONG *pIndex); HRESULT SetIndex([in]LONG Unit, [in]LONG Index, [in]LONG Extend); - HRESULT SetRange([in]LONG cpActive, [in]LONG cpOther); + HRESULT SetRange([in]LONG anchor, [in]LONG active); HRESULT InRange([in]ITextRange *pRange, [retval, out]LONG *pb); HRESULT InStory([in]ITextRange *pRange, [retval, out]LONG *pb); HRESULT IsEqual([in]ITextRange *pRange, [retval, out]LONG *pb); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/winbase.h wine-staging-1.7.46~ubuntu14.10.1/include/winbase.h --- wine-staging-1.7.45~ubuntu14.10.1/include/winbase.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/winbase.h 2015-06-28 16:51:28.000000000 +0000 @@ -2460,6 +2460,7 @@ WINBASEAPI BOOL WINAPI SetFileAttributesA(LPCSTR,DWORD); WINBASEAPI BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD); #define SetFileAttributes WINELIB_NAME_AW(SetFileAttributes) +WINBASEAPI BOOL WINAPI SetFileCompletionNotificationModes(HANDLE,UCHAR); WINBASEAPI BOOL WINAPI SetFileInformationByHandle(HANDLE,FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD); WINBASEAPI DWORD WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD); WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,LARGE_INTEGER*,DWORD); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/winnt.h wine-staging-1.7.46~ubuntu14.10.1/include/winnt.h --- wine-staging-1.7.45~ubuntu14.10.1/include/winnt.h 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/winnt.h 2015-06-28 16:51:28.000000000 +0000 @@ -1755,6 +1755,7 @@ typedef struct _CONTEXT { ULONG ContextFlags; + ULONG Cpsr; /* This section is specified/returned if the ContextFlags word contains the flag CONTEXT_INTEGER. */ @@ -1793,7 +1794,6 @@ ULONGLONG Lr; ULONGLONG Sp; ULONGLONG Pc; - ULONGLONG PState; /* These are selected by CONTEXT_FLOATING_POINT */ /* FIXME */ @@ -3620,7 +3620,30 @@ WORD cbFrame : 2; } FPO_DATA, *PFPO_DATA; -typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY { +typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64 { + DWORD Size; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD GlobalFlagsClear; + DWORD GlobalFlagsSet; + DWORD CriticalSectionDefaultTimeout; + ULONGLONG DeCommitFreeBlockThreshold; + ULONGLONG DeCommitTotalFreeThreshold; + ULONGLONG LockPrefixTable; + ULONGLONG MaximumAllocationSize; + ULONGLONG VirtualMemoryThreshold; + ULONGLONG ProcessAffinityMask; + DWORD ProcessHeapFlags; + WORD CSDVersion; + WORD Reserved1; + ULONGLONG EditList; + ULONGLONG SecurityCookie; + ULONGLONG SEHandlerTable; + ULONGLONG SEHandlerCount; +} IMAGE_LOAD_CONFIG_DIRECTORY64, *PIMAGE_LOAD_CONFIG_DIRECTORY64; + +typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32 { DWORD Size; DWORD TimeDateStamp; WORD MajorVersion; @@ -3641,7 +3664,15 @@ DWORD SecurityCookie; DWORD SEHandlerTable; DWORD SEHandlerCount; -} IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY; +} IMAGE_LOAD_CONFIG_DIRECTORY32, *PIMAGE_LOAD_CONFIG_DIRECTORY32; + +#ifdef _WIN64 +typedef IMAGE_LOAD_CONFIG_DIRECTORY64 IMAGE_LOAD_CONFIG_DIRECTORY; +typedef PIMAGE_LOAD_CONFIG_DIRECTORY64 PIMAGE_LOAD_CONFIG_DIRECTORY; +#else +typedef IMAGE_LOAD_CONFIG_DIRECTORY32 IMAGE_LOAD_CONFIG_DIRECTORY; +typedef PIMAGE_LOAD_CONFIG_DIRECTORY32 PIMAGE_LOAD_CONFIG_DIRECTORY; +#endif typedef struct _IMAGE_FUNCTION_ENTRY { DWORD StartingAddress; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/include/xaudio2.idl wine-staging-1.7.46~ubuntu14.10.1/include/xaudio2.idl --- wine-staging-1.7.45~ubuntu14.10.1/include/xaudio2.idl 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/include/xaudio2.idl 2015-06-28 16:51:28.000000000 +0000 @@ -19,6 +19,8 @@ import "unknwn.idl"; import "mmdeviceapi.idl"; +import "audiosessiontypes.h"; + [ uuid(5a508685-a254-4fba-9b82-9a24b00306af) ] @@ -328,7 +330,9 @@ [ local ] -interface IXAudio2SourceVoice : IXAudio2Voice +/* XAudio2 2.7's IXAudio2SourceVoice interface. Actually called + * IXAudio2SourceVoice in the Jun 2010 DX SDK */ +interface IXAudio27SourceVoice : IXAudio2Voice { HRESULT Start( [in, defaultvalue(0)] UINT32 Flags, @@ -362,6 +366,41 @@ [ local ] +/* XAudio2 2.8's IXAudio2SourceVoice interface. */ +interface IXAudio2SourceVoice : IXAudio2Voice +{ + HRESULT Start( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT Stop( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT SubmitSourceBuffer( + [in] const XAUDIO2_BUFFER* pBuffer, + [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA); + + HRESULT FlushSourceBuffers(); + + HRESULT Discontinuity(); + + HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState, [in, defaultvalue(0)] UINT32 Flags); + + HRESULT SetFrequencyRatio( + [in] float Ratio, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetFrequencyRatio([out] float* pRatio); + + HRESULT SetSourceSampleRate([in] UINT32 NewSourceSampleRate); +} + +[ + local +] interface IXAudio2SubmixVoice : IXAudio2Voice { } @@ -371,6 +410,8 @@ ] interface IXAudio2MasteringVoice : IXAudio2Voice { + /* not present in XAudio2 2.7 */ + void GetChannelMask([out] DWORD *pChannelMask); } [ @@ -410,7 +451,9 @@ object, uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), ] -interface IXAudio2 : IUnknown +/* XAudio2 2.7's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010 + * DX SDK */ +interface IXAudio27 : IUnknown { HRESULT GetDeviceCount([out] UINT32* pCount); @@ -465,6 +508,57 @@ [in, defaultvalue(NULL)] void* pReserved); } +[ + object, + uuid(60d8dac8-5aa1-4e8e-b597-2f5e2883d484), +] +/* XAudio2 2.8's IXAudio2 interface. */ +interface IXAudio2 : IUnknown +{ + HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + HRESULT CreateSourceVoice( + [out] IXAudio2SourceVoice** ppSourceVoice, + [in] const WAVEFORMATEX* pSourceFormat, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio, + [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateSubmixVoice( + [out] IXAudio2SubmixVoice** ppSubmixVoice, + [in] UINT32 InputChannels, + [in] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(0)] UINT32 ProcessingStage, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateMasteringVoice( + [out] IXAudio2MasteringVoice** ppMasteringVoice, + [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels, + [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(NULL)] LPCWSTR DeviceId, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain, + [in, defaultvalue(AudioCategory_GameEffects)] AUDIO_STREAM_CATEGORY StreamCategory); + + HRESULT StartEngine(); + + void StopEngine(); + + HRESULT CommitChanges([in] UINT32 OperationSet); + + void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData); + + [local] void SetDebugConfiguration( + [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, + [in, defaultvalue(NULL)] void* pReserved); +} + const UINT32 XAUDIO2_DEBUG_ENGINE = 1; const UINT32 XAUDIO2_VOICE_NOPITCH = 2; const UINT32 XAUDIO2_VOICE_NOSRC = 4; @@ -497,30 +591,4 @@ cpp_quote("inline static float XAudio2RadiansToCutoffFrequency(float radians, float samplerate) { return samplerate * asinf(radians/2.0f) / (float)M_PI; }") cpp_quote("#endif") -cpp_quote("#ifdef __cplusplus") -cpp_quote("inline static HRESULT XAudio2Create(IXAudio2** pxaudio2, UINT32 flags = 0, XAUDIO2_PROCESSOR processor = XAUDIO2_DEFAULT_PROCESSOR) {") -cpp_quote(" IXAudio2* xaudio2;") -cpp_quote(" HRESULT hr = CoCreateInstance(__uuidof(XAudio2), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXAudio2), (void**)&xaudio2);") -cpp_quote(" if (SUCCEEDED(hr)) {") -cpp_quote(" hr = xaudio2->Initialize(flags, processor);") -cpp_quote(" if (SUCCEEDED(hr))") -cpp_quote(" *pxaudio2 = xaudio2;") -cpp_quote(" else") -cpp_quote(" xaudio2->Release();") -cpp_quote(" }") -cpp_quote(" return hr;") -cpp_quote("}") -cpp_quote("#else") -cpp_quote("inline static HRESULT XAudio2Create(IXAudio2** pxaudio2, UINT32 flags, XAUDIO2_PROCESSOR processor) {") -cpp_quote(" IXAudio2* xaudio2;") -cpp_quote(" HRESULT hr = CoCreateInstance(&CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&xaudio2);") -cpp_quote(" if (SUCCEEDED(hr)) {") -cpp_quote(" hr = xaudio2->lpVtbl->Initialize(xaudio2, flags, processor);") -cpp_quote(" if (SUCCEEDED(hr))") -cpp_quote(" *pxaudio2 = xaudio2;") -cpp_quote(" else") -cpp_quote(" xaudio2->lpVtbl->Release(xaudio2);") -cpp_quote(" }") -cpp_quote(" return hr;") -cpp_quote("}") -cpp_quote("#endif") +cpp_quote("HRESULT WINAPI XAudio2Create(IXAudio2** pxaudio2, UINT32 flags, XAUDIO2_PROCESSOR processor);") diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/0001-advapi32-Implement-GetWindowsAccountDomainSid.patch wine-staging-1.7.46~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/0001-advapi32-Implement-GetWindowsAccountDomainSid.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/0001-advapi32-Implement-GetWindowsAccountDomainSid.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/0001-advapi32-Implement-GetWindowsAccountDomainSid.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,219 +0,0 @@ -From 4ba47dbc95a5a73ef646648a3ba8dd90a1089ee8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 13 Jun 2015 20:45:09 +0200 -Subject: advapi32: Implement GetWindowsAccountDomainSid. - ---- - dlls/advapi32/advapi32.spec | 2 +- - dlls/advapi32/security.c | 45 +++++++++++++ - dlls/advapi32/tests/security.c | 78 ++++++++++++++++++++++ - .../api-ms-win-security-base-l1-1-0.spec | 2 +- - .../api-ms-win-security-base-l1-2-0.spec | 2 +- - 5 files changed, 126 insertions(+), 3 deletions(-) - -diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec -index 4600142..ec27440 100644 ---- a/dlls/advapi32/advapi32.spec -+++ b/dlls/advapi32/advapi32.spec -@@ -363,7 +363,7 @@ - @ stdcall GetTrusteeTypeW(ptr) - @ stdcall GetUserNameA(ptr ptr) - @ stdcall GetUserNameW(ptr ptr) --# @ stub GetWindowsAccountDomainSid -+@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) - # @ stub I_QueryTagInformation - # @ stub I_ScGetCurrentGroupStateW - # @ stub I_ScIsSecurityProcess -diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c -index 028dcc6..1aae1e0 100644 ---- a/dlls/advapi32/security.c -+++ b/dlls/advapi32/security.c -@@ -1538,6 +1538,51 @@ BOOL WINAPI SetSecurityDescriptorControl( PSECURITY_DESCRIPTOR pSecurityDescript - pSecurityDescriptor, ControlBitsOfInterest, ControlBitsToSet ) ); - } - -+/****************************************************************************** -+ * GetWindowsAccountDomainSid [ADVAPI32.@] -+ */ -+BOOL WINAPI GetWindowsAccountDomainSid( PSID sid, PSID domain_sid, DWORD *size ) -+{ -+ SID_IDENTIFIER_AUTHORITY domain_ident = {{0,0,0,0,0,5}}; -+ DWORD required_size; -+ int i; -+ -+ FIXME( "(%p %p %p): semi-stub\n", sid, domain_sid, size ); -+ -+ if (!sid || !IsValidSid( sid )) -+ { -+ SetLastError( ERROR_INVALID_SID ); -+ return FALSE; -+ } -+ -+ if (!size) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return FALSE; -+ } -+ -+ if (*GetSidSubAuthorityCount( sid ) < 4) -+ { -+ SetLastError( ERROR_INVALID_SID ); -+ return FALSE; -+ } -+ -+ required_size = GetSidLengthRequired( 4 ); -+ if (*size < required_size || !domain_sid) -+ { -+ *size = required_size; -+ SetLastError( domain_sid ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER ); -+ return FALSE; -+ } -+ -+ InitializeSid( domain_sid, &domain_ident, 4 ); -+ for (i = 0; i < 4; i++) -+ *GetSidSubAuthority( domain_sid, i ) = *GetSidSubAuthority( sid, i ); -+ -+ *size = required_size; -+ return TRUE; -+} -+ - /* ############################## - ###### ACL FUNCTIONS ###### - ############################## -diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index b43f212..3cc149c 100644 ---- a/dlls/advapi32/tests/security.c -+++ b/dlls/advapi32/tests/security.c -@@ -129,6 +129,7 @@ static NTSTATUS (WINAPI *pNtSetSecurityObject)(HANDLE,SECURITY_INFORMATION,PSECU - static NTSTATUS (WINAPI *pNtCreateFile)(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG); - static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(LPCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*); - static NTSTATUS (WINAPI *pRtlAnsiStringToUnicodeString)(PUNICODE_STRING,PCANSI_STRING,BOOLEAN); -+static BOOL (WINAPI *pGetWindowsAccountDomainSid)(PSID,PSID,DWORD*); - - static HMODULE hmod; - static int myARGC; -@@ -190,6 +191,7 @@ static void init(void) - pConvertStringSidToSidA = (void *)GetProcAddress(hmod, "ConvertStringSidToSidA"); - pGetAclInformation = (void *)GetProcAddress(hmod, "GetAclInformation"); - pGetAce = (void *)GetProcAddress(hmod, "GetAce"); -+ pGetWindowsAccountDomainSid = (void *)GetProcAddress(hmod, "GetWindowsAccountDomainSid"); - - myARGC = winetest_get_mainargs( &myARGV ); - } -@@ -5835,6 +5837,81 @@ static void test_AddAce(void) - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %d\n", GetLastError()); - } - -+static void test_GetWindowsAccountDomainSid (void) -+{ -+ char b[sizeof(TOKEN_USER) + sizeof(SID) + sizeof(DWORD)*SID_MAX_SUB_AUTHORITIES]; -+ char buffer1[SECURITY_MAX_SID_SIZE], buffer2[SECURITY_MAX_SID_SIZE]; -+ SID_IDENTIFIER_AUTHORITY domain_ident = {{0,0,0,0,0,5}}; -+ PSID domain_sid = (PSID *)&buffer1; -+ PSID domain_sid2 = (PSID *)&buffer2; -+ DWORD sid_size, l = sizeof(b); -+ PSID user_sid; -+ HANDLE token; -+ BOOL ret = TRUE; -+ int i; -+ -+ if (!pGetWindowsAccountDomainSid) -+ { -+ win_skip("GetWindowsAccountDomainSid not available\n"); -+ return; -+ } -+ -+ if (!OpenThreadToken(GetCurrentThread(), TOKEN_READ, TRUE, &token)) -+ { -+ if (GetLastError() != ERROR_NO_TOKEN) ret = FALSE; -+ else if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) ret = FALSE; -+ } -+ if (!ret) -+ { -+ win_skip("Failed to get current user token\n"); -+ return; -+ } -+ -+ GetTokenInformation(token, TokenUser, b, l, &l); -+ user_sid = ((TOKEN_USER *)b)->User.Sid; -+ CloseHandle(token); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetWindowsAccountDomainSid(0, 0, 0); -+ ok(!ret, "GetWindowsAccountDomainSid succeeded\n"); -+ ok(GetLastError() == ERROR_INVALID_SID, "expected ERROR_INVALID_SID, got %d\n", GetLastError()); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetWindowsAccountDomainSid(user_sid, 0, 0); -+ ok(!ret, "GetWindowsAccountDomainSid succeeded\n"); -+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -+ -+ sid_size = SECURITY_MAX_SID_SIZE; -+ SetLastError(0xdeadbeef); -+ ret = pGetWindowsAccountDomainSid(user_sid, 0, &sid_size); -+ ok(!ret, "GetWindowsAccountDomainSid succeeded\n"); -+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -+ ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetWindowsAccountDomainSid(user_sid, domain_sid, 0); -+ ok(!ret, "GetWindowsAccountDomainSid succeeded\n"); -+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -+ -+ sid_size = 1; -+ SetLastError(0xdeadbeef); -+ ret = pGetWindowsAccountDomainSid(user_sid, domain_sid, &sid_size); -+ ok(!ret, "GetWindowsAccountDomainSid succeeded\n"); -+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); -+ ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); -+ -+ SetLastError(0xdeadbeef); -+ sid_size = SECURITY_MAX_SID_SIZE; -+ ret = pGetWindowsAccountDomainSid(user_sid, domain_sid, &sid_size); -+ ok(ret, "GetWindowsAccountDomainSid failed with error %d\n", GetLastError()); -+ todo_wine ok(GetLastError() == 0xdeadbeef, "last error should not change\n"); -+ ok(sid_size == GetSidLengthRequired(4), "expected size %d, got %d\n", GetSidLengthRequired(4), sid_size); -+ InitializeSid(domain_sid2, &domain_ident, 4); -+ for (i = 0; i < 4; i++) -+ *GetSidSubAuthority(domain_sid2, i) = *GetSidSubAuthority(user_sid, i); -+ ok(EqualSid(domain_sid, domain_sid2), "unexpected domain sid\n"); -+} -+ - START_TEST(security) - { - init(); -@@ -5877,4 +5954,5 @@ START_TEST(security) - test_default_dacl_owner_sid(); - test_AdjustTokenPrivileges(); - test_AddAce(); -+ test_GetWindowsAccountDomainSid(); - } -diff --git a/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec b/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec -index 4277706..edae6d1 100644 ---- a/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec -+++ b/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec -@@ -57,7 +57,7 @@ - @ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority - @ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount - @ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation --@ stub GetWindowsAccountDomainSid -+@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid - @ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken - @ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser - @ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf -diff --git a/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec b/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec -index 3adef23..e19fe53 100644 ---- a/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec -+++ b/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec -@@ -63,7 +63,7 @@ - @ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority - @ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount - @ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation --@ stub GetWindowsAccountDomainSid -+@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid - @ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken - @ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser - @ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/definition wine-staging-1.7.46~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/advapi32-GetWindowsAccountDomainSid/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38624] Implement advapi32.GetWindowsAccountDomainSid diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch wine-staging-1.7.46~ubuntu14.10.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,39 @@ +From 463cba8291e1dba1f381e0930926bc0c4bc26916 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 21 Jun 2015 20:00:18 +0200 +Subject: configure.ac: Search for otool using AC_CHECK_TOOL. + +This is necessary to allow using otool from custom host toolchains like i686-apple-darwin12-otool. +--- + aclocal.m4 | 2 +- + configure.ac | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index 3d43721..9993de1 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -62,7 +62,7 @@ LIBS="-l$1 $5 $LIBS" + AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], + [case "$LIBEXT" in + dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;; +- dylib) AS_VAR_SET(ac_Lib,[`otool -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; ++ dylib) AS_VAR_SET(ac_Lib,[`$ac_cv_prog_OTOOL -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; + *) AS_VAR_SET(ac_Lib,[`$READELF -d conftest$ac_exeext | grep "NEEDED.*ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\\m4_dquote(\\(ac_lib_pattern\\.$LIBEXT[[^ ]]*\\)\\).*$/\1/"';2,$d'`]) + AS_VAR_IF([ac_Lib],[], + [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;; +diff --git a/configure.ac b/configure.ac +index f9df3f0..3587a12 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -268,6 +268,7 @@ fi + + AC_CHECK_TOOLS(AR,[ar gar],ar) + AC_CHECK_TOOL(STRIP,strip,strip) ++AC_CHECK_TOOL(OTOOL,otool,otool) + AC_SUBST(ARFLAGS,rc) + AC_PROG_RANLIB + AC_PROG_LN_S +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch wine-staging-1.7.46~ubuntu14.10.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,42 @@ +From eb555bcc219bdd332d0bff45aa66c26f7a846307 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 21 Jun 2015 20:04:34 +0200 +Subject: configure.ac: Remove check for strength-reduce bug. + +This was bug was fixed in gcc-2.7.2.1 which was released 19 years ago. +When cross compiling, the configure check currently assumes that the bug +is present, which produces a lot of noise with non-gcc compilers. +--- + configure.ac | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3587a12..fa6a542 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1788,22 +1788,6 @@ if test "x${GCC}" = "xyes" + then + EXTRACFLAGS="-Wall -pipe" + +- dnl Check for strength-reduce bug +- AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug, +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[int L[[4]] = {0,1,2,3};]], +-[[static int Array[[3]]; +- unsigned int B = 3; +- int i; +- for(i=0; i -Date: Fri, 12 Jun 2015 15:52:40 -0600 -Subject: configure: Add libunwind configure flag. - -Based on a patch by Erich E. Hoover and Ken Thomases. ---- - configure.ac | 28 ++++++++++++++++++++++++++++ - dlls/ntdll/Makefile.in | 2 +- - dlls/ntdll/signal_x86_64.c | 8 ++++---- - 3 files changed, 33 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index df28b27..78e5558 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -75,4 +75,6 @@ AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthrea - AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) - AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) -+AC_ARG_WITH(unwind, AS_HELP_STRING([--without-unwind],[do not use libunwind]), -+ [if test "x$withval" = "xno"; then ac_cv_header_libunwind_h=no; fi]) - AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) - AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), -@@ -1084,6 +1086,32 @@ WINE_ERROR_WITH(pthread,[test "x$ac_cv_func_pthread_create" != xyes -a "x$PTHREA - [pthread ${notice_platform}development files not found. - Wine cannot support threads without libpthread.]) - -+dnl **** Check for libunwind **** -+ -+if test "x$enable_win64" = "xyes" -+then -+ if test "$ac_cv_header_libunwind_h" = "yes" -+ then -+ ac_save_LIBS="$LIBS" -+ AC_MSG_CHECKING([for libunwind]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY -+ #include ]], [[unw_context_t u; unw_cursor_t c; unw_getcontext(&u); unw_init_local(&c, &u);]])], -+ [AC_MSG_RESULT([yes, without linking]) -+ AC_DEFINE(HAVE_LIBUNWIND, 1, [Define to 1 if you have libunwind])], -+ [LIBS="$LIBS -lunwind" -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY -+ #include ]], [[unw_context_t u; unw_cursor_t c; unw_getcontext(&u); unw_init_local(&c, &u);]])], -+ [AC_MSG_RESULT([yes, with linking]) -+ AC_SUBST(UNWIND_LIBS,"-lunwind") -+ AC_DEFINE(HAVE_LIBUNWIND, 1, [Define to 1 if you have libunwind])], -+ [AC_MSG_RESULT([no]) -+ ac_cv_header_libunwind_h=no])]) -+ LIBS="$ac_save_LIBS" -+ fi -+ WINE_NOTICE_WITH(unwind,[test "x$ac_cv_header_libunwind_h" != xyes], -+ [libunwind ${notice_platform}development files not found.]) -+fi -+ - dnl **** Check for X11 **** - - AC_PATH_XTRA -diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in -index ed4bb94..08f094a 100644 ---- a/dlls/ntdll/Makefile.in -+++ b/dlls/ntdll/Makefile.in -@@ -2,7 +2,7 @@ EXTRADEFS = -D_NTSYSTEM_ - MODULE = ntdll.dll - IMPORTLIB = ntdll - IMPORTS = winecrt0 --EXTRALIBS = $(IOKIT_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) -+EXTRALIBS = $(IOKIT_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) - EXTRADLLFLAGS = -nodefaultlibs -Wl,--image-base,0x7bc00000 - - C_SRCS = \ -diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 9b98894..a4aa269 100644 ---- a/dlls/ntdll/signal_x86_64.c -+++ b/dlls/ntdll/signal_x86_64.c -@@ -51,7 +51,7 @@ - #ifdef HAVE_SYS_UCONTEXT_H - # include - #endif --#ifdef HAVE_LIBUNWIND_H -+#ifdef HAVE_LIBUNWIND - # define UNW_LOCAL_ONLY - # include - #endif -@@ -1431,7 +1431,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex - } - - --#if HAVE_LIBUNWIND_H -+#if HAVE_LIBUNWIND - /*********************************************************************** - * libunwind_set_cursor_from_context - */ -@@ -2341,7 +2341,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex - if (status != STATUS_SUCCESS) return status; - got_info = TRUE; - } --#if HAVE_LIBUNWIND_H -+#if HAVE_LIBUNWIND - else - { - status = libunwind_virtual_unwind( context.Rip, &got_info, &dispatch.EstablisherFrame, &new_context, -@@ -3369,7 +3369,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec - if (status != STATUS_SUCCESS) raise_status( status, rec ); - got_info = TRUE; - } --#if HAVE_LIBUNWIND_H -+#if HAVE_LIBUNWIND - else - { - status = libunwind_virtual_unwind( context->Rip, &got_info, &dispatch.EstablisherFrame, &new_context, --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/configure-libunwind/definition wine-staging-1.7.46~ubuntu14.10.1/patches/configure-libunwind/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/configure-libunwind/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/configure-libunwind/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38713] Properly check existence of libunwind before linking against it diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/d3dx9_36-DXTn/definition wine-staging-1.7.46~ubuntu14.10.1/patches/d3dx9_36-DXTn/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/d3dx9_36-DXTn/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/d3dx9_36-DXTn/definition 2015-06-28 17:08:11.000000000 +0000 @@ -1,6 +1,5 @@ Depends: wined3d-DXTn Fixes: [33768] Fix texture corruption in CSI: Fatal Conspiracy -Fixes: [19231] Fix crash of Trine Demo on start Fixes: [37391] Exception during start of fr-043 caused by missing DXTn support Fixes: [34692] Fix wrong colors in Wolfenstein (2009) Fixes: [24983] Fix crash in Space Rangers2 caused by missing DXTn support diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/fltlib-FilterLoad/0001-fltlib-Add-stub-for-FilterLoad.patch wine-staging-1.7.46~ubuntu14.10.1/patches/fltlib-FilterLoad/0001-fltlib-Add-stub-for-FilterLoad.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/fltlib-FilterLoad/0001-fltlib-Add-stub-for-FilterLoad.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/fltlib-FilterLoad/0001-fltlib-Add-stub-for-FilterLoad.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -From b227af567a06d06fc453d227926faa936304eccd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Mon, 11 May 2015 18:14:42 +0200 -Subject: fltlib: Add stub for FilterLoad - ---- - dlls/fltlib/fltlib.c | 9 +++++++++ - dlls/fltlib/fltlib.spec | 2 +- - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/dlls/fltlib/fltlib.c b/dlls/fltlib/fltlib.c -index 50f46ac..bf2fa9c 100644 ---- a/dlls/fltlib/fltlib.c -+++ b/dlls/fltlib/fltlib.c -@@ -79,6 +79,15 @@ HRESULT WINAPI FilterFindClose(HANDLE handle) - } - - /********************************************************************** -+ * FilterLoad (FLTLIB.@) -+ */ -+HRESULT WINAPI FilterLoad(LPCWSTR lpFilterName) -+{ -+ FIXME("(%s) stub\n", debugstr_w(lpFilterName)); -+ return S_OK; -+} -+ -+/********************************************************************** - * FilterUnload (FLTLIB.@) - */ - HRESULT WINAPI FilterUnload(LPCWSTR lpFilterName) -diff --git a/dlls/fltlib/fltlib.spec b/dlls/fltlib/fltlib.spec -index 91e803b..226a615 100644 ---- a/dlls/fltlib/fltlib.spec -+++ b/dlls/fltlib/fltlib.spec -@@ -16,7 +16,7 @@ - @ stub FilterInstanceFindFirst - @ stub FilterInstanceFindNext - @ stub FilterInstanceGetInformation --@ stub FilterLoad -+@ stdcall FilterLoad(wstr) - @ stub FilterReplyMessage - @ stub FilterSendMessage - @ stdcall FilterUnload(wstr) --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/fltlib-FilterLoad/definition wine-staging-1.7.46~ubuntu14.10.1/patches/fltlib-FilterLoad/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/fltlib-FilterLoad/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/fltlib-FilterLoad/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Fixes: [38435] Add stub for fltlib.FilterLoad -Category: stable diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/0001-gdiplus-Implement-GdipCreateRegionRgnData.-Take-3.patch wine-staging-1.7.46~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/0001-gdiplus-Implement-GdipCreateRegionRgnData.-Take-3.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/0001-gdiplus-Implement-GdipCreateRegionRgnData.-Take-3.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/0001-gdiplus-Implement-GdipCreateRegionRgnData.-Take-3.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,516 +0,0 @@ -From 662f5dfa5e3f4de2106b5abbe47b069fa580b94a Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 11 Jun 2015 15:32:36 +0200 -Subject: gdiplus: Implement GdipCreateRegionRgnData. Take 3. - ---- - dlls/gdiplus/region.c | 249 ++++++++++++++++++++++++++++++++++++-------- - dlls/gdiplus/tests/region.c | 65 ++++++++++++ - 2 files changed, 273 insertions(+), 41 deletions(-) - -diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c -index 572df62..a3b526e 100644 ---- a/dlls/gdiplus/region.c -+++ b/dlls/gdiplus/region.c -@@ -1,5 +1,6 @@ - /* - * Copyright (C) 2008 Google (Lei Zhang) -+ * Copyright (C) 2013 Dmitry Timoshkov - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -76,6 +77,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); - #define FLAGS_NOFLAGS 0x0 - #define FLAGS_INTPATH 0x4000 - -+struct memory_buffer -+{ -+ const BYTE *buffer; -+ INT size, pos; -+}; -+ -+struct region_header -+{ -+ DWORD size; -+ DWORD checksum; -+ DWORD magic; -+ DWORD num_children; -+}; -+ -+struct path_header -+{ -+ DWORD size; -+ DWORD magic; -+ DWORD count; -+ DWORD flags; -+}; -+ - /* Header size as far as header->size is concerned. This doesn't include - * header->size or header->checksum - */ -@@ -729,15 +752,9 @@ static void write_element(const region_element* element, DWORD *buffer, - { - INT i; - const GpPath* path = element->elementdata.path; -- struct _pathheader -- { -- DWORD size; -- DWORD magic; -- DWORD count; -- DWORD flags; -- } *pathheader; -+ struct path_header *pathheader; - -- pathheader = (struct _pathheader *)(buffer + *filled); -+ pathheader = (struct path_header *)(buffer + *filled); - - pathheader->flags = is_integer_path(path) ? FLAGS_INTPATH : FLAGS_NOFLAGS; - /* 3 for headers, once again size doesn't count itself */ -@@ -778,14 +795,6 @@ static void write_element(const region_element* element, DWORD *buffer, - } - } - --struct region_header --{ -- DWORD size; -- DWORD checksum; -- DWORD magic; -- DWORD num_children; --}; -- - /***************************************************************************** - * GdipGetRegionData [GDIPLUS.@] - * -@@ -856,36 +865,190 @@ GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *region, BYTE *buffer, UINT size, - return Ok; - } - --static inline GpStatus read_dword(DWORD **buffer, INT *size, DWORD *ret) -+static inline void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size) - { -- if (*size < sizeof(DWORD)) -- return GenericError; -+ mbuf->buffer = buffer; -+ mbuf->size = size; -+ mbuf->pos = 0; -+} - -- *ret = **buffer; -- (*buffer)++; -- (*size) -= sizeof(DWORD); -- return Ok; -+static inline const void *buffer_read(struct memory_buffer *mbuf, INT size) -+{ -+ if (mbuf->size - mbuf->pos >= size) -+ { -+ const void *data = mbuf->buffer + mbuf->pos; -+ mbuf->pos += size; -+ return data; -+ } -+ return NULL; - } - --static GpStatus read_element(GpRegion *region, region_element *element, DWORD **buffer, INT *size) -+static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, region_element *node, INT *count) - { - GpStatus status; -+ const DWORD *type; - -- status = read_dword(buffer, size, &element->type); -- if (status != Ok) -+ type = buffer_read(mbuf, sizeof(DWORD)); -+ if (!type) return Ok; -+ -+ TRACE("type %#x\n", *type); -+ -+ node->type = *type; -+ -+ switch (node->type) -+ { -+ case CombineModeReplace: -+ case CombineModeIntersect: -+ case CombineModeUnion: -+ case CombineModeXor: -+ case CombineModeExclude: -+ case CombineModeComplement: -+ { -+ region_element *left, *right; -+ -+ left = GdipAlloc(sizeof(region_element)); -+ if (!left) return OutOfMemory; -+ right = GdipAlloc(sizeof(region_element)); -+ if (!right) -+ { -+ GdipFree(left); -+ return OutOfMemory; -+ } -+ -+ status = read_element(mbuf, region, left, count); -+ if (status == Ok) -+ { -+ status = read_element(mbuf, region, right, count); -+ if (status == Ok) -+ { -+ node->elementdata.combine.left = left; -+ node->elementdata.combine.right = right; -+ region->num_children += 2; -+ return Ok; -+ } -+ } -+ -+ GdipFree(left); -+ GdipFree(right); - return status; -+ } - -- switch (element->type) -+ case RegionDataRect: - { -- case RegionDataInfiniteRect: -+ const GpRectF *rc; -+ -+ rc = buffer_read(mbuf, sizeof(GpRectF)); -+ if (!rc) -+ { -+ ERR("failed to read rect data\n"); -+ return InvalidParameter; -+ } -+ -+ node->elementdata.rect = *rc; -+ *count += 1; -+ return Ok; -+ } -+ -+ case RegionDataPath: -+ { -+ GpPath *path; -+ const struct path_header *path_header; -+ const BYTE *types; -+ -+ path_header = buffer_read(mbuf, sizeof(struct path_header)); -+ if (!path_header) -+ { -+ ERR("failed to read path header\n"); -+ return InvalidParameter; -+ } -+ if (path_header->magic != VERSION_MAGIC) -+ { -+ ERR("invalid path header magic %#x\n", path_header->magic); -+ return InvalidParameter; -+ } -+ -+ /* Windows always fails to create an empty path in a region */ -+ if (!path_header->count) -+ { -+ TRACE("refusing to create an empty path in a region\n"); -+ return GenericError; -+ } -+ -+ status = GdipCreatePath(FillModeAlternate, &path); -+ if (status) return status; -+ -+ node->elementdata.path = path; -+ -+ if (!lengthen_path(path, path_header->count)) -+ return OutOfMemory; -+ -+ path->pathdata.Count = path_header->count; -+ -+ if (path_header->flags & ~FLAGS_INTPATH) -+ FIXME("unhandled path flags %#x\n", path_header->flags); -+ -+ if (path_header->flags & FLAGS_INTPATH) -+ { -+ const packed_point *pt; -+ DWORD i; -+ -+ pt = buffer_read(mbuf, sizeof(packed_point) * path_header->count); -+ if (!pt) -+ { -+ ERR("failed to read packed %u path points\n", path_header->count); -+ return InvalidParameter; -+ } -+ -+ for (i = 0; i < path_header->count; i++) -+ { -+ path->pathdata.Points[i].X = (REAL)pt[i].X; -+ path->pathdata.Points[i].Y = (REAL)pt[i].Y; -+ } -+ } -+ else -+ { -+ const GpPointF *ptf; -+ -+ ptf = buffer_read(mbuf, sizeof(GpPointF) * path_header->count); -+ if (!ptf) -+ { -+ ERR("failed to read %u path points\n", path_header->count); -+ return InvalidParameter; -+ } -+ memcpy(path->pathdata.Points, ptf, sizeof(GpPointF) * path_header->count); -+ } -+ -+ types = buffer_read(mbuf, path_header->count); -+ if (!types) -+ { -+ ERR("failed to read %u path types\n", path_header->count); -+ return InvalidParameter; -+ } -+ memcpy(path->pathdata.Types, types, path_header->count); -+ if (path_header->count & 3) -+ { -+ if (!buffer_read(mbuf, 4 - (path_header->count & 3))) -+ { -+ ERR("failed to read rounding %u bytes\n", 4 - (path_header->count & 3)); -+ return InvalidParameter; -+ } -+ } -+ -+ *count += 1; -+ return Ok; -+ } -+ - case RegionDataEmptyRect: -- break; -+ case RegionDataInfiniteRect: -+ *count += 1; -+ return Ok; -+ - default: -- FIXME("region element type 0x%08x not supported\n", element->type); -- return NotImplemented; -+ FIXME("element type %#x is not supported\n", *type); -+ break; - } - -- return Ok; -+ return InvalidParameter; - } - - /***************************************************************************** -@@ -893,28 +1056,32 @@ static GpStatus read_element(GpRegion *region, region_element *element, DWORD ** - */ - GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRegion **region) - { -- struct region_header *region_header; -- DWORD *buffer = (DWORD*)data; -+ const struct region_header *region_header; -+ struct memory_buffer mbuf; - GpStatus status; -+ INT count; - - TRACE("(%p, %d, %p)\n", data, size, region); - -- if (!data || size < sizeof(*region_header) || !region) -+ if (!data || !size) - return InvalidParameter; - -- region_header = (struct region_header *)buffer; -- if (region_header->magic != VERSION_MAGIC && region_header->magic != VERSION_MAGIC2) -+ init_memory_buffer(&mbuf, data, size); -+ -+ region_header = buffer_read(&mbuf, sizeof(struct region_header)); -+ if (!region_header || (region_header->magic != VERSION_MAGIC && -+ region_header->magic != VERSION_MAGIC2)) - return InvalidParameter; - - status = GdipCreateRegion(region); - if (status != Ok) - return status; - -- /* skip header */ -- buffer += 4; -- size -= sizeof(*region_header); -+ count = 0; -+ status = read_element(&mbuf, *region, &(*region)->node, &count); -+ if (status == Ok && !count) -+ status = InvalidParameter; - -- status = read_element(*region, &(*region)->node, &buffer, &size); - if (status != Ok) - { - GdipDeleteRegion(*region); -diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c -index 92569c7..0c70ccd 100644 ---- a/dlls/gdiplus/tests/region.c -+++ b/dlls/gdiplus/tests/region.c -@@ -102,6 +102,56 @@ static void verify_region(HRGN hrgn, const RECT *rc) - rgn.data.rdh.rcBound.left, rgn.data.rdh.rcBound.top, rgn.data.rdh.rcBound.right, rgn.data.rdh.rcBound.bottom); - } - -+static void test_region_data(DWORD *data, UINT size, INT line) -+{ -+ GpStatus status; -+ GpRegion *region; -+ DWORD buf[256]; -+ UINT needed, i; -+ -+ status = GdipCreateRegionRgnData((BYTE *)data, size, ®ion); -+ /* Windows always fails to create an empty path in a region */ -+ if (data[4] == RGNDATA_PATH) -+ { -+ struct _path_header -+ { -+ DWORD size; -+ DWORD magic; -+ DWORD count; -+ DWORD flags; -+ } *path_header = (struct _path_header *)(data + 5); -+ if (!path_header->count) -+ { -+ ok_(__FILE__, line)(status == GenericError, "expected GenericError, got %d\n", status); -+ return; -+ } -+ } -+ -+ ok_(__FILE__, line)(status == Ok, "GdipCreateRegionRgnData error %d\n", status); -+ if (status != Ok) return; -+ -+ needed = 0; -+ status = GdipGetRegionDataSize(region, &needed); -+ ok_(__FILE__, line)(status == Ok, "status %d\n", status); -+ ok_(__FILE__, line)(needed == size, "data size mismatch: %u != %u\n", needed, size); -+ -+ memset(buf, 0xee, sizeof(buf)); -+ needed = 0; -+ status = GdipGetRegionData(region, (BYTE *)buf, sizeof(buf), &needed); -+ ok_(__FILE__, line)(status == Ok, "status %08x\n", status); -+ ok_(__FILE__, line)(needed == size, "data size mismatch: %u != %u\n", needed, size); -+ -+ size /= sizeof(DWORD); -+ for (i = 0; i < size - 1; i++) -+ { -+ if (i == 1) continue; /* data[1] never matches */ -+ ok_(__FILE__, line)(data[i] == buf[i], "off %u: %#x != %#x\n", i, data[i], buf[i]); -+ } -+ /* some Windows versions fail to properly clear the aligned DWORD */ -+ ok_(__FILE__, line)(data[size - 1] == buf[size - 1] || broken(data[size - 1] != buf[size - 1]), -+ "off %u: %#x != %#x\n", size - 1, data[size - 1], buf[size - 1]); -+} -+ - static void test_getregiondata(void) - { - GpStatus status; -@@ -143,6 +193,7 @@ static void test_getregiondata(void) - expect_dword(buf + 3, 0); - expect_dword(buf + 4, RGNDATA_INFINITE_RECT); - expect_dword(buf + 6, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipSetEmpty(region); - ok(status == Ok, "status %08x\n", status); -@@ -160,6 +211,7 @@ static void test_getregiondata(void) - expect_dword(buf + 3, 0); - expect_dword(buf + 4, RGNDATA_EMPTY_RECT); - expect_dword(buf + 6, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipSetInfinite(region); - ok(status == Ok, "status %08x\n", status); -@@ -177,6 +229,7 @@ static void test_getregiondata(void) - expect_dword(buf + 3, 0); - expect_dword(buf + 4, RGNDATA_INFINITE_RECT); - expect_dword(buf + 6, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeleteRegion(region); - ok(status == Ok, "status %08x\n", status); -@@ -205,6 +258,7 @@ static void test_getregiondata(void) - expect_float(buf + 7, 100.0); - expect_float(buf + 8, 200.0); - expect_dword(buf + 10, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - rect.X = 50; - rect.Y = 30; -@@ -290,6 +344,7 @@ static void test_getregiondata(void) - expect_float(buf + 37, 22.0); - expect_float(buf + 38, 55.0); - expect_dword(buf + 39, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeleteRegion(region2); - ok(status == Ok, "status %08x\n", status); -@@ -331,6 +386,7 @@ static void test_getregiondata(void) - expect_float(buf + 16, 28.0); - expect_dword(buf + 17, 0x81010100); - expect_dword(buf + 18, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - rect.X = 50; - rect.Y = 30; -@@ -371,6 +427,7 @@ static void test_getregiondata(void) - expect_float(buf + 22, 10.0); - expect_float(buf + 23, 20.0); - expect_dword(buf + 24, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeleteRegion(region); - ok(status == Ok, "status %08x\n", status); -@@ -403,6 +460,7 @@ static void test_getregiondata(void) - ok(*(buf + 8) == 0x4000 /* before win7 */ || *(buf + 8) == 0, - "expected 0x4000 or 0, got %08x\n", *(buf + 8)); - expect_dword(buf + 10, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - /* Transform an empty region */ - status = GdipCreateMatrix(&matrix); -@@ -453,6 +511,7 @@ static void test_getregiondata(void) - expect(6, point[3].Y); - expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ - expect_dword(buf + 14, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipTranslateRegion(region, 0.6, 0.8); - expect(Ok, status); -@@ -480,6 +539,7 @@ static void test_getregiondata(void) - expect_float(buf + 16, 6.8); - expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ - expect_dword(buf + 18, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); -@@ -522,6 +582,7 @@ static void test_getregiondata(void) - expect_float(buf + 16, 6.2); - expect_dword(buf + 17, 0x01010100); - expect_dword(buf + 18, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); -@@ -584,6 +645,7 @@ static void test_getregiondata(void) - ok(*(buf + 28) == 0x00000101 || *(buf + 28) == 0x43050101 /* Win 7 */, - "expected 00000101 or 43050101 got %08x\n", *(buf + 28)); - expect_dword(buf + 29, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); -@@ -627,6 +689,7 @@ static void test_getregiondata(void) - expect(23, point[3].Y); - expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ - expect_dword(buf + 14, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); -@@ -669,6 +732,7 @@ static void test_getregiondata(void) - expect_float(buf + 16, 2300.0); - expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ - expect_dword(buf + 18, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); -@@ -732,6 +796,7 @@ static void test_getregiondata(void) - *(buf + 33) == 0x43030303 /* 32-bit win7 */ || *(buf + 33) == 0x4c030303 /* 64-bit win7 */, - "expected 0x00030303 or 0x43030303 or 0x4c030303 got %08x\n", *(buf + 33)); - expect_dword(buf + 34, 0xeeeeeeee); -+ test_region_data(buf, needed, __LINE__); - - status = GdipDeletePath(path); - expect(Ok, status); --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/definition wine-staging-1.7.46~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/gdiplus-GdipCreateRegionRgnData/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [34843] Support for GdipCreateRegionRgnData diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/gitapply.sh wine-staging-1.7.46~ubuntu14.10.1/patches/gitapply.sh --- wine-staging-1.7.45~ubuntu14.10.1/patches/gitapply.sh 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/gitapply.sh 2015-06-28 17:08:11.000000000 +0000 @@ -115,14 +115,27 @@ fi # Detect BSD - we check this first to error out as early as possible -if gzip -V 2>&1 | grep "BSD" &> /dev/null; then +if gzip -V 2>&1 | grep -q "BSD"; then echo "This script is not compatible with *BSD utilities. Please install git," >&2 echo "which provides the same functionality and will be used instead." >&2 exit 1 fi +# Check if GNU Awk is available +if ! command -v gawk >/dev/null 2>&1; then + if ! awk -V 2>/dev/null | grep -q "GNU Awk"; then + echo "This script requires GNU Awk (or alternatively git) to work properly." >&2 + exit 1 + fi + + gawk() + { + awk "$@" + } +fi + # Check for missing depdencies -for dependency in awk cut dd du grep gzip hexdump patch sha1sum; do +for dependency in gawk cut dd du grep gzip hexdump patch sha1sum; do if ! command -v "$dependency" >/dev/null 2>&1; then echo "Missing dependency: $dependency - please install this program and try again." >&2 exit 1 @@ -269,7 +282,7 @@ # Go through the different patch sections lastoffset=1 -for offset in $(awk '/^diff --git /{ print FNR; }' "$tmpfile"); do +for offset in $(gawk '/^diff --git /{ print FNR; }' "$tmpfile"); do # Check part between end of last patch and start of current patch if [ "$lastoffset" -gt "$offset" ]; then @@ -283,7 +296,7 @@ # Find out the size of the patch header tmpoffset=$((offset + 1)) - tmpoffset=$(sed -n "$tmpoffset,\$ p" "$tmpfile" | awk "$awk_eof_header") + tmpoffset=$(sed -n "$tmpoffset,\$ p" "$tmpfile" | gawk "$awk_eof_header") hdroffset=$((offset + tmpoffset)) # Parse all important fields of the header @@ -340,7 +353,7 @@ if [ "$patch_is_binary" -eq 0 ]; then # Find end of textual patch - tmpoffset=$(sed -n "$hdroffset,\$ p" "$tmpfile" | awk "$awk_eof_textpatch") + tmpoffset=$(sed -n "$hdroffset,\$ p" "$tmpfile" | gawk "$awk_eof_textpatch") lastoffset=$((hdroffset + tmpoffset - 1)) # Apply textual patch @@ -370,7 +383,7 @@ fi # Find end of binary patch - tmpoffset=$(sed -n "$hdroffset,\$ p" "$tmpfile" | awk "$awk_eof_binarypatch") + tmpoffset=$(sed -n "$hdroffset,\$ p" "$tmpfile" | gawk "$awk_eof_binarypatch") lastoffset=$((hdroffset + tmpoffset - 1)) # Special case - deleting the whole file @@ -393,7 +406,7 @@ # Decode base85 and gzip compression tmpoffset=$((lastoffset - 1)) - sed -n "$hdroffset,$tmpoffset p" "$tmpfile" | awk "$awk_decode_b85" | gzip -dc > "$literal_tmpfile" 2>/dev/null + sed -n "$hdroffset,$tmpoffset p" "$tmpfile" | gawk "$awk_decode_b85" | gzip -dc > "$literal_tmpfile" 2>/dev/null if [ "$patch_binary_size" -ne "$(filesize "$literal_tmpfile")" ]; then rm "$literal_tmpfile" abort "Uncompressed binary patch has wrong size." @@ -428,7 +441,7 @@ patch_binary_complete=1 else break; fi - done < <(hexdump -v -e '32/1 "%02X" "\n"' "$delta_tmpfile" | awk "$awk_decode_binarypatch") + done < <(hexdump -v -e '32/1 "%02X" "\n"' "$delta_tmpfile" | gawk "$awk_decode_binarypatch") rm "$delta_tmpfile" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-Implement-GetNumaProcessorNode.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-Implement-GetNumaProcessorNode.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-Implement-GetNumaProcessorNode.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-Implement-GetNumaProcessorNode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -From 055d712c6ebe86e06c2792d2c33cf5b9c5960cf8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 18 Oct 2014 05:57:32 +0200 -Subject: kernel32: Implement GetNumaProcessorNode. - ---- - dlls/kernel32/cpu.c | 28 ++++++++++++++++++++++++++++ - dlls/kernel32/kernel32.spec | 2 +- - include/winbase.h | 1 + - 3 files changed, 30 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c -index f48fcf0..886e415 100644 ---- a/dlls/kernel32/cpu.c -+++ b/dlls/kernel32/cpu.c -@@ -291,3 +291,31 @@ err: - } - return TRUE; - } -+ -+/*********************************************************************** -+ * GetNumaProcessorNode (KERNEL32.@) -+ */ -+BOOL WINAPI GetNumaProcessorNode(UCHAR processor, PUCHAR node) -+{ -+ SYSTEM_INFO si; -+ -+ TRACE( "(%d, %p)\n", processor, node ); -+ -+ if (!node) -+ { -+ SetLastError(ERROR_INVALID_PARAMETER); -+ return FALSE; -+ } -+ -+ GetSystemInfo(&si); -+ -+ if (processor < si.dwNumberOfProcessors) -+ { -+ *node = 0; -+ return TRUE; -+ } -+ -+ *node = 0xFF; -+ SetLastError(ERROR_INVALID_PARAMETER); -+ return FALSE; -+} -diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index a272535..da05859 100644 ---- a/dlls/kernel32/kernel32.spec -+++ b/dlls/kernel32/kernel32.spec -@@ -746,7 +746,7 @@ - @ stdcall GetNumaNodeProcessorMask(long ptr) - # @ stub GetNumaNodeProcessorMaskEx - # @ stub GetNumaProcessorMap --# @ stub GetNumaProcessorNode -+@ stdcall GetNumaProcessorNode(long ptr) - # @ stub GetNumaProcessorNodeEx - # @ stub GetNumaProximityNode - # @ stub GetNumaProximityNodeEx -diff --git a/include/winbase.h b/include/winbase.h -index 0d8cede..28fb5ea 100644 ---- a/include/winbase.h -+++ b/include/winbase.h -@@ -1953,6 +1953,7 @@ WINBASEAPI BOOL WINAPI GetNamedPipeHandleStateW(HANDLE,LPDWORD,LPDWORD,LP - #define GetNamedPipeHandleState WINELIB_NAME_AW(GetNamedPipeHandleState) - WINBASEAPI BOOL WINAPI GetNamedPipeInfo(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD); - WINBASEAPI VOID WINAPI GetNativeSystemInfo(LPSYSTEM_INFO); -+WINBASEAPI BOOL WINAPI GetNumaProcessorNode(UCHAR, PUCHAR); - WINADVAPI BOOL WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD); - WINADVAPI BOOL WINAPI GetOldestEventLogRecord(HANDLE,PDWORD); - WINBASEAPI BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,BOOL); --- -2.2.1 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-tests-Add-tests-for-GetNumaProcessorNode.-v.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-tests-Add-tests-for-GetNumaProcessorNode.-v.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-tests-Add-tests-for-GetNumaProcessorNode.-v.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0001-kernel32-tests-Add-tests-for-GetNumaProcessorNode.-v.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,91 @@ +From 1683ee187a990a2c55cc6db9b5fac120ca1bbaca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 18 Oct 2014 06:00:48 +0200 +Subject: kernel32/tests: Add tests for GetNumaProcessorNode. (v2) + +Changes in v2: + * Remove separate dlls/kernel32/tests/cpu.c file. + * Fix test failure on WinXP. +--- + dlls/kernel32/tests/process.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c +index 6660af4..b4a435b 100644 +--- a/dlls/kernel32/tests/process.c ++++ b/dlls/kernel32/tests/process.c +@@ -3,6 +3,7 @@ + * + * Copyright 2002 Eric Pouech + * Copyright 2006 Dmitry Timoshkov ++ * Copyright 2014 Michael Müller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -74,6 +75,7 @@ static BOOL (WINAPI *pTerminateJobObject)(HANDLE job, UINT exit_code); + static BOOL (WINAPI *pQueryInformationJobObject)(HANDLE job, JOBOBJECTINFOCLASS class, LPVOID info, DWORD len, LPDWORD ret_len); + static BOOL (WINAPI *pSetInformationJobObject)(HANDLE job, JOBOBJECTINFOCLASS class, LPVOID info, DWORD len); + static HANDLE (WINAPI *pCreateIoCompletionPort)(HANDLE file, HANDLE existing_port, ULONG_PTR key, DWORD threads); ++static BOOL (WINAPI *pGetNumaProcessorNode)(UCHAR, PUCHAR); + + /* ############################### */ + static char base[MAX_PATH]; +@@ -227,6 +229,7 @@ static BOOL init(void) + pQueryInformationJobObject = (void *)GetProcAddress(hkernel32, "QueryInformationJobObject"); + pSetInformationJobObject = (void *)GetProcAddress(hkernel32, "SetInformationJobObject"); + pCreateIoCompletionPort = (void *)GetProcAddress(hkernel32, "CreateIoCompletionPort"); ++ pGetNumaProcessorNode = (void *)GetProcAddress(hkernel32, "GetNumaProcessorNode"); + return TRUE; + } + +@@ -2692,6 +2695,39 @@ static void test_StartupNoConsole(void) + #endif + } + ++static void test_GetNumaProcessorNode(void) ++{ ++ SYSTEM_INFO si; ++ UCHAR node; ++ BOOL ret; ++ int i; ++ ++ if (!pGetNumaProcessorNode) ++ { ++ skip("GetNumaProcessorNode is missing\n"); ++ return; ++ } ++ ++ GetSystemInfo(&si); ++ for (i = 0; i < 256; i++) ++ { ++ SetLastError(0xdeadbeef); ++ node = (i < si.dwNumberOfProcessors) ? 0xFF : 0xAA; ++ ret = pGetNumaProcessorNode(i, &node); ++ if (i < si.dwNumberOfProcessors) ++ { ++ ok(ret, "GetNumaProcessorNode returned FALSE for processor %d\n", i); ++ ok(node != 0xFF, "expected node != 0xFF, but got 0xFF\n"); ++ } ++ else ++ { ++ ok(!ret, "GetNumaProcessorNode returned TRUE for processor %d\n", i); ++ ok(node == 0xFF || broken(node == 0xAA) /* WinXP */, "expected node 0xFF, got %x\n", node); ++ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); ++ } ++ } ++} ++ + START_TEST(process) + { + HANDLE job; +@@ -2741,6 +2777,7 @@ START_TEST(process) + test_RegistryQuota(); + test_DuplicateHandle(); + test_StartupNoConsole(); ++ test_GetNumaProcessorNode(); + /* things that can be tested: + * lookup: check the way program to be executed is searched + * handles: check the handle inheritance stuff (+sec options) +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-Implement-GetNumaProcessorNode.-v2.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-Implement-GetNumaProcessorNode.-v2.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-Implement-GetNumaProcessorNode.-v2.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-Implement-GetNumaProcessorNode.-v2.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,84 @@ +From a228108e82fd231729cc6656c443af35b4249b23 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 18 Oct 2014 05:57:32 +0200 +Subject: kernel32: Implement GetNumaProcessorNode. (v2) + +Changes in v2: + * Remove NULL-pointer check, it also crashes on Windows. +--- + dlls/kernel32/cpu.c | 21 +++++++++++++++++++++ + dlls/kernel32/kernel32.spec | 2 +- + dlls/kernel32/tests/process.c | 2 +- + include/winbase.h | 1 + + 4 files changed, 24 insertions(+), 2 deletions(-) + +diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c +index f48fcf0..dc61763 100644 +--- a/dlls/kernel32/cpu.c ++++ b/dlls/kernel32/cpu.c +@@ -291,3 +291,24 @@ err: + } + return TRUE; + } ++ ++/*********************************************************************** ++ * GetNumaProcessorNode (KERNEL32.@) ++ */ ++BOOL WINAPI GetNumaProcessorNode(UCHAR processor, PUCHAR node) ++{ ++ SYSTEM_INFO si; ++ ++ TRACE( "(%d, %p)\n", processor, node ); ++ ++ GetSystemInfo(&si); ++ if (processor < si.dwNumberOfProcessors) ++ { ++ *node = 0; ++ return TRUE; ++ } ++ ++ *node = 0xFF; ++ SetLastError(ERROR_INVALID_PARAMETER); ++ return FALSE; ++} +diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec +index f9a0770..7703f2c 100644 +--- a/dlls/kernel32/kernel32.spec ++++ b/dlls/kernel32/kernel32.spec +@@ -746,7 +746,7 @@ + @ stdcall GetNumaNodeProcessorMask(long ptr) + # @ stub GetNumaNodeProcessorMaskEx + # @ stub GetNumaProcessorMap +-# @ stub GetNumaProcessorNode ++@ stdcall GetNumaProcessorNode(long ptr) + # @ stub GetNumaProcessorNodeEx + # @ stub GetNumaProximityNode + # @ stub GetNumaProximityNodeEx +diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c +index b4a435b..4145dce 100644 +--- a/dlls/kernel32/tests/process.c ++++ b/dlls/kernel32/tests/process.c +@@ -2704,7 +2704,7 @@ static void test_GetNumaProcessorNode(void) + + if (!pGetNumaProcessorNode) + { +- skip("GetNumaProcessorNode is missing\n"); ++ win_skip("GetNumaProcessorNode is missing\n"); + return; + } + +diff --git a/include/winbase.h b/include/winbase.h +index cc1081e..f3249a7 100644 +--- a/include/winbase.h ++++ b/include/winbase.h +@@ -2052,6 +2052,7 @@ WINBASEAPI BOOL WINAPI GetNamedPipeHandleStateW(HANDLE,LPDWORD,LPDWORD,LP + #define GetNamedPipeHandleState WINELIB_NAME_AW(GetNamedPipeHandleState) + WINBASEAPI BOOL WINAPI GetNamedPipeInfo(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD); + WINBASEAPI VOID WINAPI GetNativeSystemInfo(LPSYSTEM_INFO); ++WINBASEAPI BOOL WINAPI GetNumaProcessorNode(UCHAR, PUCHAR); + WINADVAPI BOOL WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD); + WINADVAPI BOOL WINAPI GetOldestEventLogRecord(HANDLE,PDWORD); + WINBASEAPI BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,BOOL); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-tests-Add-tests-for-GetNumaProcessorNode.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-tests-Add-tests-for-GetNumaProcessorNode.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-tests-Add-tests-for-GetNumaProcessorNode.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetNumaProcessorNode/0002-kernel32-tests-Add-tests-for-GetNumaProcessorNode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -From 24212987a7f995c9219be5807c6d70bd5d0f6f2d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 18 Oct 2014 06:00:48 +0200 -Subject: kernel32/tests: Add tests for GetNumaProcessorNode. - ---- - dlls/kernel32/tests/Makefile.in | 1 + - dlls/kernel32/tests/cpu.c | 77 +++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 78 insertions(+) - create mode 100644 dlls/kernel32/tests/cpu.c - -diff --git a/dlls/kernel32/tests/Makefile.in b/dlls/kernel32/tests/Makefile.in -index 2f2ac5f..50b0d8d 100644 ---- a/dlls/kernel32/tests/Makefile.in -+++ b/dlls/kernel32/tests/Makefile.in -@@ -8,6 +8,7 @@ C_SRCS = \ - codepage.c \ - comm.c \ - console.c \ -+ cpu.c \ - debugger.c \ - directory.c \ - drive.c \ -diff --git a/dlls/kernel32/tests/cpu.c b/dlls/kernel32/tests/cpu.c -new file mode 100644 -index 0000000..405d990 ---- /dev/null -+++ b/dlls/kernel32/tests/cpu.c -@@ -0,0 +1,77 @@ -+/* -+ * Unit test suite for cpu functions -+ * -+ * Copyright 2014 Michael Müller -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "wine/test.h" -+#include "winbase.h" -+#include "winnls.h" -+ -+static BOOL (WINAPI *pGetNumaProcessorNode)(UCHAR, PUCHAR); -+ -+static void InitFunctionPointers(void) -+{ -+ HMODULE hkernel32 = GetModuleHandleA("kernel32"); -+ -+ pGetNumaProcessorNode = (void *)GetProcAddress(hkernel32, "GetNumaProcessorNode"); -+} -+ -+static void test_GetNumaProcessorNode(void) -+{ -+ SYSTEM_INFO si; -+ UCHAR node; -+ BOOL ret; -+ int i; -+ -+ if (!pGetNumaProcessorNode) -+ { -+ win_skip("GetNumaProcessorNode() is missing\n"); -+ return; -+ } -+ -+ GetSystemInfo(&si); -+ -+ for (i = 0; i < 256; i++) -+ { -+ ret = pGetNumaProcessorNode(i, &node); -+ if (i < si.dwNumberOfProcessors) -+ { -+ ok(ret, "expected TRUE, got FALSE for processor %d\n", i); -+ ok(node != 0xFF, "expected node != 0xFF, but got 0xFF\n"); -+ } -+ else -+ { -+ ok(!ret, "expected FALSE, got TRUE for processor %d\n", i); -+ ok(node == 0xFF, "expected node == 0xFF, but got %x\n", node); -+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -+ } -+ } -+ -+ /* crashes on windows */ -+ if (0) -+ { -+ ok(!pGetNumaProcessorNode(0, NULL), "expected return value FALSE, got TRUE\n"); -+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -+ } -+} -+ -+START_TEST(cpu) -+{ -+ InitFunctionPointers(); -+ test_GetNumaProcessorNode(); -+} --- -1.9.1 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0001-kernel32-Implement-GetVolumePathName.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0001-kernel32-Implement-GetVolumePathName.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0001-kernel32-Implement-GetVolumePathName.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0001-kernel32-Implement-GetVolumePathName.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -From 719e096c6ca40ef86cd8f23d419807cdcd002656 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Sat, 25 Jan 2014 09:47:12 -0700 -Subject: kernel32: Implement GetVolumePathName. - ---- - dlls/kernel32/tests/volume.c | 3 -- - dlls/kernel32/volume.c | 123 ++++++++++++++++++++++++++++++++++++++----- - 2 files changed, 109 insertions(+), 17 deletions(-) - -diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c -index 61da509..4b3bdf5 100644 ---- a/dlls/kernel32/tests/volume.c -+++ b/dlls/kernel32/tests/volume.c -@@ -649,15 +649,12 @@ static void test_GetVolumePathNameA(void) - volume[0] = '\0'; - ret = pGetVolumePathNameA(pathC1, volume, sizeof(volume)); - ok(ret, "expected success\n"); --todo_wine - ok(!strcmp(expected, volume) || broken(!strcasecmp(expected, volume)) /* <=XP */, - "expected name '%s', returned '%s'\n", expected, volume); - - volume[0] = '\0'; - ret = pGetVolumePathNameA(pathC2, volume, sizeof(volume)); --todo_wine - ok(ret, "expected success\n"); --todo_wine - ok(!strcmp(expected, volume), "expected name '%s', returned '%s'\n", expected, volume); - - /* test an invalid path */ -diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c -index d396764..8826dd2 100644 ---- a/dlls/kernel32/volume.c -+++ b/dlls/kernel32/volume.c -@@ -1786,7 +1786,7 @@ BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD bufl - BOOL ret; - WCHAR *filenameW = NULL, *volumeW = NULL; - -- FIXME("(%s, %p, %d), stub!\n", debugstr_a(filename), volumepathname, buflen); -+ TRACE("(%s, %p, %d)\n", debugstr_a(filename), volumepathname, buflen); - - if (filename && !(filenameW = FILE_name_AtoW( filename, FALSE ))) - return FALSE; -@@ -1802,12 +1802,27 @@ BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD bufl - - /*********************************************************************** - * GetVolumePathNameW (KERNEL32.@) -+ * -+ * This routine is intended to find the most basic path on the same filesystem -+ * for any particular path name. Since we can have very complicated drive/path -+ * relationships on Unix systems, due to symbolic links, the safest way to -+ * handle this is to start with the full path and work our way back folder by -+ * folder unil we find a folder on a different drive (or run out of folders). - */ - BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD buflen) - { -- const WCHAR *p = filename; -+ const WCHAR ntprefixW[] = { '\\','\\','?','\\',0 }; -+ const WCHAR fallbackpathW[] = { 'C',':','\\',0 }; -+ NTSTATUS status = STATUS_SUCCESS; -+ WCHAR *volumenameW = NULL, *c; -+ int pos, last_pos, stop_pos; -+ UNICODE_STRING nt_name; -+ ANSI_STRING unix_name; -+ BOOL first_run = TRUE; -+ dev_t search_dev = 0; -+ struct stat st; - -- FIXME("(%s, %p, %d), stub!\n", debugstr_w(filename), volumepathname, buflen); -+ TRACE("(%s, %p, %d)\n", debugstr_w(filename), volumepathname, buflen); - - if (!filename || !volumepathname || !buflen) - { -@@ -1815,24 +1830,104 @@ BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD bu - return FALSE; - } - -- if (p && tolowerW(p[0]) >= 'a' && tolowerW(p[0]) <= 'z' && p[1] ==':' && p[2] == '\\') -+ last_pos = pos = strlenW( filename ); -+ /* allocate enough memory for searching the path (need room for a slash and a NULL terminator) */ -+ if (!(volumenameW = HeapAlloc( GetProcessHeap(), 0, (pos + 2) * sizeof(WCHAR) ))) - { -- if (buflen < 4) -+ SetLastError( ERROR_NOT_ENOUGH_MEMORY ); -+ return FALSE; -+ } -+ strcpyW( volumenameW, filename ); -+ stop_pos = 0; -+ /* stop searching slashes early for NT-type and nearly NT-type paths */ -+ if (strncmpW(ntprefixW, filename, strlenW(ntprefixW)) == 0) -+ stop_pos = strlenW(ntprefixW)-1; -+ else if (strncmpW(ntprefixW, filename, 2) == 0) -+ stop_pos = 2; -+ -+ do -+ { -+ volumenameW[pos+0] = '\\'; -+ volumenameW[pos+1] = '\0'; -+ if (!RtlDosPathNameToNtPathName_U( volumenameW, &nt_name, NULL, NULL )) -+ goto cleanup; -+ volumenameW[pos] = '\0'; -+ status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE ); -+ RtlFreeUnicodeString( &nt_name ); -+ if (status == STATUS_SUCCESS) - { -- SetLastError(ERROR_FILENAME_EXCED_RANGE); -- return FALSE; -+ if (stat( unix_name.Buffer, &st ) != 0) -+ { -+ RtlFreeAnsiString( &unix_name ); -+ status = STATUS_OBJECT_NAME_INVALID; -+ goto cleanup; -+ } -+ if (first_run) -+ { -+ first_run = FALSE; -+ search_dev = st.st_dev; -+ } -+ else if (st.st_dev != search_dev) -+ { -+ /* folder is on a new filesystem, return the last folder */ -+ RtlFreeAnsiString( &unix_name ); -+ break; -+ } -+ } -+ RtlFreeAnsiString( &unix_name ); -+ last_pos = pos; -+ c = strrchrW( volumenameW, '\\' ); -+ if (c != NULL) -+ pos = c-volumenameW; -+ } while (c != NULL && pos > stop_pos); -+ -+ if (status != STATUS_SUCCESS) -+ { -+ /* the path was completely invalid */ -+ if (filename[0] != '\\') -+ { -+ /* DOS-style paths revert to C:\ (anything not beginning with a slash) */ -+ last_pos = strlenW(fallbackpathW) - 1; /* points to \\ */ -+ filename = fallbackpathW; -+ status = STATUS_SUCCESS; -+ } -+ else -+ { -+ /* NT-style paths fail */ -+ status = STATUS_OBJECT_NAME_INVALID; -+ goto cleanup; - } -- volumepathname[0] = p[0]; -- volumepathname[1] = ':'; -- volumepathname[2] = '\\'; -- volumepathname[3] = 0; -- return TRUE; - } - -- SetLastError(ERROR_INVALID_NAME); -- return FALSE; -+ if (last_pos + 1 <= buflen) -+ { -+ WCHAR *p; -+ memcpy(volumepathname, filename, last_pos * sizeof(WCHAR)); -+ if (last_pos + 2 <= buflen) volumepathname[last_pos++] = '\\'; -+ volumepathname[last_pos] = '\0'; -+ -+ /* Normalize path */ -+ for (p = volumepathname; *p; p++) if (*p == '/') *p = '\\'; -+ -+ /* DOS-style paths always return upper-case drive letters */ -+ if (volumepathname[1] == ':') -+ volumepathname[0] = toupper(volumepathname[0]); -+ -+ TRACE("Successfully translated path %s to mount-point %s\n", -+ debugstr_w(filename), debugstr_w(volumepathname)); -+ } -+ else -+ status = STATUS_NAME_TOO_LONG; -+ -+cleanup: -+ HeapFree( GetProcessHeap(), 0, volumenameW ); -+ -+ if (status != STATUS_SUCCESS) -+ SetLastError( RtlNtStatusToDosError(status) ); -+ return (status == STATUS_SUCCESS); - } - -+ - /*********************************************************************** - * GetVolumePathNamesForVolumeNameA (KERNEL32.@) - */ --- -2.1.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0002-kernel32-Convert-GetVolumePathName-tests-into-a-list.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0002-kernel32-Convert-GetVolumePathName-tests-into-a-list.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0002-kernel32-Convert-GetVolumePathName-tests-into-a-list.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0002-kernel32-Convert-GetVolumePathName-tests-into-a-list.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -From f01a3110045b59483ec4172ad782198f44ed7639 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Sat, 25 Jan 2014 09:53:39 -0700 -Subject: kernel32: Convert GetVolumePathName tests into a list. - ---- - dlls/kernel32/tests/volume.c | 137 +++++++++++++++++++++++-------------------- - 1 file changed, 74 insertions(+), 63 deletions(-) - -diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c -index 4b3bdf5..f15269c 100644 ---- a/dlls/kernel32/tests/volume.c -+++ b/dlls/kernel32/tests/volume.c -@@ -591,79 +591,90 @@ static void test_disk_extents(void) - - static void test_GetVolumePathNameA(void) - { -- BOOL ret; -- char volume[MAX_PATH]; -- char expected[] = "C:\\", pathC1[] = "C:\\", pathC2[] = "C::"; -+ char volume_path[MAX_PATH]; -+ struct { -+ const char *file_name; -+ const char *path_name; -+ DWORD path_len; -+ DWORD error; -+ DWORD broken_error; -+ } test_paths[] = { -+ { /* test 0: NULL parameters, 0 output length */ -+ NULL, NULL, 0, -+ ERROR_INVALID_PARAMETER, 0xdeadbeef /* XP */ -+ }, -+ { /* test 1: empty input, NULL output, 0 output length */ -+ "", NULL, 0, -+ ERROR_INVALID_PARAMETER, 0xdeadbeef /* XP */ -+ }, -+ { /* test 2: valid input, NULL output, 0 output length */ -+ "C:\\", NULL, 0, -+ ERROR_INVALID_PARAMETER, ERROR_FILENAME_EXCED_RANGE /* XP */ -+ }, -+ { /* test 3: valid input, valid output, 0 output length */ -+ "C:\\", "C:\\", 0, -+ ERROR_INVALID_PARAMETER, ERROR_FILENAME_EXCED_RANGE /* XP */ -+ }, -+ { /* test 4: valid input, valid output, 1 output length */ -+ "C:\\", "C:\\", 1, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 5: valid input, valid output, valid output length */ -+ "C:\\", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 6: lowercase input, uppercase output, valid output length */ -+ "c:\\", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 7: poor quality input, valid output, valid output length */ -+ "C::", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 8: really bogus input, valid output, 1 output length */ -+ "\\\\$$$", "C:\\", 1, -+ ERROR_INVALID_NAME, ERROR_FILENAME_EXCED_RANGE -+ }, -+ }; -+ BOOL ret, success; - DWORD error; -+ UINT i; - -+ /* GetVolumePathNameA is not present before w2k */ - if (!pGetVolumePathNameA) - { - win_skip("required functions not found\n"); - return; - } - -- SetLastError( 0xdeadbeef ); -- ret = pGetVolumePathNameA(NULL, NULL, 0); -- error = GetLastError(); -- ok(!ret, "expected failure\n"); -- ok(error == ERROR_INVALID_PARAMETER -- || broken( error == 0xdeadbeef) /* <=XP */, -- "expected ERROR_INVALID_PARAMETER got %u\n", error); -- -- SetLastError( 0xdeadbeef ); -- ret = pGetVolumePathNameA("", NULL, 0); -- error = GetLastError(); -- ok(!ret, "expected failure\n"); -- ok(error == ERROR_INVALID_PARAMETER -- || broken( error == 0xdeadbeef) /* <=XP */, -- "expected ERROR_INVALID_PARAMETER got %u\n", error); -+ for(i=0; i -Date: Sat, 25 Jan 2014 09:54:39 -0700 -Subject: kernel32: Add a bunch more GetVolumePathName tests. - ---- - dlls/kernel32/tests/volume.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c -index f15269c..e17cc16 100644 ---- a/dlls/kernel32/tests/volume.c -+++ b/dlls/kernel32/tests/volume.c -@@ -635,6 +635,34 @@ static void test_GetVolumePathNameA(void) - "\\\\$$$", "C:\\", 1, - ERROR_INVALID_NAME, ERROR_FILENAME_EXCED_RANGE - }, -+ { /* test 9: a reasonable DOS path that is guaranteed to exist */ -+ "C:\\windows\\system32", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 10: a reasonable DOS path that shouldn't exist */ -+ "C:\\windows\\system32\\AnInvalidFolder", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 11: an unreasonable DOS path */ -+ "InvalidDrive:\\AnInvalidFolder", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 12: a reasonable NT-converted DOS path that shouldn't exist */ -+ "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 13: an unreasonable NT-converted DOS path */ -+ "\\\\?\\InvalidDrive:\\AnInvalidFolder", "", sizeof(volume_path), -+ ERROR_INVALID_NAME, NO_ERROR -+ }, -+ { /* test 14: an unreasonable NT volume path */ -+ "\\\\?\\Volume{00000000-00-0000-0000-000000000000}\\AnInvalidFolder", "", sizeof(volume_path), -+ ERROR_INVALID_NAME, NO_ERROR -+ }, -+ { /* test 15: an unreasonable NT-ish path */ -+ "\\\\ReallyBogus\\InvalidDrive:\\AnInvalidFolder", "", sizeof(volume_path), -+ ERROR_INVALID_NAME, NO_ERROR -+ }, - }; - BOOL ret, success; - DWORD error; --- -2.1.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0004-kernel32-tests-Add-a-lot-of-picky-GetVolumePathName-.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0004-kernel32-tests-Add-a-lot-of-picky-GetVolumePathName-.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0004-kernel32-tests-Add-a-lot-of-picky-GetVolumePathName-.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/0004-kernel32-tests-Add-a-lot-of-picky-GetVolumePathName-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -From 58660ba82873512fe46e897274f569865f8af80f Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Tue, 2 Sep 2014 05:23:37 +0200 -Subject: kernel32/tests: Add a lot of picky GetVolumePathName tests. - ---- - dlls/kernel32/tests/volume.c | 153 ++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 152 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c -index e17cc16..e4026ed 100644 ---- a/dlls/kernel32/tests/volume.c -+++ b/dlls/kernel32/tests/volume.c -@@ -54,6 +54,7 @@ static UINT (WINAPI *pGetLogicalDriveStringsA)(UINT,LPSTR); - static UINT (WINAPI *pGetLogicalDriveStringsW)(UINT,LPWSTR); - static BOOL (WINAPI *pGetVolumeInformationA)(LPCSTR, LPSTR, DWORD, LPDWORD, LPDWORD, LPDWORD, LPSTR, DWORD); - static BOOL (WINAPI *pGetVolumePathNameA)(LPCSTR, LPSTR, DWORD); -+static BOOL (WINAPI *pGetVolumePathNameW)(LPWSTR, LPWSTR, DWORD); - static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameA)(LPCSTR, LPSTR, DWORD, LPDWORD); - static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameW)(LPCWSTR, LPWSTR, DWORD, LPDWORD); - -@@ -645,7 +646,7 @@ static void test_GetVolumePathNameA(void) - }, - { /* test 11: an unreasonable DOS path */ - "InvalidDrive:\\AnInvalidFolder", "C:\\", sizeof(volume_path), -- NO_ERROR, NO_ERROR -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ - }, - { /* test 12: a reasonable NT-converted DOS path that shouldn't exist */ - "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:\\", sizeof(volume_path), -@@ -663,6 +664,103 @@ static void test_GetVolumePathNameA(void) - "\\\\ReallyBogus\\InvalidDrive:\\AnInvalidFolder", "", sizeof(volume_path), - ERROR_INVALID_NAME, NO_ERROR - }, -+ { /* test 16 */ -+ "C:", "C:", 2, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 17 */ -+ "C:", "C:", 3, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 18 */ -+ "C:\\", "C:", 2, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 19 */ -+ "C:\\", "C:", 3, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 20 */ -+ "C::", "C:", 2, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 21 */ -+ "C::", "C:", 3, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 22 */ -+ "C::", "C:\\", 4, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 23 */ -+ "C:\\windows\\system32\\AnInvalidFolder", "C:", 3, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 24 */ -+ "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 3, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 25 */ -+ "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 6, -+ ERROR_FILENAME_EXCED_RANGE, NO_ERROR -+ }, -+ { /* test 26 */ -+ "\\\\?\\C:\\AnInvalidFolder", "\\\\?\\C:", 7, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 27 */ -+ "\\\\?\\c:\\AnInvalidFolder", "\\\\?\\c:", 7, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 28 */ -+ "C:/", "C:\\", 4, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 29 */ -+ "E:/", "", 4, -+ ERROR_FILE_NOT_FOUND, NO_ERROR -+ }, -+ { /* test 30 */ -+ "M::", "C:\\", 4, -+ ERROR_FILE_NOT_FOUND, NO_ERROR -+ }, -+ { /* test 31 */ -+ "C:ABC:DEF:\\AnInvalidFolder", "C:\\", 4, -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 32 */ -+ "?:ABC:DEF:\\AnInvalidFolder", "", sizeof(volume_path), -+ ERROR_FILE_NOT_FOUND, NO_ERROR -+ }, -+ { /* test 33 */ -+ "relative/path", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ -+ }, -+ { /* test 34 */ -+ "/unix-style/absolute/path", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ -+ }, -+ { /* test 35 */ -+ "\\??\\ReallyBogus", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ -+ }, -+ { /* test 36 */ -+ "\\??\\C:\\NonExistent", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ -+ }, -+ { /* test 37 */ -+ "\\??\\M:\\NonExistent", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR /* FIXME: depends on system dir */ -+ }, -+ { /* test 38 */ -+ "somefile:def", "C:\\", sizeof(volume_path), -+ NO_ERROR, NO_ERROR -+ }, -+ { /* test 39 */ -+ "s:omefile", "", sizeof(volume_path), -+ ERROR_FILE_NOT_FOUND, NO_ERROR -+ }, -+ - }; - BOOL ret, success; - DWORD error; -@@ -681,6 +779,9 @@ static void test_GetVolumePathNameA(void) - BOOL expected_ret = test_paths[i].error == NO_ERROR ? TRUE : FALSE; - - volume_path[0] = 0; -+ if (test_paths[i].path_len < sizeof(volume_path)) -+ volume_path[ test_paths[i].path_len ] = 0x11; -+ - SetLastError( 0xdeadbeef ); - ret = pGetVolumePathNameA( test_paths[i].file_name, output, test_paths[i].path_len ); - error = GetLastError(); -@@ -702,9 +803,57 @@ static void test_GetVolumePathNameA(void) - ok(success, "GetVolumePathName test %d unexpectedly returned error 0x%x (expected 0x%x).\n", - i, error, test_paths[i].error); - } -+ -+ if (test_paths[i].path_len < sizeof(volume_path)) -+ ok(volume_path[ test_paths[i].path_len ] == 0x11, -+ "GetVolumePathName test %d corrupted byte after end of buffer.\n", i); - } - } - -+static void test_GetVolumePathNameW(void) -+{ -+ static WCHAR drive_c1[] = {'C',':',0}; -+ static WCHAR drive_c2[] = {'C',':','\\',0}; -+ WCHAR volume_path[MAX_PATH]; -+ BOOL ret; -+ -+ if (!pGetVolumePathNameW) -+ { -+ win_skip("required functions not found\n"); -+ return; -+ } -+ -+ volume_path[0] = 0; -+ volume_path[1] = 0x11; -+ ret = pGetVolumePathNameW( drive_c1, volume_path, 1 ); -+ ok(!ret, "GetVolumePathNameW test succeeded unexpectedly.\n"); -+ ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).\n", -+ GetLastError(), ERROR_FILENAME_EXCED_RANGE); -+ ok(volume_path[1] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n"); -+ -+ volume_path[0] = 0; -+ volume_path[2] = 0x11; -+ ret = pGetVolumePathNameW( drive_c1, volume_path, 2 ); -+ ok(!ret, "GetVolumePathNameW test succeeded unexpectedly.\n"); -+ ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).\n", -+ GetLastError(), ERROR_FILENAME_EXCED_RANGE); -+ ok(volume_path[2] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n"); -+ -+ volume_path[0] = 0; -+ volume_path[3] = 0x11; -+ ret = pGetVolumePathNameW( drive_c1, volume_path, 3 ); -+ ok(ret, "GetVolumePathNameW test failed unexpectedly.\n"); -+ ok(memcmp(volume_path, drive_c1, sizeof(drive_c1)) == 0, "GetVolumePathNameW unexpectedly returned wrong path.\n"); -+ ok(volume_path[3] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n"); -+ -+ volume_path[0] = 0; -+ volume_path[4] = 0x11; -+ ret = pGetVolumePathNameW( drive_c1, volume_path, 4 ); -+ ok(ret, "GetVolumePathNameW test failed unexpectedly.\n"); -+ ok(memcmp(volume_path, drive_c2, sizeof(drive_c2)) == 0, "GetVolumePathNameW unexpectedly returned wrong path.\n"); -+ ok(volume_path[4] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n"); -+} -+ - static void test_GetVolumePathNamesForVolumeNameA(void) - { - BOOL ret; -@@ -1044,6 +1193,7 @@ START_TEST(volume) - pGetLogicalDriveStringsW = (void *) GetProcAddress(hdll, "GetLogicalDriveStringsW"); - pGetVolumeInformationA = (void *) GetProcAddress(hdll, "GetVolumeInformationA"); - pGetVolumePathNameA = (void *) GetProcAddress(hdll, "GetVolumePathNameA"); -+ pGetVolumePathNameW = (void *) GetProcAddress(hdll, "GetVolumePathNameW"); - pGetVolumePathNamesForVolumeNameA = (void *) GetProcAddress(hdll, "GetVolumePathNamesForVolumeNameA"); - pGetVolumePathNamesForVolumeNameW = (void *) GetProcAddress(hdll, "GetVolumePathNamesForVolumeNameW"); - -@@ -1051,6 +1201,7 @@ START_TEST(volume) - test_define_dos_deviceA(); - test_FindFirstVolume(); - test_GetVolumePathNameA(); -+ test_GetVolumePathNameW(); - test_GetVolumeNameForVolumeMountPointA(); - test_GetVolumeNameForVolumeMountPointW(); - test_GetLogicalDriveStringsA(); --- -2.1.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/definition wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-GetVolumePathName/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-GetVolumePathName/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Support for GetVolumePathName diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-Named_Pipe/0023-server-Fix-wineserver-crash-when-pipe-server-object-.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-Named_Pipe/0023-server-Fix-wineserver-crash-when-pipe-server-object-.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-Named_Pipe/0023-server-Fix-wineserver-crash-when-pipe-server-object-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-Named_Pipe/0023-server-Fix-wineserver-crash-when-pipe-server-object-.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,120 @@ +From b2a17b581c4d8452a605b494f8ff7884fcb3a481 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 17 Jun 2015 13:50:59 +0200 +Subject: server: Fix wineserver crash when pipe server object is destroyed + before client. + +--- + dlls/kernel32/tests/pipe.c | 35 +++++++++++++++++++++++++++++++++++ + server/named_pipe.c | 14 ++++++++++++-- + 2 files changed, 47 insertions(+), 2 deletions(-) + +diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c +index ddad351..06242aa 100644 +--- a/dlls/kernel32/tests/pipe.c ++++ b/dlls/kernel32/tests/pipe.c +@@ -1162,6 +1162,8 @@ static void test_CloseNamedPipe(void) + char ibuf[32]; + DWORD written; + DWORD readden; ++ DWORD state; ++ BOOL ret; + + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, +@@ -1196,6 +1198,14 @@ static void test_CloseNamedPipe(void) + ok(readden == sizeof(obuf), "got %d bytes\n", readden); + /* pipe is empty now */ + ++ ret = GetNamedPipeHandleStateA(hFile, &state, NULL, NULL, NULL, NULL, 0); ++ todo_wine ++ ok(ret, "GetNamedPipeHandleState failed with %d\n", GetLastError()); ++ state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ++ ret = SetNamedPipeHandleState(hFile, &state, NULL, NULL); ++ todo_wine ++ ok(ret, "SetNamedPipeHandleState failed with %d\n", GetLastError()); ++ + SetLastError(0xdeadbeef); + ok(!ReadFile(hFile, ibuf, 0, &readden, NULL), "ReadFile() succeeded\n"); + ok(GetLastError() == ERROR_BROKEN_PIPE, "GetLastError() returned %08x, expected ERROR_BROKEN_PIPE\n", GetLastError()); +@@ -1233,6 +1243,14 @@ static void test_CloseNamedPipe(void) + ok(readden == 0, "got %d bytes\n", readden); + /* pipe is empty now */ + ++ ret = GetNamedPipeHandleStateA(hFile, &state, NULL, NULL, NULL, NULL, 0); ++ todo_wine ++ ok(ret, "GetNamedPipeHandleState failed with %d\n", GetLastError()); ++ state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ++ ret = SetNamedPipeHandleState(hFile, &state, NULL, NULL); ++ todo_wine ++ ok(ret, "SetNamedPipeHandleState failed with %d\n", GetLastError()); ++ + SetLastError(0xdeadbeef); + ok(!ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile() succeeded\n"); + ok(GetLastError() == ERROR_BROKEN_PIPE, "GetLastError() returned %08x, expected ERROR_BROKEN_PIPE\n", GetLastError()); +@@ -1277,6 +1295,14 @@ static void test_CloseNamedPipe(void) + ok(readden == sizeof(obuf), "got %d bytes\n", readden); + /* pipe is empty now */ + ++ ret = GetNamedPipeHandleStateA(hnp, &state, NULL, NULL, NULL, NULL, 0); ++ ok(ret, "GetNamedPipeHandleState failed with %d\n", GetLastError()); ++ SetLastError(0xdeadbeef); ++ state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ++ ret = SetNamedPipeHandleState(hFile, &state, NULL, NULL); ++ ok(!ret, "SetNamedPipeHandleState unexpectedly succeeded\n"); ++ ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() returned %08x, expected ERROR_INVALID_HANDLE\n", GetLastError()); ++ + SetLastError(0xdeadbeef); + ok(!ReadFile(hnp, ibuf, 0, &readden, NULL), "ReadFile() succeeded\n"); + ok(GetLastError() == ERROR_BROKEN_PIPE, "GetLastError() returned %08x, expected ERROR_BROKEN_PIPE\n", GetLastError()); +@@ -1314,6 +1340,15 @@ static void test_CloseNamedPipe(void) + ok(readden == 0, "got %d bytes\n", readden); + /* pipe is empty now */ + ++ ret = GetNamedPipeHandleStateA(hnp, &state, NULL, NULL, NULL, NULL, 0); ++ ok(ret, "GetNamedPipeHandleState failed with %d\n", GetLastError()); ++ ret = SetNamedPipeHandleState(hFile, &state, NULL, NULL); ++ SetLastError(0xdeadbeef); ++ state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ++ ret = SetNamedPipeHandleState(hFile, &state, NULL, NULL); ++ ok(!ret, "SetNamedPipeHandleState unexpectedly succeeded\n"); ++ ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() returned %08x, expected ERROR_INVALID_HANDLE\n", GetLastError()); ++ + SetLastError(0xdeadbeef); + ok(!ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile() succeeded\n"); + ok(GetLastError() == ERROR_BROKEN_PIPE, "GetLastError() returned %08x, expected ERROR_BROKEN_PIPE\n", GetLastError()); +diff --git a/server/named_pipe.c b/server/named_pipe.c +index 4718d1b..53bec02 100644 +--- a/server/named_pipe.c ++++ b/server/named_pipe.c +@@ -1105,7 +1105,12 @@ DECL_HANDLER(get_named_pipe_info) + client = (struct pipe_client *)get_handle_obj( current->process, req->handle, + 0, &pipe_client_ops ); + if (!client) return; +- server = client->server; ++ if (!(server = client->server)) ++ { ++ release_object( client ); ++ set_error( STATUS_INVALID_HANDLE ); ++ return; ++ } + } + + reply->flags = client ? client->pipe_flags : server->pipe_flags; +@@ -1142,7 +1147,12 @@ DECL_HANDLER(set_named_pipe_info) + client = (struct pipe_client *)get_handle_obj( current->process, req->handle, + 0, &pipe_client_ops ); + if (!client) return; +- server = client->server; ++ if (!(server = client->server)) ++ { ++ release_object( client ); ++ set_error( STATUS_INVALID_HANDLE ); ++ return; ++ } + } + + if ((req->flags & ~(NAMED_PIPE_MESSAGE_STREAM_READ | NAMED_PIPE_NONBLOCKING_MODE)) || +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -From f8bfaee1501abb1b24d80f2221c3b55ca4a3a628 Mon Sep 17 00:00:00 2001 -From: "Olivier F. R. Dierick" -Date: Thu, 30 Apr 2015 22:58:37 +0200 -Subject: kernel32: Implement SetFileCompletionNotificationModes as a stub. - ---- - .../api-ms-win-core-kernel32-legacy-l1-1-0.spec | 2 +- - dlls/kernel32/file.c | 10 ++++++++++ - dlls/kernel32/kernel32.spec | 2 +- - include/winbase.h | 1 + - 4 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec b/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec -index f4b9050..7c196c9 100644 ---- a/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec -+++ b/dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec -@@ -45,7 +45,7 @@ - @ stub RaiseFailFastException - @ stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) kernel32.RegisterWaitForSingleObject - @ stdcall SetConsoleTitleA(str) kernel32.SetConsoleTitleA --@ stub SetFileCompletionNotificationModes -+@ stdcall SetFileCompletionNotificationModes(long long) kernel32.SetFileCompletionNotificationModes - @ stdcall SetHandleCount(long) kernel32.SetHandleCount - @ stdcall SetMailslotInfo(long long) kernel32.SetMailslotInfo - @ stdcall SetVolumeLabelW(wstr wstr) kernel32.SetVolumeLabelW -diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c -index bcb21c9..3e557aa 100644 ---- a/dlls/kernel32/file.c -+++ b/dlls/kernel32/file.c -@@ -1041,6 +1041,16 @@ BOOL WINAPI SetEndOfFile( HANDLE hFile ) - } - - -+/************************************************************************** -+ * SetFileCompletionNotificationModes (KERNEL32.@) -+ */ -+BOOL WINAPI SetFileCompletionNotificationModes( HANDLE file, UCHAR flags ) -+{ -+ FIXME("%p %x - stub\n", file, flags); -+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -+ return FALSE; -+} -+ - /*********************************************************************** - * SetFileInformationByHandle (KERNEL32.@) - */ -diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index a0c8123..8e97cdb 100644 ---- a/dlls/kernel32/kernel32.spec -+++ b/dlls/kernel32/kernel32.spec -@@ -1393,7 +1393,7 @@ - # @ stub SetFileAttributesTransactedW - @ stdcall SetFileAttributesW(wstr long) - # @ stub SetFileBandwidthReservation --# @ stub SetFileCompletionNotificationModes -+@ stdcall SetFileCompletionNotificationModes(long long) - @ stdcall SetFileInformationByHandle(long long ptr long) - # @ stub SetFileIoOverlappedRange - @ stdcall SetFilePointer(long long ptr long) -diff --git a/include/winbase.h b/include/winbase.h -index e20a675..cc1081e 100644 ---- a/include/winbase.h -+++ b/include/winbase.h -@@ -2460,6 +2460,7 @@ WINBASEAPI VOID WINAPI SetFileApisToOEM(void); - WINBASEAPI BOOL WINAPI SetFileAttributesA(LPCSTR,DWORD); - WINBASEAPI BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD); - #define SetFileAttributes WINELIB_NAME_AW(SetFileAttributes) -+WINBASEAPI BOOL WINAPI SetFileCompletionNotificationModes(HANDLE,UCHAR); - WINBASEAPI BOOL WINAPI SetFileInformationByHandle(HANDLE,FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD); - WINBASEAPI DWORD WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD); - WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,LARGE_INTEGER*,DWORD); --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/definition wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/kernel32-SetFileCompletionNotificationMode/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38493] Add stub for kernel32.SetFileCompletionNotificationModes (for Steam in Win7 mode) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/0001-msvcrt-Avoid-crash-when-NULL-pointer-is-passed-to-at.patch wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/0001-msvcrt-Avoid-crash-when-NULL-pointer-is-passed-to-at.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/0001-msvcrt-Avoid-crash-when-NULL-pointer-is-passed-to-at.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/0001-msvcrt-Avoid-crash-when-NULL-pointer-is-passed-to-at.patch 2015-06-28 17:08:11.000000000 +0000 @@ -1,33 +1,15 @@ -From 50aadbdd128d6cf1489abdceb91302c53a144cbd Mon Sep 17 00:00:00 2001 +From 5464947ce0bbc3f0da79231c5e366cd54d7888d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 8 Nov 2014 22:39:28 +0100 Subject: msvcrt: Avoid crash when NULL pointer is passed to atof / strtod functions. --- - dlls/msvcrt/string.c | 6 +++++ dlls/msvcrt/tests/string.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 63 insertions(+) + 1 file changed, 57 insertions(+) -diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c -index 6f9280f..d933643 100644 ---- a/dlls/msvcrt/string.c -+++ b/dlls/msvcrt/string.c -@@ -434,6 +434,12 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale - */ - double CDECL MSVCRT_strtod_l(const char *str, char **end, MSVCRT__locale_t locale) - { -+ if (!str) -+ { -+ if (end) *end = NULL; -+ *MSVCRT__errno() = MSVCRT_EINVAL; -+ return 0.0; -+ } - return strtod_helper(str, end, locale, NULL); - } - diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c -index e2d53d4..187d2b9 100644 +index 9920df0..1a3c598 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -89,6 +89,8 @@ static int (__cdecl *p_tolower)(int); @@ -39,7 +21,7 @@ static int (__cdecl *p__strnset_s)(char*,size_t,int,size_t); static int (__cdecl *p__wcsset_s)(wchar_t*,size_t,wchar_t); -@@ -1580,6 +1582,28 @@ static void test__strtod(void) +@@ -1678,6 +1680,28 @@ static void test__strtod(void) ok(almost_equal(d, 0), "d = %lf\n", d); ok(end == white_chars, "incorrect end (%d)\n", (int)(end-white_chars)); @@ -57,7 +39,7 @@ + d = strtod(NULL, &end); + ok(almost_equal(d, 0.0), "d = %lf\n", d); + ok(errno == EINVAL, "errno = %x\n", errno); -+ ok(!end, "incorrect end ptr %p\n", end); ++ todo_wine ok(!end, "incorrect end ptr %p\n", end); + + errno = EBADF; + d = p__strtod_l(NULL, NULL, NULL); @@ -68,7 +50,7 @@ /* Set locale with non '.' decimal point (',') */ if(!setlocale(LC_ALL, "Polish")) { win_skip("system with limited locales\n"); -@@ -2623,6 +2647,36 @@ static void test_atoi(void) +@@ -2721,6 +2745,36 @@ static void test_atoi(void) ok(r == 0, "atoi(4294967296) = %d\n", r); } @@ -105,7 +87,7 @@ static void test_strncpy(void) { #define TEST_STRNCPY_LEN 10 -@@ -2831,6 +2885,8 @@ START_TEST(string) +@@ -2959,6 +3013,8 @@ START_TEST(string) p_mbrtowc = (void*)GetProcAddress(hMsvcrt, "mbrtowc"); p_mbsrtowcs = (void*)GetProcAddress(hMsvcrt, "mbsrtowcs"); p__atodbl_l = (void*)GetProcAddress(hMsvcrt, "_atodbl_l"); @@ -114,7 +96,7 @@ p__strnset_s = (void*)GetProcAddress(hMsvcrt, "_strnset_s"); p__wcsset_s = (void*)GetProcAddress(hMsvcrt, "_wcsset_s"); -@@ -2884,6 +2940,7 @@ START_TEST(string) +@@ -3015,6 +3071,7 @@ START_TEST(string) test__stricmp(); test__wcstoi64(); test_atoi(); @@ -123,5 +105,5 @@ test_strxfrm(); test__strnset_s(); -- -2.2.1 +2.4.3 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/0002-msvcrt-Set-end-to-NULL-when-strtod-is-called-with-NU.patch wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/0002-msvcrt-Set-end-to-NULL-when-strtod-is-called-with-NU.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/0002-msvcrt-Set-end-to-NULL-when-strtod-is-called-with-NU.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/0002-msvcrt-Set-end-to-NULL-when-strtod-is-called-with-NU.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,45 @@ +From 826e80ab90bc03c4e156f3600ae8078b3c75e3ed Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 26 Jun 2015 10:35:50 +0200 +Subject: msvcrt: Set *end to NULL when strtod is called with NULL pointer + string. + +--- + dlls/msvcrt/string.c | 7 +++++-- + dlls/msvcrt/tests/string.c | 2 +- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c +index fdeb4e0..980d492 100644 +--- a/dlls/msvcrt/string.c ++++ b/dlls/msvcrt/string.c +@@ -317,8 +317,11 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale + + if(err) + *err = 0; +- else +- if(!MSVCRT_CHECK_PMT(str != NULL)) return 0; ++ else if(!MSVCRT_CHECK_PMT(str != NULL)) { ++ if (end) ++ *end = NULL; ++ return 0; ++ } + + if(!locale) + locinfo = get_locinfo(); +diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c +index 1a3c598..83de762 100644 +--- a/dlls/msvcrt/tests/string.c ++++ b/dlls/msvcrt/tests/string.c +@@ -1694,7 +1694,7 @@ static void test__strtod(void) + d = strtod(NULL, &end); + ok(almost_equal(d, 0.0), "d = %lf\n", d); + ok(errno == EINVAL, "errno = %x\n", errno); +- todo_wine ok(!end, "incorrect end ptr %p\n", end); ++ ok(!end, "incorrect end ptr %p\n", end); + + errno = EBADF; + d = p__strtod_l(NULL, NULL, NULL); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/definition wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/msvcrt-atof_strtod/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/msvcrt-atof_strtod/definition 2015-06-28 17:08:11.000000000 +0000 @@ -1 +1 @@ -Fixes: [32550] MSVCRT crashes when NULL is passed as string to atof or strtod +Fixes: msvcrt.strtod should initialize *end with NULL on failure diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/0001-ntdll-Add-support-for-AT_ROUND_TO_PAGE-flag-in-NtMap.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/0001-ntdll-Add-support-for-AT_ROUND_TO_PAGE-flag-in-NtMap.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/0001-ntdll-Add-support-for-AT_ROUND_TO_PAGE-flag-in-NtMap.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/0001-ntdll-Add-support-for-AT_ROUND_TO_PAGE-flag-in-NtMap.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -From f595930f5c3bbfed975ddf38173573b56b20838f Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 5 Jun 2015 07:40:44 +0200 -Subject: ntdll: Add support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection. - ---- - dlls/kernel32/tests/virtual.c | 4 ---- - dlls/ntdll/virtual.c | 5 +++++ - 2 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c -index 3bcf697..cdd2466 100644 ---- a/dlls/kernel32/tests/virtual.c -+++ b/dlls/kernel32/tests/virtual.c -@@ -1138,12 +1138,10 @@ static void test_NtMapViewOfSection(void) - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); -- todo_wine - ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - ok( (char *)ptr2 == (char *)ptr + 0x1000, - "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2 ); - status = pNtUnmapViewOfSection( hProcess, ptr2 ); -- todo_wine - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - - /* the address is rounded down if not on a page boundary */ -@@ -1166,12 +1164,10 @@ static void test_NtMapViewOfSection(void) - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); -- todo_wine - ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - ok( (char *)ptr2 == (char *)ptr + 0x2000, - "expected address %p, got %p\n", (char *)ptr + 0x2000, ptr2 ); - status = pNtUnmapViewOfSection( hProcess, ptr2 ); -- todo_wine - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } - else -diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index 72309f6..91c420e 100644 ---- a/dlls/ntdll/virtual.c -+++ b/dlls/ntdll/virtual.c -@@ -2601,6 +2601,11 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p - - /* Check parameters */ - -+#ifndef _WIN64 -+ if (!is_wow64 && (alloc_type & AT_ROUND_TO_PAGE) && !zero_bits) -+ mask = page_mask; -+#endif -+ - if ((offset.u.LowPart & mask) || (*addr_ptr && ((UINT_PTR)*addr_ptr & mask))) - return STATUS_MAPPED_ALIGNMENT; - --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/definition wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-AT_ROUND_TO_PAGE/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -From bb710e8476f67b51076f25866657f97c7907c442 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Mon, 22 Dec 2014 20:32:29 -0700 -Subject: ntdll: Fix expected IOCTL_DVD_READ_STRUCTURE expected output size. - (rev 2) - ---- - dlls/ntdll/cdrom.c | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c -index 25a3fde..4407277 100644 ---- a/dlls/ntdll/cdrom.c -+++ b/dlls/ntdll/cdrom.c -@@ -2491,6 +2491,28 @@ static NTSTATUS DVD_GetRegion(int fd, PDVD_REGION region) - #endif - } - -+static DWORD DVD_ReadStructureSize(const DVD_READ_STRUCTURE *structure, DWORD size) -+{ -+ if (!structure || size != sizeof(DVD_READ_STRUCTURE)) -+ return 0; -+ -+ switch (structure->Format) -+ { -+ case DvdPhysicalDescriptor: -+ return sizeof(DVD_LAYER_DESCRIPTOR); -+ case DvdCopyrightDescriptor: -+ return sizeof(DVD_COPYRIGHT_DESCRIPTOR); -+ case DvdDiskKeyDescriptor: -+ return sizeof(DVD_DISK_KEY_DESCRIPTOR); -+ case DvdBCADescriptor: -+ return sizeof(DVD_BCA_DESCRIPTOR); -+ case DvdManufacturerDescriptor: -+ return sizeof(DVD_MANUFACTURER_DESCRIPTOR); -+ default: -+ return 0; -+ } -+} -+ - /****************************************************************** - * DVD_ReadStructure - * -@@ -3097,7 +3119,7 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice, - } - break; - case IOCTL_DVD_READ_STRUCTURE: -- sz = sizeof(DVD_LAYER_DESCRIPTOR); -+ sz = DVD_ReadStructureSize(lpInBuffer, nInBufferSize); - if (lpInBuffer == NULL || nInBufferSize != sizeof(DVD_READ_STRUCTURE)) status = STATUS_INVALID_PARAMETER; - else if (nOutBufferSize < sz || !lpOutBuffer) status = STATUS_BUFFER_TOO_SMALL; - else --- -2.3.5 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/definition wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-DVD_Read_Size/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [37767] IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-NtQuerySection/definition wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-NtQuerySection/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-NtQuerySection/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-NtQuerySection/definition 2015-06-28 17:08:11.000000000 +0000 @@ -1,2 +1 @@ Fixes: [37338] Support for NtQuerySection -Depends: ntdll-AT_ROUND_TO_PAGE diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch 2015-06-28 17:08:11.000000000 +0000 @@ -1,4 +1,4 @@ -From 367e9fd451bf7fb6f521c2410ce193857d8ab12c Mon Sep 17 00:00:00 2001 +From f620c720c8a3920dc189f1ef2147126ce1d469d7 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 26 Nov 2014 10:46:09 +0100 Subject: ntdll: Move code to update user shared data into a separate function. @@ -9,10 +9,10 @@ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 7e95969..729a8f6 100644 +index 270d7ff..173bb22 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1434,3 +1434,6 @@ +@@ -1439,3 +1439,6 @@ @ cdecl wine_nt_to_unix_file_name(ptr ptr long long) @ cdecl wine_unix_to_nt_file_name(ptr ptr) @ cdecl __wine_init_windows_dir(wstr wstr) @@ -20,10 +20,10 @@ +# User shared data +@ cdecl __wine_user_shared_data() diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index c8461b0..7d317ad 100644 +index 3696c8e..7411e48 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -202,6 +202,26 @@ static ULONG get_dyld_image_info_addr(void) +@@ -202,6 +202,26 @@ static ULONG64 get_dyld_image_info_addr(void) } #endif /* __APPLE__ */ @@ -33,7 +33,7 @@ + * + * Update user shared data and return the address of the structure. + */ -+void* CDECL __wine_user_shared_data(void) ++BYTE* CDECL __wine_user_shared_data(void) +{ + LARGE_INTEGER now; + NtQuerySystemTime( &now ); @@ -43,7 +43,7 @@ + user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; + user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; + user_shared_data->TickCountMultiplier = 1 << 24; -+ return user_shared_data; ++ return (BYTE *)user_shared_data; +} + + @@ -58,7 +58,7 @@ NTSTATUS status; struct ntdll_thread_data *thread_data; static struct debug_info debug_info; /* debug info for initial thread */ -@@ -317,15 +336,8 @@ HANDLE thread_init(void) +@@ -331,15 +350,8 @@ HANDLE thread_init(void) wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdError ); } @@ -77,5 +77,5 @@ NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 ); -- -2.1.3 +2.4.3 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0002-ntoskrnl-Update-USER_SHARED_DATA-before-accessing-me.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0002-ntoskrnl-Update-USER_SHARED_DATA-before-accessing-me.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0002-ntoskrnl-Update-USER_SHARED_DATA-before-accessing-me.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-User_Shared_Data/0002-ntoskrnl-Update-USER_SHARED_DATA-before-accessing-me.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,55 @@ +From af766674c13b728cd090803c41b0a304d7138bc3 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 19 Jun 2015 15:57:14 +0200 +Subject: ntoskrnl: Update USER_SHARED_DATA before accessing memory. + +--- + dlls/ntoskrnl.exe/instr.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c +index 1306d5f..a941428 100644 +--- a/dlls/ntoskrnl.exe/instr.c ++++ b/dlls/ntoskrnl.exe/instr.c +@@ -495,8 +495,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); + #define SIB_INDEX( sib, rex ) (((sib) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0) + #define SIB_BASE( sib, rex ) (((sib) & 7) | (((rex) & REX_B) ? 8 : 0)) + +-/* keep in sync with dlls/ntdll/thread.c:thread_init */ +-static const BYTE *wine_user_shared_data = (BYTE *)0x7ffe0000; ++extern BYTE* CDECL __wine_user_shared_data(void); + static const BYTE *user_shared_data = (BYTE *)0xfffff78000000000; + + static inline DWORD64 *get_int_reg( CONTEXT *context, int index ) +@@ -689,7 +688,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) + if (offset <= sizeof(KSHARED_USER_DATA) - data_size) + { + ULONGLONG temp = 0; +- memcpy( &temp, wine_user_shared_data + offset, data_size ); ++ memcpy( &temp, __wine_user_shared_data() + offset, data_size ); + store_reg_word( context, instr[2], (BYTE *)&temp, long_op, rex ); + context->Rip += prefixlen + len + 2; + return ExceptionContinueExecution; +@@ -711,8 +710,8 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) + { + switch (*instr) + { +- case 0x8a: store_reg_byte( context, instr[1], wine_user_shared_data + offset, rex ); break; +- case 0x8b: store_reg_word( context, instr[1], wine_user_shared_data + offset, long_op, rex ); break; ++ case 0x8a: store_reg_byte( context, instr[1], __wine_user_shared_data() + offset, rex ); break; ++ case 0x8b: store_reg_word( context, instr[1], __wine_user_shared_data() + offset, long_op, rex ); break; + } + context->Rip += prefixlen + len + 1; + return ExceptionContinueExecution; +@@ -730,7 +729,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) + + if (offset <= sizeof(KSHARED_USER_DATA) - data_size) + { +- memcpy( &context->Rax, wine_user_shared_data + offset, data_size ); ++ memcpy( &context->Rax, __wine_user_shared_data() + offset, data_size ); + context->Rip += prefixlen + len + 1; + return ExceptionContinueExecution; + } +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch 2015-06-28 17:08:11.000000000 +0000 @@ -1,21 +1,21 @@ -From 987e4f22d9f0647bf6d68b9be95e79ee578094dd Mon Sep 17 00:00:00 2001 +From 1cb822449427e537c098bb6b738bb983a0cf8ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 4 Oct 2014 02:53:22 +0200 Subject: ntdll: Setup a temporary signal handler during process startup to - handle page faults. + handle page faults. (v2) --- dlls/ntdll/ntdll_misc.h | 1 + - dlls/ntdll/signal_arm.c | 6 ++++++ - dlls/ntdll/signal_arm64.c | 6 ++++++ - dlls/ntdll/signal_i386.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/ntdll/signal_powerpc.c | 6 ++++++ - dlls/ntdll/signal_x86_64.c | 6 ++++++ + dlls/ntdll/signal_arm.c | 6 +++++ + dlls/ntdll/signal_arm64.c | 6 +++++ + dlls/ntdll/signal_i386.c | 53 +++++++++++++++++++++++++++++++++++++++++++++ + dlls/ntdll/signal_powerpc.c | 6 +++++ + dlls/ntdll/signal_x86_64.c | 6 +++++ dlls/ntdll/thread.c | 1 + - 7 files changed, 73 insertions(+) + 7 files changed, 79 insertions(+) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index afd1980..e344c31 100644 +index f5b5339..8d985d9 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -68,6 +68,7 @@ extern NTSTATUS signal_alloc_thread( TEB **teb ) DECLSPEC_HIDDEN; @@ -27,10 +27,10 @@ extern void debug_init(void) DECLSPEC_HIDDEN; extern HANDLE thread_init(void) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c -index e3ae7bd..1d79b3d 100644 +index 1f6da96..cfb9df1 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c -@@ -930,6 +930,12 @@ void signal_init_process(void) +@@ -974,6 +974,12 @@ void signal_init_process(void) exit(1); } @@ -44,10 +44,10 @@ /********************************************************************** * __wine_enter_vm86 (NTDLL.@) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c -index 8c8f7af..483bc85 100644 +index bd91d81..3bd705f 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c -@@ -791,6 +791,12 @@ void signal_init_process(void) +@@ -846,6 +846,12 @@ void signal_init_process(void) exit(1); } @@ -61,10 +61,10 @@ /********************************************************************** * __wine_enter_vm86 (NTDLL.@) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index de55c31..49222f4 100644 +index cf20483..7275233 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c -@@ -2035,6 +2035,30 @@ static void usr2_handler( int signal, siginfo_t *siginfo, void *sigcontext ) +@@ -2035,6 +2035,31 @@ static void usr2_handler( int signal, siginfo_t *siginfo, void *sigcontext ) /********************************************************************** @@ -87,6 +87,7 @@ + /* fall-through */ + default: + WINE_ERR( "Got unexpected trap %d during process initialization\n", get_trap_code(context) ); ++ abort_thread(1); + break; + } +} @@ -95,7 +96,7 @@ * segv_handler * * Handler for SIGSEGV and related errors. -@@ -2457,6 +2481,29 @@ void signal_init_process(void) +@@ -2466,6 +2491,34 @@ void signal_init_process(void) exit(1); } @@ -116,17 +117,22 @@ + sig_act.sa_restorer = rt_sigreturn; +#endif + sig_act.sa_sigaction = segv_handler_early; -+ if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) -+ { -+ perror("sigaction"); -+ exit(1); -+ } ++ if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error; ++ if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error; ++#ifdef SIGBUS ++ if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error; ++#endif ++ return; ++ ++error: ++ perror("sigaction"); ++ exit(1); +} #ifdef __HAVE_VM86 /********************************************************************** diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c -index 0fca342..5d1d756 100644 +index 886da86..d2e7819 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -1048,6 +1048,12 @@ void signal_init_process(void) @@ -143,10 +149,10 @@ /********************************************************************** * __wine_enter_vm86 (NTDLL.@) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index c71069d..07a0f6e 100644 +index 9b98894..60170cc 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c -@@ -2623,6 +2623,12 @@ void signal_init_process(void) +@@ -2826,6 +2826,12 @@ void signal_init_process(void) exit(1); } @@ -172,5 +178,5 @@ /* reserve space for shared user data */ -- -2.2.2 +2.4.3 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,316 +0,0 @@ -From 0f2b6adbefd88a3600e223774cb4aa4765815e78 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 10 Nov 2014 21:27:39 +0100 -Subject: ntoskrnl: Emulate memory access to KI_USER_SHARED_DATA on x86_64. - (try 2) - ---- - dlls/ntoskrnl.exe/instr.c | 273 ++++++++++++++++++++++++++++++++++++++++++- - dlls/ntoskrnl.exe/ntoskrnl.c | 2 +- - 2 files changed, 273 insertions(+), 2 deletions(-) - -diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c -index 05cd238..b6da767 100644 ---- a/dlls/ntoskrnl.exe/instr.c -+++ b/dlls/ntoskrnl.exe/instr.c -@@ -4,6 +4,7 @@ - * Copyright 1995 Alexandre Julliard - * Copyright 2005 Ivan Leo Puoti - * Copyright 2005 Laurent Pinchart -+ * Copyright 2014 Sebastian Lackner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -470,4 +471,274 @@ LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) - return EXCEPTION_CONTINUE_SEARCH; - } - --#endif /* __i386__ */ -+#elif defined(__x86_64__) /* __i386__ */ -+ -+#include -+ -+#include "windef.h" -+#include "winbase.h" -+#include "winternl.h" -+#define WIN32_NO_STATUS -+#include "ddk/wdm.h" -+#include "excpt.h" -+#include "wine/debug.h" -+#include "wine/exception.h" -+ -+WINE_DEFAULT_DEBUG_CHANNEL(int); -+ -+#define REX_B 1 -+#define REX_X 2 -+#define REX_R 4 -+#define REX_W 8 -+ -+#define REGMODRM_MOD( regmodrm, rex ) ((regmodrm) >> 6) -+#define REGMODRM_REG( regmodrm, rex ) (((regmodrm) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0) -+#define REGMODRM_RM( regmodrm, rex ) (((regmodrm) & 7) | (((rex) & REX_B) ? 8 : 0)) -+ -+#define SIB_SS( sib, rex ) ((sib) >> 6) -+#define SIB_INDEX( sib, rex ) (((sib) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0) -+#define SIB_BASE( sib, rex ) (((sib) & 7) | (((rex) & REX_B) ? 8 : 0)) -+ -+#define KI_USER_SHARED_DATA 0xfffff78000000000 -+extern void* CDECL __wine_user_shared_data(void); -+ -+static inline DWORD64 *get_int_reg( CONTEXT *context, int index ) -+{ -+ return &context->Rax + index; /* index should be in range 0 .. 15 */ -+} -+ -+static inline int get_op_size( int long_op, int rex ) -+{ -+ if (rex & REX_W) -+ return sizeof(DWORD64); -+ else if (long_op) -+ return sizeof(DWORD); -+ else -+ return sizeof(WORD); -+} -+ -+/* store an operand into a register */ -+static void store_reg_word( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int long_op, int rex ) -+{ -+ int index = REGMODRM_REG( regmodrm, rex ); -+ BYTE *reg = (BYTE *)get_int_reg( context, index ); -+ memcpy( reg, addr, get_op_size( long_op, rex ) ); -+} -+ -+/* store an operand into a byte register */ -+static void store_reg_byte( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int rex ) -+{ -+ int index = REGMODRM_REG( regmodrm, rex ); -+ BYTE *reg = (BYTE *)get_int_reg( context, index ); -+ if (!rex && index >= 4 && index < 8) reg -= (4 * sizeof(DWORD64) - 1); /* special case: ah, ch, dh, bh */ -+ *reg = *addr; -+} -+ -+/*********************************************************************** -+ * INSTR_GetOperandAddr -+ * -+ * Return the address of an instruction operand (from the mod/rm byte). -+ */ -+static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr, -+ int long_addr, int rex, int segprefix, int *len ) -+{ -+ int mod, rm, ss = 0, off, have_sib = 0; -+ DWORD64 base = 0, index = 0; -+ -+#define GET_VAL( val, type ) \ -+ { *val = *(type *)instr; instr += sizeof(type); *len += sizeof(type); } -+ -+ *len = 0; -+ GET_VAL( &mod, BYTE ); -+ rm = REGMODRM_RM( mod, rex ); -+ mod = REGMODRM_MOD( mod, rex ); -+ -+ if (mod == 3) -+ return (BYTE *)get_int_reg( context, rm ); -+ -+ if ((rm & 7) == 4) -+ { -+ BYTE sib; -+ int id; -+ -+ GET_VAL( &sib, BYTE ); -+ rm = SIB_BASE( sib, rex ); -+ id = SIB_INDEX( sib, rex ); -+ ss = SIB_SS( sib, rex ); -+ -+ index = (id != 4) ? *get_int_reg( context, id ) : 0; -+ if (!long_addr) index &= 0xffffffff; -+ have_sib = 1; -+ } -+ -+ base = *get_int_reg( context, rm ); -+ if (!long_addr) base &= 0xffffffff; -+ -+ switch (mod) -+ { -+ case 0: -+ if (rm == 5) /* special case */ -+ { -+ base = have_sib ? 0 : context->Rip; -+ if (!long_addr) base &= 0xffffffff; -+ GET_VAL( &off, DWORD ); -+ base += (signed long)off; -+ } -+ break; -+ -+ case 1: /* 8-bit disp */ -+ GET_VAL( &off, BYTE ); -+ base += (signed char)off; -+ break; -+ -+ case 2: /* 32-bit disp */ -+ GET_VAL( &off, DWORD ); -+ base += (signed long)off; -+ break; -+ } -+ -+ /* FIXME: we assume that all segments have a base of 0 */ -+ return (BYTE *)(base + (index << ss)); -+#undef GET_VAL -+} -+ -+ -+/*********************************************************************** -+ * emulate_instruction -+ * -+ * Emulate a privileged instruction. -+ * Returns exception continuation status. -+ */ -+static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) -+{ -+ int prefix, segprefix, prefixlen, len, long_op, long_addr, rex; -+ BYTE *instr; -+ -+ long_op = long_addr = 1; -+ instr = (BYTE *)context->Rip; -+ if (!instr) return ExceptionContinueSearch; -+ -+ /* First handle any possible prefix */ -+ -+ segprefix = -1; /* no seg prefix */ -+ rex = 0; /* no rex prefix */ -+ prefix = 1; -+ prefixlen = 0; -+ while(prefix) -+ { -+ switch(*instr) -+ { -+ case 0x2e: -+ segprefix = context->SegCs; -+ break; -+ case 0x36: -+ segprefix = context->SegSs; -+ break; -+ case 0x3e: -+ segprefix = context->SegDs; -+ break; -+ case 0x26: -+ segprefix = context->SegEs; -+ break; -+ case 0x64: -+ segprefix = context->SegFs; -+ break; -+ case 0x65: -+ segprefix = context->SegGs; -+ break; -+ case 0x66: -+ long_op = !long_op; /* opcode size prefix */ -+ break; -+ case 0x67: -+ long_addr = !long_addr; /* addr size prefix */ -+ break; -+ case 0xf0: /* lock */ -+ break; -+ case 0xf2: /* repne */ -+ break; -+ case 0xf3: /* repe */ -+ break; -+ default: -+ prefix = 0; /* no more prefixes */ -+ break; -+ } -+ if (*instr >= 0x40 && *instr < 0x50) /* rex */ -+ { -+ rex = *instr; -+ prefix = TRUE; -+ } -+ if (prefix) -+ { -+ instr++; -+ prefixlen++; -+ } -+ } -+ -+ /* Now look at the actual instruction */ -+ -+ switch(*instr) -+ { -+ case 0x8a: /* mov Eb, Gb */ -+ case 0x8b: /* mov Ev, Gv */ -+ { -+ BYTE *data = INSTR_GetOperandAddr( context, instr + 1, long_addr, -+ rex, segprefix, &len ); -+ unsigned int data_size = (*instr == 0x8b) ? get_op_size( long_op, rex ) : 1; -+ unsigned int offset = data - (BYTE *)KI_USER_SHARED_DATA; -+ -+ if (offset <= sizeof(KSHARED_USER_DATA) - data_size) -+ { -+ BYTE *user_shared_data = __wine_user_shared_data(); -+ switch (*instr) -+ { -+ case 0x8a: store_reg_byte( context, instr[1], user_shared_data + offset, rex ); break; -+ case 0x8b: store_reg_word( context, instr[1], user_shared_data + offset, long_op, rex ); break; -+ } -+ context->Rip += prefixlen + len + 1; -+ return ExceptionContinueExecution; -+ } -+ break; /* Unable to emulate it */ -+ } -+ -+ case 0xa0: /* mov Ob, AL */ -+ case 0xa1: /* mov Ovqp, rAX */ -+ { -+ BYTE *data = (BYTE *)(long_addr ? *(DWORD64 *)(instr + 1) : *(DWORD *)(instr + 1)); -+ unsigned int data_size = (*instr == 0xa1) ? get_op_size( long_op, rex ) : 1; -+ unsigned int offset = data - (BYTE *)KI_USER_SHARED_DATA; -+ len = long_addr ? sizeof(DWORD64) : sizeof(DWORD); -+ -+ if (offset <= sizeof(KSHARED_USER_DATA) - data_size) -+ { -+ BYTE *user_shared_data = __wine_user_shared_data(); -+ memcpy( &context->Rax, user_shared_data + offset, data_size ); -+ context->Rip += prefixlen + len + 1; -+ return ExceptionContinueExecution; -+ } -+ break; /* Unable to emulate it */ -+ } -+ } -+ return ExceptionContinueSearch; /* Unable to emulate it */ -+} -+ -+ -+/*********************************************************************** -+ * vectored_handler -+ * -+ * Vectored exception handler used to emulate protected instructions -+ * from 64-bit code. -+ */ -+LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) -+{ -+ EXCEPTION_RECORD *record = ptrs->ExceptionRecord; -+ CONTEXT *context = ptrs->ContextRecord; -+ -+ if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) -+ { -+ if (emulate_instruction( record, context ) == ExceptionContinueExecution) -+ return EXCEPTION_CONTINUE_EXECUTION; -+ } -+ return EXCEPTION_CONTINUE_SEARCH; -+} -+ -+#endif /* __x86_64__ */ -\ No newline at end of file -diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c -index a31b186..1d87110 100644 ---- a/dlls/ntoskrnl.exe/ntoskrnl.c -+++ b/dlls/ntoskrnl.exe/ntoskrnl.c -@@ -1880,7 +1880,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( inst ); --#ifdef __i386__ -+#if defined(__i386__) || defined(__x86_64__) - handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); - #endif - KeQueryTickCount( &count ); /* initialize the global KeTickCount */ --- -2.1.3 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -From c5d80d20b8e3ba1eb46d18cef337a1d6d1b0ed10 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 10 Nov 2014 21:42:53 +0100 -Subject: ntoskrnl: Add TRACEs for instruction emulator on x86_64 to simplify - debugging. - ---- - dlls/ntoskrnl.exe/instr.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c -index 51b7bec..16d7afd 100644 ---- a/dlls/ntoskrnl.exe/instr.c -+++ b/dlls/ntoskrnl.exe/instr.c -@@ -739,8 +739,28 @@ LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) - - if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) - { -+ DWORD64 rip = context->Rip; - if (emulate_instruction( record, context ) == ExceptionContinueExecution) -+ { -+ -+ if (context->Rip - rip <= 32) -+ { -+ TRACE("emulated opcodes:"); -+ for (; rip < context->Rip; rip++) TRACE(" %02x", *(BYTE *)rip); -+ TRACE("\n"); -+ } -+ TRACE( "next instruction rip=%lx\n", context->Rip ); -+ TRACE( " rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", -+ context->Rax, context->Rbx, context->Rcx, context->Rdx ); -+ TRACE( " rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", -+ context->Rsi, context->Rdi, context->Rbp, context->Rsp ); -+ TRACE( " r8=%016lx r9=%016lx r10=%016lx r11=%016lx\n", -+ context->R8, context->R9, context->R10, context->R11 ); -+ TRACE( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", -+ context->R12, context->R13, context->R14, context->R15 ); -+ - return EXCEPTION_CONTINUE_EXECUTION; -+ } - } - return EXCEPTION_CONTINUE_SEARCH; - } --- -2.1.3 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/definition wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Emulator/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Emulator/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -Fixes: [33849] Emulate access to KI_USER_SHARED_DATA kernel page on x86_64 -Depends: ntdll-User_Shared_Data -Category: stable diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,35 @@ +From 61970080c0dc917618c2884ceeeb1ef664705292 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Sun, 14 Jun 2015 18:58:20 -0600 +Subject: ntoskrnl.exe: Improve IoGetDeviceObjectPointer stub to appease + SecuROM 5.x. + +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index 2051939..57352e4 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -884,10 +884,16 @@ NTSTATUS WINAPI IoGetDeviceInterfaces( const GUID *InterfaceClassGuid, + */ + NTSTATUS WINAPI IoGetDeviceObjectPointer( UNICODE_STRING *name, ACCESS_MASK access, PFILE_OBJECT *file, PDEVICE_OBJECT *device ) + { ++ static DEVICE_OBJECT stub_device; ++ static DRIVER_OBJECT stub_driver; ++ + FIXME( "stub: %s %x %p %p\n", debugstr_us(name), access, file, device ); + ++ stub_device.StackSize = 0x80; /* minimum value to appease SecuROM 5.x */ ++ stub_device.DriverObject = &stub_driver; ++ + *file = NULL; +- *device = NULL; ++ *device = &stub_device; + + return STATUS_SUCCESS; + } +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Stubs/definition wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Stubs/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/ntoskrnl-Stubs/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/ntoskrnl-Stubs/definition 2015-06-28 17:08:11.000000000 +0000 @@ -11,3 +11,4 @@ Fixes: Implement ntoskrnl.KeInitializeMutex Fixes: [38103] Process Hacker 2.x needs ntoskrnl.ProbeForRead Fixes: Add stub for ntoskrnl.PsRemoveLoadImageNotifyRoutine +Fixes: [21448] SecuROM 5.x media validation fails diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch wine-staging-1.7.46~ubuntu14.10.1/patches/nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,47 @@ +From d27994fd0542d6f1f7dd0acfa04b75c29a99b8a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Jun 2015 19:45:44 +0200 +Subject: nvcuda: Search for dylib library on Mac OS X. + +--- + dlls/nvcuda/nvcuda.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/dlls/nvcuda/nvcuda.c b/dlls/nvcuda/nvcuda.c +index ec32da2..67376c7 100644 +--- a/dlls/nvcuda/nvcuda.c ++++ b/dlls/nvcuda/nvcuda.c +@@ -412,11 +412,28 @@ static void *cuda_handle = NULL; + + static BOOL load_functions(void) + { +- cuda_handle = wine_dlopen("libcuda.so", RTLD_NOW, NULL, 0); ++ static const char *libname[] = ++ { ++ #ifdef __APPLE__ ++ "libcuda.dylib", ++ "libcuda.6.0.dylib", ++ "/usr/local/cuda/lib/libcuda.dylib", ++ "/usr/local/cuda/lib/libcuda.6.0.dylib", ++ #else ++ "libcuda.so" ++ #endif ++ }; ++ int i; ++ ++ for (i = 0; i < sizeof(libname)/sizeof(libname[0]); i++) ++ { ++ cuda_handle = wine_dlopen(libname[i], RTLD_NOW, NULL, 0); ++ if (cuda_handle) break; ++ } + + if (!cuda_handle) + { +- FIXME("Wine cannot find the libcuda.so library, CUDA support disabled.\n"); ++ FIXME("Wine cannot find the libcuda library, CUDA support is disabled.\n"); + return FALSE; + } + +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/patchinstall.sh wine-staging-1.7.46~ubuntu14.10.1/patches/patchinstall.sh --- wine-staging-1.7.45~ubuntu14.10.1/patches/patchinstall.sh 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/patchinstall.sh 2015-06-28 17:08:11.000000000 +0000 @@ -51,11 +51,11 @@ # Show version information version() { - echo "Wine Staging 1.7.45" + echo "Wine Staging 1.7.46" echo "Copyright (C) 2014-2015 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" - echo " commit cde46665fa8503e90c9a2fab1898cdb4d22f667b" + echo " commit ae6efa469bfaecade30e160d195d607bdcdcc6ae" echo "" } @@ -80,13 +80,12 @@ enable_Exagear="$1" enable_Pipelight="$1" enable_Staging="$1" - enable_advapi32_GetWindowsAccountDomainSid="$1" enable_advapi32_LsaLookupSids="$1" enable_browseui_Progress_Dialog="$1" enable_combase_String="$1" enable_comctl32_LoadIconMetric="$1" enable_configure_Absolute_RPATH="$1" - enable_configure_libunwind="$1" + enable_configure_Crosscompiling="$1" enable_crypt32_CMS_Certificates="$1" enable_d3d11_D3D11CreateDeviceAndSwapChain="$1" enable_d3d9_DesktopWindow="$1" @@ -117,7 +116,6 @@ enable_dsound_Fast_Mixer="$1" enable_dxgi_GetDesc="$1" enable_dxva2_Video_Decoder="$1" - enable_fltlib_FilterLoad="$1" enable_fltmgr_Stub_SYS="$1" enable_fonts_Missing_Fonts="$1" enable_gdi32_Default_Palette="$1" @@ -125,7 +123,6 @@ enable_gdi32_MultiMonitor="$1" enable_gdiplus_GIF_Encoder="$1" enable_gdiplus_GdipCreateEffect="$1" - enable_gdiplus_GdipCreateRegionRgnData="$1" enable_imagehlp_BindImageEx="$1" enable_imagehlp_ImageLoad="$1" enable_inetcpl_Default_Home="$1" @@ -136,12 +133,10 @@ enable_kernel32_GetFinalPathNameByHandle="$1" enable_kernel32_GetLogicalProcessorInformationEx="$1" enable_kernel32_GetNumaProcessorNode="$1" - enable_kernel32_GetVolumePathName="$1" enable_kernel32_InsertMode="$1" enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" enable_kernel32_Profile="$1" - enable_kernel32_SetFileCompletionNotificationMode="$1" enable_kernel32_SetFileInformationByHandle="$1" enable_kernel32_TimezoneInformation_Registry="$1" enable_kernel32_VerifyVersionInfo="$1" @@ -158,11 +153,9 @@ enable_msvfw32_Image_Size="$1" enable_ntdll_APC_Performance="$1" enable_ntdll_APC_Start_Process="$1" - enable_ntdll_AT_ROUND_TO_PAGE="$1" enable_ntdll_Activation_Context="$1" enable_ntdll_CLI_Images="$1" enable_ntdll_DOS_Attributes="$1" - enable_ntdll_DVD_Read_Size="$1" enable_ntdll_DeviceType_Systemroot="$1" enable_ntdll_DllRedirects="$1" enable_ntdll_Exception="$1" @@ -189,7 +182,6 @@ enable_ntdll_WinSqm="$1" enable_ntdll_WriteWatches="$1" enable_ntoskrnl_DriverTest="$1" - enable_ntoskrnl_Emulator="$1" enable_ntoskrnl_Stubs="$1" enable_nvapi_Stub_DLL="$1" enable_nvcuda_CUDA_Support="$1" @@ -197,9 +189,9 @@ enable_nvencodeapi_Video_Encoder="$1" enable_opengl32_Revert_Disable_Ext="$1" enable_quartz_MediaSeeking_Positions="$1" + enable_rasapi32_RasEnumDevicesA="$1" enable_regedit_Reg_Parser="$1" enable_riched20_IText_Interface="$1" - enable_riched20_Link_Notification="$1" enable_rpcrt4_Pipe_Transport="$1" enable_rpcrt4_Use_After_Free="$1" enable_secur32_ANSI_NTLM_Credentials="$1" @@ -225,6 +217,7 @@ enable_setupapi_SetupPromptForDisk="$1" enable_shdocvw_ParseURLFromOutsideSource_Tests="$1" enable_shell32_Default_Path="$1" + enable_shell32_File_Property_Dialog="$1" enable_shell32_Icons="$1" enable_shell32_Placeholder_Icons="$1" enable_shell32_Progress_Dialog="$1" @@ -240,6 +233,7 @@ enable_user32_Dialog_Paint_Event="$1" enable_user32_DrawTextExW="$1" enable_user32_GetSystemMetrics="$1" + enable_user32_Invalidate_Key_State="$1" enable_user32_Mouse_Message_Hwnd="$1" enable_user32_Painting="$1" enable_user32_ScrollWindowEx="$1" @@ -279,7 +273,6 @@ enable_winex11_Window_Style="$1" enable_winex11_XEMBED="$1" enable_winex11_wglShareLists="$1" - enable_wininet_Cache_Long_URLs="$1" enable_wininet_Cleanup="$1" enable_wininet_ParseX509EncodedCertificateForListBoxEntry="$1" enable_winmm_Delay_Import_Depends="$1" @@ -320,9 +313,6 @@ Staging) enable_Staging="$2" ;; - advapi32-GetWindowsAccountDomainSid) - enable_advapi32_GetWindowsAccountDomainSid="$2" - ;; advapi32-LsaLookupSids) enable_advapi32_LsaLookupSids="$2" ;; @@ -341,8 +331,8 @@ configure-Absolute_RPATH) enable_configure_Absolute_RPATH="$2" ;; - configure-libunwind) - enable_configure_libunwind="$2" + configure-Crosscompiling) + enable_configure_Crosscompiling="$2" ;; crypt32-CMS_Certificates) enable_crypt32_CMS_Certificates="$2" @@ -434,9 +424,6 @@ dxva2-Video_Decoder) enable_dxva2_Video_Decoder="$2" ;; - fltlib-FilterLoad) - enable_fltlib_FilterLoad="$2" - ;; fltmgr-Stub_SYS) enable_fltmgr_Stub_SYS="$2" ;; @@ -458,9 +445,6 @@ gdiplus-GdipCreateEffect) enable_gdiplus_GdipCreateEffect="$2" ;; - gdiplus-GdipCreateRegionRgnData) - enable_gdiplus_GdipCreateRegionRgnData="$2" - ;; imagehlp-BindImageEx) enable_imagehlp_BindImageEx="$2" ;; @@ -491,9 +475,6 @@ kernel32-GetNumaProcessorNode) enable_kernel32_GetNumaProcessorNode="$2" ;; - kernel32-GetVolumePathName) - enable_kernel32_GetVolumePathName="$2" - ;; kernel32-InsertMode) enable_kernel32_InsertMode="$2" ;; @@ -506,9 +487,6 @@ kernel32-Profile) enable_kernel32_Profile="$2" ;; - kernel32-SetFileCompletionNotificationMode) - enable_kernel32_SetFileCompletionNotificationMode="$2" - ;; kernel32-SetFileInformationByHandle) enable_kernel32_SetFileInformationByHandle="$2" ;; @@ -557,9 +535,6 @@ ntdll-APC_Start_Process) enable_ntdll_APC_Start_Process="$2" ;; - ntdll-AT_ROUND_TO_PAGE) - enable_ntdll_AT_ROUND_TO_PAGE="$2" - ;; ntdll-Activation_Context) enable_ntdll_Activation_Context="$2" ;; @@ -569,9 +544,6 @@ ntdll-DOS_Attributes) enable_ntdll_DOS_Attributes="$2" ;; - ntdll-DVD_Read_Size) - enable_ntdll_DVD_Read_Size="$2" - ;; ntdll-DeviceType_Systemroot) enable_ntdll_DeviceType_Systemroot="$2" ;; @@ -650,9 +622,6 @@ ntoskrnl-DriverTest) enable_ntoskrnl_DriverTest="$2" ;; - ntoskrnl-Emulator) - enable_ntoskrnl_Emulator="$2" - ;; ntoskrnl-Stubs) enable_ntoskrnl_Stubs="$2" ;; @@ -674,15 +643,15 @@ quartz-MediaSeeking_Positions) enable_quartz_MediaSeeking_Positions="$2" ;; + rasapi32-RasEnumDevicesA) + enable_rasapi32_RasEnumDevicesA="$2" + ;; regedit-Reg_Parser) enable_regedit_Reg_Parser="$2" ;; riched20-IText_Interface) enable_riched20_IText_Interface="$2" ;; - riched20-Link_Notification) - enable_riched20_Link_Notification="$2" - ;; rpcrt4-Pipe_Transport) enable_rpcrt4_Pipe_Transport="$2" ;; @@ -758,6 +727,9 @@ shell32-Default_Path) enable_shell32_Default_Path="$2" ;; + shell32-File_Property_Dialog) + enable_shell32_File_Property_Dialog="$2" + ;; shell32-Icons) enable_shell32_Icons="$2" ;; @@ -803,6 +775,9 @@ user32-GetSystemMetrics) enable_user32_GetSystemMetrics="$2" ;; + user32-Invalidate_Key_State) + enable_user32_Invalidate_Key_State="$2" + ;; user32-Mouse_Message_Hwnd) enable_user32_Mouse_Message_Hwnd="$2" ;; @@ -920,9 +895,6 @@ winex11-wglShareLists) enable_winex11_wglShareLists="$2" ;; - wininet-Cache_Long_URLs) - enable_wininet_Cache_Long_URLs="$2" - ;; wininet-Cleanup) enable_wininet_Cleanup="$2" ;; @@ -1376,9 +1348,6 @@ if test "$enable_dxgi_GetDesc" -gt 1; then abort "Patchset dxgi-GetDesc disabled, but category-stable depends on that." fi - if test "$enable_fltlib_FilterLoad" -gt 1; then - abort "Patchset fltlib-FilterLoad disabled, but category-stable depends on that." - fi if test "$enable_fonts_Missing_Fonts" -gt 1; then abort "Patchset fonts-Missing_Fonts disabled, but category-stable depends on that." fi @@ -1460,9 +1429,6 @@ if test "$enable_ntdll_WriteWatches" -gt 1; then abort "Patchset ntdll-WriteWatches disabled, but category-stable depends on that." fi - if test "$enable_ntoskrnl_Emulator" -gt 1; then - abort "Patchset ntoskrnl-Emulator disabled, but category-stable depends on that." - fi if test "$enable_opengl32_Revert_Disable_Ext" -gt 1; then abort "Patchset opengl32-Revert_Disable_Ext disabled, but category-stable depends on that." fi @@ -1583,7 +1549,6 @@ enable_ddraw_EnumSurfaces=1 enable_dinput_Events=1 enable_dxgi_GetDesc=1 - enable_fltlib_FilterLoad=1 enable_fonts_Missing_Fonts=1 enable_gdi32_MaxPixelFormats=1 enable_gdiplus_GdipCreateEffect=1 @@ -1611,7 +1576,6 @@ enable_ntdll_Threading=1 enable_ntdll_User_Shared_Data=1 enable_ntdll_WriteWatches=1 - enable_ntoskrnl_Emulator=1 enable_opengl32_Revert_Disable_Ext=1 enable_server_Address_List_Change=1 enable_server_ClipCursor=1 @@ -1774,13 +1738,6 @@ enable_nvcuda_CUDA_Support=1 fi -if test "$enable_ntoskrnl_Emulator" -eq 1; then - if test "$enable_ntdll_User_Shared_Data" -gt 1; then - abort "Patchset ntdll-User_Shared_Data disabled, but ntoskrnl-Emulator depends on that." - fi - enable_ntdll_User_Shared_Data=1 -fi - if test "$enable_ntdll_WriteWatches" -eq 1; then if test "$enable_kernel32_Named_Pipe" -gt 1; then abort "Patchset kernel32-Named_Pipe disabled, but ntdll-WriteWatches depends on that." @@ -1799,13 +1756,6 @@ enable_ntdll_LZNT1_Compression=1 fi -if test "$enable_ntdll_NtQuerySection" -eq 1; then - if test "$enable_ntdll_AT_ROUND_TO_PAGE" -gt 1; then - abort "Patchset ntdll-AT_ROUND_TO_PAGE disabled, but ntdll-NtQuerySection depends on that." - fi - enable_ntdll_AT_ROUND_TO_PAGE=1 -fi - if test "$enable_ntdll_Junction_Points" -eq 1; then if test "$enable_ntdll_Fix_Free" -gt 1; then abort "Patchset ntdll-Fix_Free disabled, but ntdll-Junction_Points depends on that." @@ -1984,7 +1934,7 @@ ( echo '+ { "Sebastian Lackner", "ntdll: Trigger write watches before passing userdata pointer to wait_reply.", 1 },'; echo '+ { "Sebastian Lackner", "advapi: Trigger write watches before passing userdata pointer to read syscall.", 1 },'; - echo '+ { "Michael Müller", "ntdll: Setup a temporary signal handler during process startup to handle page faults.", 1 },'; + echo '+ { "Michael Müller", "ntdll: Setup a temporary signal handler during process startup to handle page faults.", 2 },'; echo '+ { "Michael Müller", "ntdll: Properly handle PAGE_WRITECOPY protection.", 5 },'; echo '+ { "Michael Müller", "ntdll: Only enable true WRITECOPY protection when a special environment variable is set.", 1 },'; ) >> "$patchlist" @@ -2042,29 +1992,14 @@ patch_apply Staging/0003-winelib-Append-Staging-at-the-end-of-the-version-s.patch patch_apply Staging/0004-loader-Add-commandline-option-patches-to-show-the-pa.patch patch_apply Staging/0005-loader-Add-commandline-option-check-libs.patch + patch_apply Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch ( echo '+ { "Sebastian Lackner", "kernel32: Add winediag message to show warning, that this isn'\''t vanilla wine.", 1 },'; echo '+ { "Sebastian Lackner", "winedbg: Change bug reporting URL to Wine Staging.", 1 },'; echo '+ { "Sebastian Lackner", "winelib: Append '\''(Staging)'\'' at the end of the version string.", 1 },'; echo '+ { "Sebastian Lackner", "loader: Add commandline option --patches to show the patch list.", 1 },'; echo '+ { "Michael Müller", "loader: Add commandline option --check-libs.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset advapi32-GetWindowsAccountDomainSid -# | -# | This patchset fixes the following Wine bugs: -# | * [#38624] Implement advapi32.GetWindowsAccountDomainSid -# | -# | Modified files: -# | * dlls/advapi32/advapi32.spec, dlls/advapi32/security.c, dlls/advapi32/tests/security.c, dlls/api-ms-win-security- -# | base-l1-1-0/api-ms-win-security-base-l1-1-0.spec, dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security- -# | base-l1-2-0.spec -# | -if test "$enable_advapi32_GetWindowsAccountDomainSid" -eq 1; then - patch_apply advapi32-GetWindowsAccountDomainSid/0001-advapi32-Implement-GetWindowsAccountDomainSid.patch - ( - echo '+ { "Michael Müller", "advapi32: Implement GetWindowsAccountDomainSid.", 1 },'; + echo '+ { "Michael Müller", "loader: Print library paths for --check-libs on Mac OS X.", 1 },'; ) >> "$patchlist" fi @@ -2188,18 +2123,17 @@ ) >> "$patchlist" fi -# Patchset configure-libunwind -# | -# | This patchset fixes the following Wine bugs: -# | * [#38713] Properly check existence of libunwind before linking against it +# Patchset configure-Crosscompiling # | # | Modified files: -# | * configure.ac, dlls/ntdll/Makefile.in, dlls/ntdll/signal_x86_64.c +# | * aclocal.m4, configure.ac # | -if test "$enable_configure_libunwind" -eq 1; then - patch_apply configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch +if test "$enable_configure_Crosscompiling" -eq 1; then + patch_apply configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch + patch_apply configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch ( - echo '+ { "Sebastian Lackner", "configure: Add libunwind configure flag.", 1 },'; + echo '+ { "Michael Müller", "configure.ac: Search for otool using AC_CHECK_TOOL.", 1 },'; + echo '+ { "Michael Müller", "configure.ac: Remove check for strength-reduce bug.", 1 },'; ) >> "$patchlist" fi @@ -2340,10 +2274,12 @@ patch_apply wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch patch_apply wined3d-DXTn/0002-wined3d-Improve-DXTn-support-and-export-conversion-f.patch patch_apply wined3d-DXTn/0003-wined3d-add-DXT1-to-B4G4R4A4-DXT1-to-B5G5R5A1-and-DX.patch + patch_apply wined3d-DXTn/0004-wined3d-Load-dxtn-dylib-library-on-Mac-OS-X.patch ( echo '+ { "Michael Müller", "wined3d: Add support for DXTn software decoding through libtxc_dxtn.", 3 },'; echo '+ { "Christian Costa", "wined3d: Improve DXTn support and export conversion functions for d3dx9_36.", 1 },'; echo '+ { "Michael Müller", "wined3d: add DXT1 to B4G4R4A4, DXT1 to B5G5R5A1 and DXT3 to B4G4R4A4 conversion.", 1 },'; + echo '+ { "Michael Müller", "wined3d: Load dxtn dylib library on Mac OS X.", 1 },'; ) >> "$patchlist" fi @@ -2351,7 +2287,6 @@ # | # | This patchset fixes the following Wine bugs: # | * [#33768] Fix texture corruption in CSI: Fatal Conspiracy -# | * [#19231] Fix crash of Trine Demo on start # | * [#37391] Exception during start of fr-043 caused by missing DXTn support # | * [#34692] Fix wrong colors in Wolfenstein (2009) # | * [#24983] Fix crash in Space Rangers2 caused by missing DXTn support @@ -2749,21 +2684,6 @@ ) >> "$patchlist" fi -# Patchset fltlib-FilterLoad -# | -# | This patchset fixes the following Wine bugs: -# | * [#38435] Add stub for fltlib.FilterLoad -# | -# | Modified files: -# | * dlls/fltlib/fltlib.c, dlls/fltlib/fltlib.spec -# | -if test "$enable_fltlib_FilterLoad" -eq 1; then - patch_apply fltlib-FilterLoad/0001-fltlib-Add-stub-for-FilterLoad.patch - ( - echo '+ { "Michael Müller", "fltlib: Add stub for FilterLoad.", 1 },'; - ) >> "$patchlist" -fi - # Patchset fltmgr-Stub_SYS # | # | This patchset fixes the following Wine bugs: @@ -2879,21 +2799,6 @@ ) >> "$patchlist" fi -# Patchset gdiplus-GdipCreateRegionRgnData -# | -# | This patchset fixes the following Wine bugs: -# | * [#34843] Support for GdipCreateRegionRgnData -# | -# | Modified files: -# | * dlls/gdiplus/region.c, dlls/gdiplus/tests/region.c -# | -if test "$enable_gdiplus_GdipCreateRegionRgnData" -eq 1; then - patch_apply gdiplus-GdipCreateRegionRgnData/0001-gdiplus-Implement-GdipCreateRegionRgnData.-Take-3.patch - ( - echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipCreateRegionRgnData.", 3 },'; - ) >> "$patchlist" -fi - # Patchset imagehlp-BindImageEx # | # | This patchset fixes the following Wine bugs: @@ -2977,18 +2882,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-SetFileInformationByHandle -# | -# | Modified files: -# | * include/winbase.h -# | -if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then - patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch - ( - echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },'; - ) >> "$patchlist" -fi - # Patchset server-File_Permissions # | # | Modified files: @@ -3052,6 +2945,18 @@ ) >> "$patchlist" fi +# Patchset kernel32-SetFileInformationByHandle +# | +# | Modified files: +# | * include/winbase.h +# | +if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then + patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch + ( + echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },'; + ) >> "$patchlist" +fi + # Patchset kernel32-CopyFileEx # | # | This patchset fixes the following Wine bugs: @@ -3102,33 +3007,14 @@ # | * [#38660] Add implementation for kernel32.GetNumaProcessorNode # | # | Modified files: -# | * dlls/kernel32/cpu.c, dlls/kernel32/kernel32.spec, dlls/kernel32/tests/Makefile.in, dlls/kernel32/tests/cpu.c, -# | include/winbase.h +# | * dlls/kernel32/cpu.c, dlls/kernel32/kernel32.spec, dlls/kernel32/tests/process.c, include/winbase.h # | if test "$enable_kernel32_GetNumaProcessorNode" -eq 1; then - patch_apply kernel32-GetNumaProcessorNode/0001-kernel32-Implement-GetNumaProcessorNode.patch - patch_apply kernel32-GetNumaProcessorNode/0002-kernel32-tests-Add-tests-for-GetNumaProcessorNode.patch + patch_apply kernel32-GetNumaProcessorNode/0001-kernel32-tests-Add-tests-for-GetNumaProcessorNode.-v.patch + patch_apply kernel32-GetNumaProcessorNode/0002-kernel32-Implement-GetNumaProcessorNode.-v2.patch ( - echo '+ { "Michael Müller", "kernel32: Implement GetNumaProcessorNode.", 1 },'; - echo '+ { "Michael Müller", "kernel32/tests: Add tests for GetNumaProcessorNode.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset kernel32-GetVolumePathName -# | -# | Modified files: -# | * dlls/kernel32/tests/volume.c, dlls/kernel32/volume.c -# | -if test "$enable_kernel32_GetVolumePathName" -eq 1; then - patch_apply kernel32-GetVolumePathName/0001-kernel32-Implement-GetVolumePathName.patch - patch_apply kernel32-GetVolumePathName/0002-kernel32-Convert-GetVolumePathName-tests-into-a-list.patch - patch_apply kernel32-GetVolumePathName/0003-kernel32-Add-a-bunch-more-GetVolumePathName-tests.patch - patch_apply kernel32-GetVolumePathName/0004-kernel32-tests-Add-a-lot-of-picky-GetVolumePathName-.patch - ( - echo '+ { "Erich E. Hoover", "kernel32: Implement GetVolumePathName.", 1 },'; - echo '+ { "Erich E. Hoover", "kernel32: Convert GetVolumePathName tests into a list.", 1 },'; - echo '+ { "Erich E. Hoover", "kernel32: Add a bunch more GetVolumePathName tests.", 1 },'; - echo '+ { "Sebastian Lackner", "kernel32/tests: Add a lot of picky GetVolumePathName tests.", 1 },'; + echo '+ { "Michael Müller", "kernel32/tests: Add tests for GetNumaProcessorNode.", 2 },'; + echo '+ { "Michael Müller", "kernel32: Implement GetNumaProcessorNode.", 2 },'; ) >> "$patchlist" fi @@ -3189,6 +3075,7 @@ patch_apply kernel32-Named_Pipe/0020-kernel32-tests-Add-tests-for-behaviour-of-WriteFile-.patch patch_apply kernel32-Named_Pipe/0021-server-Return-correct-error-codes-for-NtWriteFile-wh.patch patch_apply kernel32-Named_Pipe/0022-ntdll-Pre-cache-file-descriptors-after-opening-a-fil.patch + patch_apply kernel32-Named_Pipe/0023-server-Fix-wineserver-crash-when-pipe-server-object-.patch ( echo '+ { "Dan Kegel", "kernel32: ConnectNamedPort should return FALSE and set ERROR_PIPE_CONNECTED on success in overlapped mode.", 1 },'; echo '+ { "Sebastian Lackner", "kernel32/tests: Add tests for PeekNamedPipe with partial received messages.", 1 },'; @@ -3212,6 +3099,7 @@ echo '+ { "Sebastian Lackner", "kernel32/tests: Add tests for behaviour of WriteFile on closed pipe.", 1 },'; echo '+ { "Sebastian Lackner", "server: Return correct error codes for NtWriteFile when pipes are closed without disconnecting.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Pre-cache file descriptors after opening a file.", 1 },'; + echo '+ { "Sebastian Lackner", "server: Fix wineserver crash when pipe server object is destroyed before client.", 1 },'; ) >> "$patchlist" fi @@ -3250,22 +3138,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-SetFileCompletionNotificationMode -# | -# | This patchset fixes the following Wine bugs: -# | * [#38493] Add stub for kernel32.SetFileCompletionNotificationModes (for Steam in Win7 mode) -# | -# | Modified files: -# | * dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec, dlls/kernel32/file.c, -# | dlls/kernel32/kernel32.spec, include/winbase.h -# | -if test "$enable_kernel32_SetFileCompletionNotificationMode" -eq 1; then - patch_apply kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch - ( - echo '+ { "Olivier F. R. Dierick", "kernel32: Implement SetFileCompletionNotificationModes as a stub.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-TimezoneInformation_Registry # | # | Modified files: @@ -3433,16 +3305,15 @@ # Patchset msvcrt-atof_strtod # | -# | This patchset fixes the following Wine bugs: -# | * [#32550] MSVCRT crashes when NULL is passed as string to atof or strtod -# | # | Modified files: # | * dlls/msvcrt/string.c, dlls/msvcrt/tests/string.c # | if test "$enable_msvcrt_atof_strtod" -eq 1; then patch_apply msvcrt-atof_strtod/0001-msvcrt-Avoid-crash-when-NULL-pointer-is-passed-to-at.patch + patch_apply msvcrt-atof_strtod/0002-msvcrt-Set-end-to-NULL-when-strtod-is-called-with-NU.patch ( echo '+ { "Michael Müller", "msvcrt: Avoid crash when NULL pointer is passed to atof / strtod functions.", 1 },'; + echo '+ { "Sebastian Lackner", "msvcrt: Set *end to NULL when strtod is called with NULL pointer string.", 1 },'; ) >> "$patchlist" fi @@ -3485,18 +3356,6 @@ ) >> "$patchlist" fi -# Patchset ntdll-AT_ROUND_TO_PAGE -# | -# | Modified files: -# | * dlls/kernel32/tests/virtual.c, dlls/ntdll/virtual.c -# | -if test "$enable_ntdll_AT_ROUND_TO_PAGE" -eq 1; then - patch_apply ntdll-AT_ROUND_TO_PAGE/0001-ntdll-Add-support-for-AT_ROUND_TO_PAGE-flag-in-NtMap.patch - ( - echo '+ { "Sebastian Lackner", "ntdll: Add support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-Activation_Context # | # | Modified files: @@ -3552,21 +3411,6 @@ ) >> "$patchlist" fi -# Patchset ntdll-DVD_Read_Size -# | -# | This patchset fixes the following Wine bugs: -# | * [#37767] IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests -# | -# | Modified files: -# | * dlls/ntdll/cdrom.c -# | -if test "$enable_ntdll_DVD_Read_Size" -eq 1; then - patch_apply ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch - ( - echo '+ { "Erich E. Hoover", "ntdll: Fix expected IOCTL_DVD_READ_STRUCTURE expected output size.", 2 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-DeviceType_Systemroot # | # | This patchset fixes the following Wine bugs: @@ -3873,12 +3717,14 @@ # Patchset ntdll-User_Shared_Data # | # | Modified files: -# | * dlls/ntdll/ntdll.spec, dlls/ntdll/thread.c +# | * dlls/ntdll/ntdll.spec, dlls/ntdll/thread.c, dlls/ntoskrnl.exe/instr.c # | if test "$enable_ntdll_User_Shared_Data" -eq 1; then patch_apply ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch + patch_apply ntdll-User_Shared_Data/0002-ntoskrnl-Update-USER_SHARED_DATA-before-accessing-me.patch ( echo '+ { "Sebastian Lackner", "ntdll: Move code to update user shared data into a separate function.", 1 },'; + echo '+ { "Sebastian Lackner", "ntoskrnl: Update USER_SHARED_DATA before accessing memory.", 1 },'; ) >> "$patchlist" fi @@ -3984,27 +3830,11 @@ ) >> "$patchlist" fi -# Patchset ntoskrnl-Emulator -# | -# | This patchset fixes the following Wine bugs: -# | * [#33849] Emulate access to KI_USER_SHARED_DATA kernel page on x86_64 -# | -# | Modified files: -# | * dlls/ntoskrnl.exe/instr.c, dlls/ntoskrnl.exe/ntoskrnl.c -# | -if test "$enable_ntoskrnl_Emulator" -eq 1; then - patch_apply ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch - patch_apply ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch - ( - echo '+ { "Sebastian Lackner", "ntoskrnl: Emulate memory access to KI_USER_SHARED_DATA on x86_64.", 2 },'; - echo '+ { "Sebastian Lackner", "ntoskrnl: Add TRACEs for instruction emulator on x86_64 to simplify debugging.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntoskrnl-Stubs # | # | This patchset fixes the following Wine bugs: # | * [#38103] Process Hacker 2.x needs ntoskrnl.ProbeForRead +# | * [#21448] SecuROM 5.x media validation fails # | # | Modified files: # | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/wdm.h @@ -4027,6 +3857,7 @@ patch_apply ntoskrnl-Stubs/0015-ntoskrnl.exe-Add-stub-for-ProbeForRead.patch patch_apply ntoskrnl-Stubs/0016-ntoskrnl.exe-Add-stub-for-ProbeForWrite.patch patch_apply ntoskrnl-Stubs/0017-ntoskrnl.exe-Add-stub-for-PsRemoveLoadImageNotifyRou.patch + patch_apply ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch ( echo '+ { "Austin English", "ntoskrnl.exe: add KeWaitForMultipleObjects stub.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stub for IoGetAttachedDeviceReference.", 1 },'; @@ -4045,6 +3876,7 @@ echo '+ { "Austin English", "ntoskrnl.exe: Add stub for ProbeForRead.", 1 },'; echo '+ { "Sebastian Lackner", "ntoskrnl.exe: Add stub for ProbeForWrite.", 1 },'; echo '+ { "Michael Müller", "ntoskrnl.exe: Add stub for PsRemoveLoadImageNotifyRoutine.", 1 },'; + echo '+ { "Erich E. Hoover", "ntoskrnl.exe: Improve IoGetDeviceObjectPointer stub to appease SecuROM 5.x.", 1 },'; ) >> "$patchlist" fi @@ -4068,6 +3900,7 @@ patch_apply nvcuda-CUDA_Support/0007-nvcuda-Properly-wrap-stream-callbacks-by-forwarding-.patch patch_apply nvcuda-CUDA_Support/0008-nvcuda-Add-support-for-CUDA-7.0.patch patch_apply nvcuda-CUDA_Support/0009-nvcuda-Implement-cuModuleLoad-wrapper-function.patch + patch_apply nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch ( echo '+ { "Sebastian Lackner", "include: Add cuda.h.h.", 1 },'; echo '+ { "Sebastian Lackner", "nvcuda: Add stub dll.", 1 },'; @@ -4078,6 +3911,7 @@ echo '+ { "Sebastian Lackner", "nvcuda: Properly wrap stream callbacks by forwarding them to a worker thread.", 1 },'; echo '+ { "Sebastian Lackner", "nvcuda: Add support for CUDA 7.0.", 1 },'; echo '+ { "Sebastian Lackner", "nvcuda: Implement cuModuleLoad wrapper function.", 1 },'; + echo '+ { "Michael Müller", "nvcuda: Search for dylib library on Mac OS X.", 1 },'; ) >> "$patchlist" fi @@ -4170,9 +4004,6 @@ # Patchset quartz-MediaSeeking_Positions # | -# | This patchset fixes the following Wine bugs: -# | * [#23174] Return correct IMediaSeeking stream positions in quartz -# | # | Modified files: # | * dlls/quartz/filtergraph.c, dlls/strmbase/pospass.c # | @@ -4191,6 +4022,21 @@ ) >> "$patchlist" fi +# Patchset rasapi32-RasEnumDevicesA +# | +# | This patchset fixes the following Wine bugs: +# | * [#30378] Initialize *lpcDevices in RasEnumDevicesA +# | +# | Modified files: +# | * dlls/rasapi32/rasapi.c, dlls/rasapi32/tests/rasapi.c +# | +if test "$enable_rasapi32_RasEnumDevicesA" -eq 1; then + patch_apply rasapi32-RasEnumDevicesA/0001-rasapi32-Set-lpcDevices-in-RasEnumDevicesA.patch + ( + echo '+ { "Sebastian Lackner", "rasapi32: Set *lpcDevices in RasEnumDevicesA.", 1 },'; + ) >> "$patchlist" +fi + # Patchset regedit-Reg_Parser # | # | Modified files: @@ -4233,21 +4079,6 @@ ) >> "$patchlist" fi -# Patchset riched20-Link_Notification -# | -# | This patchset fixes the following Wine bugs: -# | * [#35949] Fix link notification conditions for riched20 -# | -# | Modified files: -# | * dlls/riched20/editor.c, dlls/riched20/tests/editor.c -# | -if test "$enable_riched20_Link_Notification" -eq 1; then - patch_apply riched20-Link_Notification/0001-riched20-Fix-link-notification-conditions-and-add-te.patch - ( - echo '+ { "Alex Henrie", "riched20: Fix link notification conditions and add tests.", 1 },'; - ) >> "$patchlist" -fi - # Patchset rpcrt4-Use_After_Free # | # | This patchset fixes the following Wine bugs: @@ -4320,9 +4151,6 @@ # Patchset server-Inherited_ACLs # | -# | This patchset fixes the following Wine bugs: -# | * [#34406] Support for inherited file ACLs -# | # | Modified files: # | * dlls/advapi32/tests/security.c, server/file.c # | @@ -4589,6 +4417,18 @@ ) >> "$patchlist" fi +# Patchset shell32-File_Property_Dialog +# | +# | Modified files: +# | * dlls/shell32/shell32.rc, dlls/shell32/shlview_cmenu.c, dlls/shell32/shresdef.h +# | +if test "$enable_shell32_File_Property_Dialog" -eq 1; then + patch_apply shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch + ( + echo '+ { "Michael Müller", "shell32: Add general tab in file property dialog.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shell32-Icons # | # | This patchset fixes the following Wine bugs: @@ -4809,6 +4649,21 @@ ) >> "$patchlist" fi +# Patchset user32-Invalidate_Key_State +# | +# | This patchset fixes the following Wine bugs: +# | * [#29871] Globally invalidate key state on changes in other threads +# | +# | Modified files: +# | * dlls/user32/input.c +# | +if test "$enable_user32_Invalidate_Key_State" -eq 1; then + patch_apply user32-Invalidate_Key_State/0001-user32-Globally-invalidate-key-state-on-changes-in-o.patch + ( + echo '+ { "Sebastian Lackner", "user32: Globally invalidate key state on changes in other threads.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-Mouse_Message_Hwnd # | # | This patchset fixes the following Wine bugs: @@ -5117,6 +4972,21 @@ ) >> "$patchlist" fi +# Patchset wined3d-Multisampling +# | +# | This patchset fixes the following Wine bugs: +# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. +# | +# | Modified files: +# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h +# | +if test "$enable_wined3d_Multisampling" -eq 1; then + patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch + ( + echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Revert_PixelFormat # | # | This patchset fixes the following Wine bugs: @@ -5151,6 +5021,18 @@ ) >> "$patchlist" fi +# Patchset wined3d-UnhandledBlendFactor +# | +# | Modified files: +# | * dlls/wined3d/state.c +# | +if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then + patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-resource_check_usage # | # | Modified files: @@ -5175,33 +5057,6 @@ ) >> "$patchlist" fi -# Patchset wined3d-Multisampling -# | -# | This patchset fixes the following Wine bugs: -# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. -# | -# | Modified files: -# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Multisampling" -eq 1; then - patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch - ( - echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset wined3d-UnhandledBlendFactor -# | -# | Modified files: -# | * dlls/wined3d/state.c -# | -if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then - patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: @@ -5806,50 +5661,32 @@ ) >> "$patchlist" fi -# Patchset wininet-Cache_Long_URLs -# | -# | Modified files: -# | * dlls/wininet/urlcache.c -# | -if test "$enable_wininet_Cache_Long_URLs" -eq 1; then - patch_apply wininet-Cache_Long_URLs/0001-wininet-Use-random-names-when-caching-very-long-urls.patch - ( - echo '+ { "Michael Müller", "wininet: Use random names when caching very long urls.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wininet-Cleanup # | # | This patchset fixes the following Wine bugs: # | * [#28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest # | # | Modified files: -# | * dlls/rpcrt4/rpc_transport.c, dlls/wininet/http.c, dlls/wininet/tests/http.c +# | * dlls/wininet/http.c, dlls/wininet/tests/http.c # | if test "$enable_wininet_Cleanup" -eq 1; then patch_apply wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch - patch_apply wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch - patch_apply wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch - patch_apply wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch - patch_apply wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch - patch_apply wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch - patch_apply wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch - patch_apply wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch - patch_apply wininet-Cleanup/0009-rpcrt4-Fix-arguments-of-HttpAddRequestHeaders.patch - patch_apply wininet-Cleanup/0010-wininet-Fix-arguments-of-HttpAddRequestHeaders.patch - patch_apply wininet-Cleanup/0011-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch - patch_apply wininet-Cleanup/0012-wininet-Replacing-header-fields-should-fail-if-they-.patch + patch_apply wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch + patch_apply wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch + patch_apply wininet-Cleanup/0004-wininet-Use-request-server-name-when-processing-cook.patch + patch_apply wininet-Cleanup/0005-wininet-Delay-setting-the-http-host-header.patch + patch_apply wininet-Cleanup/0006-wininet-Use-request-server-canon_host_port-in-authen.patch + patch_apply wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-when-quer.patch + patch_apply wininet-Cleanup/0008-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch + patch_apply wininet-Cleanup/0009-wininet-Replacing-header-fields-should-fail-if-they-.patch ( echo '+ { "Michael Müller", "wininet/tests: Add more tests for cookies.", 1 },'; - echo '+ { "Michael Müller", "wininet/tests: Add tests for overriding host header.", 1 },'; echo '+ { "Michael Müller", "wininet/tests: Test auth credential reusage with host override.", 1 },'; echo '+ { "Michael Müller", "wininet/tests: Check cookie behaviour when overriding host.", 1 },'; echo '+ { "Michael Müller", "wininet: Use request->server->name when processing cookies instead of Host header field.", 1 },'; echo '+ { "Michael Müller", "wininet: Delay setting the http host header.", 1 },'; echo '+ { "Michael Müller", "wininet: Use request->server->canon_host_port in authentication process.", 1 },'; echo '+ { "Michael Müller", "wininet: Use request->server->canon_host_port when querying for INTERNET_OPTION_URL.", 1 },'; - echo '+ { "Michael Müller", "rpcrt4: Fix arguments of HttpAddRequestHeaders.", 1 },'; - echo '+ { "Michael Müller", "wininet: Fix arguments of HttpAddRequestHeaders.", 1 },'; echo '+ { "Michael Müller", "wininet: Strip filename if no path is set in cookie.", 1 },'; echo '+ { "Michael Müller", "wininet: Replacing header fields should fail if they do not exist yet.", 1 },'; ) >> "$patchlist" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/quartz-MediaSeeking_Positions/definition wine-staging-1.7.46~ubuntu14.10.1/patches/quartz-MediaSeeking_Positions/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/quartz-MediaSeeking_Positions/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/quartz-MediaSeeking_Positions/definition 2015-06-28 17:08:11.000000000 +0000 @@ -1 +1 @@ -Fixes: [23174] Return correct IMediaSeeking stream positions in quartz +Fixes: Return correct IMediaSeeking stream positions in quartz diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/0001-rasapi32-Set-lpcDevices-in-RasEnumDevicesA.patch wine-staging-1.7.46~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/0001-rasapi32-Set-lpcDevices-in-RasEnumDevicesA.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/0001-rasapi32-Set-lpcDevices-in-RasEnumDevicesA.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/0001-rasapi32-Set-lpcDevices-in-RasEnumDevicesA.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,123 @@ +From 8377389407d8ab624c79cbb072e7c6e5c1b4a8d5 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 28 Jun 2015 03:58:23 +0200 +Subject: rasapi32: Set *lpcDevices in RasEnumDevicesA. + +Based on a patch by Qian Hong. +--- + dlls/rasapi32/rasapi.c | 2 ++ + dlls/rasapi32/tests/rasapi.c | 21 +++++++++++++++++++++ + 2 files changed, 23 insertions(+) + +diff --git a/dlls/rasapi32/rasapi.c b/dlls/rasapi32/rasapi.c +index 235ab65..c2a4b55 100644 +--- a/dlls/rasapi32/rasapi.c ++++ b/dlls/rasapi32/rasapi.c +@@ -254,6 +254,8 @@ DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD l + if(lpRasDevinfo && lpRasDevinfo->dwSize != sizeof(RASDEVINFOA)) + return ERROR_INVALID_SIZE; + ++ *lpcDevices = 1; ++ + if (!lpRasDevinfo || (*lpcb < sizeof(RASDEVINFOA))) { + *lpcb = sizeof(RASDEVINFOA); + return ERROR_BUFFER_TOO_SMALL; +diff --git a/dlls/rasapi32/tests/rasapi.c b/dlls/rasapi32/tests/rasapi.c +index e0ff25f..5171bb2 100644 +--- a/dlls/rasapi32/tests/rasapi.c ++++ b/dlls/rasapi32/tests/rasapi.c +@@ -77,54 +77,71 @@ static void test_rasenum(void) + + /* test first parameter */ + cb = bufsize; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(NULL, &cb, &cDevices); ++ ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); + ok(result == ERROR_BUFFER_TOO_SMALL || + result == ERROR_INVALID_USER_BUFFER, /* win98 */ + "Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); + + rasDevInfo[0].dwSize = 0; + cb = bufsize; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_SIZE || + result == ERROR_INVALID_USER_BUFFER, /* win98 */ + "Expected ERROR_INVALID_SIZE, got %08d\n", result); + + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1; + cb = bufsize; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_SIZE || + result == ERROR_INVALID_USER_BUFFER, /* win98 */ + "Expected ERROR_INVALID_SIZE, got %08d\n", result); + + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1; + cb = bufsize; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_SIZE || + result == ERROR_INVALID_USER_BUFFER, /* win98 */ + "Expected ERROR_INVALID_SIZE, got %08d\n", result); + + /* test second parameter */ + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, NULL, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); + + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); + cb = 0; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ todo_wine ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_BUFFER_TOO_SMALL || + result == ERROR_INVALID_SIZE, /* vista, 2k8 */ + "Expected ERROR_BUFFER_TOO_SMALL/ERROR_INVALID_SIZE, got %08d\n", result); + + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); + cb = bufsize -1; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); + ok(result == ERROR_BUFFER_TOO_SMALL, + "Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); + + rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); + cb = bufsize +1; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); + ok(result == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got %08d\n", result); + +@@ -136,7 +153,9 @@ static void test_rasenum(void) + "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); + + /* test combinations of invalid parameters */ ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(NULL, NULL, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); + +@@ -147,7 +166,9 @@ static void test_rasenum(void) + + cb = 0; + rasDevInfo[0].dwSize = 0; ++ cDevices = 0xdeadbeef; + result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); ++ ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); + ok(result == ERROR_INVALID_SIZE || + broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */ + "Expected ERROR_INVALID_SIZE, got %08d\n", result); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/definition wine-staging-1.7.46~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/rasapi32-RasEnumDevicesA/definition 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [30378] Initialize *lpcDevices in RasEnumDevicesA diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch 2015-06-28 17:08:11.000000000 +0000 @@ -1,18 +1,18 @@ -From 4cbf20d7de172a442808f0c9a78d360ea2e57e5b Mon Sep 17 00:00:00 2001 +From 1d213a01d28a273c2b1b46dac6b606864cc88321 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Wed, 13 Aug 2014 17:17:14 +0800 Subject: riched20: Implement ITextRange::SetRange. --- - dlls/riched20/richole.c | 42 +++++++++++++++++++++++++----------------- + dlls/riched20/richole.c | 41 +++++++++++++++++++++++++---------------- dlls/riched20/tests/richole.c | 35 +++++++++++++++++++++++++++++++++++ - 2 files changed, 60 insertions(+), 17 deletions(-) + 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index c309292..8aea23e 100644 +index cc1a3c9..e432c79 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -1990,14 +1990,36 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Inde +@@ -2003,6 +2003,23 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG inde return E_NOTIMPL; } @@ -33,25 +33,25 @@ + *cp1 = *cp2 = len - 1; +} + - static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG cpActive, LONG cpOther) + static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active) { ITextRangeImpl *This = impl_from_ITextRange(me); +@@ -2012,7 +2029,13 @@ static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG ac if (!This->child.reole) return CO_E_RELEASED; -- FIXME("not implemented %p\n", This); - return E_NOTIMPL; -+ cp2range(This->child.reole->editor, &cpActive, &cpOther); -+ if (cpActive == This->start && cpOther == This->end) ++ cp2range(This->child.reole->editor, &anchor, &active); ++ if (anchor == This->start && active == This->end) + return S_FALSE; + -+ This->start = cpActive; -+ This->end = cpOther; ++ This->start = anchor; ++ This->end = active; + return S_OK; } static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret) -@@ -4198,26 +4220,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2, +@@ -4263,26 +4286,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2, ITextRange** ppRange) { IRichEditOleImpl *This = impl_from_ITextDocument(me); @@ -133,5 +133,5 @@ test_IOleWindow_GetWindow(); test_IOleInPlaceSite_GetWindow(); -- -2.4.2 +2.4.3 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-Link_Notification/0001-riched20-Fix-link-notification-conditions-and-add-te.patch wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-Link_Notification/0001-riched20-Fix-link-notification-conditions-and-add-te.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-Link_Notification/0001-riched20-Fix-link-notification-conditions-and-add-te.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-Link_Notification/0001-riched20-Fix-link-notification-conditions-and-add-te.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,282 +0,0 @@ -From f38b5b90a84ab9acc82032c0f360cb34705aad92 Mon Sep 17 00:00:00 2001 -From: Alex Henrie -Date: Thu, 4 Jun 2015 00:34:40 -0600 -Subject: riched20: Fix link notification conditions and add tests. - -Fixes https://bugs.winehq.org/show_bug.cgi?id=35949 ---- - dlls/riched20/editor.c | 13 +++- - dlls/riched20/tests/editor.c | 178 +++++++++++++++++++++++++++++++++++++++---- - 2 files changed, 172 insertions(+), 19 deletions(-) - -diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c -index 38861fd..33b4462 100644 ---- a/dlls/riched20/editor.c -+++ b/dlls/riched20/editor.c -@@ -4121,6 +4121,10 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - return 0; - case WM_SETCURSOR: - { -+ POINT cursor_pos; -+ if (wParam == (WPARAM)editor->hWnd && GetCursorPos(&cursor_pos) && -+ ScreenToClient(editor->hWnd, &cursor_pos)) -+ ME_LinkNotify(editor, msg, 0, MAKELPARAM(cursor_pos.x, cursor_pos.y)); - return ME_SetCursor(editor); - } - case WM_LBUTTONDBLCLK: -@@ -4135,7 +4139,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - ME_CalculateClickCount(editor, msg, wParam, lParam)); - ITextHost_TxSetCapture(editor->texthost, TRUE); - editor->bMouseCaptured = TRUE; -- ME_LinkNotify(editor,msg,wParam,lParam); -+ ME_LinkNotify(editor, msg, wParam, lParam); - if (!ME_SetCursor(editor)) goto do_default; - break; - } -@@ -4145,7 +4149,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - return 0; - if (editor->bMouseCaptured) - ME_MouseMove(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)); -- ME_LinkNotify(editor,msg,wParam,lParam); -+ else -+ ME_LinkNotify(editor, msg, wParam, lParam); - /* Set cursor if mouse is captured, since WM_SETCURSOR won't be received. */ - if (editor->bMouseCaptured) - ME_SetCursor(editor); -@@ -4163,15 +4168,17 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - else - { - ME_SetCursor(editor); -- ME_LinkNotify(editor,msg,wParam,lParam); -+ ME_LinkNotify(editor, msg, wParam, lParam); - } - break; - case WM_RBUTTONUP: - case WM_RBUTTONDOWN: -+ case WM_RBUTTONDBLCLK: - ME_CommitUndo(editor); /* End coalesced undos for typed characters */ - if ((editor->nEventMask & ENM_MOUSEEVENTS) && - !ME_FilterEvent(editor, msg, &wParam, &lParam)) - return 0; -+ ME_LinkNotify(editor, msg, wParam, lParam); - goto do_default; - case WM_CONTEXTMENU: - if (!ME_ShowContextMenu(editor, (short)LOWORD(lParam), (short)HIWORD(lParam))) -diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c -index 09437ef..d2ea70c 100644 ---- a/dlls/riched20/tests/editor.c -+++ b/dlls/riched20/tests/editor.c -@@ -6004,26 +6004,155 @@ static void test_WM_NOTIFY(void) - DestroyWindow(parent); - } - --static int cpMin_EN_LINK = -1; --static int cpMax_EN_LINK = -1; -+static ENLINK enlink; -+#define CURSOR_CLIENT_X 5 -+#define CURSOR_CLIENT_Y 5 -+#define WP_PARENT 1 -+#define WP_CHILD 2 - - static LRESULT WINAPI EN_LINK_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { -- ENLINK* enlink = (ENLINK*)lParam; -- if(message == WM_NOTIFY && enlink->nmhdr.code == EN_LINK) -+ if(message == WM_NOTIFY && ((NMHDR*)lParam)->code == EN_LINK) - { -- cpMin_EN_LINK = enlink->chrg.cpMin; -- cpMax_EN_LINK = enlink->chrg.cpMax; -+ enlink = *(ENLINK*)lParam; - } - return DefWindowProcA(hwnd, message, wParam, lParam); - } - -+static void link_notify_test(const char *desc, int i, HWND hwnd, HWND parent, UINT msg, WPARAM wParam, BOOL notifies) -+{ -+ LPARAM lParam; -+ ENLINK junk_enlink; -+ -+ switch (msg) -+ { -+ case EM_LINESCROLL: -+ lParam = 1; -+ break; -+ case WM_LBUTTONDBLCLK: -+ case WM_LBUTTONDOWN: -+ case WM_LBUTTONUP: -+ case WM_MOUSEHOVER: -+ case WM_MOUSEMOVE: -+ case WM_MOUSEWHEEL: -+ case WM_RBUTTONDBLCLK: -+ case WM_RBUTTONDOWN: -+ case WM_RBUTTONUP: -+ lParam = MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y); -+ break; -+ case WM_SETCURSOR: -+ if (wParam == WP_PARENT) -+ wParam = (WPARAM)parent; -+ else if (wParam == WP_CHILD) -+ wParam = (WPARAM)hwnd; -+ /* fall through */ -+ default: -+ lParam = 0; -+ } -+ -+ memset(&junk_enlink, 0x23, sizeof(junk_enlink)); -+ enlink = junk_enlink; -+ -+ SendMessageA(hwnd, msg, wParam, lParam); -+ -+ if (notifies) -+ { -+ ok(enlink.nmhdr.hwndFrom == hwnd, -+ "%s test %i: Expected hwnd %p got %p\n", desc, i, hwnd, enlink.nmhdr.hwndFrom); -+ ok(enlink.nmhdr.idFrom == 0, -+ "%s test %i: Expected idFrom 0 got 0x%lx\n", desc, i, enlink.nmhdr.idFrom); -+ ok(enlink.msg == msg, -+ "%s test %i: Expected msg 0x%x got 0x%x\n", desc, i, msg, enlink.msg); -+ if (msg == WM_SETCURSOR) -+ { -+ ok(enlink.wParam == 0, -+ "%s test %i: Expected wParam 0 got 0x%lx\n", desc, i, enlink.wParam); -+ ok(enlink.lParam == MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y), -+ "%s test %i: Expected lParam 0x%lx got 0x%lx\n", -+ desc, i, MAKELPARAM(CURSOR_CLIENT_X, CURSOR_CLIENT_Y), enlink.lParam); -+ } -+ else -+ { -+ ok(enlink.wParam == wParam, -+ "%s test %i: Expected wParam 0x%lx got 0x%lx\n", desc, i, wParam, enlink.wParam); -+ ok(enlink.lParam == lParam, -+ "%s test %i: Expected lParam 0x%lx got 0x%lx\n", desc, i, lParam, enlink.lParam); -+ } -+ ok(enlink.chrg.cpMin == 0 && enlink.chrg.cpMax == 31, -+ "%s test %i: Expected link range [0,31) got [%i,%i)\n", desc, i, enlink.chrg.cpMin, enlink.chrg.cpMax); -+ } -+ else -+ { -+ ok(memcmp(&enlink, &junk_enlink, sizeof(enlink)) == 0, -+ "%s test %i: Expected enlink to remain unmodified\n", desc, i); -+ } -+} -+ - static void test_EN_LINK(void) - { -- HWND parent; -+ HWND hwnd, parent; - WNDCLASSA cls; -- HWND hwndRichedit_EN_LINK; - CHARFORMAT2A cf2; -+ POINT cursor_screen_pos = {CURSOR_CLIENT_X, CURSOR_CLIENT_Y}; -+ int i; -+ -+ static const struct -+ { -+ UINT msg; -+ WPARAM wParam; -+ BOOL notifies; -+ } -+ link_notify_tests[] = -+ { -+ /* hold down the left button and try some messages */ -+ { WM_LBUTTONDOWN, 0, TRUE }, /* 0 */ -+ { EM_LINESCROLL, 0, FALSE }, -+ { EM_SCROLL, SB_BOTTOM, FALSE }, -+ { WM_LBUTTONDBLCLK, 0, TRUE }, -+ { WM_MOUSEHOVER, 0, FALSE }, -+ { WM_MOUSEMOVE, 0, FALSE }, -+ { WM_MOUSEWHEEL, 0, FALSE }, -+ { WM_RBUTTONDBLCLK, 0, TRUE }, -+ { WM_RBUTTONDOWN, 0, TRUE }, -+ { WM_RBUTTONUP, 0, TRUE }, -+ { WM_SETCURSOR, 0, FALSE }, -+ { WM_SETCURSOR, WP_PARENT, FALSE }, -+ { WM_SETCURSOR, WP_CHILD, TRUE }, -+ { WM_VSCROLL, SB_BOTTOM, FALSE }, -+ { WM_LBUTTONUP, 0, TRUE }, -+ /* hold down the right button and try some messages */ -+ { WM_RBUTTONDOWN, 0, TRUE }, /* 15 */ -+ { EM_LINESCROLL, 0, FALSE }, -+ { EM_SCROLL, SB_BOTTOM, FALSE }, -+ { WM_LBUTTONDBLCLK, 0, TRUE }, -+ { WM_LBUTTONDOWN, 0, TRUE }, -+ { WM_LBUTTONUP, 0, TRUE }, -+ { WM_MOUSEHOVER, 0, FALSE }, -+ { WM_MOUSEMOVE, 0, TRUE }, -+ { WM_MOUSEWHEEL, 0, FALSE }, -+ { WM_RBUTTONDBLCLK, 0, TRUE }, -+ { WM_SETCURSOR, 0, FALSE }, -+ { WM_SETCURSOR, WP_PARENT, FALSE }, -+ { WM_SETCURSOR, WP_CHILD, TRUE }, -+ { WM_VSCROLL, SB_BOTTOM, FALSE }, -+ { WM_RBUTTONUP, 0, TRUE }, -+ /* try the messages with both buttons released */ -+ { EM_LINESCROLL, 0, FALSE }, /* 30 */ -+ { EM_SCROLL, SB_BOTTOM, FALSE }, -+ { WM_LBUTTONDBLCLK, 0, TRUE }, -+ { WM_LBUTTONDOWN, 0, TRUE }, -+ { WM_LBUTTONUP, 0, TRUE }, -+ { WM_MOUSEHOVER, 0, FALSE }, -+ { WM_MOUSEMOVE, 0, TRUE }, -+ { WM_MOUSEWHEEL, 0, FALSE }, -+ { WM_RBUTTONDBLCLK, 0, TRUE }, -+ { WM_RBUTTONDOWN, 0, TRUE }, -+ { WM_RBUTTONUP, 0, TRUE }, -+ { WM_SETCURSOR, 0, FALSE }, -+ { WM_SETCURSOR, WP_CHILD, TRUE }, -+ { WM_SETCURSOR, WP_PARENT, FALSE }, -+ { WM_VSCROLL, SB_BOTTOM, FALSE } -+ }; - - /* register class to capture WM_NOTIFY */ - cls.style = 0; -@@ -6042,21 +6171,38 @@ static void test_EN_LINK(void) - 0, 0, 200, 60, NULL, NULL, NULL, NULL); - ok(parent != 0, "Failed to create parent window\n"); - -- hwndRichedit_EN_LINK = new_richedit(parent); -- ok(hwndRichedit_EN_LINK != 0, "Failed to create edit window\n"); -+ hwnd = new_richedit(parent); -+ ok(hwnd != 0, "Failed to create edit window\n"); - -- SendMessageA(hwndRichedit_EN_LINK, EM_SETEVENTMASK, 0, ENM_LINK); -+ SendMessageA(hwnd, EM_SETEVENTMASK, 0, ENM_LINK); - - cf2.cbSize = sizeof(CHARFORMAT2A); - cf2.dwMask = CFM_LINK; - cf2.dwEffects = CFE_LINK; -- SendMessageA(hwndRichedit_EN_LINK, EM_SETCHARFORMAT, 0, (LPARAM)&cf2); -+ SendMessageA(hwnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf2); - /* mixing letters and numbers causes runs to be split */ -- SendMessageA(hwndRichedit_EN_LINK, WM_SETTEXT, 0, (LPARAM)"link text with at least 2 runs"); -- SendMessageA(hwndRichedit_EN_LINK, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); -- ok(cpMin_EN_LINK == 0 && cpMax_EN_LINK == 31, "Expected link range [0,31) got [%i,%i)\n", cpMin_EN_LINK, cpMax_EN_LINK); -+ SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"link text with at least 2 runs"); - -- DestroyWindow(hwndRichedit_EN_LINK); -+ ok(SetCursorPos(0, 0), "SetCursorPos failed\n"); -+ -+ for (i = 0; i < sizeof(link_notify_tests)/sizeof(link_notify_tests[0]); i++) -+ { -+ link_notify_test("cursor position simulated", i, hwnd, parent, -+ link_notify_tests[i].msg, link_notify_tests[i].wParam, -+ link_notify_tests[i].msg == WM_SETCURSOR ? FALSE : link_notify_tests[i].notifies); -+ } -+ -+ ok(ClientToScreen(hwnd, &cursor_screen_pos), "ClientToScreen failed\n"); -+ ok(SetCursorPos(cursor_screen_pos.x, cursor_screen_pos.y), "SetCursorPos failed\n"); -+ -+ for (i = 0; i < sizeof(link_notify_tests)/sizeof(link_notify_tests[0]); i++) -+ { -+ link_notify_test("cursor position set", i, hwnd, parent, -+ link_notify_tests[i].msg, link_notify_tests[i].wParam, -+ link_notify_tests[i].notifies); -+ } -+ -+ DestroyWindow(hwnd); - DestroyWindow(parent); - } - --- -2.4.2 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-Link_Notification/definition wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-Link_Notification/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/riched20-Link_Notification/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/riched20-Link_Notification/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [35949] Fix link notification conditions for riched20 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/server-Inherited_ACLs/definition wine-staging-1.7.46~ubuntu14.10.1/patches/server-Inherited_ACLs/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/server-Inherited_ACLs/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/server-Inherited_ACLs/definition 2015-06-28 17:08:11.000000000 +0000 @@ -1,2 +1,2 @@ Depends: server-Stored_ACLs -Fixes: [34406] Support for inherited file ACLs +Fixes: Support for inherited file ACLs diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch wine-staging-1.7.46~ubuntu14.10.1/patches/shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,509 @@ +From 85a66b44d805d0a24a05903d54d716ba0f8595a2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 21 Jun 2015 01:10:54 +0200 +Subject: shell32: Add general tab in file property dialog. + +--- + dlls/shell32/shell32.rc | 66 ++++++++ + dlls/shell32/shlview_cmenu.c | 347 +++++++++++++++++++++++++++++++++++++++++-- + dlls/shell32/shresdef.h | 28 ++++ + 3 files changed, 425 insertions(+), 16 deletions(-) + +diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc +index 847d2ce..2641bc6 100644 +--- a/dlls/shell32/shell32.rc ++++ b/dlls/shell32/shell32.rc +@@ -341,6 +341,72 @@ FONT 8, "MS Shell Dlg" + PUSHBUTTON "&Browse...", IDC_RUNDLG_BROWSE, 180, 63, 50, 14, WS_TABSTOP + } + ++IDD_FOLDER_PROPERTIES DIALOGEX 0, 0, 240, 155 ++STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION ++CAPTION "General" ++FONT 8, "MS Shell Dlg" ++BEGIN ++ ICON "", IDC_FPROP_ICON, 10, 5, 32, 32, WS_VISIBLE ++ EDITTEXT IDC_FPROP_PATH, 70, 10, 160, 14, WS_TABSTOP ++ ++ LTEXT "", -1, 5, 30, 230, 1, SS_ETCHEDHORZ ++ LTEXT "File type:", IDC_FPROP_TYPE_LABEL, 10, 35, 60, 10 ++ EDITTEXT IDC_FPROP_TYPE, 70, 35, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ ++ LTEXT "", -1, 5, 50, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Location:", IDC_FPROP_LOCATION_LABEL, 10, 55, 60, 10 ++ EDITTEXT IDC_FPROP_LOCATION, 70, 55, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ LTEXT "Size:", IDC_FPROP_SIZE_LABEL, 10, 70, 60, 10 ++ EDITTEXT IDC_FPROP_SIZE, 70, 70, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ ++ LTEXT "", -1, 5, 85, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Creation date:", IDC_FPROP_CREATED_LABEL, 10, 90, 60, 10 ++ EDITTEXT IDC_FPROP_CREATED, 70, 90, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ ++ LTEXT "", -1, 5, 105, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Attributes:", IDC_FPROP_ATTRIB_LABEL, 10, 110, 60, 10 ++ AUTOCHECKBOX "&Read-only", IDC_FPROP_READONLY, 70, 110, 70, 10 ++ AUTOCHECKBOX "&Hidden", IDC_FPROP_HIDDEN, 70, 125, 70, 10 ++ AUTOCHECKBOX "&Archive", IDC_FPROP_ARCHIVE, 70, 140, 70, 10 ++END ++ ++IDD_FILE_PROPERTIES DIALOGEX 0, 0, 240, 200 ++STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION ++CAPTION "General" ++FONT 8, "MS Shell Dlg" ++BEGIN ++ ICON "", IDC_FPROP_ICON, 10, 5, 32, 32, WS_VISIBLE ++ EDITTEXT IDC_FPROP_PATH, 70, 10, 160, 14, WS_TABSTOP ++ ++ LTEXT "", -1, 5, 30, 230, 1, SS_ETCHEDHORZ ++ LTEXT "File type:", IDC_FPROP_TYPE_LABEL, 10, 35, 60, 10 ++ EDITTEXT IDC_FPROP_TYPE, 70, 35, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ LTEXT "Open with:", IDC_FPROP_OPENWITH_LABEL, 10, 50, 60, 10 ++ ICON "", IDC_FPROP_PROG_ICON, 70, 50, 16, 16, WS_VISIBLE ++ EDITTEXT IDC_FPROP_PROG_NAME, 85, 50, 80, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ PUSHBUTTON "&Change...", IDC_FPROP_PROG_CHANGE, 170, 48, 60, 14, WS_CHILD | WS_TABSTOP ++ ++ LTEXT "", -1, 5, 65, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Location:", IDC_FPROP_LOCATION_LABEL, 10, 70, 60, 10 ++ EDITTEXT IDC_FPROP_LOCATION, 70, 70, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ LTEXT "Size:", IDC_FPROP_SIZE_LABEL, 10, 85, 60, 10 ++ EDITTEXT IDC_FPROP_SIZE, 70, 85, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ ++ LTEXT "", -1, 5, 100, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Creation date:", IDC_FPROP_CREATED_LABEL, 10, 105, 60, 10 ++ EDITTEXT IDC_FPROP_CREATED, 70, 105, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ LTEXT "Last modified:", IDC_FPROP_MODIFIED_LABEL, 10, 120, 60, 10 ++ EDITTEXT IDC_FPROP_MODIFIED, 70, 120, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ LTEXT "Last accessed:", IDC_FPROP_ACCESSED_LABEL, 10, 135, 60, 10 ++ EDITTEXT IDC_FPROP_ACCESSED, 70, 135, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP ++ ++ LTEXT "", -1, 5, 150, 230, 1, SS_ETCHEDHORZ ++ LTEXT "Attributes:", IDC_FPROP_ATTRIB_LABEL, 10, 155, 60, 10 ++ AUTOCHECKBOX "&Read-only", IDC_FPROP_READONLY, 70, 155, 70, 10 ++ AUTOCHECKBOX "&Hidden", IDC_FPROP_HIDDEN, 70, 170, 70, 10 ++ AUTOCHECKBOX "&Archive", IDC_FPROP_ARCHIVE, 70, 185, 70, 10 ++END ++ + LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + + /* @makedep: shell32.rgs */ +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index 099f5bc..aa7a7de 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -39,6 +39,7 @@ + #include "shellfolder.h" + + #include "shresdef.h" ++#include "shlwapi.h" + + WINE_DEFAULT_DEBUG_CHANNEL(shell); + +@@ -284,6 +285,318 @@ static BOOL CALLBACK Properties_AddPropSheetCallback(HPROPSHEETPAGE hpage, LPARA + return TRUE; + } + ++static BOOL format_date(FILETIME *time, WCHAR *buffer, DWORD size) ++{ ++ FILETIME ft; ++ SYSTEMTIME st; ++ int ret; ++ ++ if (!FileTimeToLocalFileTime(time, &ft)) ++ return FALSE; ++ ++ if (!FileTimeToSystemTime(&ft, &st)) ++ return FALSE; ++ ++ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buffer, size); ++ if (ret) ++ { ++ buffer[ret - 1] = ' '; ++ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buffer + ret , size - ret); ++ } ++ return ret != 0; ++} ++ ++static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size) ++{ ++ static const WCHAR translationW[] = { ++ '\\','V','a','r','F','i','l','e','I','n','f','o', ++ '\\','T','r','a','n','s','l','a','t','i','o','n',0 ++ }; ++ static const WCHAR fileDescFmtW[] = { ++ '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o', ++ '\\','%','0','4','x','%','0','4','x', ++ '\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0 ++ }; ++ WCHAR fileDescW[41], *desc; ++ DWORD versize, *lang; ++ UINT dlen, llen, i; ++ BOOL ret = FALSE; ++ PVOID data; ++ ++ versize = GetFileVersionInfoSizeW(path, NULL); ++ if (!versize) return FALSE; ++ ++ data = HeapAlloc(GetProcessHeap(), 0, versize); ++ if (!data) return FALSE; ++ ++ if (!GetFileVersionInfoW(path, 0, versize, data)) ++ goto out; ++ ++ if (!VerQueryValueW(data, translationW, (LPVOID *)&lang, &llen)) ++ goto out; ++ ++ for (i = 0; i < llen / sizeof(DWORD); i++) ++ { ++ sprintfW(fileDescW, fileDescFmtW, LOWORD(lang[i]), HIWORD(lang[i])); ++ if (VerQueryValueW(data, fileDescW, (LPVOID *)&desc, &dlen)) ++ { ++ if (dlen > size - 1) dlen = size - 1; ++ memcpy(buffer, desc, dlen * sizeof(WCHAR)); ++ buffer[dlen] = 0; ++ ret = TRUE; ++ break; ++ } ++ } ++ ++out: ++ HeapFree(GetProcessHeap(), 0, data); ++ return ret; ++} ++ ++struct file_properties_info ++{ ++ LONG refcount; ++ WCHAR path[MAX_PATH]; ++ WCHAR dir[MAX_PATH]; ++ WCHAR *filename; ++ DWORD attrib; ++}; ++ ++static void init_file_properties_dlg(HWND hwndDlg, struct file_properties_info *props) ++{ ++ WCHAR buffer[MAX_PATH], buffer2[MAX_PATH]; ++ WIN32_FILE_ATTRIBUTE_DATA exinfo; ++ SHFILEINFOW shinfo; ++ ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_PATH, props->filename); ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_LOCATION, props->dir); ++ ++ if (SHGetFileInfoW(props->path, 0, &shinfo, sizeof(shinfo), SHGFI_TYPENAME|SHGFI_ICON)) ++ { ++ if (shinfo.hIcon) SendDlgItemMessageW(hwndDlg, IDC_FPROP_ICON, STM_SETICON, (WPARAM)shinfo.hIcon, 0); ++ if (shinfo.szTypeName[0]) SetDlgItemTextW(hwndDlg, IDC_FPROP_TYPE, shinfo.szTypeName); ++ } ++ ++ if (!GetFileAttributesExW(props->path, GetFileExInfoStandard, &exinfo)) ++ return; ++ ++ if (format_date(&exinfo.ftCreationTime, buffer, sizeof(buffer) / sizeof(buffer[0]))) ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_CREATED, buffer); ++ ++ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ++ SendDlgItemMessageW(hwndDlg, IDC_FPROP_READONLY, BM_SETCHECK, BST_CHECKED, 0); ++ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ++ SendDlgItemMessageW(hwndDlg, IDC_FPROP_HIDDEN, BM_SETCHECK, BST_CHECKED, 0); ++ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) ++ SendDlgItemMessageW(hwndDlg, IDC_FPROP_ARCHIVE, BM_SETCHECK, BST_CHECKED, 0); ++ ++ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ++ { ++ static const WCHAR unknownW[] = {'(','u','n','k','n','o','w','n',')',0}; ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, unknownW); ++ ++ /* TODO: Implement counting for directories */ ++ return; ++ } ++ ++ /* Information about files only */ ++ StrFormatByteSizeW(((LONGLONG)exinfo.nFileSizeHigh << 32) | exinfo.nFileSizeLow, ++ buffer, sizeof(buffer) / sizeof(buffer[0])); ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, buffer); ++ ++ if (format_date(&exinfo.ftLastWriteTime, buffer, sizeof(buffer) / sizeof(buffer[0]))) ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_MODIFIED, buffer); ++ if (format_date(&exinfo.ftLastAccessTime, buffer, sizeof(buffer) / sizeof(buffer[0]))) ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_ACCESSED, buffer); ++ ++ if (FindExecutableW(props->path, NULL, buffer) <= (HINSTANCE)32) ++ return; ++ ++ /* Information about executables */ ++ if (SHGetFileInfoW(buffer, 0, &shinfo, sizeof(shinfo), SHGFI_ICON | SHGFI_SMALLICON) && shinfo.hIcon) ++ SendDlgItemMessageW(hwndDlg, IDC_FPROP_PROG_ICON, STM_SETICON, (WPARAM)shinfo.hIcon, 0); ++ ++ if (get_program_description(buffer, buffer2, sizeof(buffer2) / sizeof(buffer2[0]))) ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, buffer2); ++ else ++ { ++ WCHAR *p = strrchrW(buffer, '\\'); ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, p ? ++p : buffer); ++ } ++} ++ ++static INT_PTR CALLBACK file_properties_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ++{ ++ switch (uMsg) ++ { ++ case WM_INITDIALOG: ++ { ++ LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; ++ SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam); ++ init_file_properties_dlg(hwndDlg, (struct file_properties_info *)ppsp->lParam); ++ break; ++ } ++ ++ case WM_COMMAND: ++ if (LOWORD(wParam) == IDC_FPROP_PROG_CHANGE) ++ { ++ /* TODO: Implement file association dialog */ ++ MessageBoxA(hwndDlg, "Not implemented yet.", "Error", MB_OK | MB_ICONEXCLAMATION); ++ } ++ else if (LOWORD(wParam) == IDC_FPROP_READONLY || ++ LOWORD(wParam) == IDC_FPROP_HIDDEN || ++ LOWORD(wParam) == IDC_FPROP_ARCHIVE) ++ { ++ SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); ++ } ++ else if (LOWORD(wParam) == IDC_FPROP_PATH && HIWORD(wParam) == EN_CHANGE) ++ { ++ SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); ++ } ++ break; ++ ++ case WM_NOTIFY: ++ { ++ LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; ++ if (lppsn->hdr.code == PSN_APPLY) ++ { ++ struct file_properties_info *props = (struct file_properties_info *)GetWindowLongPtrW(hwndDlg, DWLP_USER); ++ WCHAR newname[MAX_PATH], newpath[MAX_PATH]; ++ DWORD attributes; ++ ++ attributes = GetFileAttributesW(props->path); ++ if (attributes != INVALID_FILE_ATTRIBUTES) ++ { ++ attributes &= ~(FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_ARCHIVE); ++ ++ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED) ++ attributes |= FILE_ATTRIBUTE_READONLY; ++ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_HIDDEN, BM_GETCHECK, 0, 0) == BST_CHECKED) ++ attributes |= FILE_ATTRIBUTE_HIDDEN; ++ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_ARCHIVE, BM_GETCHECK, 0, 0) == BST_CHECKED) ++ attributes |= FILE_ATTRIBUTE_ARCHIVE; ++ ++ if (!SetFileAttributesW(props->path, attributes)) ++ ERR("failed to update file attributes of %s\n", debugstr_w(props->path)); ++ } ++ ++ /* Update filename it it was changed */ ++ if (GetDlgItemTextW(hwndDlg, IDC_FPROP_PATH, newname, sizeof(newname)/sizeof(newname[0])) && ++ strcmpW(props->filename, newname) && ++ strlenW(props->dir) + strlenW(newname) + 2 < sizeof(newpath) / sizeof(newpath[0])) ++ { ++ static const WCHAR slash[] = {'\\', 0}; ++ strcpyW(newpath, props->dir); ++ strcatW(newpath, slash); ++ strcatW(newpath, newname); ++ ++ if (!MoveFileW(props->path, newpath)) ++ ERR("failed to move file %s to %s\n", debugstr_w(props->path), debugstr_w(newpath)); ++ else ++ { ++ WCHAR *p; ++ strcpyW(props->path, newpath); ++ strcpyW(props->dir, newpath); ++ if ((p = strrchrW(props->dir, '\\'))) ++ { ++ *p = 0; ++ props->filename = p + 1; ++ } ++ else ++ props->filename = props->dir; ++ SetDlgItemTextW(hwndDlg, IDC_FPROP_LOCATION, props->dir); ++ } ++ } ++ ++ return TRUE; ++ } ++ } ++ break; ++ ++ default: ++ break; ++ } ++ return FALSE; ++} ++ ++static UINT CALLBACK file_properties_callback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGEW ppsp) ++{ ++ struct file_properties_info *props = (struct file_properties_info *)ppsp->lParam; ++ if (uMsg == PSPCB_RELEASE) ++ { ++ if (!InterlockedDecrement(&props->refcount)) ++ HeapFree(GetProcessHeap(), 0, props); ++ } ++ return 1; ++} ++ ++static void init_file_properties_pages(IDataObject *pDo, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) ++{ ++ static WCHAR title[] = {'G','e','n','e','r','a','l',0}; ++ struct file_properties_info *props; ++ HPROPSHEETPAGE general_page; ++ PROPSHEETPAGEW propsheet; ++ FORMATETC format; ++ STGMEDIUM stgm; ++ HRESULT hr; ++ WCHAR *p; ++ ++ props = HeapAlloc(GetProcessHeap(), 0, sizeof(*props)); ++ if (!props) return; ++ ++ format.cfFormat = CF_HDROP; ++ format.ptd = NULL; ++ format.dwAspect = DVASPECT_CONTENT; ++ format.lindex = -1; ++ format.tymed = TYMED_HGLOBAL; ++ ++ hr = IDataObject_GetData(pDo, &format, &stgm); ++ if (FAILED(hr)) goto error; ++ ++ if (!DragQueryFileW((HDROP)stgm.DUMMYUNIONNAME.hGlobal, 0, ++ props->path, sizeof(props->path) / sizeof(props->path[0]))) ++ { ++ ReleaseStgMedium(&stgm); ++ goto error; ++ } ++ ++ ReleaseStgMedium(&stgm); ++ ++ props->refcount = 1; ++ props->attrib = GetFileAttributesW(props->path); ++ if (props->attrib == INVALID_FILE_ATTRIBUTES) ++ goto error; ++ ++ strcpyW(props->dir, props->path); ++ if ((p = strrchrW(props->dir, '\\'))) ++ { ++ *p = 0; ++ props->filename = p + 1; ++ } ++ else ++ props->filename = props->dir; ++ ++ memset(&propsheet, 0, sizeof(propsheet)); ++ propsheet.dwSize = sizeof(propsheet); ++ propsheet.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK; ++ propsheet.hInstance = shell32_hInstance; ++ if (props->attrib & FILE_ATTRIBUTE_DIRECTORY) ++ propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FOLDER_PROPERTIES); ++ else ++ propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FILE_PROPERTIES); ++ propsheet.pfnDlgProc = file_properties_proc; ++ propsheet.pfnCallback = file_properties_callback; ++ propsheet.lParam = (LPARAM)props; ++ propsheet.pszTitle = title; ++ ++ general_page = CreatePropertySheetPageW(&propsheet); ++ if (general_page) lpfnAddPage(general_page, lParam); ++ return; ++ ++error: ++ HeapFree(GetProcessHeap(), 0, props); ++} ++ + #define MAX_PROP_PAGES 99 + + static void DoOpenProperties(ContextMenu *This, HWND hwnd) +@@ -363,22 +676,24 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd) + IShellFolder_Release(lpDesktopSF); + } + +- if (SUCCEEDED(ret)) +- { +- hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo); +- if (hpsxa != NULL) +- { +- SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); +- SHDestroyPropSheetExtArray(hpsxa); +- } +- hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletypeAll, MAX_PROP_PAGES - psh.nPages, lpDo); +- if (hpsxa != NULL) +- { +- SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); +- SHDestroyPropSheetExtArray(hpsxa); +- } +- IDataObject_Release(lpDo); +- } ++ if (SUCCEEDED(ret)) ++ { ++ init_file_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh); ++ ++ hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo); ++ if (hpsxa != NULL) ++ { ++ SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); ++ SHDestroyPropSheetExtArray(hpsxa); ++ } ++ hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletypeAll, MAX_PROP_PAGES - psh.nPages, lpDo); ++ if (hpsxa != NULL) ++ { ++ SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); ++ SHDestroyPropSheetExtArray(hpsxa); ++ } ++ IDataObject_Release(lpDo); ++ } + + if (psh.nPages) + PropertySheetW(&psh); +diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h +index 183a75e..1518de5 100644 +--- a/dlls/shell32/shresdef.h ++++ b/dlls/shell32/shresdef.h +@@ -152,6 +152,10 @@ + /* Note: this string is referenced from the registry*/ + #define IDS_RECYCLEBIN_FOLDER_NAME 8964 + ++/* Properties dialog */ ++#define IDD_FILE_PROPERTIES 8 ++#define IDD_FOLDER_PROPERTIES 9 ++ + #define IDD_ICON 0x4300 + #define IDD_MESSAGE 0x4301 + +@@ -232,6 +236,30 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi + #define IDC_RUNDLG_EDITPATH 12298 + #define IDC_RUNDLG_LABEL 12305 + ++/* file property dialog */ ++#define IDC_FPROP_ICON 13000 ++#define IDC_FPROP_PATH 13001 ++#define IDC_FPROP_TYPE_LABEL 13002 ++#define IDC_FPROP_TYPE 13003 ++#define IDC_FPROP_OPENWITH_LABEL 13004 ++#define IDC_FPROP_PROG_ICON 13005 ++#define IDC_FPROP_PROG_NAME 13006 ++#define IDC_FPROP_PROG_CHANGE 13007 ++#define IDC_FPROP_LOCATION_LABEL 13008 ++#define IDC_FPROP_LOCATION 13009 ++#define IDC_FPROP_SIZE_LABEL 13010 ++#define IDC_FPROP_SIZE 13011 ++#define IDC_FPROP_CREATED_LABEL 13012 ++#define IDC_FPROP_CREATED 13013 ++#define IDC_FPROP_MODIFIED_LABEL 13014 ++#define IDC_FPROP_MODIFIED 13015 ++#define IDC_FPROP_ACCESSED_LABEL 13016 ++#define IDC_FPROP_ACCESSED 13017 ++#define IDC_FPROP_ATTRIB_LABEL 13018 ++#define IDC_FPROP_READONLY 13019 ++#define IDC_FPROP_HIDDEN 13020 ++#define IDC_FPROP_ARCHIVE 13021 ++ + /* bitmaps */ + /* explorer toolbar icons + * FIXME: images are hacky and should be re-drawn; also dark and light bitmaps are same for now +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/shell32-File_Property_Dialog/definition wine-staging-1.7.46~ubuntu14.10.1/patches/shell32-File_Property_Dialog/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/shell32-File_Property_Dialog/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/shell32-File_Property_Dialog/definition 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Implement general tab for file property dialog diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch wine-staging-1.7.46~ubuntu14.10.1/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,64 @@ +From b4a2543264f9eb91fc259a81dea872eee3c14aba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Jun 2015 19:28:51 +0200 +Subject: loader: Print library paths for --check-libs on Mac OS X. + +--- + loader/main.c | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/loader/main.c b/loader/main.c +index 44804e1..4d9126e 100644 +--- a/loader/main.c ++++ b/loader/main.c +@@ -48,6 +48,7 @@ + #include "main.h" + + #ifdef __APPLE__ ++#include + + #ifndef __clang__ + __asm__(".zerofill WINE_DOS, WINE_DOS, ___wine_dos, 0x40000000"); +@@ -73,6 +74,26 @@ static inline void reserve_area( void *addr, size_t size ) + wine_mmap_add_reserved_area( addr, size ); + } + ++static const char *get_macho_library_path( const char *libname ) ++{ ++ unsigned int path_len, libname_len = strlen( libname ); ++ uint32_t i, count = _dyld_image_count(); ++ ++ for (i = 0; i < count; i++) ++ { ++ const char *path = _dyld_get_image_name( i ); ++ if (!path) continue; ++ ++ path_len = strlen( path ); ++ if (path_len < libname_len + 1) continue; ++ if (path[path_len - libname_len - 1] != '/') continue; ++ if (strcmp( path + path_len - libname_len, libname )) continue; ++ ++ return path; ++ } ++ return NULL; ++} ++ + #else /* __APPLE__ */ + + /* the preloader will set this variable */ +@@ -181,7 +202,11 @@ static void check_command_line( int argc, char *argv[] ) + else + #endif + { +- printf( "%s: found\n", *wine_libs ); ++ const char *path = NULL; ++ #ifdef __APPLE__ ++ path = get_macho_library_path( *wine_libs ); ++ #endif ++ printf( "%s: %s\n", *wine_libs, path ? path : "found"); + } + wine_dlclose( lib_handle, NULL, 0 ); + } +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/user32-Invalidate_Key_State/0001-user32-Globally-invalidate-key-state-on-changes-in-o.patch wine-staging-1.7.46~ubuntu14.10.1/patches/user32-Invalidate_Key_State/0001-user32-Globally-invalidate-key-state-on-changes-in-o.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/user32-Invalidate_Key_State/0001-user32-Globally-invalidate-key-state-on-changes-in-o.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/user32-Invalidate_Key_State/0001-user32-Globally-invalidate-key-state-on-changes-in-o.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,50 @@ +From 6ef2ab6c2318d4fb15220891ce16768e84354a88 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 16 Jun 2015 02:56:25 +0200 +Subject: user32: Globally invalidate key state on changes in other threads. + +--- + dlls/user32/input.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/dlls/user32/input.c b/dlls/user32/input.c +index 40e35a9..95f3c2f 100644 +--- a/dlls/user32/input.c ++++ b/dlls/user32/input.c +@@ -371,6 +371,7 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) + { + struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; + INT counter = global_key_state_counter; ++ BYTE prev_key_state; + SHORT ret; + + if (key < 0 || key >= 256) return 0; +@@ -398,14 +399,23 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) + { + req->tid = 0; + req->key = key; +- if (key_state_info) wine_server_set_reply( req, key_state_info->state, +- sizeof(key_state_info->state) ); ++ if (key_state_info) ++ { ++ prev_key_state = key_state_info->state[key]; ++ wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) ); ++ } + if (!wine_server_call( req )) + { + if (reply->state & 0x40) ret |= 0x0001; + if (reply->state & 0x80) ret |= 0x8000; + if (key_state_info) + { ++ /* force refreshing the key state cache - some multithreaded programs ++ * (like Adobe Photoshop CS5) expect that changes to the async key state ++ * are also immediately available in other threads. */ ++ if (prev_key_state != key_state_info->state[key]) ++ counter = interlocked_xchg_add( &global_key_state_counter, 1 ) + 1; ++ + key_state_info->time = GetTickCount(); + key_state_info->counter = counter; + } +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/user32-Invalidate_Key_State/definition wine-staging-1.7.46~ubuntu14.10.1/patches/user32-Invalidate_Key_State/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/user32-Invalidate_Key_State/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/user32-Invalidate_Key_State/definition 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [29871] Globally invalidate key state on changes in other threads diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2015-06-28 17:08:11.000000000 +0000 @@ -408,7 +408,7 @@ float scale; union -@@ -4190,9 +4222,15 @@ +@@ -4174,9 +4206,15 @@ } } } else { @@ -424,7 +424,7 @@ WARN("unsupported blending in openGl\n"); } } -@@ -4546,7 +4584,11 @@ +@@ -4530,7 +4568,11 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -436,7 +436,7 @@ const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; -@@ -4724,7 +4766,11 @@ +@@ -4708,7 +4750,11 @@ } else { @@ -448,7 +448,7 @@ UINT height; UINT width; -@@ -4788,7 +4834,11 @@ +@@ -4772,7 +4818,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1500,7 +1500,7 @@ if (rt_mask != *cur_mask) { context_apply_draw_buffers(context, rt_mask); -@@ -2954,7 +3030,11 @@ +@@ -2955,7 +3031,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -1512,7 +1512,7 @@ context->use_immediate_mode_draw = TRUE; } else -@@ -3094,11 +3174,19 @@ +@@ -3095,11 +3175,19 @@ } /* Context activation is done by the caller. */ @@ -1532,7 +1532,7 @@ unsigned int i, j; WORD map; -@@ -3130,12 +3218,17 @@ +@@ -3131,12 +3219,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1550,7 +1550,7 @@ } if (state->index_buffer) { -@@ -3239,7 +3332,11 @@ +@@ -3240,7 +3333,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1846,7 +1846,7 @@ void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, -@@ -1979,7 +2038,11 @@ +@@ -1980,7 +2039,11 @@ struct wined3d_state { DWORD flags; @@ -1858,7 +1858,7 @@ struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2024,6 +2087,7 @@ +@@ -2025,6 +2088,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1866,7 +1866,7 @@ struct wined3d_gl_bo { GLuint name; -@@ -2032,6 +2096,7 @@ +@@ -2033,6 +2097,7 @@ UINT size; }; @@ -1874,7 +1874,7 @@ #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2087,11 +2152,23 @@ +@@ -2088,11 +2153,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1898,7 +1898,7 @@ /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2102,6 +2179,9 @@ +@@ -2103,6 +2180,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1908,7 +1908,7 @@ HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2133,6 +2213,7 @@ +@@ -2134,6 +2214,7 @@ UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1916,7 +1916,7 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2144,6 +2225,11 @@ +@@ -2145,6 +2226,11 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -1928,7 +1928,7 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2160,9 +2246,11 @@ +@@ -2161,9 +2247,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1940,7 +1940,7 @@ }; struct wined3d_resource -@@ -2187,6 +2275,7 @@ +@@ -2188,6 +2276,7 @@ UINT depth; UINT size; DWORD priority; @@ -1948,7 +1948,7 @@ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2194,6 +2283,11 @@ +@@ -2195,6 +2284,11 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1960,7 +1960,7 @@ void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2218,6 +2312,7 @@ +@@ -2219,6 +2313,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1968,7 +1968,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2264,6 +2359,15 @@ +@@ -2265,6 +2360,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1984,7 +1984,7 @@ /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2348,7 +2452,9 @@ +@@ -2349,7 +2453,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1994,7 +1994,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2382,9 +2488,16 @@ +@@ -2383,9 +2489,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2011,7 +2011,7 @@ }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2392,6 +2505,7 @@ +@@ -2393,6 +2506,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2019,7 +2019,7 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2404,6 +2518,23 @@ +@@ -2405,6 +2519,23 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2043,7 +2043,7 @@ UINT bitmap_size; }; -@@ -2429,7 +2560,11 @@ +@@ -2430,7 +2561,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2055,7 +2055,7 @@ }; struct wined3d_surface -@@ -2437,12 +2572,25 @@ +@@ -2438,12 +2573,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2081,7 +2081,7 @@ GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2486,10 +2634,19 @@ +@@ -2487,10 +2635,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2101,7 +2101,7 @@ void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2501,6 +2658,7 @@ +@@ -2502,6 +2659,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2109,7 +2109,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2519,6 +2677,21 @@ +@@ -2520,6 +2678,21 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; @@ -2131,7 +2131,7 @@ /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2566,8 +2739,10 @@ +@@ -2567,8 +2740,10 @@ BOOL half_float_conv_needed; }; @@ -2142,7 +2142,7 @@ struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2635,6 +2810,7 @@ +@@ -2636,6 +2811,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2150,7 +2150,7 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2685,6 +2861,32 @@ +@@ -2686,6 +2862,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2183,7 +2183,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2734,6 +2936,7 @@ +@@ -2735,6 +2937,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2191,7 +2191,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2793,6 +2996,7 @@ +@@ -2794,6 +2997,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2199,7 +2199,7 @@ /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2807,8 +3011,12 @@ +@@ -2808,8 +3012,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2212,7 +2212,7 @@ }; struct wined3d_query -@@ -2822,12 +3030,16 @@ +@@ -2823,12 +3031,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2229,7 +2229,7 @@ /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2854,7 +3066,9 @@ +@@ -2855,7 +3067,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2239,7 +2239,7 @@ void *map_ptr; struct wined3d_map_range *maps; -@@ -2879,11 +3093,15 @@ +@@ -2880,11 +3094,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2255,7 +2255,7 @@ struct wined3d_rendertarget_view { -@@ -2922,8 +3140,10 @@ +@@ -2923,8 +3141,10 @@ return surface_from_resource(resource); } @@ -2266,7 +2266,7 @@ struct wined3d_shader_resource_view { LONG refcount; -@@ -2936,8 +3156,12 @@ +@@ -2937,8 +3157,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2279,7 +2279,7 @@ }; struct wined3d_swapchain -@@ -2977,8 +3201,10 @@ +@@ -2978,8 +3202,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2290,7 +2290,7 @@ /***************************************************************************** * Utility function prototypes -@@ -3182,7 +3408,9 @@ +@@ -3183,7 +3409,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -4512,7 +4512,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1527,9 +1527,17 @@ +@@ -1528,9 +1528,17 @@ const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) { const struct wined3d_shader_version *version = ®_maps->shader_version; @@ -4530,7 +4530,7 @@ unsigned int i, extra_constants_needed = 0; const struct wined3d_shader_lconst *lconst; const char *prefix; -@@ -1789,7 +1797,11 @@ +@@ -1790,7 +1798,11 @@ { UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); @@ -4542,7 +4542,7 @@ shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } -@@ -1830,6 +1842,7 @@ +@@ -1831,6 +1843,7 @@ } else { @@ -4550,7 +4550,7 @@ /* This happens because we do not have proper tracking of the * constant registers that are actually used, only the max * limit of the shader version. -@@ -1838,6 +1851,23 @@ +@@ -1839,6 +1852,23 @@ * it and just create the uniform. */ FIXME("Cannot find a free uniform for vpos correction params\n"); @@ -7090,7 +7090,7 @@ } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1923,6 +2338,7 @@ +@@ -1902,6 +2317,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7098,7 +7098,7 @@ surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1931,6 +2347,15 @@ +@@ -1910,6 +2326,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7114,7 +7114,7 @@ width = texture_resource->width; height = texture_resource->height; -@@ -1956,7 +2381,11 @@ +@@ -1935,7 +2360,11 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7126,7 +7126,7 @@ { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -1998,11 +2427,19 @@ +@@ -1977,11 +2406,19 @@ if (!valid_location) { @@ -7146,7 +7146,7 @@ return WINED3D_OK; } -@@ -2361,6 +2798,7 @@ +@@ -2340,6 +2777,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7154,7 +7154,7 @@ void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2369,6 +2807,13 @@ +@@ -2348,6 +2786,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7168,7 +7168,7 @@ conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2392,6 +2837,7 @@ +@@ -2371,6 +2816,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7176,7 +7176,7 @@ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2432,6 +2878,32 @@ +@@ -2411,6 +2857,32 @@ if (context) context_release(context); return NULL; @@ -7209,7 +7209,7 @@ } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2499,6 +2971,7 @@ +@@ -2478,6 +2950,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7217,7 +7217,7 @@ HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2517,6 +2990,40 @@ +@@ -2496,6 +2969,40 @@ struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -7258,7 +7258,7 @@ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2528,6 +3035,13 @@ +@@ -2507,6 +3014,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7272,7 +7272,7 @@ /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2543,6 +3057,7 @@ +@@ -2522,6 +3036,7 @@ } } @@ -7280,7 +7280,7 @@ if (rect) { surface->lockedRect = *rect; -@@ -2607,20 +3122,119 @@ +@@ -2586,22 +3101,121 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7314,7 +7314,8 @@ - TRACE("Returning dc %p.\n", *dc); + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) + surface_invalidate_location(surface, ~surface->resource.map_binding); -+ + +- return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; + switch (surface->resource.map_binding) + { + case WINED3D_LOCATION_SYSMEM: @@ -7409,10 +7410,12 @@ + wined3d_cs_emit_getdc(device->cs, surface); + *dc = surface->hDC; + TRACE("Returning dc %p.\n", *dc); - - return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; ++ ++ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; } -@@ -2648,6 +3262,35 @@ + + void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) +@@ -2627,6 +3241,35 @@ if (context) context_release(context); } @@ -7448,7 +7451,7 @@ } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2667,6 +3310,7 @@ +@@ -2646,6 +3289,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7456,7 +7459,7 @@ wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2679,6 +3323,31 @@ +@@ -2658,6 +3302,31 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *restore_rt; @@ -7488,7 +7491,7 @@ BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2686,6 +3355,7 @@ +@@ -2665,6 +3334,7 @@ struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -7496,7 +7499,7 @@ wined3d_resource_get_memory(&surface->resource, dst_location, &data); /* Context_release does not restore the original context in case of -@@ -2703,6 +3373,11 @@ +@@ -2682,6 +3352,11 @@ context = context_acquire(device, surface); } @@ -7508,7 +7511,7 @@ context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2791,12 +3466,16 @@ +@@ -2770,12 +3445,16 @@ checkGLcall("glBindBuffer"); } @@ -7525,7 +7528,7 @@ } /* Read the framebuffer contents into a texture. Note that this function -@@ -2858,6 +3537,85 @@ +@@ -2837,6 +3516,85 @@ } } @@ -7611,7 +7614,7 @@ /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -2964,8 +3722,13 @@ +@@ -2943,8 +3701,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7625,7 +7628,7 @@ } /* Uses the hardware to stretch and flip the image */ -@@ -3033,7 +3796,11 @@ +@@ -3012,7 +3775,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7637,7 +7640,7 @@ } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3230,6 +3997,7 @@ +@@ -3209,6 +3976,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7645,7 +7648,7 @@ if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3241,6 +4009,17 @@ +@@ -3220,6 +3988,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7663,7 +7666,7 @@ } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3271,6 +4050,7 @@ +@@ -3250,6 +4029,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7671,7 +7674,7 @@ /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3305,6 +4085,26 @@ +@@ -3284,6 +4064,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7698,7 +7701,7 @@ wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3347,6 +4147,7 @@ +@@ -3326,6 +4126,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7706,7 +7709,7 @@ if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3360,6 +4161,14 @@ +@@ -3339,6 +4140,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7721,7 +7724,7 @@ } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3383,8 +4192,13 @@ +@@ -3362,8 +4171,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7735,7 +7738,7 @@ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3575,6 +4389,7 @@ +@@ -3554,6 +4368,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7743,7 +7746,7 @@ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3583,6 +4398,15 @@ +@@ -3562,6 +4377,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7759,7 +7762,7 @@ } /* Context activation is done by the caller. */ -@@ -3597,7 +4421,11 @@ +@@ -3576,7 +4400,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7771,7 +7774,7 @@ { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3623,7 +4451,11 @@ +@@ -3602,7 +4430,11 @@ return; } @@ -7783,7 +7786,7 @@ { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3643,6 +4475,7 @@ +@@ -3622,6 +4454,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7791,7 +7794,7 @@ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3654,6 +4487,19 @@ +@@ -3633,6 +4466,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7811,7 +7814,7 @@ surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3718,9 +4564,13 @@ +@@ -3697,9 +4543,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7825,7 +7828,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3736,9 +4586,13 @@ +@@ -3715,9 +4565,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7839,7 +7842,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3746,6 +4600,7 @@ +@@ -3725,6 +4579,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7847,7 +7850,7 @@ surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3791,6 +4646,135 @@ +@@ -3770,6 +4625,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7983,7 +7986,7 @@ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3800,6 +4784,7 @@ +@@ -3779,6 +4763,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7991,7 +7994,7 @@ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3868,6 +4853,66 @@ +@@ -3847,6 +4832,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8058,7 +8061,7 @@ &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3877,6 +4922,7 @@ +@@ -3856,6 +4901,7 @@ if (srgb) { @@ -8066,7 +8069,7 @@ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3905,6 +4951,39 @@ +@@ -3884,6 +4930,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8106,7 +8109,7 @@ wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -3919,7 +4998,11 @@ +@@ -3898,7 +4977,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8118,7 +8121,7 @@ { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3928,6 +5011,7 @@ +@@ -3907,6 +4990,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8126,7 +8129,7 @@ wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3935,6 +5019,14 @@ +@@ -3914,6 +4998,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8141,7 +8144,7 @@ if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3980,6 +5072,7 @@ +@@ -3959,6 +5051,7 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8149,7 +8152,7 @@ HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -4003,6 +5096,31 @@ +@@ -3982,6 +5075,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8181,7 +8184,7 @@ HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4010,6 +5128,7 @@ +@@ -3989,6 +5107,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8189,7 +8192,7 @@ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4019,21 +5138,63 @@ +@@ -3998,21 +5117,63 @@ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ @@ -8258,7 +8261,7 @@ } switch (location) -@@ -4042,6 +5203,7 @@ +@@ -4021,6 +5182,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8266,7 +8269,7 @@ surface_load_sysmem(surface, context, location); break; -@@ -4059,6 +5221,24 @@ +@@ -4038,6 +5200,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8291,7 +8294,7 @@ break; default: -@@ -4066,12 +5246,21 @@ +@@ -4045,12 +5225,21 @@ break; } @@ -8313,7 +8316,7 @@ } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4179,6 +5368,7 @@ +@@ -4158,6 +5347,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8321,7 +8324,7 @@ struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4199,6 +5389,21 @@ +@@ -4178,6 +5368,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8343,7 +8346,7 @@ return WINED3D_OK; } -@@ -4207,6 +5412,7 @@ +@@ -4186,6 +5391,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8351,7 +8354,7 @@ struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4222,6 +5428,20 @@ +@@ -4201,6 +5407,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8372,7 +8375,7 @@ return WINED3D_OK; } -@@ -4234,6 +5454,7 @@ +@@ -4213,6 +5433,7 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; DWORD old_color_key_flags = src_surface->container->async.color_key_flags; @@ -8380,7 +8383,7 @@ struct wined3d_context *context; TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -4251,6 +5472,22 @@ +@@ -4230,6 +5451,22 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -8403,7 +8406,7 @@ } const struct blit_shader ffp_blit = { -@@ -4410,6 +5647,7 @@ +@@ -4389,6 +5626,7 @@ const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_texture *src_texture = NULL; @@ -8411,7 +8414,7 @@ void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4440,6 +5678,23 @@ +@@ -4419,6 +5657,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8435,7 +8438,7 @@ src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4451,12 +5706,14 @@ +@@ -4430,12 +5685,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -8450,7 +8453,7 @@ if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4467,9 +5724,13 @@ +@@ -4446,9 +5703,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8464,7 +8467,7 @@ src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4479,8 +5740,12 @@ +@@ -4458,8 +5719,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -8477,7 +8480,7 @@ } bpp = dst_surface->resource.format->byte_count; -@@ -4491,12 +5756,24 @@ +@@ -4470,12 +5735,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8502,7 +8505,7 @@ if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4531,7 +5808,11 @@ +@@ -4510,7 +5787,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8514,7 +8517,7 @@ src_format, flags, fx); goto release; } -@@ -4539,7 +5820,11 @@ +@@ -4518,7 +5799,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8526,7 +8529,7 @@ flags &= ~WINEDDBLT_COLORFILL; } -@@ -4588,6 +5873,7 @@ +@@ -4567,6 +5852,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8534,7 +8537,7 @@ sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4601,6 +5887,21 @@ +@@ -4580,6 +5866,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8556,7 +8559,7 @@ memcpy(dbuf, sbuf, width); } } -@@ -4610,8 +5911,13 @@ +@@ -4589,8 +5890,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8570,7 +8573,7 @@ } } } -@@ -4620,9 +5926,15 @@ +@@ -4599,9 +5905,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8586,7 +8589,7 @@ } } } -@@ -4632,6 +5944,7 @@ +@@ -4611,6 +5923,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8594,7 +8597,7 @@ sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4639,6 +5952,15 @@ +@@ -4618,6 +5931,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8610,7 +8613,7 @@ } else { -@@ -4685,6 +6007,7 @@ +@@ -4664,6 +5986,7 @@ } #undef STRETCH_ROW } @@ -8618,7 +8621,7 @@ dbuf += dst_row_pitch; last_sy = sy; } -@@ -4693,6 +6016,16 @@ +@@ -4672,6 +5995,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8635,7 +8638,7 @@ DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4742,7 +6075,11 @@ +@@ -4721,7 +6054,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8647,7 +8650,7 @@ dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4819,6 +6156,7 @@ +@@ -4798,6 +6135,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8655,7 +8658,7 @@ #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4840,6 +6178,29 @@ +@@ -4819,6 +6157,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8685,7 +8688,7 @@ switch (bpp) { -@@ -4858,7 +6219,11 @@ +@@ -4837,7 +6198,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8697,7 +8700,7 @@ dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4889,10 +6254,12 @@ +@@ -4868,10 +6233,12 @@ } } @@ -8710,7 +8713,7 @@ error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4900,6 +6267,7 @@ +@@ -4879,6 +6246,7 @@ } release: @@ -8718,7 +8721,7 @@ if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4918,6 +6286,14 @@ +@@ -4897,6 +6265,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8733,7 +8736,7 @@ return hr; } -@@ -4962,6 +6338,7 @@ +@@ -4941,6 +6317,7 @@ cpu_blit_blit_surface, }; @@ -8741,7 +8744,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4969,6 +6346,16 @@ +@@ -4948,6 +6325,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8758,7 +8761,7 @@ BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4979,6 +6366,106 @@ +@@ -4958,6 +6345,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8865,7 +8868,7 @@ if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5021,8 +6508,13 @@ +@@ -5000,8 +6487,13 @@ } scale = src_surface @@ -8879,7 +8882,7 @@ convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5042,6 +6534,7 @@ +@@ -5021,6 +6513,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8887,7 +8890,7 @@ return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5052,6 +6545,24 @@ +@@ -5031,6 +6524,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -8912,7 +8915,7 @@ } } else -@@ -5060,8 +6571,13 @@ +@@ -5039,8 +6550,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -8926,7 +8929,7 @@ { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5082,8 +6598,13 @@ +@@ -5061,8 +6577,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -8940,7 +8943,7 @@ } else { -@@ -5101,8 +6622,13 @@ +@@ -5080,8 +6601,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -8954,7 +8957,7 @@ { /* Upload */ if (scale) -@@ -5111,6 +6637,7 @@ +@@ -5090,6 +6616,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8962,7 +8965,7 @@ POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5123,6 +6650,15 @@ +@@ -5102,6 +6629,15 @@ context_release(context); } return; @@ -8978,7 +8981,7 @@ } } } -@@ -5146,6 +6682,7 @@ +@@ -5125,6 +6661,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8986,7 +8989,7 @@ return; } -@@ -5341,6 +6878,49 @@ +@@ -5320,6 +6857,49 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9036,7 +9039,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5408,7 +6988,11 @@ +@@ -5387,7 +6967,11 @@ } surface->container = container; @@ -9048,7 +9051,7 @@ list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5440,9 +7024,14 @@ +@@ -5419,9 +7003,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9063,7 +9066,7 @@ } return hr; -@@ -5469,7 +7058,11 @@ +@@ -5448,7 +7037,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -9611,7 +9614,7 @@ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5328,9 +5328,15 @@ +@@ -5341,9 +5341,15 @@ DebugBreak(); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wined3d-DXTn/0004-wined3d-Load-dxtn-dylib-library-on-Mac-OS-X.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wined3d-DXTn/0004-wined3d-Load-dxtn-dylib-library-on-Mac-OS-X.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wined3d-DXTn/0004-wined3d-Load-dxtn-dylib-library-on-Mac-OS-X.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wined3d-DXTn/0004-wined3d-Load-dxtn-dylib-library-on-Mac-OS-X.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,27 @@ +From d8452914d07d7a24aa2647bf7c98383d962693f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Jun 2015 22:26:14 +0200 +Subject: wined3d: Load dxtn dylib library on Mac OS X. + +--- + dlls/wined3d/dxtn.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/wined3d/dxtn.c b/dlls/wined3d/dxtn.c +index 2639788..03e4b26 100644 +--- a/dlls/wined3d/dxtn.c ++++ b/dlls/wined3d/dxtn.c +@@ -465,6 +465,10 @@ BOOL wined3d_dxtn_init(void) + #ifdef SONAME_LIBTXC_DXTN + SONAME_LIBTXC_DXTN, + #endif ++#ifdef __APPLE__ ++ "libtxc_dxtn.dylib", ++ "libtxc_dxtn_s2tc.dylib", ++#endif + "libtxc_dxtn.so", + "libtxc_dxtn_s2tc.so.0" + }; +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/0001-wininet-Use-random-names-when-caching-very-long-urls.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/0001-wininet-Use-random-names-when-caching-very-long-urls.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/0001-wininet-Use-random-names-when-caching-very-long-urls.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/0001-wininet-Use-random-names-when-caching-very-long-urls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From c437a2f59781727e9dd2109eafc9fa750404c260 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Thu, 28 May 2015 22:47:20 +0200 -Subject: wininet: Use random names when caching very long urls. - ---- - dlls/wininet/urlcache.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c -index 276132b..0e5fe3c 100644 ---- a/dlls/wininet/urlcache.c -+++ b/dlls/wininet/urlcache.c -@@ -2630,7 +2630,7 @@ static BOOL urlcache_entry_create(const char *url, const char *ext, WCHAR *full_ - if(!InternetCrackUrlA(url, 0, 0, &uc)) - uc.dwUrlPathLength = 0; - -- if(!uc.dwUrlPathLength) { -+ if(!uc.dwUrlPathLength || uc.dwUrlPathLength >= sizeof(file_name)) { - file_name[0] = 0; - }else { - char *p, *e; --- -2.4.1 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/definition wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/definition --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/definition 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cache_Long_URLs/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Use random names when caching very long urls in wininet diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch 2015-06-28 17:08:11.000000000 +0000 @@ -1,4 +1,4 @@ -From 258182e1105befbf3ee6b6a388c07d1a84632fee Mon Sep 17 00:00:00 2001 +From 58d5370c1a1a1e0ee44742440ebf7abcd19c148c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 May 2015 20:37:19 +0200 Subject: wininet/tests: Add more tests for cookies. @@ -8,10 +8,10 @@ 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 3b2f9a5..bbfdaf0 100644 +index b841795..559ab3e 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c -@@ -1974,6 +1974,14 @@ static const char okmsg2[] = +@@ -1990,6 +1990,14 @@ static const char okmsg2[] = "Set-Cookie: two\r\n" "\r\n"; @@ -26,7 +26,7 @@ static const char notokmsg[] = "HTTP/1.1 400 Bad Request\r\n" "Server: winetest\r\n" -@@ -2335,6 +2343,32 @@ static DWORD CALLBACK server_thread(LPVOID param) +@@ -2353,6 +2361,32 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof notokmsg-1, 0); } @@ -56,10 +56,10 @@ + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } - shutdown(c, 2); - closesocket(c); - c = -1; -@@ -3545,7 +3579,7 @@ static void test_cookie_header(int port) + if (strstr(buffer, "/test_host_override")) + { + if (strstr(buffer, host_header_override)) +@@ -3669,7 +3703,7 @@ static void test_cookie_header(int port) HINTERNET ses, con, req; DWORD size, error; BOOL ret; @@ -68,7 +68,7 @@ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n"); -@@ -3573,7 +3607,7 @@ static void test_cookie_header(int port) +@@ -3697,7 +3731,7 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); @@ -77,15 +77,15 @@ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); -@@ -3584,9 +3618,61 @@ static void test_cookie_header(int port) +@@ -3708,9 +3742,61 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!strcmp(buffer, "cookie=biscuit"), "got '%s' expected \'cookie=biscuit\'\n", buffer); + ok(!strstr(buffer, "cookie=not biscuit"), "'%s' should not contain \'cookie=not biscuit\'\n", buffer); + ok(!!strstr(buffer, "cookie=biscuit"), "'%s' should contain \'cookie=biscuit\'\n", buffer); - - InternetCloseHandle(req); ++ ++ InternetCloseHandle(req); + + InternetSetCookieA("http://localhost/testCCCC", "subcookie", "data"); + @@ -118,12 +118,12 @@ + + req = HttpOpenRequestA(con, NULL, "/test_cookie_path2", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); -+ + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 400); -+ InternetCloseHandle(req); + InternetCloseHandle(req); + + req = HttpOpenRequestA(con, NULL, "/test_cookie_merge", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); @@ -141,5 +141,5 @@ InternetCloseHandle(ses); } -- -2.4.0 +2.4.3 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -From 0f294422ff9d63808689d47eddb20945d74d2349 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 15 May 2015 21:07:19 +0200 -Subject: wininet/tests: Add tests for overriding host header. - ---- - dlls/wininet/tests/http.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 109 insertions(+) - -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index bbfdaf0..94f4ae9 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -2043,6 +2043,7 @@ static DWORD CALLBACK server_thread(LPVOID param) - WSADATA wsaData; - int last_request = 0; - char host_header[22]; -+ char host_header_override[30]; - static BOOL test_b = FALSE; - static int test_no_cache = 0; - -@@ -2069,6 +2070,7 @@ static DWORD CALLBACK server_thread(LPVOID param) - SetEvent(si->hEvent); - - sprintf(host_header, "Host: localhost:%d", si->port); -+ sprintf(host_header_override, "Host: test.local:%d\r\n", si->port); - - do - { -@@ -2369,6 +2371,13 @@ static DWORD CALLBACK server_thread(LPVOID param) - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } -+ if (strstr(buffer, "/test_host_override")) -+ { -+ if (strstr(buffer, host_header_override)) -+ send(c, okmsg, sizeof okmsg-1, 0); -+ else -+ send(c, notokmsg, sizeof notokmsg-1, 0); -+ } - shutdown(c, 2); - closesocket(c); - c = -1; -@@ -2964,6 +2973,105 @@ static void test_connection_header(int port) - InternetCloseHandle(ses); - } - -+static void test_header_override(int port) -+{ -+ char buffer[128], host_header_override[30], full_url[128]; -+ HINTERNET ses, con, req; -+ DWORD size, count, err; -+ BOOL ret; -+ -+ sprintf(host_header_override, "Host: test.local:%d\r\n", port); -+ sprintf(full_url, "http://localhost:%d/test_host_override", port); -+ -+ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); -+ ok(ses != NULL, "InternetOpen failed\n"); -+ -+ con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); -+ ok(con != NULL, "InternetConnect failed\n"); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ memset(buffer, 0, sizeof(buffer)); -+ size = sizeof(buffer)-1; -+ count = 0; -+ ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); -+ err = GetLastError(); -+ todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); -+ todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); -+ -+ memset(buffer, 0, sizeof(buffer)); -+ size = sizeof(buffer)-1; -+ ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); -+ ok(ret, "InternetQueryOption failed\n"); -+ ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ memset(buffer, 0, sizeof(buffer)); -+ size = sizeof(buffer)-1; -+ count = 0; -+ ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); -+ ok(ret, "HttpQueryInfo failed\n"); -+ -+ memset(buffer, 0, sizeof(buffer)); -+ size = sizeof(buffer)-1; -+ ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); -+ ok(ret, "InternetQueryOption failed\n"); -+ todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code_todo(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_COALESCE); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 400); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE); -+ err = GetLastError(); -+ todo_wine ok(!ret, "HttpAddRequestHeaders succeeded\n"); -+ todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code_todo(req, 400); -+ InternetCloseHandle(req); -+ -+ InternetCloseHandle( con ); -+ InternetCloseHandle( ses ); -+} -+ - static void test_http1_1(int port) - { - HINTERNET ses, con, req; -@@ -4392,6 +4500,7 @@ static void test_http_connection(void) - test_basic_request(si.port, "GET", "/test6"); - test_basic_request(si.port, "GET", "/testF"); - test_connection_header(si.port); -+ test_header_override(si.port); - test_http1_1(si.port); - test_cookie_header(si.port); - test_basic_authentication(si.port); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,122 @@ +From 5049ef6fb20ab57cfe18209df3deee1bf1c5d069 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 15 May 2015 21:18:37 +0200 +Subject: wininet/tests: Test auth credential reusage with host override. + +--- + dlls/wininet/tests/http.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 92 insertions(+) + +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 559ab3e..29abb2f 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -2394,6 +2394,20 @@ static DWORD CALLBACK server_thread(LPVOID param) + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } ++ if (strstr(buffer, "HEAD /test_auth_host1")) ++ { ++ if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzcw==")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, noauthmsg, sizeof noauthmsg-1, 0); ++ } ++ if (strstr(buffer, "HEAD /test_auth_host2")) ++ { ++ if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzczI=")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, noauthmsg, sizeof noauthmsg-1, 0); ++ } + shutdown(c, 2); + closesocket(c); + c = -1; +@@ -3086,6 +3100,84 @@ static void test_header_override(int port) + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); ++ ++ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ++ ok(ses != NULL, "InternetOpenA failed\n"); ++ ++ con = InternetConnectA(ses, "localhost", port, "test1", "pass", INTERNET_SERVICE_HTTP, 0, 0); ++ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); ++ ++ req = HttpOpenRequestA( con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); ++ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ InternetCloseHandle(con); ++ InternetCloseHandle(ses); ++ ++ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ++ ok(ses != NULL, "InternetOpenA failed\n"); ++ ++ con = InternetConnectA( ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); ++ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); ++ ++ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); ++ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); ++ ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ InternetCloseHandle(con); ++ InternetCloseHandle(ses); ++ ++ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ++ ok(ses != NULL, "InternetOpenA failed\n"); ++ ++ con = InternetConnectA(ses, "localhost", port, "test1", "pass2", INTERNET_SERVICE_HTTP, 0, 0); ++ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); ++ ++ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); ++ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ InternetCloseHandle(con); ++ InternetCloseHandle(ses); ++ ++ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ++ ok(ses != NULL, "InternetOpenA failed\n"); ++ ++ con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); ++ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); ++ ++ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); ++ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ InternetCloseHandle(con); ++ InternetCloseHandle(ses); + } + + static void test_http1_1(int port) +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,144 @@ +From 6f8e73f6f05924035dcb731332298cc224ab8f20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 15 May 2015 23:09:20 +0200 +Subject: wininet/tests: Check cookie behaviour when overriding host. + +--- + dlls/wininet/tests/http.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 98 insertions(+), 1 deletion(-) + +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 58eb5cc..6d1d48f 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -1998,6 +1998,14 @@ static const char okmsg_cookie_path[] = + "Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" + "\r\n"; + ++static const char okmsg_cookie[] = ++"HTTP/1.1 200 OK\r\n" ++"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" ++"Server: winetest\r\n" ++"Content-Length: 0\r\n" ++"Set-Cookie: testcookie=testvalue\r\n" ++"\r\n"; ++ + static const char notokmsg[] = + "HTTP/1.1 400 Bad Request\r\n" + "Server: winetest\r\n" +@@ -2387,6 +2395,25 @@ static DWORD CALLBACK server_thread(LPVOID param) + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } ++ if (strstr(buffer, "/test_cookie_set_host_override")) ++ { ++ send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); ++ } ++ if (strstr(buffer, "/test_cookie_check_host_override")) ++ { ++ if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, notokmsg, sizeof notokmsg-1, 0); ++ } ++ if (strstr(buffer, "/test_cookie_check_different_host")) ++ { ++ if (!strstr(buffer, "foo") && ++ strstr(buffer, "cookie=biscuit")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, notokmsg, sizeof notokmsg-1, 0); ++ } + if (strstr(buffer, "/test_host_override")) + { + if (strstr(buffer, host_header_override)) +@@ -3098,6 +3125,74 @@ static void test_header_override(int port) + test_status_code_todo(req, 400); + + InternetCloseHandle(req); ++ InternetSetCookieA("http://localhost", "cookie", "biscuit"); ++ req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code_todo(req, 200); ++ ++ InternetCloseHandle(req); ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code_todo(req, 200); ++ ++ InternetCloseHandle(req); ++ InternetSetCookieA("http://test.local", "foo", "bar"); ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ ++ InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + +@@ -4545,8 +4640,10 @@ static void test_request_content_length(int port) + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + ++ /* On XP there is a weird bug that the following tests fail if certain cookies ++ * are set. We workaround this problem by passing INTERNET_FLAG_NO_COOKIES as flag. */ + req = HttpOpenRequestA(con, "POST", "/test_request_content_length", NULL, NULL, NULL, +- INTERNET_FLAG_KEEP_CONNECTION, 0); ++ INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_COOKIES, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From 7a7b4bf4644553b821deea0287289ffe54207768 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 15 May 2015 21:18:37 +0200 -Subject: wininet/tests: Test auth credential reusage with host override. - ---- - dlls/wininet/tests/http.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 92 insertions(+) - -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 94f4ae9..4c515b7 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -2378,6 +2378,20 @@ static DWORD CALLBACK server_thread(LPVOID param) - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } -+ if (strstr(buffer, "HEAD /test_auth_host1")) -+ { -+ if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzcw==")) -+ send(c, okmsg, sizeof okmsg-1, 0); -+ else -+ send(c, noauthmsg, sizeof noauthmsg-1, 0); -+ } -+ if (strstr(buffer, "HEAD /test_auth_host2")) -+ { -+ if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzczI=")) -+ send(c, okmsg, sizeof okmsg-1, 0); -+ else -+ send(c, noauthmsg, sizeof noauthmsg-1, 0); -+ } - shutdown(c, 2); - closesocket(c); - c = -1; -@@ -3070,6 +3084,84 @@ static void test_header_override(int port) - - InternetCloseHandle( con ); - InternetCloseHandle( ses ); -+ -+ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); -+ ok(ses != NULL, "InternetOpenA failed\n"); -+ -+ con = InternetConnectA(ses, "localhost", port, "test1", "pass", INTERNET_SERVICE_HTTP, 0, 0); -+ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); -+ -+ req = HttpOpenRequestA( con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); -+ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); -+ -+ test_status_code(req, 200); -+ -+ InternetCloseHandle(req); -+ InternetCloseHandle(con); -+ InternetCloseHandle(ses); -+ -+ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); -+ ok(ses != NULL, "InternetOpenA failed\n"); -+ -+ con = InternetConnectA( ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); -+ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); -+ -+ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); -+ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); -+ ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); -+ -+ test_status_code(req, 200); -+ -+ InternetCloseHandle(req); -+ InternetCloseHandle(con); -+ InternetCloseHandle(ses); -+ -+ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); -+ ok(ses != NULL, "InternetOpenA failed\n"); -+ -+ con = InternetConnectA(ses, "localhost", port, "test1", "pass2", INTERNET_SERVICE_HTTP, 0, 0); -+ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); -+ -+ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); -+ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); -+ -+ test_status_code(req, 200); -+ -+ InternetCloseHandle(req); -+ InternetCloseHandle(con); -+ InternetCloseHandle(ses); -+ -+ ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); -+ ok(ses != NULL, "InternetOpenA failed\n"); -+ -+ con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); -+ ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); -+ -+ req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); -+ ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); -+ -+ test_status_code(req, 200); -+ -+ InternetCloseHandle(req); -+ InternetCloseHandle(con); -+ InternetCloseHandle(ses); - } - - static void test_http1_1(int port) --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -From 9e879920a222f6c795b836fb687b6d3549c8c36e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 15 May 2015 23:09:20 +0200 -Subject: wininet/tests: Check cookie behaviour when overriding host. - ---- - dlls/wininet/tests/http.c | 101 +++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 100 insertions(+), 1 deletion(-) - -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 4c515b7..165a76e 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -1982,6 +1982,14 @@ static const char okmsg_cookie_path[] = - "Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" - "\r\n"; - -+static const char okmsg_cookie[] = -+"HTTP/1.1 200 OK\r\n" -+"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" -+"Server: winetest\r\n" -+"Content-Length: 0\r\n" -+"Set-Cookie: testcookie=testvalue\r\n" -+"\r\n"; -+ - static const char notokmsg[] = - "HTTP/1.1 400 Bad Request\r\n" - "Server: winetest\r\n" -@@ -2371,6 +2379,25 @@ static DWORD CALLBACK server_thread(LPVOID param) - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } -+ if (strstr(buffer, "/test_cookie_set_host_override")) -+ { -+ send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); -+ } -+ if (strstr(buffer, "/test_cookie_check_host_override")) -+ { -+ if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) -+ send(c, okmsg, sizeof okmsg-1, 0); -+ else -+ send(c, notokmsg, sizeof notokmsg-1, 0); -+ } -+ if (strstr(buffer, "/test_cookie_check_different_host")) -+ { -+ if (!strstr(buffer, "foo") && -+ strstr(buffer, "cookie=biscuit")) -+ send(c, okmsg, sizeof okmsg-1, 0); -+ else -+ send(c, notokmsg, sizeof notokmsg-1, 0); -+ } - if (strstr(buffer, "/test_host_override")) - { - if (strstr(buffer, host_header_override)) -@@ -3082,6 +3109,76 @@ static void test_header_override(int port) - test_status_code_todo(req, 400); - InternetCloseHandle(req); - -+ InternetSetCookieA("http://localhost", "cookie", "biscuit"); -+ -+ req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code_todo(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code_todo(req, 200); -+ InternetCloseHandle(req); -+ -+ InternetSetCookieA("http://test.local", "foo", "bar"); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 200); -+ InternetCloseHandle(req); -+ -+ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -+ ok(req != NULL, "HttpOpenRequest failed\n"); -+ -+ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); -+ ok(ret, "HttpAddRequestHeaders failed\n"); -+ -+ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); -+ ok(ret, "HttpSendRequest failed\n"); -+ -+ test_status_code(req, 200); -+ InternetCloseHandle(req); -+ - InternetCloseHandle( con ); - InternetCloseHandle( ses ); - -@@ -4453,8 +4550,10 @@ static void test_request_content_length(int port) - con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnect failed\n"); - -+ /* On XP there is a weird bug that the following tests fail if certain cookies -+ * are set. We workaround this problem by passing INTERNET_FLAG_NO_COOKIES as flag. */ - req = HttpOpenRequestA(con, "POST", "/test_request_content_length", NULL, NULL, NULL, -- INTERNET_FLAG_KEEP_CONNECTION, 0); -+ INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_COOKIES, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-Use-request-server-name-when-processing-cook.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-Use-request-server-name-when-processing-cook.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-Use-request-server-name-when-processing-cook.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0004-wininet-Use-request-server-name-when-processing-cook.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,45 @@ +From d3936900b7650ff24b116c48457861ea3b78eef4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:34:22 +0200 +Subject: wininet: Use request->server->name when processing cookies instead of + Host header field. + +--- + dlls/wininet/http.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 45183cf..3539dc8 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -765,7 +765,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) + + while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) + { +- HTTPHEADERW *host; + const WCHAR *data; + WCHAR *name; + +@@ -774,10 +773,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) + if (!setCookieHeader->lpszValue) + continue; + +- host = HTTP_GetHeader(request, hostW); +- if(!host) +- continue; +- + data = strchrW(setCookieHeader->lpszValue, '='); + if(!data) + continue; +@@ -787,7 +782,7 @@ static void HTTP_ProcessCookies( http_request_t *request ) + continue; + + data++; +- set_cookie(host->lpszValue, request->path, name, data, INTERNET_COOKIE_HTTPONLY); ++ set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); + heap_free(name); + } + +-- +2.4.0 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Delay-setting-the-http-host-header.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Delay-setting-the-http-host-header.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Delay-setting-the-http-host-header.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Delay-setting-the-http-host-header.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,138 @@ +From 72a8f7896554e752e1c924b71709e8cb0e48a51c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:39:33 +0200 +Subject: wininet: Delay setting the http host header. + +This change temporarly breaks two other tests which were only +working by pure accident before. +--- + dlls/wininet/http.c | 28 ++++++++++++++++++---------- + dlls/wininet/tests/http.c | 10 +++++----- + 2 files changed, 23 insertions(+), 15 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 5dd1b3b..e24a337 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -376,6 +376,7 @@ static WCHAR *get_host_header( http_request_t *req ) + + EnterCriticalSection( &req->headers_section ); + if ((header = HTTP_GetHeader( req, hostW ))) ret = heap_strdupW( header->lpszValue ); ++ else ret = heap_strdupW( req->server->canon_host_port ); + LeaveCriticalSection( &req->headers_section ); + return ret; + } +@@ -1886,20 +1887,21 @@ static BOOL HTTP_GetRequestURL(http_request_t *req, LPWSTR buf) + static const WCHAR https[] = { 'h','t','t','p','s',':','/','/',0 }; + static const WCHAR slash[] = { '/',0 }; + LPHTTPHEADERW host_header; ++ const WCHAR *host; + LPCWSTR scheme; + +- host_header = HTTP_GetHeader(req, hostW); +- if(!host_header) +- return FALSE; +- + EnterCriticalSection( &req->headers_section ); + ++ host_header = HTTP_GetHeader(req, hostW); ++ if (host_header) host = host_header->lpszValue; ++ else host = req->server->canon_host_port; ++ + if (req->hdr.dwFlags & INTERNET_FLAG_SECURE) + scheme = https; + else + scheme = http; + strcpyW(buf, scheme); +- strcatW(buf, host_header->lpszValue); ++ strcatW(buf, host); + if (req->path[0] != '/') + strcatW(buf, slash); + strcatW(buf, req->path); +@@ -2140,14 +2142,19 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe + case INTERNET_OPTION_URL: { + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; + WCHAR url[INTERNET_MAX_URL_LENGTH]; +- HTTPHEADERW *host; ++ HTTPHEADERW *host_header; ++ const WCHAR *host; + + TRACE("INTERNET_OPTION_URL\n"); + + EnterCriticalSection( &req->headers_section ); +- host = HTTP_GetHeader(req, hostW); ++ ++ host_header = HTTP_GetHeader(req, hostW); ++ if (host_header) host = host_header->lpszValue; ++ else host = req->server->canon_host_port; ++ + strcpyW(url, httpW); +- strcatW(url, host->lpszValue); ++ strcatW(url, host); + strcatW(url, req->path); + LeaveCriticalSection( &req->headers_section ); + +@@ -3417,8 +3424,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, + request->verb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); + request->version = heap_strdupW(lpszVersion && *lpszVersion ? lpszVersion : g_szHttp1_1); + +- HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); +- + if (hIC->proxy && hIC->proxy[0] && !HTTP_ShouldBypassProxy(hIC, session->hostName)) + HTTP_DealWithProxy( hIC, session, request ); + +@@ -4911,6 +4916,9 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, + if (!request->verb) + request->verb = heap_strdupW(szGET); + ++ HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, ++ HTTP_ADDREQ_FLAG_ADD_IF_NEW | HTTP_ADDHDR_FLAG_REQ); ++ + if (dwContentLength || strcmpW(request->verb, szGET)) + { + sprintfW(contentLengthStr, szContentLength, dwContentLength); +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 46a2258..5725b30 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3054,8 +3054,8 @@ static void test_header_override(int port) + memset(buffer, 0, sizeof(buffer)); + ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); + err = GetLastError(); +- todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); +- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); ++ ok(!ret, "HttpQueryInfo succeeded\n"); ++ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + + size = sizeof(buffer) - 1; + memset(buffer, 0, sizeof(buffer)); +@@ -3081,7 +3081,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); +@@ -3229,7 +3229,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); + ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + +- test_status_code(req, 200); ++ test_status_code_todo(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +@@ -3268,7 +3268,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + +- test_status_code(req, 200); ++ test_status_code_todo(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -From d3936900b7650ff24b116c48457861ea3b78eef4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 01:34:22 +0200 -Subject: wininet: Use request->server->name when processing cookies instead of - Host header field. - ---- - dlls/wininet/http.c | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 45183cf..3539dc8 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -765,7 +765,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) - - while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) - { -- HTTPHEADERW *host; - const WCHAR *data; - WCHAR *name; - -@@ -774,10 +773,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) - if (!setCookieHeader->lpszValue) - continue; - -- host = HTTP_GetHeader(request, hostW); -- if(!host) -- continue; -- - data = strchrW(setCookieHeader->lpszValue, '='); - if(!data) - continue; -@@ -787,7 +782,7 @@ static void HTTP_ProcessCookies( http_request_t *request ) - continue; - - data++; -- set_cookie(host->lpszValue, request->path, name, data, INTERNET_COOKIE_HTTPONLY); -+ set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); - heap_free(name); - } - --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -From 086a65eab198ca7d2ab4215660369b0e05dbfbbf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 01:39:33 +0200 -Subject: wininet: Delay setting the http host header. - -This change temporarly breaks two other tests which were only -working by pure accident before. ---- - dlls/wininet/http.c | 28 ++++++++++++++++++---------- - dlls/wininet/tests/http.c | 10 +++++----- - 2 files changed, 23 insertions(+), 15 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 3539dc8..356ebb6 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -376,6 +376,7 @@ static WCHAR *get_host_header( http_request_t *req ) - - EnterCriticalSection( &req->headers_section ); - if ((header = HTTP_GetHeader( req, hostW ))) ret = heap_strdupW( header->lpszValue ); -+ else ret = heap_strdupW( req->server->canon_host_port ); - LeaveCriticalSection( &req->headers_section ); - return ret; - } -@@ -1878,20 +1879,21 @@ static BOOL HTTP_GetRequestURL(http_request_t *req, LPWSTR buf) - static const WCHAR https[] = { 'h','t','t','p','s',':','/','/',0 }; - static const WCHAR slash[] = { '/',0 }; - LPHTTPHEADERW host_header; -+ const WCHAR *host; - LPCWSTR scheme; - -- host_header = HTTP_GetHeader(req, hostW); -- if(!host_header) -- return FALSE; -- - EnterCriticalSection( &req->headers_section ); - -+ host_header = HTTP_GetHeader(req, hostW); -+ if (host_header) host = host_header->lpszValue; -+ else host = req->server->canon_host_port; -+ - if (req->hdr.dwFlags & INTERNET_FLAG_SECURE) - scheme = https; - else - scheme = http; - strcpyW(buf, scheme); -- strcatW(buf, host_header->lpszValue); -+ strcatW(buf, host); - if (req->path[0] != '/') - strcatW(buf, slash); - strcatW(buf, req->path); -@@ -2132,14 +2134,19 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe - case INTERNET_OPTION_URL: { - static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; - WCHAR url[INTERNET_MAX_URL_LENGTH]; -- HTTPHEADERW *host; -+ HTTPHEADERW *host_header; -+ const WCHAR *host; - - TRACE("INTERNET_OPTION_URL\n"); - - EnterCriticalSection( &req->headers_section ); -- host = HTTP_GetHeader(req, hostW); -+ -+ host_header = HTTP_GetHeader(req, hostW); -+ if (host_header) host = host_header->lpszValue; -+ else host = req->server->canon_host_port; -+ - strcpyW(url, httpW); -- strcatW(url, host->lpszValue); -+ strcatW(url, host); - strcatW(url, req->path); - LeaveCriticalSection( &req->headers_section ); - -@@ -3406,8 +3413,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, - request->verb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); - request->version = heap_strdupW(lpszVersion && *lpszVersion ? lpszVersion : g_szHttp1_1); - -- HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); -- - if (hIC->proxy && hIC->proxy[0] && !HTTP_ShouldBypassProxy(hIC, session->hostName)) - HTTP_DealWithProxy( hIC, session, request ); - -@@ -4899,6 +4904,9 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, - if (!request->verb) - request->verb = heap_strdupW(szGET); - -+ HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, -+ HTTP_ADDREQ_FLAG_ADD_IF_NEW | HTTP_ADDHDR_FLAG_REQ); -+ - if (dwContentLength || strcmpW(request->verb, szGET)) - { - sprintfW(contentLengthStr, szContentLength, dwContentLength); -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 165a76e..2ac075f 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -3038,8 +3038,8 @@ static void test_header_override(int port) - count = 0; - ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); - err = GetLastError(); -- todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); -- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); -+ ok(!ret, "HttpQueryInfo succeeded\n"); -+ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); - - memset(buffer, 0, sizeof(buffer)); - size = sizeof(buffer)-1; -@@ -3065,7 +3065,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - -- test_status_code_todo(req, 200); -+ test_status_code(req, 200); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -@@ -3215,7 +3215,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); - ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); - -- test_status_code(req, 200); -+ test_status_code_todo(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); -@@ -3254,7 +3254,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); - -- test_status_code(req, 200); -+ test_status_code_todo(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Use-request-server-canon_host_port-in-authen.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Use-request-server-canon_host_port-in-authen.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Use-request-server-canon_host_port-in-authen.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0006-wininet-Use-request-server-canon_host_port-in-authen.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,49 @@ +From f0e05bd23a5a4377462586a0f8bd9c54117dcbb8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:57:17 +0200 +Subject: wininet: Use request->server->canon_host_port in authentication + process. + +--- + dlls/wininet/http.c | 2 +- + dlls/wininet/tests/http.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 356ebb6..3232fad 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -5116,7 +5116,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, + dwBufferSize=2048; + if (request->status_code == HTTP_STATUS_DENIED) + { +- WCHAR *host = get_host_header( request ); ++ WCHAR *host = heap_strdupW( request->server->canon_host_port ); + DWORD dwIndex = 0; + while (HTTP_HttpQueryInfoW(request,HTTP_QUERY_WWW_AUTHENTICATE,szAuthValue,&dwBufferSize,&dwIndex) == ERROR_SUCCESS) + { +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 2ac075f..9e207b9 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3215,7 +3215,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); + ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +@@ -3254,7 +3254,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +-- +2.4.0 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -From f0e05bd23a5a4377462586a0f8bd9c54117dcbb8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 01:57:17 +0200 -Subject: wininet: Use request->server->canon_host_port in authentication - process. - ---- - dlls/wininet/http.c | 2 +- - dlls/wininet/tests/http.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 356ebb6..3232fad 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -5116,7 +5116,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, - dwBufferSize=2048; - if (request->status_code == HTTP_STATUS_DENIED) - { -- WCHAR *host = get_host_header( request ); -+ WCHAR *host = heap_strdupW( request->server->canon_host_port ); - DWORD dwIndex = 0; - while (HTTP_HttpQueryInfoW(request,HTTP_QUERY_WWW_AUTHENTICATE,szAuthValue,&dwBufferSize,&dwIndex) == ERROR_SUCCESS) - { -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 2ac075f..9e207b9 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -3215,7 +3215,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); - ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); - -- test_status_code_todo(req, 200); -+ test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); -@@ -3254,7 +3254,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); - -- test_status_code_todo(req, 200); -+ test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-when-quer.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-when-quer.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-when-quer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-when-quer.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,54 @@ +From 53df41c8abfc5bafd1ba214d58a3edda1099024b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 02:00:57 +0200 +Subject: wininet: Use request->server->canon_host_port when querying for + INTERNET_OPTION_URL. + +--- + dlls/wininet/http.c | 11 +---------- + dlls/wininet/tests/http.c | 2 +- + 2 files changed, 2 insertions(+), 11 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index b61a96a..edea9f8 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -2142,21 +2142,12 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe + case INTERNET_OPTION_URL: { + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; + WCHAR url[INTERNET_MAX_URL_LENGTH]; +- HTTPHEADERW *host_header; +- const WCHAR *host; + + TRACE("INTERNET_OPTION_URL\n"); + +- EnterCriticalSection( &req->headers_section ); +- +- host_header = HTTP_GetHeader(req, hostW); +- if (host_header) host = host_header->lpszValue; +- else host = req->server->canon_host_port; +- + strcpyW(url, httpW); +- strcatW(url, host); ++ strcatW(url, req->server->canon_host_port); + strcatW(url, req->path); +- LeaveCriticalSection( &req->headers_section ); + + TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); + return str_to_buffer(url, buffer, size, unicode); +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index fd235b1..1a82aba 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3076,7 +3076,7 @@ static void test_header_override(int port) + memset(buffer, 0, sizeof(buffer)); + ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); + ok(ret, "InternetQueryOption failed\n"); +- todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); ++ ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,83 @@ +From b5601ae74c8c528a2c636587a7b8678dfb717b5a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 00:24:35 +0200 +Subject: wininet: Strip filename if no path is set in cookie. + +The order of the stored cookies doesn't match in /testC, so +be a bit less strict in the test. +--- + dlls/wininet/http.c | 11 ++++++++++- + dlls/wininet/tests/http.c | 6 +++--- + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index edea9f8..f7c8f76 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -764,10 +764,18 @@ static void HTTP_ProcessCookies( http_request_t *request ) + int HeaderIndex; + int numCookies = 0; + LPHTTPHEADERW setCookieHeader; ++ WCHAR *path, *tmp; + + if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) + return; + ++ path = heap_strdupW(request->path); ++ if (!path) ++ return; ++ ++ tmp = strrchrW(path, '/'); ++ if (tmp && tmp[1]) tmp[1] = 0; ++ + EnterCriticalSection( &request->headers_section ); + + while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) +@@ -789,11 +797,12 @@ static void HTTP_ProcessCookies( http_request_t *request ) + continue; + + data++; +- set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); ++ set_cookie(request->server->name, path, name, data, INTERNET_COOKIE_HTTPONLY); + heap_free(name); + } + + LeaveCriticalSection( &request->headers_section ); ++ heap_free(path); + } + + static void strip_spaces(LPWSTR start) +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 1a82aba..ff76e9f 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -2217,7 +2217,7 @@ static DWORD CALLBACK server_thread(LPVOID param) + } + if (strstr(buffer, "/testC")) + { +- if (strstr(buffer, "Cookie: cookie=biscuit")) ++ if (strstr(buffer, "cookie=biscuit")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); +@@ -3159,7 +3159,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); +@@ -3168,7 +3168,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + InternetSetCookieA("http://test.local", "foo", "bar"); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From 31baebdaabf58e3bf1f1bdcb92f85cd5e0857a5b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 02:00:57 +0200 -Subject: wininet: Use request->server->canon_host_port when querying for - INTERNET_OPTION_URL. - ---- - dlls/wininet/http.c | 11 +---------- - dlls/wininet/tests/http.c | 2 +- - 2 files changed, 2 insertions(+), 11 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 3232fad..cfeb7ac 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -2134,21 +2134,12 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe - case INTERNET_OPTION_URL: { - static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; - WCHAR url[INTERNET_MAX_URL_LENGTH]; -- HTTPHEADERW *host_header; -- const WCHAR *host; - - TRACE("INTERNET_OPTION_URL\n"); - -- EnterCriticalSection( &req->headers_section ); -- -- host_header = HTTP_GetHeader(req, hostW); -- if (host_header) host = host_header->lpszValue; -- else host = req->server->canon_host_port; -- - strcpyW(url, httpW); -- strcatW(url, host); -+ strcatW(url, req->server->canon_host_port); - strcatW(url, req->path); -- LeaveCriticalSection( &req->headers_section ); - - TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); - return str_to_buffer(url, buffer, size, unicode); -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 9e207b9..469995b 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -3060,7 +3060,7 @@ static void test_header_override(int port) - size = sizeof(buffer)-1; - ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); - ok(ret, "InternetQueryOption failed\n"); -- todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); -+ ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0009-rpcrt4-Fix-arguments-of-HttpAddRequestHeaders.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0009-rpcrt4-Fix-arguments-of-HttpAddRequestHeaders.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0009-rpcrt4-Fix-arguments-of-HttpAddRequestHeaders.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0009-rpcrt4-Fix-arguments-of-HttpAddRequestHeaders.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From 109b633fe845cab2b8abfe4a161ecb0e41ba4e86 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 02:24:03 +0200 -Subject: rpcrt4: Fix arguments of HttpAddRequestHeaders. - ---- - dlls/rpcrt4/rpc_transport.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c -index 34f434d..0504d51 100644 ---- a/dlls/rpcrt4/rpc_transport.c -+++ b/dlls/rpcrt4/rpc_transport.c -@@ -2275,7 +2275,7 @@ static RPC_STATUS insert_content_length_header(HINTERNET request, DWORD len) - WCHAR header[sizeof(fmtW) / sizeof(fmtW[0]) + 10]; - - sprintfW(header, fmtW, len); -- if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_REPLACE))) return RPC_S_OK; -+ if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD))) return RPC_S_OK; - return RPC_S_SERVER_UNAVAILABLE; - } - -@@ -2866,7 +2866,7 @@ static RPC_STATUS authorize_request(RpcConnection_http *httpc, HINTERNET request - } - - if (info->scheme != RPC_C_HTTP_AUTHN_SCHEME_BASIC) -- HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE); -+ HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); - - destroy_authinfo(info); - return status; --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0009-wininet-Replacing-header-fields-should-fail-if-they-.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0009-wininet-Replacing-header-fields-should-fail-if-they-.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0009-wininet-Replacing-header-fields-should-fail-if-they-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0009-wininet-Replacing-header-fields-should-fail-if-they-.patch 2015-06-28 17:08:11.000000000 +0000 @@ -0,0 +1,263 @@ +From 91c7ab52a873c9c6443443937bad998f5dc40bbd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 03:16:15 +0200 +Subject: wininet: Replacing header fields should fail if they do not exist + yet. + +A lot of details are not properly covered by tests yet and were +marked with FIXME comments. The implementation was written in such +a way that it behaves identical to the old code in such situations. +--- + dlls/wininet/http.c | 185 +++++++++++++++++++++++----------------------- + dlls/wininet/tests/http.c | 6 +- + 2 files changed, 96 insertions(+), 95 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index f7c8f76..85bc392 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -6115,127 +6115,128 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) + + static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) + { +- LPHTTPHEADERW lphttpHdr = NULL; ++ LPHTTPHEADERW lphttpHdr; + INT index; + BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ); +- DWORD res = ERROR_HTTP_INVALID_HEADER; ++ DWORD res = ERROR_SUCCESS; + + TRACE("--> %s: %s - 0x%08x\n", debugstr_w(field), debugstr_w(value), dwModifier); + + EnterCriticalSection( &request->headers_section ); + +- /* REPLACE wins out over ADD */ +- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) +- dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; +- +- if (dwModifier & HTTP_ADDHDR_FLAG_ADD) +- index = -1; +- else +- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); +- ++ index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); + if (index >= 0) + { +- if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) +- { +- LeaveCriticalSection( &request->headers_section ); +- return ERROR_HTTP_INVALID_HEADER; +- } + lphttpHdr = &request->custHeaders[index]; +- } +- else if (value) +- { +- HTTPHEADERW hdr; + +- hdr.lpszField = (LPWSTR)field; +- hdr.lpszValue = (LPWSTR)value; +- hdr.wFlags = hdr.wCount = 0; ++ /* replace existing header if FLAG_REPLACE is given */ ++ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) ++ { ++ HTTP_DeleteCustomHeader( request, index ); + +- if (dwModifier & HTTP_ADDHDR_FLAG_REQ) +- hdr.wFlags |= HDR_ISREQUEST; ++ if (value && value[0]) ++ { ++ HTTPHEADERW hdr; + +- res = HTTP_InsertCustomHeader(request, &hdr); +- LeaveCriticalSection( &request->headers_section ); +- return res; +- } +- /* no value to delete */ +- else +- { +- LeaveCriticalSection( &request->headers_section ); +- return ERROR_SUCCESS; +- } ++ hdr.lpszField = (LPWSTR)field; ++ hdr.lpszValue = (LPWSTR)value; ++ hdr.wFlags = hdr.wCount = 0; + +- if (dwModifier & HTTP_ADDHDR_FLAG_REQ) +- lphttpHdr->wFlags |= HDR_ISREQUEST; +- else +- lphttpHdr->wFlags &= ~HDR_ISREQUEST; ++ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) ++ hdr.wFlags |= HDR_ISREQUEST; + +- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) +- { +- HTTP_DeleteCustomHeader( request, index ); ++ res = HTTP_InsertCustomHeader( request, &hdr ); ++ } + +- if (value && value[0]) ++ goto out; ++ } ++ ++ /* do not add new header if FLAG_ADD_IF_NEW is set */ ++ if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) + { +- HTTPHEADERW hdr; ++ res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ ++ goto out; ++ } + +- hdr.lpszField = (LPWSTR)field; +- hdr.lpszValue = (LPWSTR)value; +- hdr.wFlags = hdr.wCount = 0; ++ /* handle appending to existing header */ ++ if (dwModifier & COALESCEFLAGS) ++ { ++ LPWSTR lpsztmp; ++ WCHAR ch = 0; ++ INT len = 0; ++ INT origlen = strlenW(lphttpHdr->lpszValue); ++ INT valuelen = strlenW(value); + ++ /* FIXME: Should it really clear HDR_ISREQUEST? */ + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) +- hdr.wFlags |= HDR_ISREQUEST; +- +- res = HTTP_InsertCustomHeader(request, &hdr); +- LeaveCriticalSection( &request->headers_section ); +- return res; +- } ++ lphttpHdr->wFlags |= HDR_ISREQUEST; ++ else ++ lphttpHdr->wFlags &= ~HDR_ISREQUEST; + +- LeaveCriticalSection( &request->headers_section ); +- return ERROR_SUCCESS; +- } +- else if (dwModifier & COALESCEFLAGS) +- { +- LPWSTR lpsztmp; +- WCHAR ch = 0; +- INT len = 0; +- INT origlen = strlenW(lphttpHdr->lpszValue); +- INT valuelen = strlenW(value); ++ if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) ++ { ++ ch = ','; ++ lphttpHdr->wFlags |= HDR_COMMADELIMITED; ++ } ++ else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) ++ { ++ ch = ';'; ++ lphttpHdr->wFlags |= HDR_COMMADELIMITED; ++ } + +- if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) +- { +- ch = ','; +- lphttpHdr->wFlags |= HDR_COMMADELIMITED; +- } +- else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) +- { +- ch = ';'; +- lphttpHdr->wFlags |= HDR_COMMADELIMITED; +- } ++ len = origlen + valuelen + ((ch > 0) ? 2 : 0); + +- len = origlen + valuelen + ((ch > 0) ? 2 : 0); ++ lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); ++ if (lpsztmp) ++ { ++ lphttpHdr->lpszValue = lpsztmp; ++ /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ ++ if (ch > 0) ++ { ++ lphttpHdr->lpszValue[origlen] = ch; ++ origlen++; ++ lphttpHdr->lpszValue[origlen] = ' '; ++ origlen++; ++ } + +- lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); +- if (lpsztmp) +- { +- lphttpHdr->lpszValue = lpsztmp; +- /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ +- if (ch > 0) ++ memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); ++ lphttpHdr->lpszValue[len] = '\0'; ++ } ++ else + { +- lphttpHdr->lpszValue[origlen] = ch; +- origlen++; +- lphttpHdr->lpszValue[origlen] = ' '; +- origlen++; ++ WARN("heap_realloc (%d bytes) failed\n",len+1); ++ res = ERROR_OUTOFMEMORY; + } + +- memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); +- lphttpHdr->lpszValue[len] = '\0'; +- res = ERROR_SUCCESS; +- } +- else +- { +- WARN("heap_realloc (%d bytes) failed\n",len+1); +- res = ERROR_OUTOFMEMORY; ++ goto out; + } + } ++ ++ /* FIXME: What about other combinations? */ ++ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE) ++ { ++ res = ERROR_HTTP_HEADER_NOT_FOUND; ++ goto out; ++ } ++ ++ /* FIXME: What if value == ""? */ ++ if (value) ++ { ++ HTTPHEADERW hdr; ++ ++ hdr.lpszField = (LPWSTR)field; ++ hdr.lpszValue = (LPWSTR)value; ++ hdr.wFlags = hdr.wCount = 0; ++ ++ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) ++ hdr.wFlags |= HDR_ISREQUEST; ++ ++ res = HTTP_InsertCustomHeader( request, &hdr ); ++ goto out; ++ } ++ ++ /* FIXME: What if value == NULL? */ ++out: + TRACE("<-- %d\n", res); + LeaveCriticalSection( &request->headers_section ); + return res; +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index ff76e9f..8b5cdb7 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3116,13 +3116,13 @@ static void test_header_override(int port) + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE); + err = GetLastError(); +- todo_wine ok(!ret, "HttpAddRequestHeaders succeeded\n"); +- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); ++ ok(!ret, "HttpAddRequestHeaders succeeded\n"); ++ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + +- test_status_code_todo(req, 400); ++ test_status_code(req, 400); + + InternetCloseHandle(req); + InternetSetCookieA("http://localhost", "cookie", "biscuit"); +-- +2.4.3 + diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0010-wininet-Fix-arguments-of-HttpAddRequestHeaders.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0010-wininet-Fix-arguments-of-HttpAddRequestHeaders.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0010-wininet-Fix-arguments-of-HttpAddRequestHeaders.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0010-wininet-Fix-arguments-of-HttpAddRequestHeaders.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -From 60e158b648b47ce743f5ceabdad0354324ee7391 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 02:29:42 +0200 -Subject: wininet: Fix arguments of HttpAddRequestHeaders. - ---- - dlls/wininet/http.c | 16 ++++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index cfeb7ac..6681100 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -1661,7 +1661,8 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn - - TRACE("Inserting authorization: %s\n", debugstr_w(authorization)); - -- HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); -+ HTTP_ProcessHeader(request, header, authorization, -+ HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); - heap_free(authorization); - } - else if (!strcmpW(header, szAuthorization) && (host = get_host_header(request))) -@@ -1682,7 +1683,8 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn - - TRACE("Inserting authorization: %s\n", debugstr_w(authorization)); - -- HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); -+ HTTP_ProcessHeader(request, header, authorization, -+ HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); - heap_free(data); - heap_free(authorization); - } -@@ -3397,7 +3399,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, - HTTP_ProcessHeader(request, HTTP_ACCEPT, lpszAcceptTypes[i], - HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA | - HTTP_ADDHDR_FLAG_REQ | -- (i == 0 ? HTTP_ADDHDR_FLAG_REPLACE : 0)); -+ (i == 0 ? (HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD) : 0)); - } - } - -@@ -4235,7 +4237,8 @@ static void HTTP_InsertCookies(http_request_t *request) - if(res != ERROR_SUCCESS || !cookies) - return; - -- HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE); -+ HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), -+ HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); - heap_free(cookies); - } - -@@ -4959,7 +4962,8 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, - HTTP_FixURL(request); - if (request->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION) - { -- HTTP_ProcessHeader(request, szConnection, szKeepAlive, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); -+ HTTP_ProcessHeader(request, szConnection, szKeepAlive, -+ HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); - } - HTTP_InsertAuthorization(request, request->authInfo, szAuthorization); - HTTP_InsertAuthorization(request, request->proxyAuthInfo, szProxy_Authorization); -@@ -5976,7 +5980,7 @@ static DWORD HTTP_GetResponseHeaders(http_request_t *request, INT *len) - - /* Add status code */ - HTTP_ProcessHeader(request, szStatus, status_code, -- HTTP_ADDHDR_FLAG_REPLACE); -+ HTTP_ADDHDR_FLAG_REPLACE | HTTP_ADDHDR_FLAG_ADD); - - heap_free(request->version); - heap_free(request->statusText); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0011-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0011-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0011-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0011-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -From 95a38cefff721e71d6d543b8f28da2e4c77362ab Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 00:24:35 +0200 -Subject: wininet: Strip filename if no path is set in cookie. - -The order of the stored cookies doesn't match in /testC, so -be a bit less strict in the test. ---- - dlls/wininet/http.c | 11 ++++++++++- - dlls/wininet/tests/http.c | 6 +++--- - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 6681100..0b0f0b1 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -758,10 +758,18 @@ static void HTTP_ProcessCookies( http_request_t *request ) - int HeaderIndex; - int numCookies = 0; - LPHTTPHEADERW setCookieHeader; -+ WCHAR *path, *tmp; - - if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) - return; - -+ path = heap_strdupW(request->path); -+ if (!path) -+ return; -+ -+ tmp = strrchrW(path, '/'); -+ if (tmp && tmp[1]) tmp[1] = 0; -+ - EnterCriticalSection( &request->headers_section ); - - while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) -@@ -783,11 +791,12 @@ static void HTTP_ProcessCookies( http_request_t *request ) - continue; - - data++; -- set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); -+ set_cookie(request->server->name, path, name, data, INTERNET_COOKIE_HTTPONLY); - heap_free(name); - } - - LeaveCriticalSection( &request->headers_section ); -+ heap_free(path); - } - - static void strip_spaces(LPWSTR start) -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 469995b..87f0668 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -2201,7 +2201,7 @@ static DWORD CALLBACK server_thread(LPVOID param) - } - if (strstr(buffer, "/testC")) - { -- if (strstr(buffer, "Cookie: cookie=biscuit")) -+ if (strstr(buffer, "cookie=biscuit")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); -@@ -3144,7 +3144,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - -- test_status_code_todo(req, 200); -+ test_status_code(req, 200); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); -@@ -3153,7 +3153,7 @@ static void test_header_override(int port) - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - -- test_status_code_todo(req, 200); -+ test_status_code(req, 200); - InternetCloseHandle(req); - - InternetSetCookieA("http://test.local", "foo", "bar"); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0012-wininet-Replacing-header-fields-should-fail-if-they-.patch wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0012-wininet-Replacing-header-fields-should-fail-if-they-.patch --- wine-staging-1.7.45~ubuntu14.10.1/patches/wininet-Cleanup/0012-wininet-Replacing-header-fields-should-fail-if-they-.patch 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/patches/wininet-Cleanup/0012-wininet-Replacing-header-fields-should-fail-if-they-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -From 5d96dbdcf3e2ade7aad2745f8c48a3e56ba264c2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sat, 16 May 2015 03:16:15 +0200 -Subject: wininet: Replacing header fields should fail if they do not exist - yet. - -A lot of details are not properly covered by tests yet and were -marked with FIXME comments. The implementation was written in such -a way that it behaves identical to the old code in such situations. ---- - dlls/wininet/http.c | 185 +++++++++++++++++++++++----------------------- - dlls/wininet/tests/http.c | 6 +- - 2 files changed, 96 insertions(+), 95 deletions(-) - -diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 0b0f0b1..b32f9a3 100644 ---- a/dlls/wininet/http.c -+++ b/dlls/wininet/http.c -@@ -6106,127 +6106,128 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) - - static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) - { -- LPHTTPHEADERW lphttpHdr = NULL; -+ LPHTTPHEADERW lphttpHdr; - INT index; - BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ); -- DWORD res = ERROR_HTTP_INVALID_HEADER; -+ DWORD res = ERROR_SUCCESS; - - TRACE("--> %s: %s - 0x%08x\n", debugstr_w(field), debugstr_w(value), dwModifier); - - EnterCriticalSection( &request->headers_section ); - -- /* REPLACE wins out over ADD */ -- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) -- dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; -- -- if (dwModifier & HTTP_ADDHDR_FLAG_ADD) -- index = -1; -- else -- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); -- -+ index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); - if (index >= 0) - { -- if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) -- { -- LeaveCriticalSection( &request->headers_section ); -- return ERROR_HTTP_INVALID_HEADER; -- } - lphttpHdr = &request->custHeaders[index]; -- } -- else if (value) -- { -- HTTPHEADERW hdr; - -- hdr.lpszField = (LPWSTR)field; -- hdr.lpszValue = (LPWSTR)value; -- hdr.wFlags = hdr.wCount = 0; -+ /* replace existing header if FLAG_REPLACE is given */ -+ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) -+ { -+ HTTP_DeleteCustomHeader( request, index ); - -- if (dwModifier & HTTP_ADDHDR_FLAG_REQ) -- hdr.wFlags |= HDR_ISREQUEST; -+ if (value && value[0]) -+ { -+ HTTPHEADERW hdr; - -- res = HTTP_InsertCustomHeader(request, &hdr); -- LeaveCriticalSection( &request->headers_section ); -- return res; -- } -- /* no value to delete */ -- else -- { -- LeaveCriticalSection( &request->headers_section ); -- return ERROR_SUCCESS; -- } -+ hdr.lpszField = (LPWSTR)field; -+ hdr.lpszValue = (LPWSTR)value; -+ hdr.wFlags = hdr.wCount = 0; - -- if (dwModifier & HTTP_ADDHDR_FLAG_REQ) -- lphttpHdr->wFlags |= HDR_ISREQUEST; -- else -- lphttpHdr->wFlags &= ~HDR_ISREQUEST; -+ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) -+ hdr.wFlags |= HDR_ISREQUEST; - -- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) -- { -- HTTP_DeleteCustomHeader( request, index ); -+ res = HTTP_InsertCustomHeader( request, &hdr ); -+ } - -- if (value && value[0]) -+ goto out; -+ } -+ -+ /* do not add new header if FLAG_ADD_IF_NEW is set */ -+ if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) - { -- HTTPHEADERW hdr; -+ res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ -+ goto out; -+ } - -- hdr.lpszField = (LPWSTR)field; -- hdr.lpszValue = (LPWSTR)value; -- hdr.wFlags = hdr.wCount = 0; -+ /* handle appending to existing header */ -+ if (dwModifier & COALESCEFLAGS) -+ { -+ LPWSTR lpsztmp; -+ WCHAR ch = 0; -+ INT len = 0; -+ INT origlen = strlenW(lphttpHdr->lpszValue); -+ INT valuelen = strlenW(value); - -+ /* FIXME: Should it really clear HDR_ISREQUEST? */ - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) -- hdr.wFlags |= HDR_ISREQUEST; -- -- res = HTTP_InsertCustomHeader(request, &hdr); -- LeaveCriticalSection( &request->headers_section ); -- return res; -- } -+ lphttpHdr->wFlags |= HDR_ISREQUEST; -+ else -+ lphttpHdr->wFlags &= ~HDR_ISREQUEST; - -- LeaveCriticalSection( &request->headers_section ); -- return ERROR_SUCCESS; -- } -- else if (dwModifier & COALESCEFLAGS) -- { -- LPWSTR lpsztmp; -- WCHAR ch = 0; -- INT len = 0; -- INT origlen = strlenW(lphttpHdr->lpszValue); -- INT valuelen = strlenW(value); -+ if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) -+ { -+ ch = ','; -+ lphttpHdr->wFlags |= HDR_COMMADELIMITED; -+ } -+ else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) -+ { -+ ch = ';'; -+ lphttpHdr->wFlags |= HDR_COMMADELIMITED; -+ } - -- if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) -- { -- ch = ','; -- lphttpHdr->wFlags |= HDR_COMMADELIMITED; -- } -- else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) -- { -- ch = ';'; -- lphttpHdr->wFlags |= HDR_COMMADELIMITED; -- } -+ len = origlen + valuelen + ((ch > 0) ? 2 : 0); - -- len = origlen + valuelen + ((ch > 0) ? 2 : 0); -+ lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); -+ if (lpsztmp) -+ { -+ lphttpHdr->lpszValue = lpsztmp; -+ /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ -+ if (ch > 0) -+ { -+ lphttpHdr->lpszValue[origlen] = ch; -+ origlen++; -+ lphttpHdr->lpszValue[origlen] = ' '; -+ origlen++; -+ } - -- lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); -- if (lpsztmp) -- { -- lphttpHdr->lpszValue = lpsztmp; -- /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ -- if (ch > 0) -+ memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); -+ lphttpHdr->lpszValue[len] = '\0'; -+ } -+ else - { -- lphttpHdr->lpszValue[origlen] = ch; -- origlen++; -- lphttpHdr->lpszValue[origlen] = ' '; -- origlen++; -+ WARN("heap_realloc (%d bytes) failed\n",len+1); -+ res = ERROR_OUTOFMEMORY; - } - -- memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); -- lphttpHdr->lpszValue[len] = '\0'; -- res = ERROR_SUCCESS; -- } -- else -- { -- WARN("heap_realloc (%d bytes) failed\n",len+1); -- res = ERROR_OUTOFMEMORY; -+ goto out; - } - } -+ -+ /* FIXME: What about other combinations? */ -+ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE) -+ { -+ res = ERROR_HTTP_HEADER_NOT_FOUND; -+ goto out; -+ } -+ -+ /* FIXME: What if value == ""? */ -+ if (value) -+ { -+ HTTPHEADERW hdr; -+ -+ hdr.lpszField = (LPWSTR)field; -+ hdr.lpszValue = (LPWSTR)value; -+ hdr.wFlags = hdr.wCount = 0; -+ -+ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) -+ hdr.wFlags |= HDR_ISREQUEST; -+ -+ res = HTTP_InsertCustomHeader( request, &hdr ); -+ goto out; -+ } -+ -+ /* FIXME: What if value == NULL? */ -+out: - TRACE("<-- %d\n", res); - LeaveCriticalSection( &request->headers_section ); - return res; -diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 87f0668..7444a67 100644 ---- a/dlls/wininet/tests/http.c -+++ b/dlls/wininet/tests/http.c -@@ -3100,13 +3100,13 @@ static void test_header_override(int port) - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE); - err = GetLastError(); -- todo_wine ok(!ret, "HttpAddRequestHeaders succeeded\n"); -- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); -+ ok(!ret, "HttpAddRequestHeaders succeeded\n"); -+ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - -- test_status_code_todo(req, 400); -+ test_status_code(req, 400); - InternetCloseHandle(req); - - InternetSetCookieA("http://localhost", "cookie", "biscuit"); --- -2.4.0 - diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ar.po wine-staging-1.7.46~ubuntu14.10.1/po/ar.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ar.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ar.po 2015-06-28 16:51:28.000000000 +0000 @@ -344,7 +344,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&مساعدة" @@ -8201,7 +8201,7 @@ msgid "PrintHood" msgstr "الطباعة" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "التأريخ" @@ -11957,7 +11957,7 @@ msgstr "فشل فتح '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14112,30 +14112,30 @@ msgid "&Define..." msgstr "&عرّف..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "د&ومًا في المقدمة" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "ال&خطوط" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "صغير" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "عادي" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "كبير" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&المساعدة في استخدام المساعدة\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "د&ومًا في المقدمة" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&معلومات حول أداة المساعدة في واين" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/bg.po wine-staging-1.7.46~ubuntu14.10.1/po/bg.po --- wine-staging-1.7.45~ubuntu14.10.1/po/bg.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/bg.po 2015-06-28 16:51:28.000000000 +0000 @@ -357,7 +357,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Помощ" @@ -8318,7 +8318,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11784,7 +11784,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13964,31 +13964,31 @@ msgid "&Define..." msgstr "&Задай..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Винаги от&горе" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Шрифтове" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&Помощ за помощта" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Винаги от&горе" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Информация" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ca.po wine-staging-1.7.46~ubuntu14.10.1/po/ca.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ca.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ca.po 2015-06-28 16:51:28.000000000 +0000 @@ -356,7 +356,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "A&juda" @@ -8191,7 +8191,7 @@ msgid "PrintHood" msgstr "PrintHood" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Història" @@ -12047,8 +12047,8 @@ msgstr "regsvr32: S'ha fallat en obrir el DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 no està implementat en el DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' no està implementat en el DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14227,30 +14227,30 @@ msgid "&Define..." msgstr "&Defineix..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Sempre amunt" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Lletra" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Petita" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Gran" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Ajuda sobre l'ajuda\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Sempre amunt" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Quant a l'Ajuda del Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/cs.po wine-staging-1.7.46~ubuntu14.10.1/po/cs.po --- wine-staging-1.7.45~ubuntu14.10.1/po/cs.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/cs.po 2015-06-28 16:51:28.000000000 +0000 @@ -353,7 +353,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Nápověda" @@ -8132,7 +8132,7 @@ msgid "PrintHood" msgstr "Okolní tiskárny" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historie" @@ -11833,7 +11833,7 @@ msgstr "Otevření „%1“ se nezdařilo\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14000,30 +14000,30 @@ msgid "&Define..." msgstr "Přidat..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Vždy na &vrchu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Písma" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Malé" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normální" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Velké" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Pomoc k nápovědě\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Vždy na &vrchu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "O &aplikaci Nápověda Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/da.po wine-staging-1.7.46~ubuntu14.10.1/po/da.po --- wine-staging-1.7.45~ubuntu14.10.1/po/da.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/da.po 2015-06-28 16:51:28.000000000 +0000 @@ -361,7 +361,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Hjælp" @@ -8282,7 +8282,7 @@ msgid "PrintHood" msgstr "Printnetværk" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historie" @@ -12094,7 +12094,7 @@ msgstr "Kunne ikke åbne «%1»\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14268,30 +14268,30 @@ msgid "&Define..." msgstr "&Definer..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Altid &øverst" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Skrifttype" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Lille" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Stor" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "Brug af &Hjælp\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Altid &øverst" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Om Wine hjælp" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/de.po wine-staging-1.7.46~ubuntu14.10.1/po/de.po --- wine-staging-1.7.45~ubuntu14.10.1/po/de.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/de.po 2015-06-28 16:51:28.000000000 +0000 @@ -353,7 +353,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Hilfe" @@ -8172,7 +8172,7 @@ msgid "PrintHood" msgstr "Druckumgebung" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Verlauf" @@ -12011,8 +12011,8 @@ msgstr "regsvr32: DLL '%1' konnte nicht geladen werden\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 nicht in DLL '%2' implementiert\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' nicht in DLL '%2' implementiert\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14187,30 +14187,30 @@ msgid "&Define..." msgstr "&Definieren..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Immer im &Vordergrund" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Schriftarten" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Klein" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Mittel" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Groß" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Hilfe benutzen\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Immer im &Vordergrund" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Über Wine Hilfe" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/el.po wine-staging-1.7.46~ubuntu14.10.1/po/el.po --- wine-staging-1.7.45~ubuntu14.10.1/po/el.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/el.po 2015-06-28 16:51:28.000000000 +0000 @@ -336,7 +336,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Βοήθεια" @@ -8172,7 +8172,7 @@ msgid "PrintHood" msgstr "Εκτύπωση" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11569,7 +11569,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13691,28 +13691,28 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Γραμματοσειρές" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 -msgid "&Help on help\tF1" -msgstr "" - #: winhlp32.rc:58 -msgid "Always on &top" +msgid "&Help on help\tF1" msgstr "" #: winhlp32.rc:59 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/en.po wine-staging-1.7.46~ubuntu14.10.1/po/en.po --- wine-staging-1.7.45~ubuntu14.10.1/po/en.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/en.po 2015-06-28 16:51:28.000000000 +0000 @@ -352,7 +352,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Help" @@ -8160,7 +8160,7 @@ msgid "PrintHood" msgstr "PrintHood" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "History" @@ -11933,8 +11933,8 @@ msgstr "regsvr32: Failed to load DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' not implemented in DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14092,30 +14092,30 @@ msgid "&Define..." msgstr "&Define..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Always on &top" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fonts" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Small" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Large" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Help on help\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Always on &top" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&About Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/en_US.po wine-staging-1.7.46~ubuntu14.10.1/po/en_US.po --- wine-staging-1.7.45~ubuntu14.10.1/po/en_US.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/en_US.po 2015-06-28 16:51:28.000000000 +0000 @@ -352,7 +352,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Help" @@ -8160,7 +8160,7 @@ msgid "PrintHood" msgstr "PrintHood" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "History" @@ -11933,8 +11933,8 @@ msgstr "regsvr32: Failed to load DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' not implemented in DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14092,30 +14092,30 @@ msgid "&Define..." msgstr "&Define..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Always on &top" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fonts" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Small" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Large" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Help on help\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Always on &top" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&About Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/eo.po wine-staging-1.7.46~ubuntu14.10.1/po/eo.po --- wine-staging-1.7.45~ubuntu14.10.1/po/eo.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/eo.po 2015-06-28 16:51:28.000000000 +0000 @@ -343,7 +343,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Helpo" @@ -8073,7 +8073,7 @@ msgid "PrintHood" msgstr "Printiloj" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historio" @@ -11459,7 +11459,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13562,30 +13562,30 @@ msgid "&Define..." msgstr "&Difini..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Ĉiam &supre" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Tiparoj" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Malgranda" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Ordinara" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Granda" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Helpo pri helpo\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Ĉiam &supre" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Pri Wine-Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/es.po wine-staging-1.7.46~ubuntu14.10.1/po/es.po --- wine-staging-1.7.45~ubuntu14.10.1/po/es.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/es.po 2015-06-28 16:51:28.000000000 +0000 @@ -364,7 +364,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "A&yuda" @@ -8295,7 +8295,7 @@ msgid "PrintHood" msgstr "Vecindario de impresión" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historial" @@ -12176,7 +12176,7 @@ msgstr "No se pudo abrir '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14364,30 +14364,30 @@ msgid "&Define..." msgstr "&Definir..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Siempre visible" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fuentes" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Pequeña" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Grande" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "A&yuda sobre la ayuda\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Siempre visible" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Sobre la ayuda de &Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/fa.po wine-staging-1.7.46~ubuntu14.10.1/po/fa.po --- wine-staging-1.7.45~ubuntu14.10.1/po/fa.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/fa.po 2015-06-28 16:51:28.000000000 +0000 @@ -336,7 +336,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&کمک" @@ -8161,7 +8161,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11568,7 +11568,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13711,32 +13711,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "&قلم‌ها..." -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&کمک برای کمک" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "" - #: winhlp32.rc:59 #, fuzzy msgid "&About Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/fi.po wine-staging-1.7.46~ubuntu14.10.1/po/fi.po --- wine-staging-1.7.45~ubuntu14.10.1/po/fi.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/fi.po 2015-06-28 16:51:28.000000000 +0000 @@ -348,7 +348,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Apua" @@ -8152,7 +8152,7 @@ msgid "PrintHood" msgstr "Tulostinympäristö" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historia" @@ -11913,8 +11913,8 @@ msgstr "regsvr32: DLL:n '%1' lataaminen epäonnistui\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1-toteutusta ei ole DLL:ssä '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!'-toteutusta ei ole DLL:ssä '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14065,30 +14065,30 @@ msgid "&Define..." msgstr "&Aseta..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Aina päällimmäisenä" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fontit" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Pieni" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normaali" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Suuri" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "Apua &Ohjeeseen\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Aina päällimmäisenä" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "T&ietoja Winen Ohjeesta" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/fr.po wine-staging-1.7.46~ubuntu14.10.1/po/fr.po --- wine-staging-1.7.45~ubuntu14.10.1/po/fr.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/fr.po 2015-06-28 16:51:28.000000000 +0000 @@ -356,7 +356,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "Aid&e" @@ -8210,7 +8210,7 @@ msgid "PrintHood" msgstr "Voisinage d'impression" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historique" @@ -12092,8 +12092,8 @@ msgstr "regsvr32 : Impossible de charger la DLL « %1 »\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32 : %1 non implémentée dans la DLL « %2 »\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32 : « %1!S! » non implémentée dans la DLL « %2 »\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14276,30 +14276,30 @@ msgid "&Define..." msgstr "&Définir..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Toujours visible" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Polices" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Petite" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normale" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Grande" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Utiliser l'aide\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Toujours visible" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "À &propos de l'aide de Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/he.po wine-staging-1.7.46~ubuntu14.10.1/po/he.po --- wine-staging-1.7.45~ubuntu14.10.1/po/he.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/he.po 2015-06-28 16:51:28.000000000 +0000 @@ -357,7 +357,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "ע&זרה" @@ -8443,7 +8443,7 @@ msgid "PrintHood" msgstr "הדפסה ברשת" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "היסטוריה" @@ -12148,7 +12148,7 @@ msgstr "Failed to open '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14418,30 +14418,30 @@ msgid "&Define..." msgstr "ה&גדרה..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "תמיד &עליון" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "גופנים" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "קטנים" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "רגילים" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "גדולים" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "ע&זרה לעזרה\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "תמיד &עליון" - #: winhlp32.rc:59 #, fuzzy msgid "&About Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/hi.po wine-staging-1.7.46~ubuntu14.10.1/po/hi.po --- wine-staging-1.7.45~ubuntu14.10.1/po/hi.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/hi.po 2015-06-28 16:51:28.000000000 +0000 @@ -332,7 +332,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -8031,7 +8031,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11371,7 +11371,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13471,32 +13471,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "हमेशा शीर्ष पर (&A)" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "फ़ॉन्ट (&F)..." -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "हमेशा शीर्ष पर (&A)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/hr.po wine-staging-1.7.46~ubuntu14.10.1/po/hr.po --- wine-staging-1.7.45~ubuntu14.10.1/po/hr.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/hr.po 2015-06-28 16:51:28.000000000 +0000 @@ -351,7 +351,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Pomoć" @@ -8213,7 +8213,7 @@ msgid "PrintHood" msgstr "Pisači" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Povijest" @@ -11648,7 +11648,7 @@ msgstr "Neuspjelo otvaranje '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13791,30 +13791,30 @@ msgid "&Define..." msgstr "&Odredi..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Uvijek na &vrhu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fontovi" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Mali" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normalan" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Veliki" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Pomoć za pomoć\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Uvijek na &vrhu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "O Wine pomo&ći" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/hu.po wine-staging-1.7.46~ubuntu14.10.1/po/hu.po --- wine-staging-1.7.45~ubuntu14.10.1/po/hu.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/hu.po 2015-06-28 16:51:28.000000000 +0000 @@ -365,7 +365,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Súgó" @@ -8243,7 +8243,7 @@ msgid "PrintHood" msgstr "Nyomtatók" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Előzmény" @@ -12100,7 +12100,7 @@ msgstr "'%1' megnyitása sikertelen\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14277,30 +14277,30 @@ msgid "&Define..." msgstr "&Definiálás..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Mindig &legfelül" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Betûtípusok" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Kicsi" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normál" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Nagy" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Használat" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Mindig &legfelül" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Névjegy" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/it.po wine-staging-1.7.46~ubuntu14.10.1/po/it.po --- wine-staging-1.7.45~ubuntu14.10.1/po/it.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/it.po 2015-06-28 16:51:28.000000000 +0000 @@ -371,7 +371,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Aiuto" @@ -8311,7 +8311,7 @@ msgid "PrintHood" msgstr "Stampanti condivise" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Cronologia" @@ -12176,7 +12176,7 @@ msgstr "Impossibile aprire '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14362,30 +14362,30 @@ msgid "&Define..." msgstr "&Definisci..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Sempre in primo &piano" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Caratteri" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Piccoli" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normali" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Grandi" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Aiuto sulla Guida\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Sempre in primo &piano" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Informazioni sulla Guida di Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ja.po wine-staging-1.7.46~ubuntu14.10.1/po/ja.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ja.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ja.po 2015-06-28 16:51:28.000000000 +0000 @@ -354,7 +354,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "ヘルプ(&H)" @@ -8153,7 +8153,7 @@ msgid "PrintHood" msgstr "PrintHood" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "History" @@ -11936,8 +11936,8 @@ msgstr "regsvr32: '%1' を読み込めませんでした\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1はDLL '%2'内で実装されていません\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!'はDLL '%2'内で実装されていません\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14097,30 +14097,30 @@ msgid "&Define..." msgstr "定義(&D)..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "常に手前に表示(&T)" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "フォント" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "小" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "標準" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "大" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "ヘルプの使い方(&H)\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "常に手前に表示(&T)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "バージョン情報(&A)" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ko.po wine-staging-1.7.46~ubuntu14.10.1/po/ko.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ko.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ko.po 2015-06-28 16:51:28.000000000 +0000 @@ -352,7 +352,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "도움말(&H)" @@ -8211,7 +8211,7 @@ msgid "PrintHood" msgstr "네트워크 환경" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "기록" @@ -11981,7 +11981,7 @@ msgstr "'%1' 열기 실패\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14142,30 +14142,30 @@ msgid "&Define..." msgstr "정의(&D)..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "항상 위(&T)" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "글꼴" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "작게" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "보통" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "크게" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "도움말 사용법(&H)\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "항상 위(&T)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Wine 도움말 정보(&A)" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/lt.po wine-staging-1.7.46~ubuntu14.10.1/po/lt.po --- wine-staging-1.7.45~ubuntu14.10.1/po/lt.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/lt.po 2015-06-28 16:51:28.000000000 +0000 @@ -353,7 +353,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Žinynas" @@ -8164,7 +8164,7 @@ msgid "PrintHood" msgstr "Spausdintuvai" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Istorija" @@ -11939,8 +11939,8 @@ msgstr "regsvr32: Nepavyko įkelti DLL bibliotekos „%1“\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 neįgyvendinta DLL bibliotekoje „%2“\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: „%1!S!“ neįgyvendinta DLL bibliotekoje „%2“\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14106,30 +14106,30 @@ msgid "&Define..." msgstr "&Apibrėžti..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Visada viršuje" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Šriftai" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "&Mažas" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "&Normalus" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "&Didelis" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "Pa&galba apie žinyną\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Visada viršuje" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Apie „Wine“ žinyną" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ml.po wine-staging-1.7.46~ubuntu14.10.1/po/ml.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ml.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ml.po 2015-06-28 16:51:28.000000000 +0000 @@ -332,7 +332,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -8031,7 +8031,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11371,7 +11371,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13471,32 +13471,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "_എപ്പോഴും മുകളില്‍" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "_അക്ഷരസഞ്ചയം..." -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "_എപ്പോഴും മുകളില്‍" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/nb_NO.po wine-staging-1.7.46~ubuntu14.10.1/po/nb_NO.po --- wine-staging-1.7.45~ubuntu14.10.1/po/nb_NO.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/nb_NO.po 2015-06-28 16:51:28.000000000 +0000 @@ -352,7 +352,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Hjelp" @@ -8230,7 +8230,7 @@ msgid "PrintHood" msgstr "Skrivere" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historikk" @@ -11999,7 +11999,7 @@ msgstr "Klarte ikke åpne «%1»\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14165,30 +14165,30 @@ msgid "&Define..." msgstr "&Definer..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "All&tid øverst" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Skrifttyper" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Liten" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Stor" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Hjelp om hjelp\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "All&tid øverst" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Om Wine Hjelp" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/nl.po wine-staging-1.7.46~ubuntu14.10.1/po/nl.po --- wine-staging-1.7.45~ubuntu14.10.1/po/nl.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/nl.po 2015-06-28 16:51:28.000000000 +0000 @@ -354,7 +354,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Help" @@ -8286,7 +8286,7 @@ msgid "PrintHood" msgstr "Printeromgeving" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Geschiedenis" @@ -12142,7 +12142,7 @@ msgstr "Openen van '%1' is mislukt\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14331,30 +14331,30 @@ msgid "&Define..." msgstr "&Aanmaken..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Altijd &zichtbaar" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Lettertype" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Klein" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Standaard" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Groot" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "H&ulp bij Help\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Altijd &zichtbaar" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Info" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/or.po wine-staging-1.7.46~ubuntu14.10.1/po/or.po --- wine-staging-1.7.45~ubuntu14.10.1/po/or.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/or.po 2015-06-28 16:51:28.000000000 +0000 @@ -332,7 +332,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -8031,7 +8031,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11371,7 +11371,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13471,32 +13471,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "ସର୍ବଦା ଉପରେ (&A)" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "ଅକ୍ଷରରୂପ (&F)..." -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "ସର୍ବଦା ଉପରେ (&A)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/pa.po wine-staging-1.7.46~ubuntu14.10.1/po/pa.po --- wine-staging-1.7.45~ubuntu14.10.1/po/pa.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/pa.po 2015-06-28 16:51:28.000000000 +0000 @@ -332,7 +332,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -8031,7 +8031,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11371,7 +11371,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13471,32 +13471,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "ਹਮੇਸ਼ਾ ਉੱਪਰ(&A)" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "ਫੌਂਟ(&F)..." -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "ਹਮੇਸ਼ਾ ਉੱਪਰ(&A)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/pl.po wine-staging-1.7.46~ubuntu14.10.1/po/pl.po --- wine-staging-1.7.45~ubuntu14.10.1/po/pl.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/pl.po 2015-06-28 16:51:28.000000000 +0000 @@ -357,7 +357,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "Pomo&c" @@ -8187,7 +8187,7 @@ msgid "PrintHood" msgstr "Drukowanie otoczenie" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historia" @@ -12005,8 +12005,8 @@ msgstr "regsvr32: Nieudane wczytywanie biblioteki DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 nie jest zaimplementowana w bibliotece DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' nie jest zaimplementowana w bibliotece DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14174,30 +14174,30 @@ msgid "&Define..." msgstr "&Definiuj..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Zawsze na wierzchu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Czcionki" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Małe" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normalne" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Duże" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "Jak korzystać z pomo&cy\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Zawsze na wierzchu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Pomoc Wine - i&nformacje" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/pt_BR.po wine-staging-1.7.46~ubuntu14.10.1/po/pt_BR.po --- wine-staging-1.7.45~ubuntu14.10.1/po/pt_BR.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/pt_BR.po 2015-06-28 16:51:28.000000000 +0000 @@ -354,7 +354,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "Aj&uda" @@ -8180,7 +8180,7 @@ msgid "PrintHood" msgstr "Impressoras" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Histórico" @@ -12015,8 +12015,8 @@ msgstr "regsvr32: Falha ao carregar a DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 não implementado na DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: '%1!S!' não implementado na DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14188,30 +14188,30 @@ msgid "&Define..." msgstr "&Definir..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Sempre &visível" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fontes" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Pequeno" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Grande" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Ajuda na ajuda\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Sempre &visível" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Sobre a Ajuda Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/pt_PT.po wine-staging-1.7.46~ubuntu14.10.1/po/pt_PT.po --- wine-staging-1.7.45~ubuntu14.10.1/po/pt_PT.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/pt_PT.po 2015-06-28 16:51:28.000000000 +0000 @@ -354,7 +354,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Ajuda" @@ -8150,7 +8150,7 @@ msgid "PrintHood" msgstr "Impressoras" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Histórico" @@ -11974,7 +11974,7 @@ msgstr "Falhou ao abrir '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14145,30 +14145,30 @@ msgid "&Define..." msgstr "&Definir..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Sempre &visível" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Tipos de Letra" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Pequeno" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Grande" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Ajuda na ajuda\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Sempre &visível" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Acerca da Ajuda do &Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/rm.po wine-staging-1.7.46~ubuntu14.10.1/po/rm.po --- wine-staging-1.7.45~ubuntu14.10.1/po/rm.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/rm.po 2015-06-28 16:51:28.000000000 +0000 @@ -338,7 +338,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Ag�d" @@ -8089,7 +8089,7 @@ msgid "PrintHood" msgstr "&Stampar tema" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11457,7 +11457,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13570,31 +13570,31 @@ msgid "&Define..." msgstr "&Definir..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Ad�na da&vant" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&Douvrar l'ag�d" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Ad�na da&vant" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "I&nfuormaziuns" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ro.po wine-staging-1.7.46~ubuntu14.10.1/po/ro.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ro.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ro.po 2015-06-28 16:51:28.000000000 +0000 @@ -338,7 +338,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Ajutor" @@ -8416,7 +8416,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Istorie" @@ -12182,7 +12182,7 @@ msgstr "Deschiderea „%1” a eșuat\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14354,30 +14354,30 @@ msgid "&Define..." msgstr "&Definește..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "În&totdeauna deasupra" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fonturi" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Mic" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Mare" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Ajutor la ajutor\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "În&totdeauna deasupra" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/ru.po wine-staging-1.7.46~ubuntu14.10.1/po/ru.po --- wine-staging-1.7.45~ubuntu14.10.1/po/ru.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/ru.po 2015-06-28 16:51:28.000000000 +0000 @@ -353,7 +353,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Справка" @@ -8166,7 +8166,7 @@ msgid "PrintHood" msgstr "Принтеры" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "История" @@ -11939,8 +11939,8 @@ msgstr "regsvr32: не удалось загрузить DLL «%1»\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 не реализован в DLL «%2»\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" +msgstr "regsvr32: «%1!S!» не реализован в DLL «%2»\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14100,30 +14100,30 @@ msgid "&Define..." msgstr "&Определить..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Всегда &сверху" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Шрифты" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Мелкий" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Обычный" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Крупный" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Справка о справочной программе\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Всегда &сверху" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Информация" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/sk.po wine-staging-1.7.46~ubuntu14.10.1/po/sk.po --- wine-staging-1.7.45~ubuntu14.10.1/po/sk.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/sk.po 2015-06-28 16:51:28.000000000 +0000 @@ -371,7 +371,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Pomoc" @@ -8191,7 +8191,7 @@ msgid "PrintHood" msgstr "&Tlačiť" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11614,7 +11614,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13753,30 +13753,30 @@ msgid "&Define..." msgstr "&Definovať..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Vždy na &vrchu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Písma" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Malé" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normálne" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Veľké" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Nápoveda k nápovede\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Vždy na &vrchu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&O programe Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/sl.po wine-staging-1.7.46~ubuntu14.10.1/po/sl.po --- wine-staging-1.7.45~ubuntu14.10.1/po/sl.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/sl.po 2015-06-28 16:51:28.000000000 +0000 @@ -370,7 +370,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "Pomo&č" @@ -8299,7 +8299,7 @@ msgid "PrintHood" msgstr "Tiskalniki" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Zgodovina" @@ -12122,7 +12122,7 @@ msgstr "Odpiranje '%1' je spodletelo\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14303,30 +14303,30 @@ msgid "&Define..." msgstr "Do&loči ..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Vedno na &vrhu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Pisave" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Majhna" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Običajna" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Velika" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Pomoč o pomoči\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Vedno na &vrhu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&O pomoči Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/sr_RS@cyrillic.po wine-staging-1.7.46~ubuntu14.10.1/po/sr_RS@cyrillic.po --- wine-staging-1.7.45~ubuntu14.10.1/po/sr_RS@cyrillic.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/sr_RS@cyrillic.po 2015-06-28 16:51:28.000000000 +0000 @@ -357,7 +357,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Помоћ" @@ -8511,7 +8511,7 @@ msgid "PrintHood" msgstr "Штампачи" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -12039,7 +12039,7 @@ msgstr "Отварање „%s“ датотеке није успело\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14286,32 +14286,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "&Увек на врху" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Фонтови" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&Помоћ за помоћ" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "&Увек на врху" - #: winhlp32.rc:59 #, fuzzy msgid "&About Wine Help" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/sr_RS@latin.po wine-staging-1.7.46~ubuntu14.10.1/po/sr_RS@latin.po --- wine-staging-1.7.45~ubuntu14.10.1/po/sr_RS@latin.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/sr_RS@latin.po 2015-06-28 16:51:28.000000000 +0000 @@ -362,7 +362,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Pomoć" @@ -8612,7 +8612,7 @@ msgid "PrintHood" msgstr "Štampači" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Istorija" @@ -12186,7 +12186,7 @@ msgstr "Otvaranje „%s“ datoteke nije uspelo\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14436,31 +14436,31 @@ msgid "&Define..." msgstr "&Odredi..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Uvek na &vrhu" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Fontovi" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Mali" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normalan" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Veliki" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&Pomoć za pomoć" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Uvek na &vrhu" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/sv.po wine-staging-1.7.46~ubuntu14.10.1/po/sv.po --- wine-staging-1.7.45~ubuntu14.10.1/po/sv.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/sv.po 2015-06-28 16:51:28.000000000 +0000 @@ -351,7 +351,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Hjälp" @@ -8194,7 +8194,7 @@ msgid "PrintHood" msgstr "Skrivare" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Historik" @@ -11889,7 +11889,7 @@ msgstr "Misslyckades med att öppna '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14051,30 +14051,30 @@ msgid "&Define..." msgstr "&Definiera..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Alltid &överst" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Typsnitt" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Litet" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normalt" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Stort" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Hjälp om hjälp\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Alltid &överst" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Om Wine Hjälp" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/te.po wine-staging-1.7.46~ubuntu14.10.1/po/te.po --- wine-staging-1.7.45~ubuntu14.10.1/po/te.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/te.po 2015-06-28 16:51:28.000000000 +0000 @@ -332,7 +332,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -8031,7 +8031,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11371,7 +11371,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13471,32 +13471,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "ఎల్లప్పుడూ పైన (&A)" + +#: winhlp32.rc:50 winhlp32.rc:70 #, fuzzy msgid "Fonts" msgstr "ఫాంట్... (&F)" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "ఎల్లప్పుడూ పైన (&A)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/th.po wine-staging-1.7.46~ubuntu14.10.1/po/th.po --- wine-staging-1.7.45~ubuntu14.10.1/po/th.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/th.po 2015-06-28 16:51:28.000000000 +0000 @@ -335,7 +335,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "ช่วยเหลีอ" @@ -8199,7 +8199,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11612,7 +11612,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13751,32 +13751,32 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +#, fuzzy +msgid "Always on &top" +msgstr "ยูบนสุดเสมอ" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "ดัวอักษร" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "เกี่ยวกับช่วยเหลีอ" -#: winhlp32.rc:58 -#, fuzzy -msgid "Always on &top" -msgstr "ยูบนสุดเสมอ" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/tr.po wine-staging-1.7.46~ubuntu14.10.1/po/tr.po --- wine-staging-1.7.45~ubuntu14.10.1/po/tr.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/tr.po 2015-06-28 16:51:28.000000000 +0000 @@ -354,7 +354,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Yardım" @@ -8223,7 +8223,7 @@ msgid "PrintHood" msgstr "Paylaşılan Yazıcılar" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Geçmiş" @@ -11948,7 +11948,7 @@ msgstr "'%1' açılamadı\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14106,30 +14106,30 @@ msgid "&Define..." msgstr "&Tanımla..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "&Her Zaman Üstte" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Yazı Tipleri" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Küçük" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Normal" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Geniş" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Yardım üzerine yardım\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "&Her Zaman Üstte" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "&Wine Yardım Hakkında" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/uk.po wine-staging-1.7.46~ubuntu14.10.1/po/uk.po --- wine-staging-1.7.45~ubuntu14.10.1/po/uk.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/uk.po 2015-06-28 16:51:28.000000000 +0000 @@ -349,7 +349,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Довідка" @@ -8246,7 +8246,7 @@ msgid "PrintHood" msgstr "Принтери" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "Історія" @@ -12031,7 +12031,7 @@ msgstr "regsvr32: Не вдалося завантажити DLL '%1'\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "regsvr32: %1 не реалізовано у DLL '%2'\n" #: regsvr32.rc:44 @@ -14191,30 +14191,30 @@ msgid "&Define..." msgstr "&Задати..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Завжди &зверху" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "Шрифти" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "Малий" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "Нормальний" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "Великий" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "&Використання Довідки\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Завжди &зверху" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "Про &Довідку Wine" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/wa.po wine-staging-1.7.46~ubuntu14.10.1/po/wa.po --- wine-staging-1.7.45~ubuntu14.10.1/po/wa.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/wa.po 2015-06-28 16:51:28.000000000 +0000 @@ -341,7 +341,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "&Aide" @@ -8132,7 +8132,7 @@ msgid "PrintHood" msgstr "&Rexhe" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11517,7 +11517,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13654,31 +13654,31 @@ msgid "&Define..." msgstr "&Defini..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "Todi &Visibe" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 +#: winhlp32.rc:58 #, fuzzy msgid "&Help on help\tF1" msgstr "&Aide so l' Aide" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "Todi &Visibe" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/wine.pot wine-staging-1.7.46~ubuntu14.10.1/po/wine.pot --- wine-staging-1.7.45~ubuntu14.10.1/po/wine.pot 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/wine.pot 2015-06-28 16:51:28.000000000 +0000 @@ -325,7 +325,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "" @@ -7976,7 +7976,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "" @@ -11307,7 +11307,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13392,28 +13392,28 @@ msgid "&Define..." msgstr "" -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "" -#: winhlp32.rc:57 -msgid "&Help on help\tF1" -msgstr "" - #: winhlp32.rc:58 -msgid "Always on &top" +msgid "&Help on help\tF1" msgstr "" #: winhlp32.rc:59 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/zh_CN.po wine-staging-1.7.46~ubuntu14.10.1/po/zh_CN.po --- wine-staging-1.7.45~ubuntu14.10.1/po/zh_CN.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/zh_CN.po 2015-06-28 16:51:28.000000000 +0000 @@ -336,7 +336,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "帮助(&H)" @@ -8079,7 +8079,7 @@ msgid "PrintHood" msgstr "" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "历史" @@ -11473,7 +11473,7 @@ msgstr "" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -13617,30 +13617,30 @@ msgid "&Define..." msgstr "定义(&D)..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "总是在最前面(&T)" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "字体" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "小号" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "中号" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "大号" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "如何使用帮助(&H)\tF1" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "总是在最前面(&T)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "关于 Wine 帮助(&I)" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/po/zh_TW.po wine-staging-1.7.46~ubuntu14.10.1/po/zh_TW.po --- wine-staging-1.7.45~ubuntu14.10.1/po/zh_TW.po 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/po/zh_TW.po 2015-06-28 16:51:28.000000000 +0000 @@ -341,7 +341,7 @@ #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 -#: winemine.rc:51 winhlp32.rc:56 wordpad.rc:94 +#: winemine.rc:51 winhlp32.rc:57 wordpad.rc:94 msgid "&Help" msgstr "求助(&H)" @@ -8165,7 +8165,7 @@ msgid "PrintHood" msgstr "印表套頁" -#: shell32.rc:214 winhlp32.rc:48 +#: shell32.rc:214 winhlp32.rc:49 msgid "History" msgstr "歷程" @@ -11866,7 +11866,7 @@ msgstr "開啟 %1 失敗\n" #: regsvr32.rc:43 -msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" msgstr "" #: regsvr32.rc:44 @@ -14013,30 +14013,30 @@ msgid "&Define..." msgstr "定義(&D)..." -#: winhlp32.rc:49 winhlp32.rc:70 +#: winhlp32.rc:48 +msgid "Always on &top" +msgstr "總是在最上層(&T)" + +#: winhlp32.rc:50 winhlp32.rc:70 msgid "Fonts" msgstr "字型" -#: winhlp32.rc:51 winhlp32.rc:72 +#: winhlp32.rc:52 winhlp32.rc:72 msgid "Small" msgstr "小" -#: winhlp32.rc:52 winhlp32.rc:73 +#: winhlp32.rc:53 winhlp32.rc:73 msgid "Normal" msgstr "中" -#: winhlp32.rc:53 winhlp32.rc:74 +#: winhlp32.rc:54 winhlp32.rc:74 msgid "Large" msgstr "大" -#: winhlp32.rc:57 +#: winhlp32.rc:58 msgid "&Help on help\tF1" msgstr "如何使用說明(&H)" -#: winhlp32.rc:58 -msgid "Always on &top" -msgstr "總是在最上層(&T)" - #: winhlp32.rc:59 msgid "&About Wine Help" msgstr "關於 Wine 說明(&A)" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/builtins.c wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/builtins.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/builtins.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/builtins.c 2015-06-28 16:51:28.000000000 +0000 @@ -1561,7 +1561,7 @@ (*cmdList)->command)) { /* Swap between if and else processing */ - processThese = !processThese; + processThese = !executecmds; /* Process the ELSE part */ if (processThese) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd --- wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd 2015-06-28 16:51:28.000000000 +0000 @@ -667,7 +667,45 @@ ) else ( echo parameter detection seems to be broken ) - +SET elseIF=0 +if 1 == 1 ( + SET /a elseIF=%elseIF%+1 +) else if 1 == 1 ( + SET /a elseIF=%elseIF%+2 +) else ( + SET /a elseIF=%elseIF%+2 +) +if %elseIF% == 1 ( + echo else if seems to work +) else ( + echo else if seems to be broken +) +SET elseIF=0 +if 1 == 2 ( + SET /a elseIF=%elseIF%+2 +) else if 1 == 1 ( + SET /a elseIF=%elseIF%+1 +) else ( + SET /a elseIF=%elseIF%+2 +) +if %elseIF% == 1 ( + echo else if seems to work +) else ( + echo else if seems to be broken +) +SET elseIF=0 +if 1 == 2 ( + SET /a elseIF=%elseIF%+2 +) else if 1 == 2 ( + SET /a elseIF=%elseIF%+2 +) else ( + SET /a elseIF=%elseIF%+1 +) +if %elseIF% == 1 ( + echo else if seems to work +) else ( + echo else if seems to be broken +) echo --- case sensitivity with and without /i option if bar==BAR echo if does not default to case sensitivity if not bar==BAR echo if seems to default to case sensitivity diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd.exp wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd.exp --- wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd.exp 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/tests/test_builtins.cmd.exp 2015-06-28 16:51:28.000000000 +0000 @@ -438,6 +438,9 @@ if seems to work else seems to work if seems not to detect /c as parameter +else if seems to work +else if seems to work +else if seems to work --- case sensitivity with and without /i option if seems to default to case sensitivity if /i seems to work diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/wcmdmain.c wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/wcmdmain.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/cmd/wcmdmain.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/cmd/wcmdmain.c 2015-06-28 16:51:28.000000000 +0000 @@ -1330,7 +1330,7 @@ * Changing default drive has to be handled as a special case. */ - if ((cmd[1] == ':') && IsCharAlphaW(cmd[0]) && (strlenW(cmd) == 2)) { + if ((strlenW(cmd) == 2) && (cmd[1] == ':') && IsCharAlphaW(cmd[0])) { WCHAR envvar[5]; WCHAR dir[MAX_PATH]; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/net/net.c wine-staging-1.7.46~ubuntu14.10.1/programs/net/net.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/net/net.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/net/net.c 2015-06-28 16:51:28.000000000 +0000 @@ -49,7 +49,7 @@ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, strA, lenA, NULL, NULL); - WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, len, &count, FALSE); + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, lenA, &count, FALSE); HeapFree(GetProcessHeap(), 0, strA); } return count; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/regedit/childwnd.c wine-staging-1.7.46~ubuntu14.10.1/programs/regedit/childwnd.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/regedit/childwnd.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/regedit/childwnd.c 2015-06-28 16:51:28.000000000 +0000 @@ -243,7 +243,14 @@ if (RegCreateKeyExW(HKEY_CURRENT_USER, wszKeyName, 0, NULL, 0, KEY_READ, NULL, &hkey, NULL) == ERROR_SUCCESS) { if (RegQueryValueExW(hkey, wszLastKey, NULL, NULL, (LPBYTE)wszVal, &dwSize) == ERROR_SUCCESS) - SendMessageW(hwndTV, TVM_SELECTITEM, TVGN_CARET, (LPARAM)FindPathInTree(hwndTV, wszVal)); + { + HTREEITEM selection; + if (!strcmpW(wszVal, g_pChildWnd->szPath)) + selection = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0); + else + selection = FindPathInTree(hwndTV, wszVal); + SendMessageW(hwndTV, TVM_SELECTITEM, TVGN_CARET, (LPARAM)selection); + } RegCloseKey(hkey); } @@ -258,15 +265,20 @@ static void set_last_key(HWND hwndTV) { HKEY hkey; - WCHAR *wszVal; if (RegCreateKeyExW(HKEY_CURRENT_USER, wszKeyName, 0, NULL, 0, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS) { HTREEITEM selection = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_CARET, 0); + HTREEITEM root = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0); + WCHAR *value; - wszVal = GetItemFullPath(g_pChildWnd->hTreeWnd, selection, FALSE); - RegSetValueExW(hkey, wszLastKey, 0, REG_SZ, (LPBYTE)wszVal, (lstrlenW(wszVal) + 1) * sizeof(WCHAR)); - HeapFree(GetProcessHeap(), 0, wszVal); + if (selection == root) + value = g_pChildWnd->szPath; + else + value = GetItemFullPath(g_pChildWnd->hTreeWnd, selection, FALSE); + RegSetValueExW(hkey, wszLastKey, 0, REG_SZ, (LPBYTE)value, (lstrlenW(value) + 1) * sizeof(WCHAR)); + if (selection != root) + HeapFree(GetProcessHeap(), 0, value); RegCloseKey(hkey); } } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/Makefile.in wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/Makefile.in --- wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/Makefile.in 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/Makefile.in 2015-06-28 16:51:28.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = regsvr32.exe -APPMODE = -mconsole +APPMODE = -mconsole -municode IMPORTS = ole32 user32 C_SRCS = \ diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/regsvr32.c wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/regsvr32.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/regsvr32.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/regsvr32.c 2015-06-28 16:51:28.000000000 +0000 @@ -4,6 +4,7 @@ * Copyright 2001 ReactOS project * Copyright 2001 Jurgen Van Gael [jurgen.vangael@student.kuleuven.ac.be] * Copyright 2002 Andriy Palamarchuk + * Copyright 2014, 2015 Hugh McMaster * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,30 +21,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * This version deliberately differs in error handling compared to the - * windows version. - */ - -/* - * - * regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname ... - * [/u] unregister server - * [/s] silent (no message boxes) - * [/i] Call DllInstall passing it an optional [cmdline]; - * when used with /u calls dll uninstall. - * [/n] Do not call DllRegisterServer; this option must be used with [/i] - * [/c] Console output (seems to be deprecated and ignored) - * - * Note the complication that this version may be passed unix format file names - * which might be mistaken for flags. Conveniently the Windows version - * requires each flag to be separate (e.g. no /su ) and so we will simply - * assume that anything longer than /. is a filename. - */ - -/** - * FIXME - currently receives command-line parameters in ASCII only and later - * converts to Unicode. Ideally the function should have wWinMain entry point - * and then work in Unicode only, but it seems Wine does not have necessary - * support. + * Windows version. */ #define WIN32_LEAN_AND_MEAN @@ -51,30 +29,30 @@ #include "config.h" #include "wine/port.h" -#include #include #include #include "regsvr32.h" +#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(regsvr32); -typedef HRESULT (*DLLREGISTER) (void); -typedef HRESULT (*DLLUNREGISTER) (void); -typedef HRESULT (*DLLINSTALL) (BOOL,LPCWSTR); +typedef HRESULT (WINAPI *DLLREGISTER) (void); +typedef HRESULT (WINAPI *DLLUNREGISTER) (void); +typedef HRESULT (WINAPI *DLLINSTALL) (BOOL,LPCWSTR); static BOOL Silent = FALSE; static void __cdecl output_write(UINT id, ...) { - char fmt[1024]; + WCHAR fmt[1024]; __ms_va_list va_args; - char *str; + WCHAR *str; DWORD len, nOut, ret; if (Silent) return; - if (!LoadStringA(GetModuleHandleA(NULL), id, fmt, sizeof(fmt)/sizeof(fmt[0]))) + if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, sizeof(fmt)/sizeof(fmt[0]))) { WINE_FIXME("LoadString failed with %d\n", GetLastError()); return; @@ -82,20 +60,34 @@ __ms_va_start(va_args, id); SetLastError(NO_ERROR); - len = FormatMessageA(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, - fmt, 0, 0, (LPSTR)&str, 0, &va_args); + len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, + fmt, 0, 0, (LPWSTR)&str, 0, &va_args); __ms_va_end(va_args); if (len == 0 && GetLastError() != NO_ERROR) { - WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_a(fmt)); + WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt)); return; } - ret = WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &nOut, NULL); + ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &nOut, NULL); + /* WriteConsole fails if its output is redirected to a file. + * If this occurs, we should use an OEM codepage and call WriteFile. + */ if (!ret) - WINE_WARN("regsvr32: WriteConsoleA() failed.\n"); + { + DWORD lenA; + char *strA; + lenA = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, NULL, 0, NULL, NULL); + strA = HeapAlloc(GetProcessHeap(), 0, lenA); + if (strA) + { + WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, strA, lenA, NULL, NULL); + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, lenA, &nOut, FALSE); + HeapFree(GetProcessHeap(), 0, strA); + } + } LocalFree(str); } @@ -104,14 +96,14 @@ * * Parameters: * strDll - name of the dll. - * procName - name of the procedure to load from dll - * pDllHanlde - output variable receives handle of the loaded dll. + * procName - name of the procedure to load from the dll. + * DllHandle - a variable that receives the handle of the loaded dll. */ -static VOID *LoadProc(const char* strDll, const char* procName, HMODULE* DllHandle) +static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHandle) { VOID* (*proc)(void); - *DllHandle = LoadLibraryExA(strDll, 0, LOAD_WITH_ALTERED_SEARCH_PATH); + *DllHandle = LoadLibraryExW(strDll, 0, LOAD_WITH_ALTERED_SEARCH_PATH); if(!*DllHandle) { output_write(STRING_DLL_LOAD_FAILED, strDll); @@ -127,7 +119,7 @@ return proc; } -static int RegisterDll(const char* strDll) +static int RegisterDll(const WCHAR* strDll) { HRESULT hr; DLLREGISTER pfRegister; @@ -150,7 +142,7 @@ return 0; } -static int UnregisterDll(char* strDll) +static int UnregisterDll(const WCHAR* strDll) { HRESULT hr; DLLUNREGISTER pfUnregister; @@ -173,7 +165,7 @@ return 0; } -static int InstallDll(BOOL install, char *strDll, WCHAR *command_line) +static int InstallDll(BOOL install, const WCHAR *strDll, const WCHAR *command_line) { HRESULT hr; DLLINSTALL pfInstall; @@ -202,7 +194,32 @@ return 0; } -int main(int argc, char* argv[]) +static WCHAR *parse_command_line(WCHAR *command_line) +{ + if (command_line[0] == ':' && command_line[1]) + { + int len = strlenW(command_line); + + command_line++; + len--; + /* remove double quotes */ + if (command_line[0] == '"') + { + command_line++; + len--; + if (command_line[0]) + { + len--; + command_line[len] = 0; + } + } + if (command_line[0]) + return command_line; + } + return NULL; +} + +int wmain(int argc, WCHAR* argv[]) { int i; BOOL CallRegister = TRUE; @@ -218,68 +235,45 @@ * the files (e.g. regsvr32 file1 /s file2 is silent even for file1). * For ease, we will not replicate that and will process the arguments * in order. + * + * Note the complication that this version may be passed Unix format filenames + * which could be mistaken for flags. The Windows version conveniently + * requires each flag to be separate (e.g. no /su), so we will simply + * assume that anything longer than /. is a filename. */ for(i = 1; i < argc; i++) { - if ((!strcasecmp(argv[i], "/u")) ||(!strcasecmp(argv[i], "-u"))) - Unregister = TRUE; - else if ((!strcasecmp(argv[i], "/s"))||(!strcasecmp(argv[i], "-s"))) - Silent = TRUE; - else if ((!strncasecmp(argv[i], "/i", strlen("/i")))||(!strncasecmp(argv[i], "-i", strlen("-i")))) + if ((argv[i][0] == '/' || argv[i][0] == '-') && (!argv[i][2] || argv[i][2] == ':')) { - CHAR* command_line = argv[i] + strlen("/i"); - - CallInstall = TRUE; - if (command_line[0] == ':' && command_line[1]) + switch (tolowerW(argv[i][1])) { - int len = strlen(command_line); - - command_line++; - len--; - /* remove double quotes */ - if (command_line[0] == '"') - { - command_line++; - len--; - if (command_line[0]) - { - len--; - command_line[len] = 0; - } - } - if (command_line[0]) - { - len = MultiByteToWideChar(CP_ACP, 0, command_line, -1, - NULL, 0); - wsCommandLine = HeapAlloc(GetProcessHeap(), 0, - len * sizeof(WCHAR)); - if (wsCommandLine) - MultiByteToWideChar(CP_ACP, 0, command_line, -1, - wsCommandLine, len); - } - else - { + case 'u': + Unregister = TRUE; + break; + case 's': + Silent = TRUE; + break; + case 'i': + CallInstall = TRUE; + wsCommandLine = parse_command_line(argv[i] + 2); /* argv[i] + strlen("/i") */ + if (!wsCommandLine) wsCommandLine = EmptyLine; - } + break; + case 'n': + CallRegister = FALSE; + break; + case 'c': + /* console output */; + break; + default: + output_write(STRING_UNRECOGNIZED_SWITCH, argv[i]); + output_write(STRING_USAGE); + return 1; } - else - { - wsCommandLine = EmptyLine; - } - } - else if((!strcasecmp(argv[i], "/n"))||(!strcasecmp(argv[i], "-n"))) - CallRegister = FALSE; - else if((!strcasecmp(argv[i], "/c"))||(!strcasecmp(argv[i], "-c"))) - /* console output */; - else if (argv[i][0] == '/' && (!argv[i][2] || argv[i][2] == ':')) - { - output_write(STRING_UNRECOGNIZED_SWITCH, argv[i]); - output_write(STRING_USAGE); - return 1; } else { - char *DllName = argv[i]; + WCHAR *DllName = argv[i]; int res = 0; DllFound = TRUE; @@ -293,7 +287,7 @@ if (res) return res; - /* Confirmed. The windows version does stop on the first error.*/ + /* Confirmed. The Windows version stops on the first error. */ if (CallInstall) { diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/regsvr32.rc wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/regsvr32.rc --- wine-staging-1.7.45~ubuntu14.10.1/programs/regsvr32/regsvr32.rc 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/regsvr32/regsvr32.rc 2015-06-28 16:51:28.000000000 +0000 @@ -39,7 +39,7 @@ \ [/n] Do not call DllRegisterServer. This option must be used with [/i].\n\n" STRING_UNRECOGNIZED_SWITCH, "regsvr32: Invalid or unrecognized switch [%1]\n\n" STRING_DLL_LOAD_FAILED, "regsvr32: Failed to load DLL '%1'\n" - STRING_PROC_NOT_IMPLEMENTED, "regsvr32: %1 not implemented in DLL '%2'\n" + STRING_PROC_NOT_IMPLEMENTED, "regsvr32: '%1!S!' not implemented in DLL '%2'\n" STRING_REGISTER_FAILED, "regsvr32: Failed to register DLL '%1'\n" STRING_REGISTER_SUCCESSFUL, "regsvr32: Successfully registered DLL '%1'\n" STRING_UNREGISTER_FAILED, "regsvr32: Failed to unregister DLL '%1'\n" diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/be_arm64.c wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/be_arm64.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/be_arm64.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/be_arm64.c 2015-06-28 16:51:28.000000000 +0000 @@ -60,7 +60,7 @@ int i; char buf[8]; - switch (ctx->PState & 0x0f) + switch (ctx->Cpsr & 0x0f) { case 0: strcpy(buf, "EL0t"); break; case 4: strcpy(buf, "EL1t"); break; @@ -73,15 +73,15 @@ } dbg_printf("Register dump:\n"); - dbg_printf("%s %s Mode\n", (ctx->PState & 0x10) ? "ARM" : "ARM64", buf); + dbg_printf("%s %s Mode\n", (ctx->Cpsr & 0x10) ? "ARM" : "ARM64", buf); strcpy(buf, condflags); for (i = 0; buf[i]; i++) - if (!((ctx->PState >> 26) & (1 << (sizeof(condflags) - i)))) + if (!((ctx->Cpsr >> 26) & (1 << (sizeof(condflags) - i)))) buf[i] = '-'; - dbg_printf(" Pc:%016lx Sp:%016lx Lr:%016lx Pstate:%016lx(%s)\n", - ctx->Pc, ctx->Sp, ctx->Lr, ctx->PState, buf); + dbg_printf(" Pc:%016lx Sp:%016lx Lr:%016lx Cpsr:%08x(%s)\n", + ctx->Pc, ctx->Sp, ctx->Lr, ctx->Cpsr, buf); dbg_printf(" x0: %016lx x1: %016lx x2: %016lx x3: %016lx x4: %016lx\n", ctx->X0, ctx->X1, ctx->X2, ctx->X3, ctx->X4); dbg_printf(" x5: %016lx x6: %016lx x7: %016lx x8: %016lx x9: %016lx\n", @@ -104,6 +104,7 @@ static struct dbg_internal_var be_arm64_ctx[] = { + {CV_ARM64_PSTATE, "cpsr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Cpsr), dbg_itype_unsigned_int}, {CV_ARM64_X0 + 0, "x0", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, X0), dbg_itype_unsigned_long_int}, {CV_ARM64_X0 + 1, "x1", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, X1), dbg_itype_unsigned_long_int}, {CV_ARM64_X0 + 2, "x2", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, X2), dbg_itype_unsigned_long_int}, @@ -137,7 +138,6 @@ {CV_ARM64_LR, "lr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Lr), dbg_itype_unsigned_long_int}, {CV_ARM64_SP, "sp", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Sp), dbg_itype_unsigned_long_int}, {CV_ARM64_PC, "pc", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_long_int}, - {CV_ARM64_PSTATE, "pstate", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, PState), dbg_itype_unsigned_long_int}, {0, NULL, 0, dbg_itype_none} }; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/gdbproxy.c wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/gdbproxy.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/gdbproxy.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/gdbproxy.c 2015-06-28 16:51:28.000000000 +0000 @@ -399,6 +399,7 @@ #elif defined(__aarch64__) static const char target_xml[] = ""; static struct cpu_register cpu_register_map[] = { + REG(Cpsr, 4, CONTEXT_CONTROL), REG(X0, 8, CONTEXT_INTEGER), REG(X1, 8, CONTEXT_INTEGER), REG(X2, 8, CONTEXT_INTEGER), @@ -432,7 +433,6 @@ REG(Lr, 8, CONTEXT_INTEGER), REG(Sp, 8, CONTEXT_CONTROL), REG(Pc, 8, CONTEXT_CONTROL), - REG(PState, 8, CONTEXT_CONTROL), }; #else # error Define the registers map for your CPU diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/types.c wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/types.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/winedbg/types.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winedbg/types.c 2015-06-28 16:51:28.000000000 +0000 @@ -56,7 +56,7 @@ LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue, unsigned* psize, BOOL *issigned) { - LONGLONG rtn; + LONGLONG rtn = 0; DWORD tag, bt; DWORD64 size; struct dbg_type type = lvalue->type; @@ -123,7 +123,6 @@ default: WINE_FIXME("Unsupported tag %u\n", tag); RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL); - rtn = 0; } return rtn; diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winemenubuilder/winemenubuilder.c wine-staging-1.7.46~ubuntu14.10.1/programs/winemenubuilder/winemenubuilder.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/winemenubuilder/winemenubuilder.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winemenubuilder/winemenubuilder.c 2015-06-28 16:51:28.000000000 +0000 @@ -1423,11 +1423,11 @@ static HKEY open_menus_reg_key(void) { - static const WCHAR Software_Wine_FileOpenAssociationsW[] = { + static const WCHAR Software_Wine_FileOpenMenuFilesW[] = { 'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\','M','e','n','u','F','i','l','e','s',0}; HKEY assocKey; DWORD ret; - ret = RegCreateKeyW(HKEY_CURRENT_USER, Software_Wine_FileOpenAssociationsW, &assocKey); + ret = RegCreateKeyW(HKEY_CURRENT_USER, Software_Wine_FileOpenMenuFilesW, &assocKey); if (ret == ERROR_SUCCESS) return assocKey; SetLastError(ret); diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winetest/main.c wine-staging-1.7.46~ubuntu14.10.1/programs/winetest/main.c --- wine-staging-1.7.45~ubuntu14.10.1/programs/winetest/main.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winetest/main.c 2015-06-28 16:51:28.000000000 +0000 @@ -445,20 +445,35 @@ static void print_language(void) { HMODULE hkernel32; + BOOL (WINAPI *pGetSystemPreferredUILanguages)(DWORD, PULONG, PZZWSTR, PULONG); LANGID (WINAPI *pGetUserDefaultUILanguage)(void); LANGID (WINAPI *pGetThreadUILanguage)(void); - xprintf (" SystemDefaultLCID=%x\n", GetSystemDefaultLCID()); - xprintf (" UserDefaultLCID=%x\n", GetUserDefaultLCID()); - xprintf (" ThreadLocale=%x\n", GetThreadLocale()); + xprintf (" SystemDefaultLCID=%04x\n", GetSystemDefaultLCID()); + xprintf (" UserDefaultLCID=%04x\n", GetUserDefaultLCID()); + xprintf (" ThreadLocale=%04x\n", GetThreadLocale()); hkernel32 = GetModuleHandleA("kernel32.dll"); + pGetSystemPreferredUILanguages = (void*)GetProcAddress(hkernel32, "GetSystemPreferredUILanguages"); pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage"); pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, "GetThreadUILanguage"); + + if (pGetSystemPreferredUILanguages && !running_under_wine()) + { + WCHAR langW[32]; + ULONG num, size = sizeof(langW)/sizeof(langW[0]); + if (pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &num, langW, &size)) + { + char lang[32], *p = lang; + WideCharToMultiByte(CP_ACP, 0, langW, size, lang, sizeof(lang), NULL, NULL); + for (p += strlen(p) + 1; *p != '\0'; p += strlen(p) + 1) *(p - 1) = ','; + xprintf (" SystemPreferredUILanguages=%s\n", lang); + } + } if (pGetUserDefaultUILanguage) - xprintf (" UserDefaultUILanguage=%x\n", pGetUserDefaultUILanguage()); + xprintf (" UserDefaultUILanguage=%04x\n", pGetUserDefaultUILanguage()); if (pGetThreadUILanguage) - xprintf (" ThreadUILanguage=%x\n", pGetThreadUILanguage()); + xprintf (" ThreadUILanguage=%04x\n", pGetThreadUILanguage()); } static inline BOOL is_dot_dir(const char* x) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/programs/winhlp32/winhlp32.rc wine-staging-1.7.46~ubuntu14.10.1/programs/winhlp32/winhlp32.rc --- wine-staging-1.7.45~ubuntu14.10.1/programs/winhlp32/winhlp32.rc 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/programs/winhlp32/winhlp32.rc 2015-06-28 16:51:28.000000000 +0000 @@ -44,6 +44,7 @@ MENUITEM "&Define...", MNID_BKMK_DEFINE } POPUP "&Options" { + MENUITEM "Always on &top", MNID_HELP_HELPTOP MENUITEM "History", MNID_OPTS_HISTORY POPUP "Fonts" BEGIN @@ -54,7 +55,6 @@ } POPUP "&Help" { MENUITEM "&Help on help\tF1", MNID_HELP_HELPON - MENUITEM "Always on &top", MNID_HELP_HELPTOP MENUITEM "&About Wine Help", MNID_HELP_ABOUT } } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/README.md wine-staging-1.7.46~ubuntu14.10.1/README.md --- wine-staging-1.7.45~ubuntu14.10.1/README.md 2015-06-13 23:18:25.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/README.md 2015-06-28 17:08:11.000000000 +0000 @@ -39,7 +39,7 @@ Included bug fixes and improvements ----------------------------------- -**Bug fixes and features in Wine Staging 1.7.45 [244]:** +**Bug fixes and features in Wine Staging 1.7.46 [236]:** *Note: The following list only contains features and bug fixes which are not yet available in vanilla Wine. They are removed from the list as soon as they @@ -65,9 +65,7 @@ * Add stub for D3DXIntersect * Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268)) * Add stub for d3d11.D3D11CreateDeviceAndSwapChain ([Wine Bug #33153](https://bugs.winehq.org/show_bug.cgi?id=33153)) -* Add stub for fltlib.FilterLoad ([Wine Bug #38435](https://bugs.winehq.org/show_bug.cgi?id=38435)) * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) -* Add stub for kernel32.SetFileCompletionNotificationModes (for Steam in Win7 mode) ([Wine Bug #38493](https://bugs.winehq.org/show_bug.cgi?id=38493)) * Add stub for ntoskrnl.ExAcquireResourceExclusiveLite * Add stub for ntoskrnl.ExDeleteResourceLite * Add stub for ntoskrnl.ExReleaseResourceForThread @@ -112,7 +110,6 @@ * D3DCompileShader should filter specific warning messages ([Wine Bug #33770](https://bugs.winehq.org/show_bug.cgi?id=33770)) * Do not fail when a used context is passed to wglShareLists ([Wine Bug #11436](https://bugs.winehq.org/show_bug.cgi?id=11436)) * Do not use unixfs for devices without mountpoint -* Emulate access to KI_USER_SHARED_DATA kernel page on x86_64 ([Wine Bug #33849](https://bugs.winehq.org/show_bug.cgi?id=33849)) * Enforce that surfaces are flushed after ReleaseDC * Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages ([Wine Bug #33162](https://bugs.winehq.org/show_bug.cgi?id=33162)) * Ensure X11 input events are handled even without explicit message loop ([Wine Bug #8854](https://bugs.winehq.org/show_bug.cgi?id=8854)) @@ -129,7 +126,6 @@ * Fix condition mask handling in RtlVerifyVersionInfo ([Wine Bug #36143](https://bugs.winehq.org/show_bug.cgi?id=36143)) * Fix crash in Space Rangers2 caused by missing DXTn support ([Wine Bug #24983](https://bugs.winehq.org/show_bug.cgi?id=24983)) * Fix crash in clip_cursor_notify caused by uninitialized TLS ([Wine Bug #36915](https://bugs.winehq.org/show_bug.cgi?id=36915)) -* Fix crash of Trine Demo on start ([Wine Bug #19231](https://bugs.winehq.org/show_bug.cgi?id=19231)) * Fix crash of winedevice when relocation entry crosses page boundary ([Wine Bug #28254](https://bugs.winehq.org/show_bug.cgi?id=28254)) * Fix cursor clip regression / broken raw input in multiple games ([Wine Bug #33479](https://bugs.winehq.org/show_bug.cgi?id=33479)) * Fix device paths in HKLM\SYSTEM\MountedDevices ([Wine Bug #38235](https://bugs.winehq.org/show_bug.cgi?id=38235)) @@ -146,7 +142,6 @@ * Fix handling of opening read-only files for FILE_DELETE_ON_CLOSE ([Wine Bug #38417](https://bugs.winehq.org/show_bug.cgi?id=38417)) * Fix handling of window attributes for WS_EX_LAYERED | WS_EX_COMPOSITED ([Wine Bug #37876](https://bugs.winehq.org/show_bug.cgi?id=37876)) * Fix issues with dragging layers between images in Adobe Photoshop 7.0 ([Wine Bug #12007](https://bugs.winehq.org/show_bug.cgi?id=12007)) -* Fix link notification conditions for riched20 ([Wine Bug #35949](https://bugs.winehq.org/show_bug.cgi?id=35949)) * Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](https://bugs.winehq.org/show_bug.cgi?id=36900)) * Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087)) * Fix possible segfault in pulse_rd_loop of PulseAudio backend @@ -166,8 +161,8 @@ * GetMessage should remove already seen messages with higher priority ([Wine Bug #28884](https://bugs.winehq.org/show_bug.cgi?id=28884)) * GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709)) * GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](https://bugs.winehq.org/show_bug.cgi?id=15980)) +* Globally invalidate key state on changes in other threads ([Wine Bug #29871](https://bugs.winehq.org/show_bug.cgi?id=29871)) * Graphical issues in Inquisitor ([Wine Bug #32490](https://bugs.winehq.org/show_bug.cgi?id=32490)) -* IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests ([Wine Bug #37767](https://bugs.winehq.org/show_bug.cgi?id=37767)) * Ignore garbage after decoding gif lines ([Wine Bug #32227](https://bugs.winehq.org/show_bug.cgi?id=32227)) * Ignore unsupported flags for CoInternetSetFeatureEnabled ([Wine Bug #35197](https://bugs.winehq.org/show_bug.cgi?id=35197)) * Implement D3DXGetShaderOutputSemantics @@ -176,12 +171,12 @@ * Implement IDXGIOutput::GetDesc * Implement a Microsoft Yahei replacement font ([Wine Bug #13829](https://bugs.winehq.org/show_bug.cgi?id=13829)) * Implement additional stubs for vcomp dlls ([Wine Bug #31640](https://bugs.winehq.org/show_bug.cgi?id=31640)) -* Implement advapi32.GetWindowsAccountDomainSid ([Wine Bug #38624](https://bugs.winehq.org/show_bug.cgi?id=38624)) * Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323)) * Implement combase.WindowsSubstring function * Implement default homepage button in inetcpl.cpl * Implement empty enumerator for IWiaDevMgr::EnumDeviceInfo ([Wine Bug #27775](https://bugs.winehq.org/show_bug.cgi?id=27775)) * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) +* Implement general tab for file property dialog * Implement locking and synchronization of key states ([Wine Bug #31899](https://bugs.winehq.org/show_bug.cgi?id=31899)) * Implement mscoree._CorValidateImage for mono runtime ([Wine Bug #38662](https://bugs.winehq.org/show_bug.cgi?id=38662)) * Implement ntoskrnl driver testing framework. @@ -201,10 +196,10 @@ * Improve stubs for AEV_{Get,Set}MasterVolumeLevel * Improve stubs for AEV_{Get,Set}Mute * Improvement for heap allocation performance +* Initialize *lpcDevices in RasEnumDevicesA ([Wine Bug #30378](https://bugs.winehq.org/show_bug.cgi?id=30378)) * Initialize System\CurrentControlSet\Control\TimeZoneInformation registry keys * Jedi Knight: Dark Forces II crashes with winmm set to native ([Wine Bug #37983](https://bugs.winehq.org/show_bug.cgi?id=37983)) * Lego Stunt Rally requires DXTn software de/encoding support ([Wine Bug #25486](https://bugs.winehq.org/show_bug.cgi?id=25486)) -* MSVCRT crashes when NULL is passed as string to atof or strtod ([Wine Bug #32550](https://bugs.winehq.org/show_bug.cgi?id=32550)) * MSYS2 expects correct handling of WRITECOPY memory protection ([Wine Bug #35561](https://bugs.winehq.org/show_bug.cgi?id=35561)) * Make it possible to change media center / tablet pc status ([Wine Bug #18732](https://bugs.winehq.org/show_bug.cgi?id=18732)) * MediaCoder needs CUDA for video encoding ([Wine Bug #37664](https://bugs.winehq.org/show_bug.cgi?id=37664)) @@ -218,16 +213,16 @@ * Prevent window managers from grouping all wine programs together ([Wine Bug #32699](https://bugs.winehq.org/show_bug.cgi?id=32699)) * Process APC calls before starting process * Process Hacker 2.x needs ntoskrnl.ProbeForRead ([Wine Bug #38103](https://bugs.winehq.org/show_bug.cgi?id=38103)) -* Properly check existence of libunwind before linking against it ([Wine Bug #38713](https://bugs.winehq.org/show_bug.cgi?id=38713)) * Reduced SetTimer minimum value from 10 ms to 5 ms (improves Silverlight framerates) * Return an error when trying to open a terminated process ([Wine Bug #37087](https://bugs.winehq.org/show_bug.cgi?id=37087)) -* Return correct IMediaSeeking stream positions in quartz ([Wine Bug #23174](https://bugs.winehq.org/show_bug.cgi?id=23174)) +* Return correct IMediaSeeking stream positions in quartz * Return correct values for GetThreadTimes function ([Wine Bug #20230](https://bugs.winehq.org/show_bug.cgi?id=20230)) * Return default palette entries from GetSystemPaletteEntries for non-palette-based devices * Return fake device type when systemroot is located on virtual disk ([Wine Bug #36546](https://bugs.winehq.org/show_bug.cgi?id=36546)) * Return proper status codes when NtReadFile/NtWriteFile is called on closed (but not disconnected) pipe * SO_CONNECT_TIME returns the appropriate time * Scrolling causes mouse and screen to lock in Call to Power II ([Wine Bug #34559](https://bugs.winehq.org/show_bug.cgi?id=34559)) +* SecuROM 5.x media validation fails ([Wine Bug #21448](https://bugs.winehq.org/show_bug.cgi?id=21448)) * Send WM_PAINT event during dialog creation ([Wine Bug #35652](https://bugs.winehq.org/show_bug.cgi?id=35652)) * Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe in NtQueryInformationFile * Show unmounted devices in winecfg and allow changing the unix path @@ -235,7 +230,6 @@ * Software support for Environmental Audio Extensions (EAX) * Super Mario 3: Mario Forever fails to load keyboard mapping from profile files. ([Wine Bug #18099](https://bugs.winehq.org/show_bug.cgi?id=18099)) * Support for 8bpp grayscale TIFF images with 8bpp alpha channel ([Wine Bug #38027](https://bugs.winehq.org/show_bug.cgi?id=38027)) -* Support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection * Support for AllocateAndGetTcpExTableFromStack ([Wine Bug #34372](https://bugs.winehq.org/show_bug.cgi?id=34372)) * Support for BindImageEx ([Wine Bug #3591](https://bugs.winehq.org/show_bug.cgi?id=3591)) * Support for CSMT (command stream) to increase graphic performance ([Wine Bug #11674](https://bugs.winehq.org/show_bug.cgi?id=11674)) @@ -245,9 +239,7 @@ * Support for DDS file format in D3DXSaveTextureToFileInMemory ([Wine Bug #26898](https://bugs.winehq.org/show_bug.cgi?id=26898)) * Support for DOS hidden/system file attributes ([Wine Bug #9158](https://bugs.winehq.org/show_bug.cgi?id=9158)) * Support for FileFsFullSizeInformation information class -* Support for GdipCreateRegionRgnData ([Wine Bug #34843](https://bugs.winehq.org/show_bug.cgi?id=34843)) * Support for GetFinalPathNameByHandle ([Wine Bug #34851](https://bugs.winehq.org/show_bug.cgi?id=34851)) -* Support for GetVolumePathName * Support for H264 DXVA2 GPU video decoding through vaapi * Support for ID3DXFont::DrawTextA/W ([Wine Bug #24754](https://bugs.winehq.org/show_bug.cgi?id=24754)) * Support for ID3DXSkinInfoImpl_UpdateSkinnedMesh ([Wine Bug #32572](https://bugs.winehq.org/show_bug.cgi?id=32572)) @@ -266,7 +258,7 @@ * Support for TransmitFile ([Wine Bug #5048](https://bugs.winehq.org/show_bug.cgi?id=5048)) * Support for WTSEnumerateProcessesW ([Wine Bug #29903](https://bugs.winehq.org/show_bug.cgi?id=29903)) * Support for extra large and jumbo icon lists in shell32 ([Wine Bug #24721](https://bugs.winehq.org/show_bug.cgi?id=24721)) -* Support for inherited file ACLs ([Wine Bug #34406](https://bugs.winehq.org/show_bug.cgi?id=34406)) +* Support for inherited file ACLs * Support for linux priority levels for faster performance * Support for loader dll redirections * Support for named pipe message mode (Linux only) ([Wine Bug #17195](https://bugs.winehq.org/show_bug.cgi?id=17195)) @@ -284,12 +276,12 @@ * Use POSIX implementation to enumerate directory content on FreeBSD ([Wine Bug #35397](https://bugs.winehq.org/show_bug.cgi?id=35397)) * Use actual program name if available to describe PulseAudio streams * Use manual relay for RunDLL_CallEntry16 in shell32 ([Wine Bug #23033](https://bugs.winehq.org/show_bug.cgi?id=23033)) -* Use random names when caching very long urls in wininet * Voobly expects correct handling of WRITECOPY memory protection ([Wine Bug #29384](https://bugs.winehq.org/show_bug.cgi?id=29384)) * Wine ignores IDF_CHECKFIRST flag in SetupPromptForDisk ([Wine Bug #20465](https://bugs.winehq.org/show_bug.cgi?id=20465)) * Workaround for shlwapi URLs with relative paths * XEMBED support for embedding Wine windows inside Linux applications * eRacer Demo doesn't correctly display text ([Wine Bug #29598](https://bugs.winehq.org/show_bug.cgi?id=29598)) +* msvcrt.strtod should initialize *end with NULL on failure * ntdll is missing WinSqm[Start|End]Session implementation ([Wine Bug #31971](https://bugs.winehq.org/show_bug.cgi?id=31971)) * wglDescribePixelFormat should return max index for NULL descriptor ([Wine Bug #6176](https://bugs.winehq.org/show_bug.cgi?id=6176)) diff -Nru wine-staging-1.7.45~ubuntu14.10.1/server/device.c wine-staging-1.7.46~ubuntu14.10.1/server/device.c --- wine-staging-1.7.45~ubuntu14.10.1/server/device.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/server/device.c 2015-06-28 16:51:28.000000000 +0000 @@ -288,7 +288,6 @@ irp->out_size = min( irp->out_size, out_size ); if (irp->out_size && !(irp->out_data = memdup( out_data, irp->out_size ))) irp->out_size = 0; - release_object( file ); irp->file = NULL; if (irp->async) { @@ -306,6 +305,7 @@ list_remove( &irp->dev_entry ); release_object( irp ); /* no longer on the device queue */ } + release_object( file ); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/tools/make_specfiles wine-staging-1.7.46~ubuntu14.10.1/tools/make_specfiles --- wine-staging-1.7.45~ubuntu14.10.1/tools/make_specfiles 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/tools/make_specfiles 2015-06-28 16:51:28.000000000 +0000 @@ -94,6 +94,8 @@ ], [ "d3dcompiler_43", + "d3dcompiler_47", + "d3dcompiler_46", "d3dcompiler_42", "d3dcompiler_41", "d3dcompiler_40", diff -Nru wine-staging-1.7.45~ubuntu14.10.1/tools/winapi/tests.dat wine-staging-1.7.46~ubuntu14.10.1/tools/winapi/tests.dat --- wine-staging-1.7.45~ubuntu14.10.1/tools/winapi/tests.dat 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/tools/winapi/tests.dat 2015-06-28 16:51:28.000000000 +0000 @@ -691,6 +691,8 @@ IMAGE_IMPORT_DESCRIPTOR IMAGE_LINENUMBER IMAGE_LOAD_CONFIG_DIRECTORY +IMAGE_LOAD_CONFIG_DIRECTORY32 +IMAGE_LOAD_CONFIG_DIRECTORY64 IMAGE_NT_HEADERS IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS64 diff -Nru wine-staging-1.7.45~ubuntu14.10.1/tools/winebuild/import.c wine-staging-1.7.46~ubuntu14.10.1/tools/winebuild/import.c --- wine-staging-1.7.45~ubuntu14.10.1/tools/winebuild/import.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/tools/winebuild/import.c 2015-06-28 16:51:28.000000000 +0000 @@ -1270,6 +1270,23 @@ if (exp_name) output( "\t.long .L%s_string-2b\n", name ); else output( "\t.long %u\n", odp->ordinal ); break; + case CPU_ARM64: + output( "\tadr x0, 2f\n" ); + output( "\tldur x0, [x0, #0]\n" ); + output( "\tadr x1, 2f+8\n" ); + output( "\tldur x1, [x1, #0]\n" ); + output( "\tadr x2, 1f\n" ); + output( "\tldur x2, [x2, #0]\n" ); + output( "\tblr x2\n" ); + output( "1:\t.quad %s\n", asm_name("__wine_spec_unimplemented_stub") ); + output( "2:\t.quad %s\n", asm_name("__wine_spec_file_name") ); + if (exp_name) + { + output( "\t.quad .L%s_string\n", name ); + count++; + } + else output( "\t.quad %u\n", odp->ordinal ); + break; default: assert(0); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/tools/winebuild/parser.c wine-staging-1.7.46~ubuntu14.10.1/tools/winebuild/parser.c --- wine-staging-1.7.45~ubuntu14.10.1/tools/winebuild/parser.c 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/tools/winebuild/parser.c 2015-06-28 16:51:28.000000000 +0000 @@ -403,9 +403,9 @@ odp->link_name = xstrdup(""); /* don't bother generating stubs for Winelib */ if (odp->flags & FLAG_CPU_MASK) - odp->flags &= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM); + odp->flags &= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64); else - odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM); + odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64); return parse_spec_arguments( odp, spec, 1 ); } diff -Nru wine-staging-1.7.45~ubuntu14.10.1/VERSION wine-staging-1.7.46~ubuntu14.10.1/VERSION --- wine-staging-1.7.45~ubuntu14.10.1/VERSION 2015-06-13 23:00:55.000000000 +0000 +++ wine-staging-1.7.46~ubuntu14.10.1/VERSION 2015-06-28 16:51:28.000000000 +0000 @@ -1 +1 @@ -Wine version 1.7.45 +Wine version 1.7.46