diff -Nru wine1.7-1.7.21/ANNOUNCE wine1.7-1.7.24/ANNOUNCE --- wine1.7-1.7.21/ANNOUNCE 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/ANNOUNCE 2014-08-08 20:19:29.000000000 +0000 @@ -1,16 +1,15 @@ -The Wine development release 1.7.21 is now available. +The Wine development release 1.7.24 is now available. What's new in this release (see below for details): - - Support for critical sections in the C runtime. - - Unicode data updated to Unicode 7.0. - - Support for interlaced PNG encoding. - - Initial stub for the Packager library. + - Beginning of some DirectWrite classes implementation. + - Initial wrapper dll for the packet capture library. + - Some crypto improvements. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.21.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.21.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.7.24.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.24.tar.bz2 Binary packages for various distributions will be available from: @@ -26,316 +25,201 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.21 (total 77): +Bugs fixed in 1.7.24 (total 44): - 9898 Virtual Moon Atlas 3.5 expert Mostly black drawing - 15478 Unity Web Player 2.1.0 doesn't show graphics in browser - 15600 Windows Live Writer crashes (IHTMLDocument2::put_designMode is a stub) - 17818 Runes of Magic menus like EULA or login doesn't appear on some graphic cards. - 18316 Word Pro: dashed "-" in parameters not resolved in command line - 19792 program "Antik Virtual set-top-box" crashes at startup - 19889 Steam client major lag - 20086 NewPGen: Doesn't restore from tray - 20497 Smilebox cannot be installed (web update fails) - 21116 page fault when running SoftwarePhoenix.BIOS.Editor.Pro.2.2.0.2.45094.exe - 21275 python's test_startfile test fails - 21521 Improper audio selection - 22091 Dragon Age Awakening/Mass Effect 2 installers crash with ntdll error - 22404 Unigine Heaven Benchmark 2.0 lacks shadows and smoke in Wine in d3d - 22697 wine iexplore browserchoice.eu is not displayed - 23219 AT4RE FastScanner v3.0 exe scanning bug - 23220 AT4RE FastScanner v3.0 UI button rectangle bug - 26504 Runes of Magic 3.0.x: "ClientUpdater.exe" crashes sometimes during updates on MD5 checksum processing (squirrel virtual machine) - 27113 Free download manager "Unknow network error" without native wininet - 27549 Frozen Synapse crash - 28756 ws2_32/tests/sock.ok: uninitialised value created in test_events(), used in get_cached_fd()? - 28824 shell32/tests/recyclebin.ok: uninitialised value used in TRASH_GetDetails - 29755 Deadlock during crash while installing gecko? - 29790 popo 2011 crash with builtin msvcrt - 29843 IE4 crashes on resetting profile sharing, needs shdocvw.dll.ResetProfileSharing - 30966 Firefox 13.0 improper region redrawing/user interface artifacts - 31349 Office 365 (Office 2013) web installer aborts early (needs support for string alias for common RID in sid strings) - 32000 ANSYS 14.0 tools crash on startup (missing system message text for 'WSAECONNRESET', error code 10054) - 32077 Runes of Magic 5.0.0.2535 (full client) crashes during update - 32150 Notepad .Net crashes doing nothing - 34215 Adobe Creative Cloud needs KERNEL32.dll.UnregisterApplicationRestart - 34525 Marine Benefit freezes in Stages 1-3 due to gstreamer error - 34828 Visual Studio 2010 fails to start (IWICBitmapFrameEncode_WriteSource_Proxy, empty rect) - 34847 The Swapper 2.0.x (GOG.com) crashes on startup (OpenGL glBindTexture on thread with no active gl context) - 34942 WinLaunch 0.4.6.1 (OSX Style free Launcher) needs support for WIC encoder "InterlaceOption" option (property bag) - 35466 Can't paste into search dialog of notepad - 35646 Multiple applications protected with Obsidium v1.4+ fail on startup, reporting "Debugger detected - please disable it and restart the application" (Condes 9, Universal mechanism) - 35948 Starcraft Campaign Editor displays incorrect numeric values when editing triggers - 36131 valgrind shows some multiple leaks in ole32/clipboard.c - 36185 comctl32/button tests shows an unitialized variable under valgrind - 36188 valgrind shows an invalid free for comctl32/tests/listview.c - 36240 valgrind shows several leaks in d3dx9_36/tests/asm.c - 36285 valgrind shows several leaks in kernel32/tests/debugger.c - 36287 valgrind shows some uninitialized memory use in kernel32/tests/format_msg.c - 36334 The Chosen (Well of Souls) demo has graphical glitches - 36350 valgrind shows a leak in d3dx9_36/tests/asm.c - 36351 valgrind shows a few leaks in d3drm/tests/d3drm.c - 36436 Popup menu is closed when clicking a sub-menu parent item twice. - 36487 Avast Free Antivirus fails to install, reporting 'HTMLayout.dll cannot be loaded to properly start GUI.' (EnumSystemLocalesEx fails to call user provided callback) - 36500 Multiple games and applications crash on unimplemented function msvcp110.dll._Mtx_init (Avast Free Antivirus, Trion's Trove MMO) - 36504 The XFORM matrix is calculated incorrectly in PlgBlt() - 36506 Wolfenstein - The New Order fails to start (glGetString(GL_VENDOR) without a current WGL context) - 36553 Tomb Raider Chronicles crashes in 32 bit color mode - 36572 valgrind shows a definite leak in shlwapi/tests/ordinal.c - 36593 valgrind shows a possible leak in windowscodecs/tests/bitmap.c - 36595 valgrind shows several memory leaks in windowscodecs/tests/metadata.c - 36596 valgrind shows a definite leak in windowscodecs/tests/propertybag.c - 36597 valgrind shows several definite leaks in user32/tests/msg.c - 36598 valgrind shows a definite leak in windowscodecs/tests/tiffformat.c - 36606 valgrind shows uninitialized memory use in ws2_32/tests/protocol.c - 36617 boost::wregex causes programs to crash - needs wcsxfrm() - 36647 Windows 7 USB/DVD download tool hangs on startup (DrawTextExW/TEXT_NextLineW live loop) - 36665 Adobe Acrobat Pro 8 freezes when using 'Combine files... and Create PDF / From multiple files' dialog - 36683 RPG Maker VX Ace 1.00: clicking menu item results in 'Out of memory' error message - 36702 PlayOn 3.9.13 installer reports 'Setup requires Windows Media Player 9 to be installed on this PC' (needs IWMPCore::get_versionInfo) - 36717 DeltaCad 8.0 crashes when trying to set printer or print - 36722 dmusic/tests/dmusic.c crashes under WINEDEBUG=warn+heap - 36736 Tucows Download Manager 2014 crashes on startup (decryption scheme relies on 'kernel32.dll.SetFilePointer' hotpatch signature) - 36737 Multiple Graviteam tank simulation games crash on start with built-in msvcr80 (small-block heap support needed) - 36745 Wine broken on FreeBSD+NFS - 36749 WinLaunch 0.4.6.1 (OSX Style free Launcher) fails to save theme (libpng png_write_end fails with 'No IDATs written into file') - 36757 Microsoft Visual Studio 2005 Express reports 'object does not support this action' during project creation (needs IFileSystem::GetDriveName method impl) - 36766 Jane Doe View build 140615 endlessly reports 'OLE Error 80004001' (JSGlobal_CollectGarbage stub returns E_NOTIMPL) - 36768 valgrind shows a couple invalid reads in windowscodecs/tests/tiffformat.c - 36782 valgrind shows a leak in kernel32/tests/thread.c - 36784 valgrind shows a leak in kernel32/tests/thread.c - 36790 ACDSee v17.0 needs unimplemented function msvcr110.dll.__crtInitializeCriticalSectionEx + 9121 Crash when launching winning eleven 8 + 14240 FC_Edit fails to initialize + 14943 CoDeSys 3.2 (Patch2) development environment does not work + 16365 Archlord Episode 3 Client crashes on startup (decrypting files with a RC4 session key derived from MD5 hash fails, only 40 bits are used, salt is dropped) + 17441 Anarchy Online: First run has messed up graphics and pointer + 17678 Anarchy Online fullscreen followes you when you switch desktops + 22177 Standalone version of DivX fails to install + 22896 Multiple applications and games need support for shell32 FOLDERID_LocalAppDataLow (.NET based Unity Engine games, Java JRE 6 in Vista mode) + 24711 AV Voice Changer Software Diamond 7.0 (VcsCore.exe) crashes on startup + 26346 Letters from Nowhere 2 demo: 'play trial' button does not work + 26887 Magicka crashes a few seconds after title screen + 26951 REALTEK 11n USB Wireless LAN Driver installer crashes + 27969 wine explorer crashes on startup + 28312 Assassin's Creed Brotherhood v1.03 needs "Saved Games" folder + 30454 Unknown program crashes on start + 30496 Serif WebPlus X2 and X5 crash on startup in mshtml + 30803 CCleaner 3.19 won't start, err:seh:setup_exception stack overflow + 30945 Jammer 6 demo fails to install without native ie7 + 31008 WinUAE "Browse for folder" works incorrectly + 31408 anarchy online crash new zone + 31566 Fallout 3: regression causes block at critical section when radio is enabled + 31599 Serif Photoplus X6 installer fails, reporting 'Invalid command line.' (registry command association for msi package, 'msiexec.exe' must be a fully qualified path) + 31687 DYMO Stamps can't connect to its server + 31846 World of Warcraft: graphical glitches with particle weather effects using D3D9 engine + 32318 Excel 2007 files password-protected in Wine cannot be opened in Windows, and vice versa + 32480 Shogun: Total War Demo crashes at startup + 32758 .NET 3.5 and 4.x apps using Microsoft Enhanced RSA and AES Cryptographic Provider with default WinVer = Windows XP report "PlatformNotSupportedException" (TurboTax 2012, Adicom PNV, GOG.com downloader) + 33805 LEGO Digital Designer 4.3.6 crashes on start + 33867 Uplay shop doesn't let you buy things + 34141 Thunderbird 17.07 Crashes when clicking done in account configuration window + 34324 QQ2013 SP1 can't install + 35342 Office 2013 full offline install setup crash at startup + 35571 Questrade IQ Divide by Zero error + 36629 .NET Framework 4.0 fails to install + 36716 World Of Tanks black screen + 36833 app aborted because call unimplemented function iphlpapi.dll._PfBindInterfaceToIPAddress@12 + 36835 Microsoft OneDrive/SkyDrive needs support for Shell32.dll.SHGetKnownFolderPath with 'KNOWNFOLDERID_Links' + 36888 DDO Wine website not work any more + 36927 SADX Mod Loader crashes due to missing msvcp100 function std::basic_istream::swap() + 36995 Regression: crash in msxml3 + 36998 Cube World crashes on unimplemented function msvcp110.dll.?_Xbad_alloc@std@@YAXXZ + 37001 APB Reloaded 1.x (MMORPG) launcher crashes on startup (some CIM data type to OLE variant (VT) mappings are incorrect) + 37005 Serif WebPlus Starter Edition crashes on startup (IPropertyBag2::GetPropertyInfo returns more properties than the caller requested, leading to stack smashing) + 37039 When copying data into memory, shows a dialog message then crashes (but info passes to memory) ---------------------------------------------------------------- -Changes since 1.7.20: +Changes since 1.7.23: -Akihiro Sagawa (7): - winmm/tests: Activate some mmioSeek tests with todo_wine keyword. - winmm: Memory file buffer is available even if we just allocate memory. - winmm: Avoid direct seeking for memory files. - winmm: Update lBufOffset after seeking file directly. - winmm: Fix SEEK_END handling for memory files. +Akihiro Sagawa (1): po: Update Japanese translation. - jscript: Improve CollectGarbage stub. -Alex Henrie (1): - riched20: Consider adjacent runs when computing EN_LINK range. +Andreas Mohr (1): + kernel32: Fix naming/spelling/typo of macro to HasOverlappedIoCompleted(). -Alexander Almaleh (1): - gdi32: Fix XFORM.eM22 calculation in PlgBlt. - -Alexandre Julliard (10): - kernel32/tests: Silence some noisy traces. - gdi32/tests: Silence some noisy traces. - user32/tests: Silence some noisy traces. - user32: Properly block sent messages while waiting for a reply with SMTO_BLOCK. - krnl386: Properly handle failure to set a 16-bit LDT entry. - kernel32: Only try to load krnl386 in native applications. - msvcrt/tests: Avoid size_t in traces. - usp10: Update the character data tables to Unicode 7.0.0. - libwine: Update the codepage tables to Unicode 7.0.0. - opengl32: Make sure the function table is initialized in all threads. - -Andrew Eikum (8): - ole32: Implement CoTreatAsClass for classes without AutoTreatAs. - ole32: Respect TreatAs in CoCreateInstance. - packager: Add stub Packager implementation. - packager: Add loading support for Ole10Native storage objects. - packager: Implement IOleObject::SetClientSite. - packager: Implement IOleObject::GetMiscStatus. - packager: Implement Activate verb for OleObject::DoVerb. - packager: Implement IOleObject::Close. - -André Hentschel (1): - krnl386: Fix typo in a comment. +Andrei Slăvoiu (5): + wined3d: Make the card selection for Nvidia binary driver use arrays only. + wined3d: Make the card selection for AMD binary driver use arrays only. + wined3d: Replace vendor specific callbacks with generic code that uses vendor specific renderer string tables. + wined3d: Make d3d_level_from_gl_info return an enum instead of a plain int. + wined3d: Use capabilities from the shader backend or the fragment pipeline to determine the D3D level. + +André Hentschel (2): + wpcap: Initial stub implementation. + wpcap: Implement pcap_lib_version. + +Aric Stewart (2): + dwrite: Make dwritefactory an allocated object. + dwrite: Basic implementation for FontCollectionLoader registration. Aurimas Fišeras (1): po: Update Lithuanian translation. Austin English (3): - user32: Add a stub for SetGestureConfig. - kernel32: Add DECLSPEC_HOTPATCH to SetFilePointer. - kernel32: Add a stub for UnregisterApplicationRestart. - -Bruno Jesus (7): - ws2_32/tests: Wait for thread test before returning (valgrind). - ws2_32: Don't call WS_EnterSingleProtocol[A|W] on unsupported protocols (valgrind). - winhttp: Use a helper to send data and take care of EINTR. - winhttp: Use a helper to receive data and take care of EINTR. - wininet/tests: Add more HTTP_QUERY_RAW_HEADERS tests. - bcrypt: Add a stub for BCryptCloseAlgorithmProvider. - opengl32/tests: Test glGetString() without an active GL context. - -Christoph von Wittich (1): - shlwapi: Avoid buffer overflow in PathCombineA. - -François Gouget (8): - ole32: Fix StorageImpl_LockRegionSync() to actually wait between locking attempts. - ole32: FileLockBytesImpl_WriteAt() should return STG_E_WRITEFAULT for write errors. - server: Treat ENOTSUP the same way as ENOLCK, consider locking to be non-functional on that filesystem. - ole32: Treat STG_E_LOCKVIOLATION the same way as STG_E_ACCESSDENIED as both indicate locking contention. - ole32: Return the correct error in FileLockBytesImpl_*LockRegion*(). - msvcrt/tests: Add a trailing '\n' to an ok() call. - packager/tests: Make the IStorage methods static. - mshtml: Remove nsAString_SetData() because it is unused. - -Frédéric Delanoy (1): - Assorted spelling/grammar fixes. - -Grazvydas Ignotas (6): - msvcrt: Free old buffer properly in setvbuf. - msvcrt/tests: Add a test for fwrite flushing behavior. - msvcrt: Change internal buffer size to 4k. - msvcrt/tests: Test _cnt value after rewind/fflush. - msvcrt: Clear _cnt on buffer flush. - msvcrt: Implement bufsiz block flushing behavior. - -Henri Verbeet (10): - ddraw/tests: Get rid of some unused assignments. - ddraw/tests: Properly declare matrices. - d2d1: Implement d2d_d3d_render_target_CreateSolidColorBrush(). - d2d1: Implement d2d_d3d_render_target_CreateGradientStopCollection(). - d2d1: Implement d2d_d3d_render_target_CreateLinearGradientBrush(). - d3d9/tests: Add some lost device tests. - d3d8/tests: Add some lost device tests. - ddraw/tests: Add some lost device tests. - d3d9: Improve d3d9_device_TestCooperativeLevel(). - d3d9: Check the device status in present calls. - -Huw D. M. Davies (1): - fonts: Add some barb arrow glyphs. - -Jacek Caban (9): - vbscript: Reset error number on error mode change. - mshtml: Added IHTMLWindow2::scroll implementation. - wininet: Don't change hostPort in HTTP_HttpOpenRequestW. - wininet: Update hostPort in HTTP_HandleRedirect. - wininet: Use current server in HTTP_GetRedirectURL. - wininet: Don't try to read content in response to HEAD request. - shdocvw: Added ResetProfileSharing stub. - ieframe: Use URL_APPLY_DEFAULT in UrlApplyScheme call. - shdocvw: Added InstallReg_RunDLL stub. - -Julian Rüger (1): - po: Update German translation. - -Lauri Kenttä (1): - po: Update Finnish translation. - -Marcus Meissner (3): - oleaut32: Avoid buffer overread (Coverity). - mscms: Removed duplicate return ret (Coverity). - winealsa/wineoss/winecoreaudio: Calculate frequency in 64bit (Coverity). - -Matteo Bruni (8): - d3d9/tests: Test GetData behavior with various size values. - wined3d: Validate and handle query size parameter. - wpp: Properly free defines (Valgrind). - wpp: Free the include filename on error (Valgrind). - d3dcompiler/tests: Add a couple more checks for parent data values. - wpp: Free some filename strings after processing an include (Valgrind). - wpp: Correctly handle OOM in pop_buffer(). - d3dx9: Correctly set parent_data for direct includes from the main file. - -Michael Stefaniuc (2): - dmusic: Increment the refcount when a IReferenceClock pointer is returned. - comctl32: Functions using setjmp can never be inlined. - -Nikolay Sivov (21): - comctl32/tests: Avoid testing uninitialized value (Valgrind). - wmp: Implement get_versionInfo(). - d3drm/tests: Release frame instance (Valgrind). - d3dx9: Trace out parameters as pointers (Valgrind). - quartz/tests: Fix couple of test failures running with limited user. - shell32: Release cached desktop folder on process detach. - windowscodecs/tests: Fixed some leaks on error path (Valgrind). - dsound/tests: Accept another error code. - msctf/tests: Fix crash when ITfInputProcessorProfileMgr is not supported. - msxml3/tests: Accept Stat() method called on test stream. - xmllite/writer: Maintain a stack of written elements to write end tags. - dwrite: Recognize more Unicode ranges in script analyzer. - kernel32: Added a message for WSAECONNRESET. - xmllite/writer: Implement WriteFullEndElement(). - po: Update Russian translation. - scrrun: Implement GetDriveName(). - scrrun: Implement SerialNumber property. - scrrun: Implement FileSystem property. - scrrun: Implement get_VolumeName(). - scrrun/tests: Run test on fixed drive. - iphlpapi/tests: Skipping test on access error. - -Piotr Caban (18): - msvcrt: Use size_t to store indexes in qsort. - msvcrt: Allocate data with 16-bytes alignement if small blocks heap is used. - msvcrt: Add small blocks heap tests. - msvcr100: Add _SpinWait implementation. - msvcr100/tests: Add _SpinWait tests. - msvcr100: Add critical_section class stub. - msvcr100: Add critical_section::scoped_lock implementation. - msvcr100: Add critical_section class implementation. - msvcr110: Add critical_section::try_lock_for implementation. - msvcp110: Add missing exports to msvcp110.spec file. - kernel32: Fix typo in enum_locale_ex_proc. - msvcp110: Add _Mtx_{destroy,getconcrtcs,init,lock,unlock,trylock} implementation. - msvcr110: Add __crtInitializeCriticalSectionEx implementation. - msvcrt: Fix _flsbuf behavior on streams with MSVCRT__IONBF flag. - msvcrt: Fix ungetc on files with empty buffer. - msvcrt: Support NULL buffer in setvbuf. - msvcrt: Use file->_flag to check if file buffering is enabled. - msvcrt: Don't touch _bufsiz value while initializing FILE structure. - -Sebastian Lackner (23): - kernel32: Update VirtualAddress of resource section in write_raw_resources. - msvcr110: Fix typo in exported symbol _set_SSE2_enable. - user32: Avoid race-condition when unloading module while hook is still active. - kernel32: Raise DBG_PRINTEXCEPTION_C exception in OutputDebugStringA. - wininet: Don't update *lpdwIndex if HttpQueryInfoW fails with ERROR_INSUFFICIENT_BUFFER. - ntdll/tests: Add exception tests for RtlUnwind on i386. - ntdll/tests: Use an EXCEPTION_REGISTRATION_RECORD array to prevent compiler from reordering variables. - ntdll/tests: Run crashing i386 exception tests as the last step. - kernel32: Process OutputDebugString events like regular exceptions. - server: Remove output_debug_string request. - ntdll/tests: Add more tests for debug string events. - server: Grab borrowed debugger reference while handling wake_up() events. (Valgrind). - server: Avoid invalid memory access when thread is killed while in wake_up(). (Valgrind). - kernel32: Fix a valgrind warning in format_add_char(). (Valgrind). - kernel32/tests: Add missing HeapFree() in doChildren(). (Valgrind). - comctl32: Allocate new memory in notify_forward_header() to avoid Free() on wrong pointer. (Valgrind). - ntdll: Fix leaking activation context when terminating via exit_thread(). (Valgrind). - kernel32/tests: Add missing ReleaseActCtx() calls. (Valgrind). - ntdll: Avoid leaking activation context in RtlCreateUserThread. (Valgrind). - kernel32: Process DBG_RIPEXCEPTION events like regular exceptions. - server: Get rid of RIP_EVENT union elements. - ntdll/tests: Add tests for DBG_RIPEXCEPTION debugger events. - user32/tests: Add a missing call to ReleaseActCtx(). - -Shuai Meng (2): - vbscript: Implemented CSng. - vbscript: Implemented TypeName. - -Thomas Faber (2): - rpcrt4: Do not omit mandatory argument to VirtualProtect. - msvcrt: Do not omit mandatory argument to VirtualProtect. - -Vincent Povirk (13): - ole32: Add tests for STGC_OVERWRITE. - windowscodecs: Share WriteSource code between implementations. - windowscodecs: Check for empty rect in WriteSource_Proxy. - windowscodecs: Support InterlaceOption in PNG encoder. - shell32: Set tm_isdst before calling mktime. - advapi32/tests: Account for limited users in registry test. - windowscodecs: Fix memory leak in ComponentFactory_CreateBitmapFromSource. - windowscodecs: Fix leak in DGifGetImageDesc. - windowscodecs: Fix leak in test_propertybag_getpropertyinfo. - windowscodecs: Fix leak in test_QueryCapability. - windowscodecs: Fix leak in test_QueryCapability. - Revert "windowscodecs: Fix leak in test_QueryCapability.". - windowscodecs: Fix interlaced PNG writing. + wine.inf: Use full path to msiexec. + hid: Add HidD_GetProductString stub. + wine.inf: Fix quoting for msiexec commands. + +Bernhard Reiter (1): + imagehlp/tests: Add test for BindImageEx. + +Bruno Jesus (11): + rsaenh: Detect AES prototype provider correctly. + dmime/tests: Fix a crash in Windows 2000. + winhttp/tests: Add a no-content header test. + rsaenh/tests: Run the tests in the Base and Strong providers too. + rsaenh: Use a helper to get the key container. + rsaenh: The RC2 algorithm from Base provider supports only 40 bit keys. + rsaenh/tests: Add SHA-256 tests. + rsaenh/tests: Update some tests. + rsaenh: Handle the failure to set Base provider effective key length properly. + rsaenh: Use the remaining hash data as salt if requested. + rsaenh: A 40 bit key on Enhanced provider will not have salt even if asked for. + +David Hedberg (8): + shell32/tests: Tests for IShellItemGetAttributes. + shell32: Mask out attributes we didn't ask for in ShellItem::GetAttributes. + shell32: Return S_OK only if the flags matches the result exactly. + shell32: Always initialize shellitem to NULL in SHCreateShellItem. + shell32: Implement SHCreateShellItemFromIDLists. + shell32: Implement IShellItemArray::GetAttributes. + comdlg32: Support browsing for folders. + shell32: Implement IEnumShellItems for IShellItemArray. + +Erich Hoover (6): + strmbase: Fix race condition on InputPin_BeginFlush between csRenderLock and filter.csFilter. + strmbase: Fix race condition on InputPin_EndFlush between csRenderLock and filter.csFilter. + strmbase: Fix race condition on InputPin_EndOfStream between csRenderLock and filter.csFilter. + quartz: Fix race condition on EndOfStream between csRenderLock and filter.csFilter. + quartz: Fix race condition on EndFlush between csRenderLock and filter.csFilter. + quartz: Fix race condition between EndOfStream and Pause. + +Gerald Pfeifer (4): + winebuild: Remove unused empty_name_table. + winhttp: Remove unused constant proxymsg. + dbghelp: Do not try to ignore the return codes in PEV_ERROR and and PEV_ERROR1. + scrrun: Add a check for empty string in start_enumeration. + +Hao Peng (3): + iphlpapi: Add PfBindInterfaceToIPAddress function stub. + iphlpapi: Add PfDeleteInterface function stub. + iphlpapi: Add PfUnBindInterface function stub. + +Henri Verbeet (5): + wined3d: Add constant buffer support to the GLSL shader backend. + d3d10core: Implement d3d10_device_CopyResource(). + wined3d: Make the "desc" parameter to wined3d_buffer_create() const. + wined3d: Get rid of the get_drawable_size() callback in struct wined3d_surface. + wined3d: Move the "draw_binding" field from struct wined3d_surface to struct wined3d_resource. + +Indrek Altpere (1): + wbemprox: Fix a few OLE variant mappings. + +Jacek Caban (2): + mshtml: Added IHTMLWindow2::navigate implementation. + mshtml: Added IHTMLElement:scrollIntoView implementation. + +Jactry Zeng (1): + include: Fix wrong type in tom.idl. + +Ken Thomases (3): + ntdll: In find_file_in_dir(), don't test directory entries' short names if the target name isn't a short name. + winemac: Use new API when available to list all display modes available on Retina Macs. + winemac: When removing the status item for a systray icon, discard any associated events in the queue. + +Michael Müller (2): + shell32: Create profile directories available in Vista and above. + windowscodecs: Fix number of returned properties in PropertyBag_GetPropertyInfo. + +Nikolay Sivov (8): + dwrite: Added some layout tests, simplify debug output for text ranges. + dwrite: Store maximum width/height for text layout. + dwrite/tests: Added some tests for inline object and ranges handling. + msxml3/saxreader: Fix attributes array growing size. + include: Added IDWriteLocalFontFileLoader. + dwrite: Implement Resize() for bitmap render target. + dwrite: Added GetCurrentTransform() for a render target. + dwrite/tests: Some tests for drawing sequence for a layout. + +Piotr Caban (8): + msvcp100: Add ios_base::swap implementation. + msvcp100: Add basic_ios::swap implementation. + msvcp100: Add basic_istream::swap implementation. + msvcp100: Add basic_ostream::swap implementaiton. + msvcp100: Add basic_iostream::swap implementation. + msvcp100: Add basic_streambuf::swap implementation. + msvcrt: Only check for flag presence in isatty function. + msvcp110: Add _Xbad_alloc implementation. + +Shuai Meng (4): + vbscript: Implemented ScriptEngine. + vbscript: Inplemented ScriptEngineBuildVersion. + vbscript: Implemented ScriptEngineMajorVersion. + vbscript: Implemented ScriptEngineMinorVersion. + +Stefan Dösinger (1): + user32: Make GetRegisteredRawInputDevices hotpatchable. + +Thomas Faber (10): + amstream: Destroy BaseFilter after MediaStreamFilterImpl child class. + quartz: Avoid side-effects in asserts. + quartz/tests: Fix memory leaks. + dsound: Do not call CoUninitialize if CoInitialize failed. + qcap: Reference module only on successful object creation. + strmbase: Separate BasePin destructors from Release. + qcap: Destroy BaseOutputPin in VfwPin_Release. + quartz: Destroy BaseOutputPin in FileAsyncReaderPin_Release. + quartz: Fix IEnumFiltersImpl memory leak. + quartz: Destroy BaseRenderer in NullRendererInner_Release. Zhenbo Li (2): - mshtml: Added IHTMLTableCell::cellIndex method implementation. - shell32: Fix SHFileOperation when deleting a nonexistent directory. + mshtml/tests: Better output when an exception is caught. + mshtml: Added IHTMLStyle:: textTransform property implementation. -- Alexandre Julliard diff -Nru wine1.7-1.7.21/AUTHORS wine1.7-1.7.24/AUTHORS --- wine1.7-1.7.21/AUTHORS 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/AUTHORS 2014-08-08 20:19:29.000000000 +0000 @@ -161,6 +161,7 @@ Bernd Paysan Bernd Schmidt Bernhard Loos +Bernhard Reiter Bernhard Rosenkraenzer Bernhard Übelacker Bertho Stultiens @@ -493,6 +494,7 @@ Hannu Valtonen Hans de Graaff Hans Leidekker +Hao Peng Harald Hoyer Harry Jeffery Harry McNally @@ -538,6 +540,7 @@ Ilya Konstantinov Ilya Korniyko Ilya Shpigor +Indrek Altpere Ingmar Thiemann Ingo Schneider Ismael Barros @@ -689,6 +692,7 @@ Jörg Mayer Joris Beugnies Joris Huizer +Joris van der Wel Jose Alonso Josef Meixner José Manuel Ferrer Ortiz diff -Nru wine1.7-1.7.21/configure wine1.7-1.7.24/configure --- wine1.7-1.7.21/configure 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/configure 2014-08-08 20:19:29.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.21. +# Generated by GNU Autoconf 2.69 for Wine 1.7.24. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.21' -PACKAGE_STRING='Wine 1.7.21' +PACKAGE_VERSION='1.7.24' +PACKAGE_STRING='Wine 1.7.24' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -676,6 +676,7 @@ XSLT_CFLAGS XML2_LIBS XML2_CFLAGS +LIBPCAP X_EXTRA_LIBS X_LIBS X_PRE_LIBS @@ -822,6 +823,7 @@ with_opengl with_osmesa with_oss +with_pcap with_png with_pthread with_sane @@ -1282,6 +1284,7 @@ enable_wmp enable_wmvcore enable_wnaspi32 +enable_wpcap enable_ws2_32 enable_wshom_ocx enable_wsnmp32 @@ -1976,7 +1979,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.21 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2045,7 +2048,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.21:";; + short | recursive ) echo "Configuration of Wine 1.7.24:";; esac cat <<\_ACEOF @@ -2090,6 +2093,7 @@ --without-opengl do not use OpenGL --without-osmesa do not use the OSMesa library --without-oss do not use the OSS sound support + --without-pcap do not use the Packet Capture library --without-png do not use PNG --without-pthread do not use the pthread library --without-sane do not use SANE (scanner support) @@ -2240,7 +2244,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.21 +Wine configure 1.7.24 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2758,7 +2762,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.21, which was +It was created by Wine $as_me 1.7.24, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3321,6 +3325,12 @@ fi +# Check whether --with-pcap was given. +if test "${with_pcap+set}" = set; then : + withval=$with_pcap; if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi +fi + + # Check whether --with-png was given. if test "${with_png+set}" = set; then : withval=$with_png; @@ -6494,6 +6504,7 @@ netinet/in_systm.h \ netinet/tcp.h \ netinet/tcp_fsm.h \ + pcap/pcap.h \ poll.h \ port.h \ process.h \ @@ -6812,13 +6823,13 @@ done -for ac_header in ucontext.h +for ac_header in sys/ucontext.h do : - ac_fn_c_check_header_compile "$LINENO" "ucontext.h" "ac_cv_header_ucontext_h" "#include + ac_fn_c_check_header_compile "$LINENO" "sys/ucontext.h" "ac_cv_header_sys_ucontext_h" "#include " -if test "x$ac_cv_header_ucontext_h" = xyes; then : +if test "x$ac_cv_header_sys_ucontext_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_UCONTEXT_H 1 +#define HAVE_SYS_UCONTEXT_H 1 _ACEOF fi @@ -6829,8 +6840,8 @@ for ac_header in sys/thr.h do : ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include -#ifdef HAVE_UCONTEXT_H -#include +#ifdef HAVE_SYS_UCONTEXT_H +#include #endif " if test "x$ac_cv_header_sys_thr_h" = xyes; then : @@ -7535,6 +7546,8 @@ libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` LOADER_RULES=" +all: wine.inf + install install-lib:: wine-installed \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary @@ -10507,6 +10520,60 @@ fi test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes && enable_opencl=${enable_opencl:-no} +if test "$ac_cv_header_pcap_pcap_h" = "yes" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_create in -lpcap" >&5 +$as_echo_n "checking for pcap_create in -lpcap... " >&6; } +if ${ac_cv_lib_pcap_pcap_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_create (); +int +main () +{ +return pcap_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pcap_pcap_create=yes +else + ac_cv_lib_pcap_pcap_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_create" >&5 +$as_echo "$ac_cv_lib_pcap_pcap_create" >&6; } +if test "x$ac_cv_lib_pcap_pcap_create" = xyes; then : + LIBPCAP="-lpcap" + +fi + +fi +if test "x$ac_cv_lib_pcap_pcap_create" != xyes; then : + case "x$with_pcap" in + x) as_fn_append wine_notices "|pcap ${notice_platform}development files not found, wpcap won't be supported." ;; + xno) ;; + *) as_fn_error $? "pcap ${notice_platform}development files not found, wpcap won't be supported. +This is an error since --with-pcap was requested." "$LINENO" 5 ;; +esac +fi +test "x$ac_cv_lib_pcap_pcap_create" != xyes && enable_wpcap=${enable_wpcap:-no} + if test "x$with_xml" != "xno" then @@ -11685,11 +11752,16 @@ if test "$ac_cv_header_resolv_h" = "yes" then - ac_save_LIBS="$LIBS" - for lib in '' -lresolv - do - LIBS="$lib $ac_save_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolver library" >&5 +$as_echo_n "checking for resolver library... " >&6; } +if ${ac_cv_have_resolv+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_LIBS="$LIBS" + for lib in '' -lresolv + do + LIBS="$lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETINET_IN_H #include @@ -11698,25 +11770,37 @@ int main () { -res_query("foo",ns_c_in,0,0,0); +if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_RESOLV 1" >>confdefs.h - - RESOLV_LIBS="$lib" - + ac_cv_have_resolv=${lib:-"none required"} +else + ac_cv_have_resolv="not found" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "${RESOLV_LIBS+set}" = set; then - break - fi - done - LIBS="$ac_save_LIBS" + test "x$ac_cv_have_resolv" = "xnot found" || break + done + LIBS="$ac_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_resolv" >&5 +$as_echo "$ac_cv_have_resolv" >&6; } + + case "$ac_cv_have_resolv" in + "not found") ;; + "none required") + +$as_echo "#define HAVE_RESOLV 1" >>confdefs.h + ;; + *) + $as_echo "#define HAVE_RESOLV 1" >>confdefs.h + + RESOLV_LIBS=$ac_cv_have_resolv + ;; + esac fi if test "x$with_lcms2" != "xno" @@ -17296,6 +17380,7 @@ wine_fn_config_dll wmvcore enable_wmvcore wine_fn_config_dll wnaspi32 enable_wnaspi32 implib wine_fn_config_dll wow32 enable_win16 implib +wine_fn_config_dll wpcap enable_wpcap wine_fn_config_dll ws2_32 enable_ws2_32 implib wine_fn_config_test dlls/ws2_32/tests ws2_32_test wine_fn_config_dll wshom.ocx enable_wshom_ocx clean @@ -17565,8 +17650,6 @@ \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader" else as_fn_append LOADER_RULES " -all: wine.inf - install install-lib:: wine.inf install-man-pages \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls @@ -18089,7 +18172,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.21, which was +This file was extended by Wine $as_me 1.7.24, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18160,7 +18243,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.21 +Wine config.status 1.7.24 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine1.7-1.7.21/configure.ac wine1.7-1.7.24/configure.ac --- wine1.7-1.7.21/configure.ac 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/configure.ac 2014-08-08 20:19:29.000000000 +0000 @@ -67,6 +67,8 @@ AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) AC_ARG_WITH(osmesa, AS_HELP_STRING([--without-osmesa],[do not use the OSMesa library])) AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) +AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), + [if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi]) AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) @@ -448,6 +450,7 @@ netinet/in_systm.h \ netinet/tcp.h \ netinet/tcp_fsm.h \ + pcap/pcap.h \ poll.h \ port.h \ process.h \ @@ -631,12 +634,12 @@ AC_CHECK_HEADERS([ifaddrs.h],,,[#include ]) -AC_CHECK_HEADERS(ucontext.h,,,[#include ]) +AC_CHECK_HEADERS(sys/ucontext.h,,,[#include ]) AC_CHECK_HEADERS([sys/thr.h],,, [#include -#ifdef HAVE_UCONTEXT_H -#include +#ifdef HAVE_SYS_UCONTEXT_H +#include #endif]) AC_CHECK_HEADERS([pthread_np.h],,, @@ -684,6 +687,8 @@ libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` AC_SUBST(LOADER_RULES,[" +all: wine.inf + install install-lib:: wine-installed \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary @@ -1266,6 +1271,15 @@ [OpenCL ${notice_platform}development files not found, OpenCL won't be supported.]) test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes && enable_opencl=${enable_opencl:-no} +dnl **** Check for libpcap **** +if test "$ac_cv_header_pcap_pcap_h" = "yes" +then + AC_CHECK_LIB(pcap,pcap_create,[AC_SUBST(LIBPCAP,["-lpcap"])]) +fi +WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_create" != xyes], + [pcap ${notice_platform}development files not found, wpcap won't be supported.]) +test "x$ac_cv_lib_pcap_pcap_create" != xyes && enable_wpcap=${enable_wpcap:-no} + dnl **** Check for libxml2 **** if test "x$with_xml" != "xno" @@ -1417,21 +1431,28 @@ dnl **** Check for resolver library *** if test "$ac_cv_header_resolv_h" = "yes" then - ac_save_LIBS="$LIBS" - for lib in '' -lresolv - do - LIBS="$lib $ac_save_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H + AC_CACHE_CHECK([for resolver library], ac_cv_have_resolv, + [ac_save_LIBS="$LIBS" + for lib in '' -lresolv + do + LIBS="$lib $ac_save_LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H #include #endif -#include ]],[[res_query("foo",ns_c_in,0,0,0);]])], - [AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header]) - AC_SUBST(RESOLV_LIBS,"$lib")]) - if test "${RESOLV_LIBS+set}" = set; then - break - fi - done - LIBS="$ac_save_LIBS" +#include ]],[[if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0)]])], + [ac_cv_have_resolv=${lib:-"none required"}],[ac_cv_have_resolv="not found"]) + test "x$ac_cv_have_resolv" = "xnot found" || break + done + LIBS="$ac_save_LIBS"]) + + case "$ac_cv_have_resolv" in + "not found") ;; + "none required") + AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header]) ;; + *) + AC_DEFINE(HAVE_RESOLV, 1) + AC_SUBST(RESOLV_LIBS,$ac_cv_have_resolv) ;; + esac fi dnl **** Check for LittleCMS *** @@ -3270,6 +3291,7 @@ WINE_CONFIG_DLL(wmvcore) WINE_CONFIG_DLL(wnaspi32,,[implib]) WINE_CONFIG_DLL(wow32,enable_win16,[implib]) +WINE_CONFIG_DLL(wpcap) WINE_CONFIG_DLL(ws2_32,,[implib]) WINE_CONFIG_TEST(dlls/ws2_32/tests) WINE_CONFIG_DLL(wshom.ocx,,[clean]) @@ -3557,8 +3579,6 @@ \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader]) else AS_VAR_APPEND([LOADER_RULES],[" -all: wine.inf - install install-lib:: wine.inf install-man-pages \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls diff -Nru wine1.7-1.7.21/debian/changelog wine1.7-1.7.24/debian/changelog --- wine1.7-1.7.21/debian/changelog 2014-07-07 20:36:14.000000000 +0000 +++ wine1.7-1.7.24/debian/changelog 2014-08-16 21:40:29.000000000 +0000 @@ -1,3 +1,27 @@ +wine1.7 (1:1.7.24-0ubuntu1~ppa1) trusty; urgency=medium + + * New upstream release + - Beginning of some DirectWrite classes implementation. + - Initial wrapper dll for the packet capture library. + - Some crypto improvements. + - Various bug fixes. + + -- Scott Ritchie Sat, 16 Aug 2014 14:11:47 -0700 + +wine1.7 (1:1.7.22-0ubuntu1) trusty; urgency=medium + + * New upstream release + - Support for Unicode bracketing pairs. + - Improved Internet cookie support. + - OS X CoreAudio driver uses AUHAL instead of AudioQueue. + - Initial support for geographical information. + - Various bug fixes. + * Disable thread override for now, causes regressions. + - http://bugs.winehq.org/show_bug.cgi?id=36772 + - http://bugs.winehq.org/show_bug.cgi?id=36744 + + -- Maarten Lankhorst Mon, 14 Jul 2014 10:06:29 +0200 + wine1.7 (1:1.7.21-0ubuntu1~ppa1) trusty; urgency=medium * New upstream release diff -Nru wine1.7-1.7.21/debian/patches/0001-winemenubuilder-silence-an-err.patch wine1.7-1.7.24/debian/patches/0001-winemenubuilder-silence-an-err.patch --- wine1.7-1.7.21/debian/patches/0001-winemenubuilder-silence-an-err.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0001-winemenubuilder-silence-an-err.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From bf0a38159f5b46099a105293fd26e5b1f6065fe8 Mon Sep 17 00:00:00 2001 +From 131ba4f7462cecb0290c836f508b6e86b624b4c9 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:44 +0200 -Subject: [PATCH 01/43] winemenubuilder: silence an err +Date: Mon, 14 Jul 2014 09:50:01 +0200 +Subject: [PATCH 01/42] winemenubuilder: silence an err --- programs/winemenubuilder/winemenubuilder.c | 2 +- diff -Nru wine1.7-1.7.21/debian/patches/0002-valgrind-prevent-crash-hack.patch wine1.7-1.7.24/debian/patches/0002-valgrind-prevent-crash-hack.patch --- wine1.7-1.7.21/debian/patches/0002-valgrind-prevent-crash-hack.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0002-valgrind-prevent-crash-hack.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 8f1f825a1d9de674f2b275082edea385296f3346 Mon Sep 17 00:00:00 2001 +From 2b70c6fd1db9b477452175e77424daf6dceda116 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 02/43] valgrind prevent crash hack +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 02/42] valgrind prevent crash hack --- libs/wine/loader.c | 10 +++++++++- diff -Nru wine1.7-1.7.21/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch wine1.7-1.7.24/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch --- wine1.7-1.7.21/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch 2014-08-16 21:40:48.000000000 +0000 @@ -1,7 +1,7 @@ -From b740aca78327bd7eb7857767900e72066df32a3c Mon Sep 17 00:00:00 2001 +From 3328c9eebc098de262718b42b9cbf5641b865ef4 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 03/43] server: Use rtkit to set realtime priority, try 4 +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 03/42] server: Use rtkit to set realtime priority, try 4 --- libs/wine/loader.c | 27 ++++++++ @@ -11,11 +11,11 @@ 4 files changed, 225 insertions(+) create mode 100644 server/rtkit.c -diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 6cc8555..28f511e 100644 ---- a/libs/wine/loader.c -+++ b/libs/wine/loader.c -@@ -915,6 +915,32 @@ jint JNI_OnLoad( JavaVM *vm, void *reserved ) +Index: wine1.7-1.7.24/libs/wine/loader.c +=================================================================== +--- wine1.7-1.7.24.orig/libs/wine/loader.c 2014-08-16 14:40:42.981883766 -0700 ++++ wine1.7-1.7.24/libs/wine/loader.c 2014-08-16 14:40:42.977883850 -0700 +@@ -921,6 +921,32 @@ #endif /* __ANDROID__ */ /*********************************************************************** @@ -48,7 +48,7 @@ * wine_init * * Main Wine initialisation. -@@ -933,6 +959,7 @@ void wine_init( int argc, char *argv[], char *error, int error_size ) +@@ -939,6 +965,7 @@ #ifdef RLIMIT_AS set_max_limit( RLIMIT_AS ); #endif @@ -56,17 +56,17 @@ wine_init_argv0_path( argv[0] ); build_dll_path(); -diff --git a/server/Makefile.in b/server/Makefile.in -index 19a4fac..76bdb96 100644 ---- a/server/Makefile.in -+++ b/server/Makefile.in +Index: wine1.7-1.7.24/server/Makefile.in +=================================================================== +--- wine1.7-1.7.24.orig/server/Makefile.in 2014-08-16 14:40:42.981883766 -0700 ++++ wine1.7-1.7.24/server/Makefile.in 2014-08-16 14:40:42.977883850 -0700 @@ -1,4 +1,5 @@ EXTRALIBS = $(POLL_LIBS) $(RT_LIBS) +EXTRAINCL = $(DBUS_CFLAGS) C_SRCS = \ async.c \ -@@ -30,6 +31,7 @@ C_SRCS = \ +@@ -30,6 +31,7 @@ region.c \ registry.c \ request.c \ @@ -74,11 +74,10 @@ semaphore.c \ serial.c \ signal.c \ -diff --git a/server/rtkit.c b/server/rtkit.c -new file mode 100644 -index 0000000..a212106 ---- /dev/null -+++ b/server/rtkit.c +Index: wine1.7-1.7.24/server/rtkit.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ wine1.7-1.7.24/server/rtkit.c 2014-08-16 14:40:42.977883850 -0700 @@ -0,0 +1,180 @@ +/* + * Rtkit dbus calls @@ -260,10 +259,10 @@ +} + +#endif -diff --git a/server/thread.c b/server/thread.c -index b310e93..6549132 100644 ---- a/server/thread.c -+++ b/server/thread.c +Index: wine1.7-1.7.24/server/thread.c +=================================================================== +--- wine1.7-1.7.24.orig/server/thread.c 2014-08-16 14:40:42.981883766 -0700 ++++ wine1.7-1.7.24/server/thread.c 2014-08-16 14:40:42.977883850 -0700 @@ -52,6 +52,8 @@ #include "user.h" #include "security.h" @@ -273,7 +272,7 @@ #ifdef __i386__ static const unsigned int supported_cpus = CPU_FLAG(CPU_x86); -@@ -476,7 +478,17 @@ static void set_thread_info( struct thread *thread, +@@ -476,7 +478,17 @@ if ((req->priority >= min && req->priority <= max) || req->priority == THREAD_PRIORITY_IDLE || req->priority == THREAD_PRIORITY_TIME_CRITICAL) @@ -291,7 +290,7 @@ else set_error( STATUS_INVALID_PARAMETER ); } -@@ -1297,6 +1309,10 @@ DECL_HANDLER(init_thread) +@@ -1301,6 +1313,10 @@ } debug_level = max( debug_level, req->debug_level ); @@ -302,6 +301,3 @@ reply->pid = get_process_id( process ); reply->tid = get_thread_id( current ); reply->version = SERVER_PROTOCOL_VERSION; --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0004-avrt-Add-realtime-to-stub.patch wine1.7-1.7.24/debian/patches/0004-avrt-Add-realtime-to-stub.patch --- wine1.7-1.7.21/debian/patches/0004-avrt-Add-realtime-to-stub.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0004-avrt-Add-realtime-to-stub.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 2e604b4b04ce9e0abb2df6a0140d7a467fa436c7 Mon Sep 17 00:00:00 2001 +From 9d799671ea3a17506a54c45142f5802c338737dd Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 04/43] avrt: Add realtime to stub +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 04/42] avrt: Add realtime to stub --- dlls/avrt/main.c | 1 + diff -Nru wine1.7-1.7.21/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch wine1.7-1.7.24/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch --- wine1.7-1.7.21/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 65cad32006c893fc7259fb5e198be41bf5111a45 Mon Sep 17 00:00:00 2001 +From 703a9933ac91e4e9df0583f4bf781f2280467f64 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 05/43] server: Bump priority on server to process messages +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 05/42] server: Bump priority on server to process messages faster --- diff -Nru wine1.7-1.7.21/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch wine1.7-1.7.24/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch --- wine1.7-1.7.21/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch 2014-08-16 21:40:58.000000000 +0000 @@ -1,7 +1,7 @@ -From 4573cb826ed03f2c1fedfc11e3d34f28c5b560eb Mon Sep 17 00:00:00 2001 +From ed6572e271a579b3235e24c18891f0d340e54919 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 06/43] rtkit: add SIGXCPU handling to wineserver +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 06/42] rtkit: add SIGXCPU handling to wineserver This is dependent on getting the correct server_pid in the previous commit. Processes now forward SIGXCPU to wineserver, who will attempt to downgrade @@ -19,11 +19,11 @@ server/thread.h | 2 + 7 files changed, 261 insertions(+), 35 deletions(-) -diff --git a/dlls/avrt/main.c b/dlls/avrt/main.c -index aa6b95d..4e29abf 100644 ---- a/dlls/avrt/main.c -+++ b/dlls/avrt/main.c -@@ -80,7 +80,7 @@ HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex) +Index: wine1.7-1.7.24/dlls/avrt/main.c +=================================================================== +--- wine1.7-1.7.24.orig/dlls/avrt/main.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/dlls/avrt/main.c 2014-08-16 14:40:54.781644951 -0700 +@@ -80,7 +80,7 @@ SetLastError(ERROR_INVALID_HANDLE); return NULL; } @@ -32,11 +32,11 @@ return (HANDLE)0x12345678; } -diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index f3c6b38..8c48fd2 100644 ---- a/dlls/ntdll/server.c -+++ b/dlls/ntdll/server.c -@@ -79,6 +79,9 @@ +Index: wine1.7-1.7.24/dlls/ntdll/server.c +=================================================================== +--- wine1.7-1.7.24.orig/dlls/ntdll/server.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/dlls/ntdll/server.c 2014-08-16 14:40:54.785644872 -0700 +@@ -81,6 +81,9 @@ #include "ntdll_misc.h" WINE_DEFAULT_DEBUG_CHANNEL(server); @@ -46,7 +46,7 @@ /* Some versions of glibc don't define this */ #ifndef SCM_RIGHTS -@@ -1328,6 +1331,88 @@ static int get_unix_tid(void) +@@ -1330,6 +1333,88 @@ } @@ -135,7 +135,7 @@ /*********************************************************************** * server_init_process * -@@ -1337,6 +1422,14 @@ void server_init_process(void) +@@ -1339,6 +1424,14 @@ { obj_handle_t version; const char *env_socket = getenv( "WINESERVERSOCKET" ); @@ -150,7 +150,7 @@ server_pid = -1; if (env_socket) -@@ -1420,7 +1513,6 @@ NTSTATUS server_init_process_done(void) +@@ -1422,7 +1515,6 @@ return status; } @@ -158,11 +158,11 @@ /*********************************************************************** * server_init_thread * -diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 28f511e..a9ad0be 100644 ---- a/libs/wine/loader.c -+++ b/libs/wine/loader.c -@@ -929,10 +929,12 @@ static void set_rttime_limit(void) +Index: wine1.7-1.7.24/libs/wine/loader.c +=================================================================== +--- wine1.7-1.7.24.orig/libs/wine/loader.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/libs/wine/loader.c 2014-08-16 14:40:54.785644872 -0700 +@@ -935,10 +935,12 @@ if (!getrlimit( RLIMIT_RTTIME, &rlimit )) { @@ -179,10 +179,10 @@ setrlimit( RLIMIT_RTTIME, &rlimit ); } -diff --git a/server/main.c b/server/main.c -index 6c257b4..f78c0fb 100644 ---- a/server/main.c -+++ b/server/main.c +Index: wine1.7-1.7.24/server/main.c +=================================================================== +--- wine1.7-1.7.24.orig/server/main.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/server/main.c 2014-08-16 14:40:54.785644872 -0700 @@ -39,7 +39,7 @@ #include "request.h" #include "wine/library.h" @@ -192,7 +192,7 @@ /* command-line options */ int debug_level = 0; -@@ -148,7 +148,7 @@ int main( int argc, char *argv[] ) +@@ -148,7 +148,7 @@ init_signals(); init_directories(); init_registry(); @@ -201,10 +201,10 @@ main_loop(); return 0; } -diff --git a/server/rtkit.c b/server/rtkit.c -index a212106..53e5ce4 100644 ---- a/server/rtkit.c -+++ b/server/rtkit.c +Index: wine1.7-1.7.24/server/rtkit.c +=================================================================== +--- wine1.7-1.7.24.orig/server/rtkit.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/server/rtkit.c 2014-08-16 14:40:54.785644872 -0700 @@ -35,7 +35,11 @@ #include #include @@ -217,7 +217,7 @@ #ifndef RLIMIT_RTTIME #define RLIMIT_RTTIME 15 -@@ -53,6 +57,8 @@ FUNCPTR(dbus_message_unref); +@@ -53,6 +57,8 @@ FUNCPTR(dbus_set_error_from_message); #undef FUNCPTR @@ -226,7 +226,7 @@ static int translate_error( unsigned tid, const char *name ) { if (!strcmp( name, DBUS_ERROR_NO_MEMORY )) -@@ -85,6 +91,88 @@ static void init_dbus(void) +@@ -85,6 +91,88 @@ #undef FUNCPTR } @@ -315,7 +315,7 @@ static DBusConnection *get_dbus(void) { static DBusConnection *bus; -@@ -96,16 +184,18 @@ static DBusConnection *get_dbus(void) +@@ -96,16 +184,18 @@ pdbus_error_init( &error ); bus = pdbus_bus_get( DBUS_BUS_SYSTEM, &error ); @@ -337,7 +337,7 @@ DBusError error; int ret; -@@ -133,16 +223,29 @@ int rtkit_make_realtime( pid_t process, pid_t thread, int priority ) +@@ -133,16 +223,29 @@ ret = -ENOMEM; goto out; } @@ -369,7 +369,7 @@ out: if (m) pdbus_message_unref( m ); -@@ -150,29 +253,38 @@ out: +@@ -150,29 +253,38 @@ pdbus_message_unref( r ); pdbus_error_free( &error ); if (debug_level) @@ -419,10 +419,10 @@ { return -ENOTSUP; } -diff --git a/server/thread.c b/server/thread.c -index 6549132..32b9e7e 100644 ---- a/server/thread.c -+++ b/server/thread.c +Index: wine1.7-1.7.24/server/thread.c +=================================================================== +--- wine1.7-1.7.24.orig/server/thread.c 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/server/thread.c 2014-08-16 14:40:54.785644872 -0700 @@ -52,8 +52,8 @@ #include "user.h" #include "security.h" @@ -434,7 +434,7 @@ #ifdef __i386__ static const unsigned int supported_cpus = CPU_FLAG(CPU_x86); -@@ -203,6 +203,8 @@ static inline void init_thread_structure( struct thread *thread ) +@@ -203,6 +203,8 @@ list_init( &thread->mutex_list ); list_init( &thread->system_apc ); list_init( &thread->user_apc ); @@ -443,7 +443,7 @@ for (i = 0; i < MAX_INFLIGHT_FDS; i++) thread->inflight[i].server = thread->inflight[i].client = -1; -@@ -271,6 +273,9 @@ static void cleanup_thread( struct thread *thread ) +@@ -271,6 +273,9 @@ { int i; @@ -453,7 +453,7 @@ clear_apc_queue( &thread->system_apc ); clear_apc_queue( &thread->user_apc ); free( thread->req_data ); -@@ -462,6 +467,15 @@ affinity_t get_thread_affinity( struct thread *thread ) +@@ -462,6 +467,15 @@ #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7 @@ -469,7 +469,7 @@ /* set all information about a thread */ static void set_thread_info( struct thread *thread, const struct set_thread_info_request *req ) -@@ -477,17 +491,21 @@ static void set_thread_info( struct thread *thread, +@@ -477,17 +491,21 @@ } if ((req->priority >= min && req->priority <= max) || req->priority == THREAD_PRIORITY_IDLE || @@ -499,7 +499,7 @@ } else set_error( STATUS_INVALID_PARAMETER ); -@@ -1311,7 +1329,7 @@ DECL_HANDLER(init_thread) +@@ -1315,7 +1333,7 @@ /* Raced with SetThreadPriority */ if (current->priority == THREAD_PRIORITY_TIME_CRITICAL) @@ -508,11 +508,11 @@ reply->pid = get_process_id( process ); reply->tid = get_thread_id( current ); -diff --git a/server/thread.h b/server/thread.h -index 996d95b..36f09ce 100644 ---- a/server/thread.h -+++ b/server/thread.h -@@ -87,6 +87,8 @@ struct thread +Index: wine1.7-1.7.24/server/thread.h +=================================================================== +--- wine1.7-1.7.24.orig/server/thread.h 2014-08-16 14:40:54.789644794 -0700 ++++ wine1.7-1.7.24/server/thread.h 2014-08-16 14:40:54.785644872 -0700 +@@ -87,6 +87,8 @@ timeout_t creation_time; /* Thread creation time */ timeout_t exit_time; /* Thread exit time */ struct token *token; /* security token associated with this thread */ @@ -521,6 +521,3 @@ }; struct thread_snapshot --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch wine1.7-1.7.24/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch --- wine1.7-1.7.21/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,16 +1,16 @@ -From 36303e2379c817c40e72e289ea8136e5bd9a33f8 Mon Sep 17 00:00:00 2001 +From edd32d3482d0231a46da8155e8bdd0dc7a897cc1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 07/43] mmdevapi: be stricter about tests +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 07/42] mmdevapi: be stricter about tests Dont care about broken drivers.. --- - dlls/mmdevapi/tests/capture.c | 14 +++---- - dlls/mmdevapi/tests/render.c | 85 +++++++++++++++++++------------------------ - 2 files changed, 44 insertions(+), 55 deletions(-) + dlls/mmdevapi/tests/capture.c | 8 ++--- + dlls/mmdevapi/tests/render.c | 79 +++++++++++++++++++------------------------ + 2 files changed, 38 insertions(+), 49 deletions(-) diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c -index e84fb26..5be8a8d 100644 +index 23075ea..5be8a8d 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -241,7 +241,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) @@ -47,60 +47,10 @@ /* Reset zeroes padding, not the position */ ok(pos >= sum, "Position %u last %u\n", (UINT)pos, sum); /*sum = pos; check after next GetBuffer */ -@@ -424,7 +424,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) - - /* Still receiving events! */ - r = WaitForSingleObject(handle, 20); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); - - hr = IAudioClient_Reset(ac); - ok(hr == S_OK, "Reset failed: %08x\n", hr); -@@ -432,13 +432,13 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) - ok(ResetEvent(handle), "ResetEvent\n"); - - r = WaitForSingleObject(handle, 120); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); - - hr = IAudioClient_SetEventHandle(ac, NULL); - ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); - - r = WaitForSingleObject(handle, 70); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); - - hr = IAudioClient_Start(ac); - ok(hr == S_OK, "Start failed: %08x\n", hr); diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c -index 91ed029..4c8221b 100644 +index 44472a6..4c8221b 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c -@@ -651,7 +651,7 @@ static void test_event(void) - - /* Still receiving events! */ - r = WaitForSingleObject(event, 20); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); - - hr = IAudioClient_Reset(ac); - ok(hr == S_OK, "Reset failed: %08x\n", hr); -@@ -659,13 +659,13 @@ static void test_event(void) - ok(ResetEvent(event), "ResetEvent\n"); - - r = WaitForSingleObject(event, 120); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); - - hr = IAudioClient_SetEventHandle(ac, NULL); - ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); - - r = WaitForSingleObject(event, 70); -- todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); -+ ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); - - /* test releasing a playing stream */ - hr = IAudioClient_Start(ac); @@ -983,7 +983,7 @@ static void test_clock(int share) ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); trace("data at %p\n", data); diff -Nru wine1.7-1.7.21/debian/patches/0008-winmm-Load-winealsa-if-winepulse-is-found.patch wine1.7-1.7.24/debian/patches/0008-winmm-Load-winealsa-if-winepulse-is-found.patch --- wine1.7-1.7.21/debian/patches/0008-winmm-Load-winealsa-if-winepulse-is-found.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0008-winmm-Load-winealsa-if-winepulse-is-found.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 9c64dcb14a77b7b1835bb06e03c90c502a1109f0 Mon Sep 17 00:00:00 2001 +From 170413df2bcce9416f55c1fd6feeeb49794ef530 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 08/43] winmm: Load winealsa if winepulse is found +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 08/42] winmm: Load winealsa if winepulse is found Fixes midi on winepulse --- diff -Nru wine1.7-1.7.21/debian/patches/0009-winepulse-Add-initial-stub-for-pulseaudio-support.patch wine1.7-1.7.24/debian/patches/0009-winepulse-Add-initial-stub-for-pulseaudio-support.patch --- wine1.7-1.7.21/debian/patches/0009-winepulse-Add-initial-stub-for-pulseaudio-support.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0009-winepulse-Add-initial-stub-for-pulseaudio-support.patch 2014-08-16 21:41:10.000000000 +0000 @@ -1,7 +1,7 @@ -From 182d5c5625ea79c4506daa6856de158558de24d8 Mon Sep 17 00:00:00 2001 +From 94131bae285db20ad8f771100816ef65de6381a8 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:45 +0200 -Subject: [PATCH 09/43] winepulse: Add initial stub for pulseaudio support +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 09/42] winepulse: Add initial stub for pulseaudio support --- Just the basic of initialization and pulseaudio mainloop support is @@ -18,11 +18,11 @@ create mode 100644 dlls/winepulse.drv/mmdevdrv.c create mode 100644 dlls/winepulse.drv/winepulse.drv.spec -diff --git a/configure b/configure -index edc03ea..0e31555 100755 ---- a/configure -+++ b/configure -@@ -653,6 +653,8 @@ OSS4_CFLAGS +Index: wine1.7-1.7.24/configure +=================================================================== +--- wine1.7-1.7.24.orig/configure 2014-08-16 14:41:06.269423068 -0700 ++++ wine1.7-1.7.24/configure 2014-08-16 14:41:06.261423219 -0700 +@@ -653,6 +653,8 @@ ALSA_LIBS GSTREAMER_LIBS GSTREAMER_CFLAGS @@ -31,15 +31,15 @@ GETTEXTPO_LIBS Z_LIBS FREETYPE_LIBS -@@ -824,6 +826,7 @@ with_osmesa - with_oss +@@ -826,6 +828,7 @@ + with_pcap with_png with_pthread +with_pulse with_sane with_tiff with_v4l -@@ -1262,6 +1265,7 @@ enable_winemapi +@@ -1265,6 +1268,7 @@ enable_winemp3_acm enable_wineoss_drv enable_wineps_drv @@ -47,15 +47,15 @@ enable_wineqtdecoder enable_winex11_drv enable_wing32 -@@ -2091,6 +2095,7 @@ Optional Packages: - --without-oss do not use the OSS sound support +@@ -2096,6 +2100,7 @@ + --without-pcap do not use the Packet Capture library --without-png do not use PNG --without-pthread do not use the pthread library + --without-pulse do not use PulseAudio sound support --without-sane do not use SANE (scanner support) --without-tiff do not use TIFF --without-v4l do not use v4l1 (v4l support) -@@ -3332,6 +3337,12 @@ if test "${with_pthread+set}" = set; then : +@@ -3343,6 +3348,12 @@ fi @@ -68,7 +68,7 @@ # Check whether --with-sane was given. if test "${with_sane+set}" = set; then : withval=$with_sane; -@@ -12102,6 +12113,87 @@ esac +@@ -12187,6 +12198,87 @@ fi fi @@ -156,7 +156,7 @@ if test "x$with_gstreamer" != "xno" then if ${GSTREAMER_CFLAGS:+false} :; then : -@@ -13413,12 +13505,14 @@ fi +@@ -13498,12 +13590,14 @@ test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} @@ -173,7 +173,7 @@ then as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." fi -@@ -17260,6 +17354,7 @@ wine_fn_config_dll winemp3.acm enable_winemp3_acm +@@ -17347,6 +17441,7 @@ wine_fn_config_dll wineoss.drv enable_wineoss_drv wine_fn_config_dll wineps.drv enable_wineps_drv clean,po wine_fn_config_dll wineps16.drv16 enable_win16 @@ -181,11 +181,11 @@ wine_fn_config_dll wineqtdecoder enable_wineqtdecoder wine_fn_config_dll winex11.drv enable_winex11_drv wine_fn_config_dll wing.dll16 enable_win16 -diff --git a/configure.ac b/configure.ac -index eccf19c..d4939c7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -70,6 +70,7 @@ AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound +Index: wine1.7-1.7.24/configure.ac +=================================================================== +--- wine1.7-1.7.24.orig/configure.ac 2014-08-16 14:41:06.269423068 -0700 ++++ wine1.7-1.7.24/configure.ac 2014-08-16 14:41:06.265423144 -0700 +@@ -72,6 +72,7 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) @@ -193,7 +193,7 @@ 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(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) -@@ -1516,6 +1517,30 @@ then +@@ -1537,6 +1538,30 @@ [GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt.]) fi @@ -224,7 +224,7 @@ dnl **** Check for gstreamer **** if test "x$with_gstreamer" != "xno" then -@@ -1734,13 +1759,15 @@ fi +@@ -1755,13 +1780,15 @@ dnl **** Disable unsupported winmm drivers **** test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} @@ -242,7 +242,7 @@ then WINE_WARNING([No sound system was found. Windows applications will be silent.]) fi -@@ -3235,6 +3262,7 @@ WINE_CONFIG_DLL(winemp3.acm) +@@ -3258,6 +3285,7 @@ WINE_CONFIG_DLL(wineoss.drv) WINE_CONFIG_DLL(wineps.drv,,[clean,po]) WINE_CONFIG_DLL(wineps16.drv16,enable_win16) @@ -250,11 +250,11 @@ WINE_CONFIG_DLL(wineqtdecoder) WINE_CONFIG_DLL(winex11.drv) WINE_CONFIG_DLL(wing.dll16,enable_win16) -diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c -index 447813f..b9ae99e 100644 ---- a/dlls/mmdevapi/main.c -+++ b/dlls/mmdevapi/main.c -@@ -110,7 +110,7 @@ static BOOL init_driver(void) +Index: wine1.7-1.7.24/dlls/mmdevapi/main.c +=================================================================== +--- wine1.7-1.7.24.orig/dlls/mmdevapi/main.c 2014-08-16 14:41:06.269423068 -0700 ++++ wine1.7-1.7.24/dlls/mmdevapi/main.c 2014-08-16 14:41:06.265423144 -0700 +@@ -110,7 +110,7 @@ { static const WCHAR drv_value[] = {'A','u','d','i','o',0}; @@ -263,11 +263,10 @@ 'c','o','r','e','a','u','d','i','o',0}; DriverFuncs driver; -diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in -new file mode 100644 -index 0000000..158bbc0 ---- /dev/null -+++ b/dlls/winepulse.drv/Makefile.in +Index: wine1.7-1.7.24/dlls/winepulse.drv/Makefile.in +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ wine1.7-1.7.24/dlls/winepulse.drv/Makefile.in 2014-08-16 14:41:06.265423144 -0700 @@ -0,0 +1,7 @@ +MODULE = winepulse.drv +IMPORTS = dxguid uuid winmm user32 advapi32 ole32 @@ -276,11 +275,10 @@ + +C_SRCS = \ + mmdevdrv.c -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -new file mode 100644 -index 0000000..d187bdc ---- /dev/null -+++ b/dlls/winepulse.drv/mmdevdrv.c +Index: wine1.7-1.7.24/dlls/winepulse.drv/mmdevdrv.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ wine1.7-1.7.24/dlls/winepulse.drv/mmdevdrv.c 2014-08-16 14:41:06.265423144 -0700 @@ -0,0 +1,290 @@ +/* + * Copyright 2011-2012 Maarten Lankhorst @@ -572,17 +570,13 @@ + *out = NULL; + return E_NOTIMPL; +} -diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec -new file mode 100644 -index 0000000..a089166 ---- /dev/null -+++ b/dlls/winepulse.drv/winepulse.drv.spec +Index: wine1.7-1.7.24/dlls/winepulse.drv/winepulse.drv.spec +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ wine1.7-1.7.24/dlls/winepulse.drv/winepulse.drv.spec 2014-08-16 14:41:06.265423144 -0700 @@ -0,0 +1,5 @@ +# MMDevAPI driver functions +@ stdcall -private GetPriority() AUDDRV_GetPriority +@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs +@ stdcall -private GetAudioEndpoint(ptr ptr long ptr) AUDDRV_GetAudioEndpoint +@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0010-winepulse-Add-format-and-period-probing.patch wine1.7-1.7.24/debian/patches/0010-winepulse-Add-format-and-period-probing.patch --- wine1.7-1.7.21/debian/patches/0010-winepulse-Add-format-and-period-probing.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0010-winepulse-Add-format-and-period-probing.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 66366363c2c99a359dfea648d2de409e362b5557 Mon Sep 17 00:00:00 2001 +From 560601710fa0fae144f31be450e5be556ee5c338 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 10/43] winepulse: Add format and period probing +Date: Mon, 14 Jul 2014 09:50:02 +0200 +Subject: [PATCH 10/42] winepulse: Add format and period probing --- dlls/winepulse.drv/mmdevdrv.c | 128 ++++++++++++++++++++++++++++++++++++++++++ diff -Nru wine1.7-1.7.21/debian/patches/0011-winepulse-Add-audioclient.patch wine1.7-1.7.24/debian/patches/0011-winepulse-Add-audioclient.patch --- wine1.7-1.7.21/debian/patches/0011-winepulse-Add-audioclient.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0011-winepulse-Add-audioclient.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 26cd0e172f299c7e63c51af9f67035f4e5865822 Mon Sep 17 00:00:00 2001 +From 51460530bd39fcac3d44759ca3ae34cbb5c85e9f Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 11/43] winepulse: Add audioclient +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 11/42] winepulse: Add audioclient --- Without AudioRenderClient and AudioCaptureClient it won't work, diff -Nru wine1.7-1.7.21/debian/patches/0012-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch wine1.7-1.7.24/debian/patches/0012-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch --- wine1.7-1.7.21/debian/patches/0012-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0012-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 9cca5914bed2a12edcafc8cebf5918d51e2570de Mon Sep 17 00:00:00 2001 +From ad8e16a8030be3579609e4dc9ce9727b3dbce2da Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 12/43] winepulse: Add IAudioRenderClient and +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 12/42] winepulse: Add IAudioRenderClient and IAudioCaptureClient --- diff -Nru wine1.7-1.7.21/debian/patches/0013-winepulse-Add-IAudioClock-and-IAudioClock2.patch wine1.7-1.7.24/debian/patches/0013-winepulse-Add-IAudioClock-and-IAudioClock2.patch --- wine1.7-1.7.21/debian/patches/0013-winepulse-Add-IAudioClock-and-IAudioClock2.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0013-winepulse-Add-IAudioClock-and-IAudioClock2.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 6b97d362c570ec4a813db1d58574a94ad61f9015 Mon Sep 17 00:00:00 2001 +From d9c51b0534a261c95cea362195dcba1688be815b Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 13/43] winepulse: Add IAudioClock and IAudioClock2 +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 13/42] winepulse: Add IAudioClock and IAudioClock2 --- dlls/winepulse.drv/mmdevdrv.c | 172 ++++++++++++++++++++++++++++++++++++++++++ diff -Nru wine1.7-1.7.21/debian/patches/0014-winepulse-Add-audiostreamvolume.patch wine1.7-1.7.24/debian/patches/0014-winepulse-Add-audiostreamvolume.patch --- wine1.7-1.7.21/debian/patches/0014-winepulse-Add-audiostreamvolume.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0014-winepulse-Add-audiostreamvolume.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 0f827300a5f9d66de488f43fa5f544e97335ea35 Mon Sep 17 00:00:00 2001 +From 9cefd9930adad40581db955cf9291708e282d8b5 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 14/43] winepulse: Add audiostreamvolume +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 14/42] winepulse: Add audiostreamvolume --- Pulse allows streams to set volume, but for various reasons it's diff -Nru wine1.7-1.7.21/debian/patches/0015-winepulse-Add-session-support.patch wine1.7-1.7.24/debian/patches/0015-winepulse-Add-session-support.patch --- wine1.7-1.7.21/debian/patches/0015-winepulse-Add-session-support.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0015-winepulse-Add-session-support.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 313c40a06e4b535ea524c0393c466a52d9c1e8eb Mon Sep 17 00:00:00 2001 +From 5672b4a48c95114e55577c676ebc68d00e5b6908 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 15/43] winepulse: Add session support +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 15/42] winepulse: Add session support --- Copied verbatim from winealsa diff -Nru wine1.7-1.7.21/debian/patches/0016-fix-fdels-trailing-whitespaces.patch wine1.7-1.7.24/debian/patches/0016-fix-fdels-trailing-whitespaces.patch --- wine1.7-1.7.21/debian/patches/0016-fix-fdels-trailing-whitespaces.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0016-fix-fdels-trailing-whitespaces.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 379ef856e7d5c5d691a8aabbb77a95dc3b0e6d9c Mon Sep 17 00:00:00 2001 +From 48782b64e7a62612d8166e74271dbeb1cd83bb3c Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 16/43] fix fdels trailing whitespaces +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 16/42] fix fdels trailing whitespaces Happy? :P --- diff -Nru wine1.7-1.7.21/debian/patches/0017-winepulse-v12.patch wine1.7-1.7.24/debian/patches/0017-winepulse-v12.patch --- wine1.7-1.7.21/debian/patches/0017-winepulse-v12.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0017-winepulse-v12.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 99756a89f015bdf24d42ef75b59736d2cfd930c5 Mon Sep 17 00:00:00 2001 +From 1f92761fc130d432299df976841b77b60b64efa5 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 17/43] winepulse v12 +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 17/42] winepulse v12 Changes since v11: - Fix incorrect assertions which may fail on moving a capture device diff -Nru wine1.7-1.7.21/debian/patches/0018-winepulse-v15-Add-support-for-missing-formats-and-si.patch wine1.7-1.7.24/debian/patches/0018-winepulse-v15-Add-support-for-missing-formats-and-si.patch --- wine1.7-1.7.21/debian/patches/0018-winepulse-v15-Add-support-for-missing-formats-and-si.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0018-winepulse-v15-Add-support-for-missing-formats-and-si.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 8bdeceb10d8f3d69cc6835e53d3a3137a276d756 Mon Sep 17 00:00:00 2001 +From 5761af9a26e1d84f53b698669efb9f33ee886635 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 18/43] winepulse v15: Add support for missing formats, and +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 18/42] winepulse v15: Add support for missing formats, and silence an error for missing format tags --- diff -Nru wine1.7-1.7.21/debian/patches/0019-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch wine1.7-1.7.24/debian/patches/0019-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch --- wine1.7-1.7.21/debian/patches/0019-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0019-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From a3b41022c8746ecf5036adf6c5582f8fe1f7e7b4 Mon Sep 17 00:00:00 2001 +From f54d61ca3af7f60aa6e99046ea42542ac89305aa Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:46 +0200 -Subject: [PATCH 19/43] winepulse v16: Add official warning wine doesn't want +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 19/42] winepulse v16: Add official warning wine doesn't want to support winepulse And give an alternative place to ask for support. diff -Nru wine1.7-1.7.21/debian/patches/0020-winepulse-v17-Fix-winmm-tests.patch wine1.7-1.7.24/debian/patches/0020-winepulse-v17-Fix-winmm-tests.patch --- wine1.7-1.7.21/debian/patches/0020-winepulse-v17-Fix-winmm-tests.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0020-winepulse-v17-Fix-winmm-tests.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 384845108243ed6592df164f13e00dd88705b8bf Mon Sep 17 00:00:00 2001 +From 534909554951611437c1c137d650dee651c4a7d9 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 20/43] winepulse v17: Fix winmm tests +Date: Mon, 14 Jul 2014 09:50:03 +0200 +Subject: [PATCH 20/42] winepulse v17: Fix winmm tests Handle dwChannelMask = SPEAKER_ALL better so WAVE_FORMAT_EXTENSIBLE tests pass too --- diff -Nru wine1.7-1.7.21/debian/patches/0021-winepulse-v18-Latency-and-compilation-improvements.patch wine1.7-1.7.24/debian/patches/0021-winepulse-v18-Latency-and-compilation-improvements.patch --- wine1.7-1.7.21/debian/patches/0021-winepulse-v18-Latency-and-compilation-improvements.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0021-winepulse-v18-Latency-and-compilation-improvements.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From e07df6656ffbccbf4974ca9103c5953f5ff090f3 Mon Sep 17 00:00:00 2001 +From 4a9c7326546604233be84528ba56e10731296ca8 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 21/43] winepulse v18: Latency and compilation improvements +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 21/42] winepulse v18: Latency and compilation improvements Changes since v17: - Remove clock_pulse interpolation diff -Nru wine1.7-1.7.21/debian/patches/0022-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch wine1.7-1.7.24/debian/patches/0022-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch --- wine1.7-1.7.21/debian/patches/0022-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0022-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From a1e43cc033dd64d05bcfc6189b332227facc24cf Mon Sep 17 00:00:00 2001 +From 87c12ec0ab5179a9460ee10096ace6e3fe8fa7d3 Mon Sep 17 00:00:00 2001 From: Juergen Tretthahn -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 22/43] winepulse: API Compatibility with 1.5.2 onward, v2 +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 22/42] winepulse: API Compatibility with 1.5.2 onward, v2 V2: Add winepulse.drv.spec to commit too V1: Original version diff -Nru wine1.7-1.7.21/debian/patches/0023-winepulse-Fix-low-latency-support.patch wine1.7-1.7.24/debian/patches/0023-winepulse-Fix-low-latency-support.patch --- wine1.7-1.7.21/debian/patches/0023-winepulse-Fix-low-latency-support.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0023-winepulse-Fix-low-latency-support.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From cf251ef3bc965d723003723fc86a995ed0808c17 Mon Sep 17 00:00:00 2001 +From c85625f7f671ee68050d9f83f2958fbb6d583c70 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 23/43] winepulse: Fix low latency support +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 23/42] winepulse: Fix low latency support Some games request a 20 ms buffer and will only fill 20 ms. Since 10 ms periods are too long in this case for winepulse, diff -Nru wine1.7-1.7.21/debian/patches/0024-winepulse-drop-realtime-priority-before-thread-destr.patch wine1.7-1.7.24/debian/patches/0024-winepulse-drop-realtime-priority-before-thread-destr.patch --- wine1.7-1.7.21/debian/patches/0024-winepulse-drop-realtime-priority-before-thread-destr.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0024-winepulse-drop-realtime-priority-before-thread-destr.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 94b06acf43a3687efabf329ab32190ebc54147e5 Mon Sep 17 00:00:00 2001 +From 4c58956caeaf8721ccbfd612175caf742797fffb Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 24/43] winepulse: drop realtime priority before thread +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 24/42] winepulse: drop realtime priority before thread destruction prevents having to handle a kernel RT Watchdog Timeout. diff -Nru wine1.7-1.7.21/debian/patches/0025-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch wine1.7-1.7.24/debian/patches/0025-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch --- wine1.7-1.7.21/debian/patches/0025-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0025-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 363670394eb26ede216523dfbaca4c22032f35b8 Mon Sep 17 00:00:00 2001 +From c35b2f43436e6237542fe210d65c6e4e3b0819bd Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 25/43] winepulse: remove bogus SetEvent from +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 25/42] winepulse: remove bogus SetEvent from pulse_started_callback --- diff -Nru wine1.7-1.7.21/debian/patches/0026-winepulse-disable-the-setevent-part-of-the-latency-h.patch wine1.7-1.7.24/debian/patches/0026-winepulse-disable-the-setevent-part-of-the-latency-h.patch --- wine1.7-1.7.21/debian/patches/0026-winepulse-disable-the-setevent-part-of-the-latency-h.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0026-winepulse-disable-the-setevent-part-of-the-latency-h.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 5cfd0ad9a87b738a7bce79c966b476a682892506 Mon Sep 17 00:00:00 2001 +From 647aa74bd4a7a11065e8ee2c513d3fdd0584d1e7 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 26/43] winepulse: disable the setevent part of the latency +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 26/42] winepulse: disable the setevent part of the latency hack If you get playback glitches in skyrim or other games as a result of diff -Nru wine1.7-1.7.21/debian/patches/0027-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch wine1.7-1.7.24/debian/patches/0027-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch --- wine1.7-1.7.21/debian/patches/0027-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0027-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From b5e9e9af838afe41a7e82ba8c5c1e0c4bd5bd517 Mon Sep 17 00:00:00 2001 +From 824fc6ecfad213000ca8e93c147687530c34ea87 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 27/43] winepulse v20: fix the checks in IsFormatSupported +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 27/42] winepulse v20: fix the checks in IsFormatSupported Thanks to DGhost001 for reporting and isolating the issue. --- diff -Nru wine1.7-1.7.21/debian/patches/0028-winepulse-fixup-IsFormatSupported-calls.patch wine1.7-1.7.24/debian/patches/0028-winepulse-fixup-IsFormatSupported-calls.patch --- wine1.7-1.7.21/debian/patches/0028-winepulse-fixup-IsFormatSupported-calls.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0028-winepulse-fixup-IsFormatSupported-calls.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 2813e16dbbefcccbf4b8b29bf65c30e4d7f2605c Mon Sep 17 00:00:00 2001 +From e94c6ccaef68dbda1906e94c9f69dab20dacae4e Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:47 +0200 -Subject: [PATCH 28/43] winepulse: fixup IsFormatSupported calls +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 28/42] winepulse: fixup IsFormatSupported calls --- dlls/mmdevapi/tests/render.c | 164 +++++++++++++++++++++++++++++++++++++++ diff -Nru wine1.7-1.7.21/debian/patches/0029-winepulse-v21-return-early-if-padding-didn-t-update.patch wine1.7-1.7.24/debian/patches/0029-winepulse-v21-return-early-if-padding-didn-t-update.patch --- wine1.7-1.7.21/debian/patches/0029-winepulse-v21-return-early-if-padding-didn-t-update.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0029-winepulse-v21-return-early-if-padding-didn-t-update.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From e95e4533229ef499e6e2ecb793e3054b8be3809a Mon Sep 17 00:00:00 2001 +From c334a7107c408e86154e4968003a28b8a5322e62 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 29/43] winepulse v21: return early if padding didn't update +Date: Mon, 14 Jul 2014 09:50:04 +0200 +Subject: [PATCH 29/42] winepulse v21: return early if padding didn't update --- dlls/winepulse.drv/mmdevdrv.c | 5 ++++- diff -Nru wine1.7-1.7.21/debian/patches/0030-winepulse-fix-unneeded-free-in-write.patch wine1.7-1.7.24/debian/patches/0030-winepulse-fix-unneeded-free-in-write.patch --- wine1.7-1.7.21/debian/patches/0030-winepulse-fix-unneeded-free-in-write.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0030-winepulse-fix-unneeded-free-in-write.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 0a2ea36a38fccd41fa3387be71fea39462e4102c Mon Sep 17 00:00:00 2001 +From 653e4912a248101e5451eec21a9e7a07dce8a49a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 30/43] winepulse: fix unneeded free in write.. +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 30/42] winepulse: fix unneeded free in write.. --- dlls/winepulse.drv/mmdevdrv.c | 6 +++++- diff -Nru wine1.7-1.7.21/debian/patches/0031-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch wine1.7-1.7.24/debian/patches/0031-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch --- wine1.7-1.7.21/debian/patches/0031-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0031-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 46f5df733fba376a7d6bbb3804fb25e108b760f0 Mon Sep 17 00:00:00 2001 +From 6a3d42407535ce71761d41f47e6b0a49938d77d1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 31/43] winepulse v23: fixup a invalid free in mmdevapi +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 31/42] winepulse v23: fixup a invalid free in mmdevapi array members of ids should be dynamically allocated, judging from valgrind output. --- diff -Nru wine1.7-1.7.21/debian/patches/0032-dsound-rework-ugly-mixer-logic.patch wine1.7-1.7.24/debian/patches/0032-dsound-rework-ugly-mixer-logic.patch --- wine1.7-1.7.21/debian/patches/0032-dsound-rework-ugly-mixer-logic.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0032-dsound-rework-ugly-mixer-logic.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 14305c79ae942158c9849372dae1035e98d7075e Mon Sep 17 00:00:00 2001 +From 3116ac4372432f4822ea5b88e4959051bc3134b9 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 32/43] dsound: rework ugly mixer logic +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 32/42] dsound: rework ugly mixer logic --- dlls/dsound/dsound.c | 1 - diff -Nru wine1.7-1.7.21/debian/patches/0033-dsound-mix-float-natively.patch wine1.7-1.7.24/debian/patches/0033-dsound-mix-float-natively.patch --- wine1.7-1.7.21/debian/patches/0033-dsound-mix-float-natively.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0033-dsound-mix-float-natively.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 2c057b59bffff9e0ff8d670f0f609ea8864eec07 Mon Sep 17 00:00:00 2001 +From a3024fb52c25ef3189c32ab9e15edb1c111100d6 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 33/43] dsound: mix float natively +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 33/42] dsound: mix float natively --- dlls/dsound/mixer.c | 43 ++++++++++++++++++++++++++++++++----------- diff -Nru wine1.7-1.7.21/debian/patches/0034-dsound-fix-format-handling-on-invalid-format-to-neve.patch wine1.7-1.7.24/debian/patches/0034-dsound-fix-format-handling-on-invalid-format-to-neve.patch --- wine1.7-1.7.21/debian/patches/0034-dsound-fix-format-handling-on-invalid-format-to-neve.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0034-dsound-fix-format-handling-on-invalid-format-to-neve.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 8a79f1d85947cd4c96f112802caa2a3343375024 Mon Sep 17 00:00:00 2001 +From 87efac245a7ff0902002d27ef36a98c4d9ba286a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 34/43] dsound: fix format handling on invalid format to never +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 34/42] dsound: fix format handling on invalid format to never fail For the users still on oss4 this is probably useful. This is more of diff -Nru wine1.7-1.7.21/debian/patches/0035-dsound-fixup-DSOUND_WaveQueue-checks.patch wine1.7-1.7.24/debian/patches/0035-dsound-fixup-DSOUND_WaveQueue-checks.patch --- wine1.7-1.7.21/debian/patches/0035-dsound-fixup-DSOUND_WaveQueue-checks.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0035-dsound-fixup-DSOUND_WaveQueue-checks.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From ef7c000bced9f1d31b95390caa1ea0d0ca1ce13a Mon Sep 17 00:00:00 2001 +From 2661ffe89e8f08111a9cede029e22fd504e9ee40 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 35/43] dsound: fixup DSOUND_WaveQueue checks +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 35/42] dsound: fixup DSOUND_WaveQueue checks If you're going to be silly, you should go all the way. :P --- diff -Nru wine1.7-1.7.21/debian/patches/0036-dsound-remove-state-machine-from-render-buffer.patch wine1.7-1.7.24/debian/patches/0036-dsound-remove-state-machine-from-render-buffer.patch --- wine1.7-1.7.21/debian/patches/0036-dsound-remove-state-machine-from-render-buffer.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0036-dsound-remove-state-machine-from-render-buffer.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From fe3f329b725484407811e0808573dfa5167bfdf5 Mon Sep 17 00:00:00 2001 +From f447e18e4acbe6f18bb23ac6c4fb0c17ce8c56ad Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 36/43] dsound: remove state machine from render buffer +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 36/42] dsound: remove state machine from render buffer .. wat --- diff -Nru wine1.7-1.7.21/debian/patches/0037-dsound-kill-unconditional-memory-allocation-in-mixin.patch wine1.7-1.7.24/debian/patches/0037-dsound-kill-unconditional-memory-allocation-in-mixin.patch --- wine1.7-1.7.21/debian/patches/0037-dsound-kill-unconditional-memory-allocation-in-mixin.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0037-dsound-kill-unconditional-memory-allocation-in-mixin.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From bd7cc7b0ccbabb8cfd5d0848c7f93b75aea06ae2 Mon Sep 17 00:00:00 2001 +From c2093260e7019dbead46f4294511646f8e789392 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 37/43] dsound: kill unconditional memory allocation in mixing +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 37/42] dsound: kill unconditional memory allocation in mixing thread Unfortunately this doesn't get rid of the memory allocation entirely, diff -Nru wine1.7-1.7.21/debian/patches/0038-winepulse-use-a-pi-mutex-for-serialization.patch wine1.7-1.7.24/debian/patches/0038-winepulse-use-a-pi-mutex-for-serialization.patch --- wine1.7-1.7.21/debian/patches/0038-winepulse-use-a-pi-mutex-for-serialization.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0038-winepulse-use-a-pi-mutex-for-serialization.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 8d23cea7bd4c530d352d0358bb078e7c9eea4b43 Mon Sep 17 00:00:00 2001 +From d6baba9b8c742b672121ad283fdee54135f46e7a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:48 +0200 -Subject: [PATCH 38/43] winepulse: use a pi-mutex for serialization. +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 38/42] winepulse: use a pi-mutex for serialization. The winepulse thread is realtime, to prevent blocking it indefinitely use priority inheritance. Only initialize and release are potentially diff -Nru wine1.7-1.7.21/debian/patches/0039-winepulse-add-support-for-IMarshal.patch wine1.7-1.7.24/debian/patches/0039-winepulse-add-support-for-IMarshal.patch --- wine1.7-1.7.21/debian/patches/0039-winepulse-add-support-for-IMarshal.patch 2014-06-24 07:27:35.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0039-winepulse-add-support-for-IMarshal.patch 2014-07-14 08:03:09.000000000 +0000 @@ -1,7 +1,7 @@ -From 0db6f5427a3a74f23c8833680a53df63cb1ab339 Mon Sep 17 00:00:00 2001 +From 2e64f15c657e318118c582361bee81ad37dca872 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:49 +0200 -Subject: [PATCH 39/43] winepulse: add support for IMarshal +Date: Mon, 14 Jul 2014 09:50:05 +0200 +Subject: [PATCH 39/42] winepulse: add support for IMarshal Fixes bug 32161 for winepulse. Based On Jeff Klein's patches for the other drivers. diff -Nru wine1.7-1.7.21/debian/patches/0040-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch wine1.7-1.7.24/debian/patches/0040-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch --- wine1.7-1.7.21/debian/patches/0040-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0040-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch 2014-07-14 08:03:09.000000000 +0000 @@ -0,0 +1,37 @@ +From 6959f67d62ee8c882709c7d7d0e13bf7136e9314 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 14 Jul 2014 09:50:06 +0200 +Subject: [PATCH 40/42] Revert "winmm: Increase mmdevapi buffer sizes." + +This reverts commit fdfff7cf6013a030f2b240b13b02831e502d49e7. + +You've got to be kidding me, 1 second latency in winmm because +of a driver not used on linux? If the 'upstream' audio devs +spent less time on workarounds and more on fixing drivers, +this kind of crap wouldn't be needed. + +I cannot believe that winecoreaudio requires .5 second latency, +their api allows for very low latency, so it's probably +winecoreaudio screwing things up instead. +--- + dlls/winmm/waveform.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c +index 6b259ff..541dc62 100644 +--- a/dlls/winmm/waveform.c ++++ b/dlls/winmm/waveform.c +@@ -68,8 +68,8 @@ static const WCHAR muteW[] = {'M','u','t','e',0}; + * - We must be able to identify bad devices without crashing. + */ + +-/* buffer size = 100 * 100000 (100 ns) = 1 second */ +-#define AC_BUFLEN (100 * 100000) ++/* buffer size = 10 * 100000 (100 ns) = 0.1 seconds */ ++#define AC_BUFLEN (10 * 100000) + #define MAX_DEVICES 256 + #define MAPPER_INDEX 0x3F + +-- +2.0.0 + diff -Nru wine1.7-1.7.21/debian/patches/0040-TESTING-override-pthreads-to-fix-gstreamer-v2.patch wine1.7-1.7.24/debian/patches/0040-TESTING-override-pthreads-to-fix-gstreamer-v2.patch --- wine1.7-1.7.21/debian/patches/0040-TESTING-override-pthreads-to-fix-gstreamer-v2.patch 2014-06-24 07:27:36.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0040-TESTING-override-pthreads-to-fix-gstreamer-v2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,534 +0,0 @@ -From ec51780f50514eeccd08b078ba5b833773895d89 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:49 +0200 -Subject: [PATCH 40/43] TESTING -- override pthreads to fix gstreamer v2 - -I believe the code is ready and will work properly now in all cases. -but please test before cherry picking this patch, and report -success or failure to me please. - -Changes since v1: - - Call pthread_yield to make sure that we link against libpthread. - This fixes the build on saucy. ---- - dlls/ntdll/ntdll_misc.h | 3 + - dlls/ntdll/thread.c | 261 ++++++++++++++++++++++++++++++++++++++-- - dlls/winegstreamer/glibthread.c | 13 ++ - libs/wine/loader.c | 7 ++ - libs/wine/wine.map | 6 + - loader/Makefile.in | 2 +- - loader/main.c | 41 +++++++ - 7 files changed, 321 insertions(+), 12 deletions(-) - -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 4370084..1af819b 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -28,6 +28,7 @@ - #include "winnt.h" - #include "winternl.h" - #include "wine/server.h" -+#include "wine/list.h" - - #define MAX_NT_PATH_LENGTH 277 - -@@ -235,6 +236,8 @@ struct ntdll_thread_data - WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ - void *exit_frame; /* 204 exit frame pointer */ - #endif -+ struct list entry; -+ BOOL detached; - }; - - static inline struct ntdll_thread_data *ntdll_get_thread_data(void) -diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 56ea033..4b11b19 100644 ---- a/dlls/ntdll/thread.c -+++ b/dlls/ntdll/thread.c -@@ -33,6 +33,7 @@ - #ifdef HAVE_SYS_SYSCALL_H - #include - #endif -+#include - - #define NONAMELESSUNION - #include "ntstatus.h" -@@ -58,6 +59,7 @@ struct startup_info - TEB *teb; - PRTL_THREAD_START_ROUTINE entry_point; - void *entry_arg; -+ BOOL native_thread; - }; - - static PEB *peb; -@@ -202,6 +204,78 @@ static ULONG get_dyld_image_info_addr(void) - } - #endif /* __APPLE__ */ - -+#ifdef __linux__ -+extern typeof(pthread_create) *__glob_pthread_create, *call_pthread_create; -+extern typeof(pthread_join) *__glob_pthread_join, *call_pthread_join; -+extern typeof(pthread_detach) *__glob_pthread_detach, *call_pthread_detach; -+ -+static typeof(pthread_create) __hook_pthread_create; -+static typeof(pthread_join) __hook_pthread_join; -+static typeof(pthread_detach) __hook_pthread_detach; -+ -+static pthread_mutex_t thread_lock; -+ -+static void thread_wrap_init(void) -+{ -+ pthread_mutexattr_t attr; -+ pthread_mutexattr_init(&attr); -+ pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST); -+ pthread_mutex_init(&thread_lock, &attr); -+ pthread_mutexattr_destroy(&attr); -+ -+ call_pthread_create = __hook_pthread_create; -+ call_pthread_join = __hook_pthread_join; -+ call_pthread_detach = __hook_pthread_detach; -+} -+ -+static TEB *dead_teb; -+static struct list active_list = LIST_INIT(active_list); -+ -+static void take_thread_lock(void) -+{ -+ int ret = pthread_mutex_lock(&thread_lock); -+ if (ret == EOWNERDEAD) -+ pthread_mutex_consistent(&thread_lock); -+} -+ -+static void detach_thread_unlock(TEB *own_teb) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = dead_teb; -+ -+ dead_teb = own_teb; -+ -+ pthread_mutex_unlock(&thread_lock); -+ if (!teb) -+ return; -+ -+ thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ __glob_pthread_join(thread_data->pthread_id, NULL); -+ signal_free_thread(teb); -+} -+ -+static void reap_thread(TEB *teb) -+{ -+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ take_thread_lock(); -+ if (thread_data->detached) -+ detach_thread_unlock(teb); -+ else { -+ /* -+ * Do not unlock, wait until the thread is thoroughly dead. -+ * This prevents a race condition where detach is called -+ * after the thread has not finished dying yet. -+ */ -+ } -+} -+ -+#else -+#define __glob_pthread_create pthread_create -+#define __glob_pthread_join pthread_join -+#define __glob_pthread_detach pthread_detach -+#define thread_wrap_init() -+#endif -+ - /*********************************************************************** - * thread_init - * -@@ -220,6 +294,7 @@ HANDLE thread_init(void) - struct ntdll_thread_data *thread_data; - static struct debug_info debug_info; /* debug info for initial thread */ - -+ thread_wrap_init(); - virtual_init(); - - /* reserve space for shared user data */ -@@ -349,14 +424,12 @@ void terminate_thread( int status ) - pthread_exit( UIntToPtr(status) ); - } - -- --/*********************************************************************** -- * exit_thread -- */ --void exit_thread( int status ) -+static void exit_thread_common( int status ) - { -+#ifndef __linux__ - static void *prev_teb; - TEB *teb; -+#endif - - if (status) /* send the exit code to the server (0 is already the default) */ - { -@@ -379,24 +452,158 @@ void exit_thread( int status ) - - pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); - -+#ifndef __linux__ - if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) - { - struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; - - if (thread_data->pthread_id) - { -- pthread_join( thread_data->pthread_id, NULL ); -+ __glob_pthread_join( thread_data->pthread_id, NULL ); - signal_free_thread( teb ); - } - } -+#else -+ reap_thread(NtCurrentTeb()); -+#endif - - close( ntdll_get_thread_data()->wait_fd[0] ); - close( ntdll_get_thread_data()->wait_fd[1] ); - close( ntdll_get_thread_data()->reply_fd ); - close( ntdll_get_thread_data()->request_fd ); -+} -+ -+void exit_thread( int status ) -+{ -+ exit_thread_common(status); - pthread_exit( UIntToPtr(status) ); - } - -+#ifdef __linux__ -+ -+struct unix_arg { -+ void *(*start)(void *); -+ void *arg; -+}; -+ -+/* dummy used for comparison */ -+static DWORD native_unix_start; -+ -+static void call_native_cleanup(void *arg) -+{ -+ RtlFreeThreadActivationContextStack(); -+ exit_thread_common(0); -+} -+ -+static int -+__hook_pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *parm) -+{ -+ NTSTATUS ret; -+ size_t stack = 8 * 1024 * 1024; -+ struct unix_arg arg; -+ arg.start = start_routine; -+ arg.arg = parm; -+ -+ TRACE("Overriding thread creation!\n"); -+ if (attr) { -+ static int once; -+ if (!once++) -+ FIXME("most thread attributes ignored!\n"); -+ else -+ WARN("most thread attributes ignored!\n"); -+ -+ pthread_attr_getstacksize(attr, &stack); -+ } -+ -+ ret = RtlCreateUserThread( NtCurrentProcess(), NULL, FALSE, NULL, stack, 0, (void*)&native_unix_start, &arg, NULL, (void*)thread ); -+ if (ret != STATUS_SUCCESS) -+ FIXME("ret: %08x\n", ret); -+ switch (ret) { -+ case STATUS_SUCCESS: -+ return 0; -+ case STATUS_NO_MEMORY: -+ return ENOMEM; -+ case STATUS_TOO_MANY_OPENED_FILES: -+ return EMFILE; -+ default: -+ ERR("Unhandled ntstatus %08x\n", ret); -+ return ENOMEM; -+ } -+} -+ -+static int __hook_pthread_detach(pthread_t thread) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = NULL; -+ -+ if (pthread_equal(thread, pthread_self())) { -+ ntdll_get_thread_data()->detached = 1; -+ return 0; -+ } -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ if (pthread_equal(thread_data->pthread_id, thread)) { -+ teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ list_remove(&thread_data->entry); -+ if (!pthread_tryjoin_np(thread, NULL)) { -+ detach_thread_unlock(NULL); -+ signal_free_thread(teb); -+ return 0; -+ } -+ thread_data->detached = 1; -+ break; -+ } -+ } -+ detach_thread_unlock(NULL); -+ return teb ? 0 : ESRCH; -+} -+ -+static int __hook_pthread_join(pthread_t thread, void **retval) -+{ -+ struct ntdll_thread_data *thread_data, *t2; -+ int ret = ESRCH; -+ -+ if (pthread_equal(thread, pthread_self())) -+ return EDEADLK; -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ TEB *teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ if (pthread_equal(thread, thread_data->pthread_id)) { -+ -+ ret = pthread_tryjoin_np(thread, retval); -+ if (!ret) -+ goto free; -+ detach_thread_unlock(NULL); -+ -+ ret = __glob_pthread_join(thread, retval); -+ if (ret) -+ return ret; -+ -+ take_thread_lock(); -+ /* Check if someone else freed the thread yet */ -+ LIST_FOR_EACH_ENTRY(t2, &active_list, typeof(*thread_data), entry) -+ if (t2 == thread_data) -+ goto free; -+ break; -+ -+free: -+ list_remove(&thread_data->entry); -+ detach_thread_unlock(NULL); -+ signal_free_thread(teb); -+ return 0; -+ } -+ } -+ -+ detach_thread_unlock(NULL); -+ return ret; -+} -+ -+#endif - - /*********************************************************************** - * start_thread -@@ -425,9 +632,26 @@ static void start_thread( struct startup_info *info ) - if (TRACE_ON(relay)) - DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); - -- call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); --} -+#ifdef __linux__ -+ if (info->native_thread) { -+ void *(*start)(void*) = (void*)func; - -+ thread_data->detached = 0; -+ -+ take_thread_lock(); -+ list_add_tail(&active_list, &thread_data->entry); -+ detach_thread_unlock(NULL); -+ -+ FIXME("Started native thread %08x\n", GetCurrentThreadId()); -+ pthread_cleanup_push(call_native_cleanup, NULL); -+ pthread_exit(start(arg)); -+ pthread_cleanup_pop(1); -+ return; -+ } -+ thread_data->detached = 1; -+#endif -+ call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); -+} - - /*********************************************************************** - * RtlCreateUserThread (NTDLL.@) -@@ -525,8 +749,18 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - - info = (struct startup_info *)(teb + 1); - info->teb = teb; -- info->entry_point = start; -- info->entry_arg = param; -+#ifdef __linux__ -+ info->native_thread = (void*)start == (void*)&native_unix_start; -+ if (info->native_thread) { -+ struct unix_arg *arg = param; -+ info->entry_point = (void*)arg->start; -+ info->entry_arg = arg->arg; -+ } else -+#endif -+ { -+ info->entry_point = start; -+ info->entry_arg = param; -+ } - - thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; - thread_data->request_fd = request_pipe[1]; -@@ -541,7 +775,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack ); - pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */ - interlocked_xchg_add( &nb_threads, 1 ); -- if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info )) -+ if (__glob_pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info )) - { - interlocked_xchg_add( &nb_threads, -1 ); - pthread_attr_destroy( &attr ); -@@ -551,6 +785,11 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - pthread_attr_destroy( &attr ); - pthread_sigmask( SIG_SETMASK, &sigset, NULL ); - -+#ifdef __linux__ -+ if ((void*)start == (void*)&native_unix_start && id) -+ *(pthread_t*)id = pthread_id; -+ else -+#endif - if (id) id->UniqueThread = ULongToHandle(tid); - if (handle_ptr) *handle_ptr = handle; - else NtClose( handle ); -diff --git a/dlls/winegstreamer/glibthread.c b/dlls/winegstreamer/glibthread.c -index 0d829a0..46e22f4 100644 ---- a/dlls/winegstreamer/glibthread.c -+++ b/dlls/winegstreamer/glibthread.c -@@ -43,6 +43,7 @@ - #include - #include - -+#if 0 - #include "windef.h" - #include "winbase.h" - #include "winnls.h" -@@ -388,3 +389,15 @@ void g_thread_impl_init (void) - g_thread_self_tls = TlsAlloc (); - g_thread_init(&g_thread_functions_for_glib_use_default); - } -+ -+#else -+ -+void g_thread_impl_init (void) -+{ -+ static gboolean beenhere = FALSE; -+ -+ if (!beenhere++) -+ g_thread_init(NULL); -+} -+ -+#endif -diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index a9ad0be..365144c 100644 ---- a/libs/wine/loader.c -+++ b/libs/wine/loader.c -@@ -73,6 +73,13 @@ char **__wine_main_argv = NULL; - WCHAR **__wine_main_wargv = NULL; - char **__wine_main_environ = NULL; - -+#ifdef __linux__ -+#include -+typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+#endif -+ - struct dll_path_context - { - unsigned int index; /* current index in the dll path list */ -diff --git a/libs/wine/wine.map b/libs/wine/wine.map -index 2159fac..fb3b951 100644 ---- a/libs/wine/wine.map -+++ b/libs/wine/wine.map -@@ -117,6 +117,12 @@ WINE_1.0 - wine_utf8_mbstowcs; - wine_utf8_wcstombs; - wine_wctype_table; -+ __glob_pthread_create; -+ call_pthread_create; -+ __glob_pthread_join; -+ call_pthread_join; -+ __glob_pthread_detach; -+ call_pthread_detach; - - local: *; - }; -diff --git a/loader/Makefile.in b/loader/Makefile.in -index 95e4798..a18dd02 100644 ---- a/loader/Makefile.in -+++ b/loader/Makefile.in -@@ -1,4 +1,4 @@ --EXTRALIBS = $(PTHREAD_LIBS) -+EXTRALIBS = $(PTHREAD_LIBS) $(DL_LIBS) - - C_SRCS = \ - main.c \ -diff --git a/loader/main.c b/loader/main.c -index ac67290..76609e1 100644 ---- a/loader/main.c -+++ b/loader/main.c -@@ -202,6 +202,45 @@ static int pre_exec(void) - - #endif - -+#ifdef __linux__ -+ -+extern typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+extern typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+extern typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+ -+int pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *arg) -+{ -+ return call_pthread_create(thread, attr, start_routine, arg); -+} -+ -+int pthread_detach(pthread_t thread) -+{ -+ return call_pthread_detach(thread); -+} -+ -+int pthread_join(pthread_t thread, void **retval) -+{ -+ return call_pthread_join(thread, retval); -+} -+ -+static void init_thread_hook(void) { -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.2.5"); -+ if (!__glob_pthread_create) -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.1"); -+ -+ call_pthread_detach = __glob_pthread_detach = dlsym(RTLD_NEXT, "pthread_detach"); -+ call_pthread_join = __glob_pthread_join = dlsym(RTLD_NEXT, "pthread_join"); -+ -+ /* Call a function from libpthread to ensure being linked against it */ -+ pthread_yield(); -+} -+ -+#else -+ -+#define init_thread_hook() -+ -+#endif - - /********************************************************************** - * main -@@ -211,6 +250,8 @@ int main( int argc, char *argv[] ) - char error[1024]; - int i; - -+ init_thread_hook(); -+ - if (!getenv( "WINELOADERNOEXEC" )) /* first time around */ - { - static char noexec[] = "WINELOADERNOEXEC=1"; --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0041-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch wine1.7-1.7.24/debian/patches/0041-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch --- wine1.7-1.7.21/debian/patches/0041-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0041-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 2014-07-14 08:03:09.000000000 +0000 @@ -0,0 +1,47 @@ +From 06312bbe0df688604e1c29252a7cc321f9253950 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 14 Jul 2014 09:50:06 +0200 +Subject: [PATCH 41/42] dsound: fixup IDirectSoundCaptureBuffer_QueryInterface + +Don't expose v8, and actually respond to iunknown. +--- + dlls/dsound/capture.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c +index 17b1a04..d997fdc 100644 +--- a/dlls/dsound/capture.c ++++ b/dlls/dsound/capture.c +@@ -51,7 +51,7 @@ typedef struct IDirectSoundCaptureBufferImpl + IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; + IDirectSoundNotify IDirectSoundNotify_iface; + LONG numIfaces; /* "in use interfaces" refcount */ +- LONG ref, refn; ++ LONG ref, refn, has_dsc8; + /* IDirectSoundCaptureBuffer fields */ + DirectSoundCaptureDevice *device; + DSCBUFFERDESC *pdscbd; +@@ -241,8 +241,9 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC + + *ppobj = NULL; + +- if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || +- IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { ++ if ( IsEqualIID( &IID_IUnknown, riid ) || ++ IsEqualIID( &IID_IDirectSoundCaptureBuffer, riid ) || ++ (This->has_dsc8 && IsEqualIID( &IID_IDirectSoundCaptureBuffer8, riid )) ) { + IDirectSoundCaptureBuffer8_AddRef(iface); + *ppobj = iface; + return S_OK; +@@ -1234,6 +1235,8 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa + + if (hr != DS_OK) + WARN("IDirectSoundCaptureBufferImpl_Create failed\n"); ++ else ++ This->device->capture_buffer->has_dsc8 = This->has_dsc8; + + return hr; + } +-- +2.0.0 + diff -Nru wine1.7-1.7.21/debian/patches/0041-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch wine1.7-1.7.24/debian/patches/0041-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch --- wine1.7-1.7.21/debian/patches/0041-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch 2014-06-24 07:27:36.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0041-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From 5f617b2ad8e8c03f63a9ce8c31bd1e66c7b54fb3 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:49 +0200 -Subject: [PATCH 41/43] Revert "winmm: Increase mmdevapi buffer sizes." - -This reverts commit fdfff7cf6013a030f2b240b13b02831e502d49e7. - -You've got to be kidding me, 1 second latency in winmm because -of a driver not used on linux? If the 'upstream' audio devs -spent less time on workarounds and more on fixing drivers, -this kind of crap wouldn't be needed. - -I cannot believe that winecoreaudio requires .5 second latency, -their api allows for very low latency, so it's probably -winecoreaudio screwing things up instead. ---- - dlls/winmm/waveform.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c -index 6b259ff..541dc62 100644 ---- a/dlls/winmm/waveform.c -+++ b/dlls/winmm/waveform.c -@@ -68,8 +68,8 @@ static const WCHAR muteW[] = {'M','u','t','e',0}; - * - We must be able to identify bad devices without crashing. - */ - --/* buffer size = 100 * 100000 (100 ns) = 1 second */ --#define AC_BUFLEN (100 * 100000) -+/* buffer size = 10 * 100000 (100 ns) = 0.1 seconds */ -+#define AC_BUFLEN (10 * 100000) - #define MAX_DEVICES 256 - #define MAPPER_INDEX 0x3F - --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0042-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch wine1.7-1.7.24/debian/patches/0042-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch --- wine1.7-1.7.21/debian/patches/0042-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 2014-06-24 07:27:36.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0042-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -From 446bc0abbdf7e7f346f0bc9dd8db4fd7d32b6687 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Tue, 24 Jun 2014 08:48:49 +0200 -Subject: [PATCH 42/43] dsound: fixup IDirectSoundCaptureBuffer_QueryInterface - -Don't expose v8, and actually respond to iunknown. ---- - dlls/dsound/capture.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c -index 17b1a04..d997fdc 100644 ---- a/dlls/dsound/capture.c -+++ b/dlls/dsound/capture.c -@@ -51,7 +51,7 @@ typedef struct IDirectSoundCaptureBufferImpl - IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; - IDirectSoundNotify IDirectSoundNotify_iface; - LONG numIfaces; /* "in use interfaces" refcount */ -- LONG ref, refn; -+ LONG ref, refn, has_dsc8; - /* IDirectSoundCaptureBuffer fields */ - DirectSoundCaptureDevice *device; - DSCBUFFERDESC *pdscbd; -@@ -241,8 +241,9 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC - - *ppobj = NULL; - -- if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || -- IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { -+ if ( IsEqualIID( &IID_IUnknown, riid ) || -+ IsEqualIID( &IID_IDirectSoundCaptureBuffer, riid ) || -+ (This->has_dsc8 && IsEqualIID( &IID_IDirectSoundCaptureBuffer8, riid )) ) { - IDirectSoundCaptureBuffer8_AddRef(iface); - *ppobj = iface; - return S_OK; -@@ -1234,6 +1235,8 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa - - if (hr != DS_OK) - WARN("IDirectSoundCaptureBufferImpl_Create failed\n"); -+ else -+ This->device->capture_buffer->has_dsc8 = This->has_dsc8; - - return hr; - } --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/0042-winepulse-handle-stream-create-failing-correctly.patch wine1.7-1.7.24/debian/patches/0042-winepulse-handle-stream-create-failing-correctly.patch --- wine1.7-1.7.21/debian/patches/0042-winepulse-handle-stream-create-failing-correctly.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0042-winepulse-handle-stream-create-failing-correctly.patch 2014-07-14 08:03:09.000000000 +0000 @@ -0,0 +1,29 @@ +From 2d638b335a2d9cdddfa9cfd7d7b6e889d124503c Mon Sep 17 00:00:00 2001 +From: Mark Harmstone +Date: Mon, 14 Jul 2014 09:50:06 +0200 +Subject: [PATCH 42/42] winepulse: handle stream create failing correctly + +--- + dlls/winepulse.drv/mmdevdrv.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c +index f052a08..e755e8a 100644 +--- a/dlls/winepulse.drv/mmdevdrv.c ++++ b/dlls/winepulse.drv/mmdevdrv.c +@@ -701,6 +701,12 @@ static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { + ret = InterlockedIncrement(&number); + sprintf(buffer, "audio stream #%i", ret); + This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map); ++ ++ if (!This->stream) { ++ WARN("pa_stream_new returned error %i\n", pa_context_errno(pulse_ctx)); ++ return AUDCLNT_E_ENDPOINT_CREATE_FAILED; ++ } ++ + pa_stream_set_state_callback(This->stream, pulse_stream_state, This); + pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This); + pa_stream_set_moved_callback(This->stream, pulse_attr_update, This); +-- +2.0.0 + diff -Nru wine1.7-1.7.21/debian/patches/0043-winepulse-handle-stream-create-failing-correctly.patch wine1.7-1.7.24/debian/patches/0043-winepulse-handle-stream-create-failing-correctly.patch --- wine1.7-1.7.21/debian/patches/0043-winepulse-handle-stream-create-failing-correctly.patch 2014-06-24 07:27:36.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/0043-winepulse-handle-stream-create-failing-correctly.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 0f7b5851573569ddf40e36e48670bf9d09765920 Mon Sep 17 00:00:00 2001 -From: Mark Harmstone -Date: Tue, 24 Jun 2014 08:48:49 +0200 -Subject: [PATCH 43/43] winepulse: handle stream create failing correctly - ---- - dlls/winepulse.drv/mmdevdrv.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index f052a08..e755e8a 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -701,6 +701,12 @@ static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { - ret = InterlockedIncrement(&number); - sprintf(buffer, "audio stream #%i", ret); - This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map); -+ -+ if (!This->stream) { -+ WARN("pa_stream_new returned error %i\n", pa_context_errno(pulse_ctx)); -+ return AUDCLNT_E_ENDPOINT_CREATE_FAILED; -+ } -+ - pa_stream_set_state_callback(This->stream, pulse_stream_state, This); - pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This); - pa_stream_set_moved_callback(This->stream, pulse_attr_update, This); --- -2.0.0 - diff -Nru wine1.7-1.7.21/debian/patches/series wine1.7-1.7.24/debian/patches/series --- wine1.7-1.7.21/debian/patches/series 2014-06-24 07:28:07.000000000 +0000 +++ wine1.7-1.7.24/debian/patches/series 2014-07-14 08:03:17.000000000 +0000 @@ -38,7 +38,6 @@ 0037-dsound-kill-unconditional-memory-allocation-in-mixin.patch 0038-winepulse-use-a-pi-mutex-for-serialization.patch 0039-winepulse-add-support-for-IMarshal.patch -0040-TESTING-override-pthreads-to-fix-gstreamer-v2.patch -0041-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch -0042-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch -0043-winepulse-handle-stream-create-failing-correctly.patch +0040-Revert-winmm-Increase-mmdevapi-buffer-sizes.patch +0041-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch +0042-winepulse-handle-stream-create-failing-correctly.patch diff -Nru wine1.7-1.7.21/dlls/advapi32/advapi32.spec wine1.7-1.7.24/dlls/advapi32/advapi32.spec --- wine1.7-1.7.21/dlls/advapi32/advapi32.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/advapi32/advapi32.spec 2014-08-08 20:19:29.000000000 +0000 @@ -588,8 +588,8 @@ # @ stub RegDeleteKeyTransactedA # @ stub RegDeleteKeyTransactedW @ stdcall RegDeleteKeyW(long wstr) -# @ stub RegDeleteKeyValueA -# @ stub RegDeleteKeyValueW +@ stdcall RegDeleteKeyValueA(long str str) +@ stdcall RegDeleteKeyValueW(long wstr wstr) @ stdcall RegDeleteTreeA(long str) @ stdcall RegDeleteTreeW(long wstr) @ stdcall RegDeleteValueA(long str) @@ -645,8 +645,8 @@ # @ stub RegSaveKeyExW @ stdcall RegSaveKeyW(long ptr ptr) @ stdcall RegSetKeySecurity(long long ptr) -# @ stub RegSetKeyValueA -# @ stub RegSetKeyValueW +@ stdcall RegSetKeyValueA(long str str long ptr long) +@ stdcall RegSetKeyValueW(long wstr wstr long ptr long) @ stdcall RegSetValueA(long str long ptr long) @ stdcall RegSetValueExA(long str long long ptr long) @ stdcall RegSetValueExW(long wstr long long ptr long) diff -Nru wine1.7-1.7.21/dlls/advapi32/registry.c wine1.7-1.7.24/dlls/advapi32/registry.c --- wine1.7-1.7.21/dlls/advapi32/registry.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/advapi32/registry.c 2014-08-08 20:19:29.000000000 +0000 @@ -1276,61 +1276,80 @@ * Sets the data for the default or unnamed value of a reg key. * * PARAMS - * hKey [I] Handle to an open key. - * lpSubKey [I] Name of a subkey of hKey. - * dwType [I] Type of information to store. - * lpData [I] String that contains the data to set for the default value. - * cbData [I] Ignored. + * hkey [I] Handle to an open key. + * subkey [I] Name of a subkey of hKey. + * type [I] Type of information to store. + * data [I] String that contains the data to set for the default value. + * count [I] Ignored. * * RETURNS * Success: ERROR_SUCCESS * Failure: nonzero error code from Winerror.h */ -LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR name, DWORD type, LPCWSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR subkey, DWORD type, LPCWSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(name), type, debugstr_w(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(subkey), type, debugstr_w(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ - { - if ((ret = RegCreateKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; - } - - ret = RegSetValueExW( subkey, NULL, 0, REG_SZ, (const BYTE*)data, - (strlenW( data ) + 1) * sizeof(WCHAR) ); - if (subkey != hkey) RegCloseKey( subkey ); - return ret; + return RegSetKeyValueW( hkey, subkey, NULL, type, data, (strlenW(data) + 1)*sizeof(WCHAR) ); } - /****************************************************************************** * RegSetValueA [ADVAPI32.@] * * See RegSetValueW. */ -LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR subkey, DWORD type, LPCSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(name), type, debugstr_a(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(subkey), type, debugstr_a(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ + return RegSetKeyValueA( hkey, subkey, NULL, type, data, strlen(data) + 1 ); +} + +/****************************************************************************** + * RegSetKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ { - if ((ret = RegCreateKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; + if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; } - ret = RegSetValueExA( subkey, NULL, 0, REG_SZ, (const BYTE*)data, strlen(data)+1 ); - if (subkey != hkey) RegCloseKey( subkey ); + + ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); return ret; } +/****************************************************************************** + * RegSetKeyValueA [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_a(subkey), debugstr_a(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ + { + if ((ret = RegCreateKeyA( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; + } + + ret = RegSetValueExA( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} /****************************************************************************** * RegQueryValueExW [ADVAPI32.@] @@ -2050,8 +2069,6 @@ return RtlNtStatusToDosError(status); } - - /****************************************************************************** * RegDeleteValueW [ADVAPI32.@] * @@ -2059,15 +2076,9 @@ */ LSTATUS WINAPI RegDeleteValueW( HKEY hkey, LPCWSTR name ) { - UNICODE_STRING nameW; - - if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; - - RtlInitUnicodeString( &nameW, name ); - return RtlNtStatusToDosError( NtDeleteValueKey( hkey, &nameW ) ); + return RegDeleteKeyValueW( hkey, NULL, name ); } - /****************************************************************************** * RegDeleteValueA [ADVAPI32.@] * @@ -2083,22 +2094,64 @@ */ LSTATUS WINAPI RegDeleteValueA( HKEY hkey, LPCSTR name ) { - ANSI_STRING nameA; + return RegDeleteKeyValueA( hkey, NULL, name ); +} + +/****************************************************************************** + * RegDeleteKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegDeleteKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name ) +{ + UNICODE_STRING nameW; + HKEY hsubkey = 0; + LONG ret; + + if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; + + if (subkey) + { + if ((ret = RegOpenKeyExW( hkey, subkey, 0, KEY_SET_VALUE, &hsubkey ))) + return ret; + hkey = hsubkey; + } + + RtlInitUnicodeString( &nameW, name ); + ret = RtlNtStatusToDosError( NtDeleteValueKey( hkey, &nameW ) ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} + +/****************************************************************************** + * RegDeleteKeyValueA [ADVAPI32.@] + */ +LONG WINAPI RegDeleteKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name ) +{ UNICODE_STRING nameW; + HKEY hsubkey = 0; + ANSI_STRING nameA; NTSTATUS status; if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; + if (subkey) + { + LONG ret = RegOpenKeyExA( hkey, subkey, 0, KEY_SET_VALUE, &hsubkey ); + if (ret) + return ret; + hkey = hsubkey; + } + RtlInitAnsiString( &nameA, name ); if (!(status = RtlAnsiStringToUnicodeString( &nameW, &nameA, TRUE ))) { status = NtDeleteValueKey( hkey, &nameW ); RtlFreeUnicodeString( &nameW ); } + + if (hsubkey) RegCloseKey( hsubkey ); return RtlNtStatusToDosError( status ); } - /****************************************************************************** * RegLoadKeyW [ADVAPI32.@] * @@ -2435,9 +2488,9 @@ if (!pSecurityDesc) return ERROR_INVALID_PARAMETER; - FIXME(":(%p,%d,%p): stub\n",hkey,SecurityInfo,pSecurityDesc); + if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; - return ERROR_SUCCESS; + return RtlNtStatusToDosError( NtSetSecurityObject( hkey, SecurityInfo, pSecurityDesc ) ); } diff -Nru wine1.7-1.7.21/dlls/advapi32/tests/registry.c wine1.7-1.7.24/dlls/advapi32/tests/registry.c --- wine1.7-1.7.21/dlls/advapi32/tests/registry.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/advapi32/tests/registry.c 2014-08-08 20:19:29.000000000 +0000 @@ -47,6 +47,8 @@ static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE); static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(UNICODE_STRING*); static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING); +static LONG (WINAPI *pRegDeleteKeyValueA)(HKEY,LPCSTR,LPCSTR); +static LONG (WINAPI *pRegSetKeyValueW)(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); static BOOL limited_user; @@ -135,6 +137,8 @@ ADVAPI32_GET_PROC(RegGetValueA); ADVAPI32_GET_PROC(RegDeleteTreeA); ADVAPI32_GET_PROC(RegDeleteKeyExA); + ADVAPI32_GET_PROC(RegDeleteKeyValueA); + ADVAPI32_GET_PROC(RegSetKeyValueW); pIsWow64Process = (void *)GetProcAddress( hkernel32, "IsWow64Process" ); pRtlFormatCurrentUserKeyPath = (void *)GetProcAddress( hntdll, "RtlFormatCurrentUserKeyPath" ); @@ -431,6 +435,37 @@ ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); ret = RegSetValueExW(hkey_main, name2W, 0, REG_DWORD, (const BYTE *)1, 1); ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); + + /* RegSetKeyValue */ + if (!pRegSetKeyValueW) + win_skip("RegSetKeyValue() is not supported.\n"); + else + { + static const WCHAR subkeyW[] = {'s','u','b','k','e','y',0}; + DWORD len, type; + HKEY subkey; + + ret = pRegSetKeyValueW(hkey_main, NULL, name1W, REG_SZ, (const BYTE*)string2W, sizeof(string2W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + test_hkey_main_Value_A(name1A, string2A, sizeof(string2A)); + test_hkey_main_Value_W(name1W, string2W, sizeof(string2W)); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, string1W, sizeof(string1W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegOpenKeyExW(hkey_main, subkeyW, 0, KEY_QUERY_VALUE, &subkey); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + type = len = 0; + ret = RegQueryValueExW(subkey, name1W, 0, &type, NULL, &len); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + ok(len == sizeof(string1W), "got %d\n", len); + ok(type == REG_SZ, "got type %d\n", type); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, NULL, 0); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + RegCloseKey(subkey); + } } static void create_test_entries(void) @@ -1068,14 +1103,15 @@ } else { - /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */ - bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); - - bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); + LONG error; + + error = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); + ok(error == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", error); + + bRet = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); + ok(error == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", error); hkResult = NULL; ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, KEY_WOW64_64KEY | KEY_READ, &hkResult); @@ -1229,14 +1265,13 @@ } else { - /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */ - bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); - - bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); + ret = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); + ok(ret == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", ret); + + ret = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); + ok(ret == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", ret); hkey1 = NULL; ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, NULL, 0, @@ -2768,6 +2803,56 @@ "expect ERROR_FILE_NOT_FOUND, got %i\n", res); } +static void test_delete_key_value(void) +{ + HKEY subkey; + LONG ret; + + if (!pRegDeleteKeyValueA) + { + win_skip("RegDeleteKeyValue is not available.\n"); + return; + } + + ret = pRegDeleteKeyValueA(NULL, NULL, NULL); + ok(ret == ERROR_INVALID_HANDLE, "got %d\n", ret); + + ret = pRegDeleteKeyValueA(hkey_main, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + ret = RegSetValueExA(hkey_main, "test", 0, REG_SZ, (const BYTE*)"value", 6); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(hkey_main, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + /* NULL subkey name means delete from open key */ + ret = pRegDeleteKeyValueA(hkey_main, NULL, "test"); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(hkey_main, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + /* now with real subkey */ + ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &subkey, NULL); + ok(!ret, "failed with error %d\n", ret); + + ret = RegSetValueExA(subkey, "test", 0, REG_SZ, (const BYTE*)"value", 6); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(subkey, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pRegDeleteKeyValueA(hkey_main, "Subkey1", "test"); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(subkey, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + RegDeleteKeyA(subkey, ""); + RegCloseKey(subkey); +} + START_TEST(registry) { /* Load pointers for functions that are not available in all Windows versions */ @@ -2808,6 +2893,7 @@ test_rw_order(); test_deleted_key(); test_delete_value(); + test_delete_key_value(); /* cleanup */ delete_key( hkey_main ); diff -Nru wine1.7-1.7.21/dlls/advapi32/tests/security.c wine1.7-1.7.24/dlls/advapi32/tests/security.c --- wine1.7-1.7.21/dlls/advapi32/tests/security.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/advapi32/tests/security.c 2014-08-08 20:19:29.000000000 +0000 @@ -208,6 +208,68 @@ myARGC = winetest_get_mainargs( &myARGV ); } +static SECURITY_DESCRIPTOR* test_get_security_descriptor(HANDLE handle, int line) +{ + /* use HeapFree(GetProcessHeap(), 0, sd); when done */ + DWORD ret, length, needed; + SECURITY_DESCRIPTOR *sd; + + needed = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + NULL, 0, &needed); + ok_(__FILE__, line)(!ret, "GetKernelObjectSecurity should fail\n"); + ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok_(__FILE__, line)(needed != 0xdeadbeef, "GetKernelObjectSecurity should return required buffer length\n"); + + length = needed; + sd = HeapAlloc(GetProcessHeap(), 0, length); + + needed = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + sd, length, &needed); + ok_(__FILE__, line)(ret, "GetKernelObjectSecurity error %d\n", GetLastError()); + ok_(__FILE__, line)(needed == length || needed == 0 /* file, pipe */, "GetKernelObjectSecurity should return %u instead of %u\n", length, needed); + return sd; +} + +static void test_owner_equal(HANDLE Handle, PSID expected, int line) +{ + BOOL res; + SECURITY_DESCRIPTOR *queriedSD = NULL; + PSID owner; + BOOL owner_defaulted; + + queriedSD = test_get_security_descriptor( Handle, line ); + + res = GetSecurityDescriptorOwner(queriedSD, &owner, &owner_defaulted); + ok_(__FILE__, line)(res, "GetSecurityDescriptorOwner failed with error %d\n", GetLastError()); + + ok_(__FILE__, line)(EqualSid(owner, expected), "Owner SIDs are not equal\n"); + ok_(__FILE__, line)(!owner_defaulted, "Defaulted is true\n"); + + HeapFree(GetProcessHeap(), 0, queriedSD); +} + +static void test_group_equal(HANDLE Handle, PSID expected, int line) +{ + BOOL res; + SECURITY_DESCRIPTOR *queriedSD = NULL; + PSID group; + BOOL group_defaulted; + + queriedSD = test_get_security_descriptor( Handle, line ); + + res = GetSecurityDescriptorGroup(queriedSD, &group, &group_defaulted); + ok_(__FILE__, line)(res, "GetSecurityDescriptorGroup failed with error %d\n", GetLastError()); + + ok_(__FILE__, line)(EqualSid(group, expected), "Group SIDs are not equal\n"); + ok_(__FILE__, line)(!group_defaulted, "Defaulted is true\n"); + + HeapFree(GetProcessHeap(), 0, queriedSD); +} + static void test_sid(void) { struct sidRef refs[] = { @@ -2478,6 +2540,8 @@ SECURITY_ATTRIBUTES psa; HANDLE token, event; DWORD size; + SID_IDENTIFIER_AUTHORITY SIDAuthWorld = { SECURITY_WORLD_SID_AUTHORITY }; + PSID EveryoneSid = NULL; Acl = HeapAlloc(GetProcessHeap(), 0, 256); res = InitializeAcl(Acl, 256, ACL_REVISION); @@ -2489,6 +2553,9 @@ } ok(res, "InitializeAcl failed with error %d\n", GetLastError()); + res = AllocateAndInitializeSid( &SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &EveryoneSid); + ok(res, "AllocateAndInitializeSid failed with error %d\n", GetLastError()); + /* get owner from the token we might be running as a user not admin */ res = OpenProcessToken( GetCurrentProcess(), MAXIMUM_ALLOWED, &token ); ok(res, "OpenProcessToken failed with error %d\n", GetLastError()); @@ -2547,7 +2614,7 @@ CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_INVALID_SECURITY_DESCR ); CHECK_SET_SECURITY( event, SACL_SECURITY_INFORMATION, ERROR_ACCESS_DENIED ); CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); - /* NULL DACL is valid and means default DACL from token */ + /* NULL DACL is valid and means that everyone has access */ SecurityDescriptor->Control |= SE_DACL_PRESENT; CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); @@ -2555,12 +2622,31 @@ res = SetSecurityDescriptorOwner(SecurityDescriptor, AdminSid, FALSE); ok(res, "SetSecurityDescriptorOwner failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, OWNER_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_owner_equal( event, AdminSid, __LINE__ ); + + res = SetSecurityDescriptorGroup(SecurityDescriptor, EveryoneSid, FALSE); + ok(res, "SetSecurityDescriptorGroup failed with error %d\n", GetLastError()); + CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, EveryoneSid, __LINE__ ); + + res = SetSecurityDescriptorDacl(SecurityDescriptor, TRUE, Acl, FALSE); + ok(res, "SetSecurityDescriptorDacl failed with error %d\n", GetLastError()); + CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); + /* setting a dacl should not change the owner or group */ + test_owner_equal( event, AdminSid, __LINE__ ); + test_group_equal( event, EveryoneSid, __LINE__ ); + + /* Test again with a different SID in case the previous SID also happens to + * be the one that is incorrectly replacing the group. */ res = SetSecurityDescriptorGroup(SecurityDescriptor, UsersSid, FALSE); ok(res, "SetSecurityDescriptorGroup failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, UsersSid, __LINE__ ); + res = SetSecurityDescriptorDacl(SecurityDescriptor, TRUE, Acl, FALSE); ok(res, "SetSecurityDescriptorDacl failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, UsersSid, __LINE__ ); sprintf(buffer, "%s tests/security.c test", myARGV[0]); memset(&startup, 0, sizeof(startup)); @@ -2579,6 +2665,7 @@ STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); winetest_wait_child_process( info.hProcess ); + FreeSid(EveryoneSid); CloseHandle( info.hProcess ); CloseHandle( info.hThread ); CloseHandle( event ); @@ -4432,29 +4519,12 @@ static void test_default_handle_security(HANDLE token, HANDLE handle, GENERIC_MAPPING *mapping) { - DWORD ret, length, needed, granted, priv_set_len; + DWORD ret, granted, priv_set_len; BOOL status; PRIVILEGE_SET priv_set; SECURITY_DESCRIPTOR *sd; - needed = 0xdeadbeef; - SetLastError(0xdeadbeef); - ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, - NULL, 0, &needed); - ok(!ret, "GetKernelObjectSecurity should fail\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(needed != 0xdeadbeef, "GetKernelObjectSecurity should return required buffer length\n"); - - length = needed; - sd = HeapAlloc(GetProcessHeap(), 0, length); - - needed = 0xdeadbeef; - SetLastError(0xdeadbeef); - ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, - sd, length, &needed); - ok(ret, "GetKernelObjectSecurity error %d\n", GetLastError()); - ok(needed == length || needed == 0 /* file, pipe */, "GetKernelObjectSecurity should return %u instead of %u\n", length, needed); - + sd = test_get_security_descriptor(handle, __LINE__); validate_default_security_descriptor(sd); priv_set_len = sizeof(priv_set); @@ -5341,7 +5411,7 @@ ret = GetSecurityDescriptorOwner( sd, &owner, &defaulted ); ok( ret, "error %u\n", GetLastError() ); ok( owner != (void *)0xdeadbeef, "owner not set\n" ); - todo_wine ok( !defaulted, "owner defaulted\n" ); + ok( !defaulted, "owner defaulted\n" ); dacl = (void *)0xdeadbeef; present = FALSE; @@ -5350,7 +5420,7 @@ ok( ret, "error %u\n", GetLastError() ); ok( present, "dacl not present\n" ); ok( dacl != (void *)0xdeadbeef, "dacl not set\n" ); - todo_wine ok( !defaulted, "dacl defaulted\n" ); + ok( !defaulted, "dacl defaulted\n" ); index = 0; found = FALSE; diff -Nru wine1.7-1.7.21/dlls/amstream/mediastreamfilter.c wine1.7-1.7.24/dlls/amstream/mediastreamfilter.c --- wine1.7-1.7.21/dlls/amstream/mediastreamfilter.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/amstream/mediastreamfilter.c 2014-08-08 20:19:29.000000000 +0000 @@ -238,7 +238,7 @@ static ULONG WINAPI MediaStreamFilterImpl_Release(IMediaStreamFilter *iface) { IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); - ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface); + ULONG ref = InterlockedDecrement(&This->filter.refCount); TRACE("(%p)->(): new ref = %u\n", iface, ref); @@ -250,6 +250,7 @@ IMediaStream_Release(This->streams[i]); IPin_Release(This->pins[i]); } + BaseFilter_Destroy(&This->filter); HeapFree(GetProcessHeap(), 0, This); } diff -Nru wine1.7-1.7.21/dlls/atl/atl_ax.c wine1.7-1.7.24/dlls/atl/atl_ax.c --- wine1.7-1.7.21/dlls/atl/atl_ax.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/atl/atl_ax.c 2014-08-08 20:19:29.000000000 +0000 @@ -1382,3 +1382,29 @@ FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); return 0; } + +#if _ATL_VER >= _ATL_VER_80 + +/*********************************************************************** + * AtlAxCreateControlLic [atl100.59] + * + */ +HRESULT WINAPI AtlAxCreateControlLic(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, BSTR lic) +{ + FIXME("(%s %p %p %p %s)\n", debugstr_w(lpTricsData), hwnd, stream, container, debugstr_w(lic)); + return E_NOTIMPL; +} + +/*********************************************************************** + * AtlAxCreateControlLicEx [atl100.60] + * + */ +HRESULT WINAPI AtlAxCreateControlLicEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, + IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink, BSTR lic) +{ + FIXME("(%s %p %p %p %p %s %p %s)\n", debugstr_w(lpTricsData), hwnd, stream, container, control, + debugstr_guid(iidSink), punkSink, debugstr_w(lic)); + return E_NOTIMPL; +} + +#endif diff -Nru wine1.7-1.7.21/dlls/atl100/atl100.spec wine1.7-1.7.24/dlls/atl100/atl100.spec --- wine1.7-1.7.21/dlls/atl100/atl100.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/atl100/atl100.spec 2014-08-08 20:19:29.000000000 +0000 @@ -40,8 +40,8 @@ 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) 56 stdcall AtlLoadTypeLib(long wstr ptr ptr) 58 stdcall AtlModuleAddTermFunc(ptr ptr long) -59 stub AtlAxCreateControlLic -60 stub AtlAxCreateControlLicEx +59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr) +60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr) 61 stdcall AtlCreateRegistrar(ptr) 62 stub AtlWinModuleRegisterClassExW 63 stub AtlWinModuleRegisterClassExA diff -Nru wine1.7-1.7.21/dlls/atl110/atl110.spec wine1.7-1.7.24/dlls/atl110/atl110.spec --- wine1.7-1.7.21/dlls/atl110/atl110.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/atl110/atl110.spec 2014-08-08 20:19:29.000000000 +0000 @@ -40,8 +40,8 @@ 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) 56 stdcall AtlLoadTypeLib(long wstr ptr ptr) 58 stdcall AtlModuleAddTermFunc(ptr ptr long) -59 stub AtlAxCreateControlLic -60 stub AtlAxCreateControlLicEx +59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr) +60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr) 61 stdcall AtlCreateRegistrar(ptr) 62 stub AtlWinModuleRegisterClassExW 63 stub AtlWinModuleRegisterClassExA diff -Nru wine1.7-1.7.21/dlls/atl80/atl80.spec wine1.7-1.7.24/dlls/atl80/atl80.spec --- wine1.7-1.7.21/dlls/atl80/atl80.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/atl80/atl80.spec 2014-08-08 20:19:29.000000000 +0000 @@ -43,8 +43,8 @@ 55 stub AtlUnRegisterTypeLib 56 stdcall AtlLoadTypeLib(long wstr ptr ptr) 58 stdcall AtlModuleAddTermFunc(ptr ptr long) -59 stub AtlAxCreateControlLic -60 stub AtlAxCreateControlLicEx +59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr) +60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr) 61 stdcall AtlCreateRegistrar(ptr) 62 stub AtlWinModuleRegisterClassExW 63 stub AtlWinModuleRegisterClassExA diff -Nru wine1.7-1.7.21/dlls/atl90/atl90.spec wine1.7-1.7.24/dlls/atl90/atl90.spec --- wine1.7-1.7.21/dlls/atl90/atl90.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/atl90/atl90.spec 2014-08-08 20:19:29.000000000 +0000 @@ -40,8 +40,8 @@ 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) 56 stdcall AtlLoadTypeLib(long wstr ptr ptr) 58 stdcall AtlModuleAddTermFunc(ptr ptr long) -59 stub AtlAxCreateControlLic -60 stub AtlAxCreateControlLicEx +59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr) +60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr) 61 stdcall AtlCreateRegistrar(ptr) 62 stub AtlWinModuleRegisterClassExW 63 stub AtlWinModuleRegisterClassExA diff -Nru wine1.7-1.7.21/dlls/comctl32/pager.c wine1.7-1.7.24/dlls/comctl32/pager.c --- wine1.7-1.7.21/dlls/comctl32/pager.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comctl32/pager.c 2014-08-08 20:19:29.000000000 +0000 @@ -985,16 +985,17 @@ { POINT pt, ptorig; HWND parent; + LRESULT ret; pt.x = 0; pt.y = 0; parent = GetParent(infoPtr->hwndSelf); MapWindowPoints(infoPtr->hwndSelf, parent, &pt, 1); OffsetWindowOrgEx (hdc, pt.x, pt.y, &ptorig); - SendMessageW (parent, WM_ERASEBKGND, (WPARAM)hdc, 0); + ret = SendMessageW (parent, WM_ERASEBKGND, (WPARAM)hdc, 0); SetWindowOrgEx (hdc, ptorig.x, ptorig.y, 0); - return 0; + return ret; } diff -Nru wine1.7-1.7.21/dlls/comctl32/toolbar.c wine1.7-1.7.24/dlls/comctl32/toolbar.c --- wine1.7-1.7.21/dlls/comctl32/toolbar.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comctl32/toolbar.c 2014-08-08 20:19:29.000000000 +0000 @@ -748,10 +748,10 @@ /* draws a blank frame for a toolbar button */ static void -TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag) +TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, const RECT *rect, DWORD dwItemCDFlag) { HDC hdc = tbcd->nmcd.hdc; - RECT rc = tbcd->nmcd.rc; + RECT rc = *rect; /* if the state is disabled or indeterminate then the button * cannot have an interactive look like pressed or hot */ BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) || @@ -954,7 +954,7 @@ tbcd.rcText.bottom = rcText.bottom - rc.top; tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr); tbcd.nmcd.hdc = hdc; - tbcd.nmcd.rc = rc; + tbcd.nmcd.rc = btnPtr->rect; tbcd.hbrMonoDither = COMCTL32_hPattern55AABrush; /* FIXME: what are these used for? */ @@ -972,7 +972,7 @@ ntfret = TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW); /* reset these fields so the user can't alter the behaviour like native */ tbcd.nmcd.hdc = hdc; - tbcd.nmcd.rc = rc; + tbcd.nmcd.rc = btnPtr->rect; dwItemCustDraw = ntfret & 0xffff; dwItemCDFlag = ntfret & 0xffff0000; @@ -1021,10 +1021,10 @@ || (drawSepDropDownArrow && btnPtr->bDropDownPressed)) stateId = TS_HOT; - DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL); + DrawThemeBackground (theme, hdc, partId, stateId, &rc, NULL); } else - TOOLBAR_DrawFrame(infoPtr, &tbcd, dwItemCDFlag); + TOOLBAR_DrawFrame(infoPtr, &tbcd, &rc, dwItemCDFlag); if (drawSepDropDownArrow) { diff -Nru wine1.7-1.7.21/dlls/comdlg32/cdlg.h wine1.7-1.7.24/dlls/comdlg32/cdlg.h --- wine1.7-1.7.21/dlls/comdlg32/cdlg.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comdlg32/cdlg.h 2014-08-08 20:19:29.000000000 +0000 @@ -176,6 +176,7 @@ #define IDS_SAVE 1203 #define IDS_SAVE_AS 1204 #define IDS_OPEN_FILE 1205 +#define IDS_SELECT_FOLDER 1206 #define IDS_FAKEDOCTEXT 1300 diff -Nru wine1.7-1.7.21/dlls/comdlg32/comdlg32.rc wine1.7-1.7.24/dlls/comdlg32/comdlg32.rc --- wine1.7-1.7.21/dlls/comdlg32/comdlg32.rc 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comdlg32/comdlg32.rc 2014-08-08 20:19:29.000000000 +0000 @@ -36,6 +36,7 @@ IDS_INVALID_FILENAME "A filename cannot contain any of the following characters:\n / : < > |" IDS_PATHNOTEXISTING "Path does not exist" IDS_FILENOTEXISTING "File does not exist" + IDS_INVALID_FOLDERNAME "The selection contains a non-folder object" } STRINGTABLE @@ -142,6 +143,7 @@ IDS_SAVE "Save" IDS_SAVE_AS "Save As" IDS_OPEN_FILE "Open File" + IDS_SELECT_FOLDER "Select Folder" } /* diff -Nru wine1.7-1.7.21/dlls/comdlg32/filedlgbrowser.h wine1.7-1.7.24/dlls/comdlg32/filedlgbrowser.h --- wine1.7-1.7.21/dlls/comdlg32/filedlgbrowser.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comdlg32/filedlgbrowser.h 2014-08-08 20:19:29.000000000 +0000 @@ -105,6 +105,7 @@ #define IDS_INVALID_FILENAME 121 #define IDS_PATHNOTEXISTING 122 #define IDS_FILENOTEXISTING 123 +#define IDS_INVALID_FOLDERNAME 124 /* File Dialog Tooltips string IDs */ diff -Nru wine1.7-1.7.21/dlls/comdlg32/itemdlg.c wine1.7-1.7.24/dlls/comdlg32/itemdlg.c --- wine1.7-1.7.21/dlls/comdlg32/itemdlg.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/comdlg32/itemdlg.c 2014-08-08 20:19:29.000000000 +0000 @@ -346,8 +346,10 @@ UINT attr; hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER, &attr); - if(SUCCEEDED(hr) && (attr & SFGAO_FOLDER)) - continue; /* FIXME: FOS_PICKFOLDERS */ + if(SUCCEEDED(hr) && + (( (This->options & FOS_PICKFOLDERS) && !(attr & SFGAO_FOLDER)) || + (!(This->options & FOS_PICKFOLDERS) && (attr & SFGAO_FOLDER)))) + continue; hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &names[valid_count]); if(SUCCEEDED(hr)) @@ -536,21 +538,42 @@ break; case ONOPEN_OPEN: - if(events_OnFileOk(This) != S_OK) - break; - hr = SHGetDesktopFolder(&psf_desktop); if(SUCCEEDED(hr)) { if(This->psia_results) + { IShellItemArray_Release(This->psia_results); + This->psia_results = NULL; + } hr = SHCreateShellItemArray(NULL, psf_desktop, file_count, (PCUITEMID_CHILD_ARRAY)pidla, &This->psia_results); - if(SUCCEEDED(hr)) - ret = S_OK; IShellFolder_Release(psf_desktop); + + if(FAILED(hr)) + break; + + if(This->options & FOS_PICKFOLDERS) + { + SFGAOF attributes; + hr = IShellItemArray_GetAttributes(This->psia_results, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &attributes); + if(hr != S_OK) + { + WCHAR buf[64]; + LoadStringW(COMDLG32_hInstance, IDS_INVALID_FOLDERNAME, buf, sizeof(buf)/sizeof(WCHAR)); + + MessageBoxW(This->dlg_hwnd, buf, This->custom_title, MB_OK | MB_ICONEXCLAMATION); + + IShellItemArray_Release(This->psia_results); + This->psia_results = NULL; + break; + } + } + + if(events_OnFileOk(This) == S_OK) + ret = S_OK; } break; @@ -1817,6 +1840,13 @@ FileDialogImpl *This = impl_from_IFileDialog2(iface); TRACE("%p (0x%x)\n", This, fos); + if( !(This->options & FOS_PICKFOLDERS) && (fos & FOS_PICKFOLDERS) ) + { + WCHAR buf[30]; + LoadStringW(COMDLG32_hInstance, IDS_SELECT_FOLDER, buf, sizeof(buf)/sizeof(WCHAR)); + IFileDialog2_SetTitle(iface, buf); + } + This->options = fos; return S_OK; @@ -2848,7 +2878,7 @@ ULONG attr; TRACE("%p (%p, %p)\n", This, shv, pidl); - if(!This->filterspec_count) + if(!This->filterspec_count && !(This->options & FOS_PICKFOLDERS)) return S_OK; hr = SHGetIDListFromObject((IUnknown*)shv, &parent_pidl); @@ -2872,6 +2902,12 @@ return S_OK; } + if((This->options & FOS_PICKFOLDERS) && !(attr & (SFGAO_FOLDER | SFGAO_LINK))) + { + IShellItem_Release(psi); + return S_FALSE; + } + hr = S_OK; if(SUCCEEDED(IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &filename))) { diff -Nru wine1.7-1.7.21/dlls/crypt32/cert.c wine1.7-1.7.24/dlls/crypt32/cert.c --- wine1.7-1.7.21/dlls/crypt32/cert.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/cert.c 2014-08-08 20:19:29.000000000 +0000 @@ -1883,6 +1883,12 @@ CertFreeCertificateContext(ret); ret = NULL; } + if (CRYPT_IsCertificateSelfSigned(pSubjectContext)) + { + CertFreeCertificateContext(ret); + ret = NULL; + SetLastError(CRYPT_E_SELF_SIGNED); + } } TRACE("returning %p\n", ret); return ret; diff -Nru wine1.7-1.7.21/dlls/crypt32/chain.c wine1.7-1.7.24/dlls/crypt32/chain.c --- wine1.7-1.7.21/dlls/crypt32/chain.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/chain.c 2014-08-08 20:19:29.000000000 +0000 @@ -265,7 +265,7 @@ LONG ref; } CertificateChain; -static BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) +BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) { PCERT_EXTENSION ext; DWORD size; diff -Nru wine1.7-1.7.21/dlls/crypt32/crypt32_private.h wine1.7-1.7.24/dlls/crypt32/crypt32_private.h --- wine1.7-1.7.21/dlls/crypt32/crypt32_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/crypt32_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -337,6 +337,7 @@ WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; WINECRYPT_CERTSTORE *CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags) DECLSPEC_HIDDEN; +BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) DECLSPEC_HIDDEN; /* Allocates and initializes a certificate chain engine, but without creating * the root store. Instead, it uses root, and assumes the caller has done any diff -Nru wine1.7-1.7.21/dlls/crypt32/str.c wine1.7-1.7.24/dlls/crypt32/str.c --- wine1.7-1.7.21/dlls/crypt32/str.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/str.c 2014-08-08 20:19:29.000000000 +0000 @@ -840,13 +840,14 @@ /* Assumes separators are characters in the 0-255 range */ static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators, - struct X500TokenW *token, LPCWSTR *ppszError) + WCHAR *separator_used, struct X500TokenW *token, LPCWSTR *ppszError) { BOOL ret = TRUE; TRACE("(%s, %s, %p, %p)\n", debugstr_w(str), debugstr_w(separators), token, ppszError); + *separator_used = 0; while (*str && isspaceW(*str)) str++; if (*str) @@ -886,6 +887,7 @@ while (*str && (*str >= 0xff || !map[*str])) str++; token->end = str; + if (map[*str]) *separator_used = *str; } } else @@ -1077,6 +1079,7 @@ static const WCHAR allSepsWithoutPlus[] = { ',',';','\r','\n',0 }; static const WCHAR allSeps[] = { '+',',',';','\r','\n',0 }; LPCWSTR sep; + WCHAR sep_used; str++; if (dwStrType & CERT_NAME_STR_COMMA_FLAG) @@ -1089,11 +1092,14 @@ sep = allSepsWithoutPlus; else sep = allSeps; - ret = CRYPT_GetNextValueW(str, dwStrType, sep, &token, + ret = CRYPT_GetNextValueW(str, dwStrType, sep, &sep_used, &token, ppszError); if (ret) { str = token.end; + /* if token.end points to the separator, skip it */ + if (str && sep_used && *str == sep_used) str++; + ret = CRYPT_ValueToRDN(dwCertEncodingType, &info, keyOID, &token, dwStrType, ppszError); } diff -Nru wine1.7-1.7.21/dlls/crypt32/tests/cert.c wine1.7-1.7.24/dlls/crypt32/tests/cert.c --- wine1.7-1.7.21/dlls/crypt32/tests/cert.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/tests/cert.c 2014-08-08 20:19:29.000000000 +0000 @@ -1564,8 +1564,12 @@ static void testGetIssuerCert(void) { BOOL ret; - PCCERT_CONTEXT parent, child, cert1, cert2; - DWORD flags = 0xffffffff; + PCCERT_CONTEXT parent, child, cert1, cert2, cert3; + DWORD flags = 0xffffffff, size; + CERT_NAME_BLOB certsubject; + BYTE *certencoded; + WCHAR rootW[] = {'R', 'O', 'O', 'T', '\0'}, + certname[] = {'C', 'N', '=', 'd', 'u', 'm', 'm', 'y', ',', ' ', 'T', '=', 'T', 'e', 's', 't', '\0'}; HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); @@ -1640,6 +1644,7 @@ ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError()); parent = CertGetIssuerCertificateFromStore(store, child, NULL, &flags); ok(parent == NULL, "Expected no issuer\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); /* Adding an issuer allows one (and only one) issuer to be found */ ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, chain10_1, sizeof(chain10_1), CERT_STORE_ADD_ALWAYS, &cert1); @@ -1648,6 +1653,7 @@ ok(parent == cert1, "Expected cert1 to be the issuer\n"); parent = CertGetIssuerCertificateFromStore(store, child, parent, &flags); ok(parent == NULL, "Expected only one issuer\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); /* Adding a second issuer allows two issuers to be found - and the second * issuer is found before the first, implying certs are added to the head * of a list. @@ -1661,6 +1667,7 @@ ok(parent == cert1, "Expected cert1 to be the second issuer\n"); parent = CertGetIssuerCertificateFromStore(store, child, parent, &flags); ok(parent == NULL, "Expected no more than two issuers\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); CertFreeCertificateContext(child); CertFreeCertificateContext(cert1); CertFreeCertificateContext(cert2); @@ -1677,6 +1684,7 @@ ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError()); parent = CertGetIssuerCertificateFromStore(store, child, NULL, &flags); ok(parent == NULL, "Expected no issuer\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); /* Adding an issuer allows one (and only one) issuer to be found */ ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, chain10_0, sizeof(chain10_0), CERT_STORE_ADD_ALWAYS, &cert1); @@ -1685,6 +1693,7 @@ ok(parent == cert1, "Expected cert1 to be the issuer\n"); parent = CertGetIssuerCertificateFromStore(store, child, parent, &flags); ok(parent == NULL, "Expected only one issuer\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); /* Adding a second issuer allows two issuers to be found - and the second * issuer is found before the first, implying certs are added to the head * of a list. @@ -1698,10 +1707,48 @@ ok(parent == cert1, "Expected cert1 to be the second issuer\n"); parent = CertGetIssuerCertificateFromStore(store, child, parent, &flags); ok(parent == NULL, "Expected no more than two issuers\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, "Expected CRYPT_E_NOT_FOUND, got %08X\n", GetLastError()); + + /* Self-sign a certificate, add to the store and test getting the issuer */ + size = 0; + ok(CertStrToNameW(X509_ASN_ENCODING, certname, CERT_X500_NAME_STR, NULL, NULL, &size, NULL), + "CertStrToName should have worked\n"); + certencoded = HeapAlloc(GetProcessHeap(), 0, size); + ok(CertStrToNameW(X509_ASN_ENCODING, certname, CERT_X500_NAME_STR, NULL, certencoded, &size, NULL), + "CertStrToName should have worked\n"); + certsubject.pbData = certencoded; + certsubject.cbData = size; + cert3 = CertCreateSelfSignCertificate(0, &certsubject, 0, NULL, NULL, NULL, NULL, NULL); + ok(cert3 != NULL, "CertCreateSelfSignCertificate should have worked\n"); + ret = CertAddCertificateContextToStore(store, cert3, CERT_STORE_ADD_REPLACE_EXISTING, 0); + ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError()); + CertFreeCertificateContext(cert3); + cert3 = CertEnumCertificatesInStore(store, NULL); + ok(cert3 != NULL, "CertEnumCertificatesInStore should have worked\n"); + SetLastError(0xdeadbeef); + flags = 0; + parent = CertGetIssuerCertificateFromStore(store, cert3, NULL, &flags); + ok(!parent, "Expected NULL\n"); + ok(GetLastError() == CRYPT_E_SELF_SIGNED, + "Expected CRYPT_E_SELF_SIGNED, got %08X\n", GetLastError()); CertFreeCertificateContext(child); CertFreeCertificateContext(cert1); CertFreeCertificateContext(cert2); CertCloseStore(store, 0); + HeapFree(GetProcessHeap(), 0, certencoded); + + /* Test root storage self-signed certificate */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, rootW); + ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); + flags = 0; + cert1 = CertEnumCertificatesInStore(store, NULL); + ok(cert1 != NULL, "CertEnumCertificatesInStore should have worked\n"); + SetLastError(0xdeadbeef); + parent = CertGetIssuerCertificateFromStore(store, cert1, NULL, &flags); + ok(!parent, "Expected NULL\n"); + ok(GetLastError() == CRYPT_E_SELF_SIGNED, + "Expected CRYPT_E_SELF_SIGNED, got %08X\n", GetLastError()); + CertCloseStore(store, 0); } static void testCryptHashCert(void) diff -Nru wine1.7-1.7.21/dlls/crypt32/tests/str.c wine1.7-1.7.24/dlls/crypt32/tests/str.c --- wine1.7-1.7.21/dlls/crypt32/tests/str.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/crypt32/tests/str.c 2014-08-08 20:19:29.000000000 +0000 @@ -450,6 +450,15 @@ static BYTE encodedNewlineCN[] = { 0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03,0x55,0x04,0x03,0x1e,0x06,0x00,0x61, 0x00,0x0a,0x00,0x62 }; +static BYTE encodedDummyCN[] = { +0x30,0x1F,0x31,0x0E,0x30,0x0C,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x64,0x75, +0x6D,0x6D,0x79,0x31,0x0D,0x30,0x0B,0x06,0x03,0x55,0x04,0x0C,0x13,0x04,0x74, +0x65,0x73,0x74 }; +static BYTE encodedFields[] = { +0x30,0x2F,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x03,0x13,0x09,0x57,0x69, +0x6E,0x65,0x20,0x54,0x65,0x73,0x74,0x31,0x0C,0x30,0x0A,0x06,0x03,0x55,0x04, +0x0C,0x13,0x03,0x31,0x32,0x33,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, +0x13,0x02,0x42,0x52 }; static void test_CertNameToStrA(void) { @@ -756,6 +765,8 @@ { "CN=\">\"", sizeof(encodedGreaterThanCN), encodedGreaterThanCN }, { "CN=\"#\"", sizeof(encodedHashCN), encodedHashCN }, { "CN=\";\"", sizeof(encodedSemiCN), encodedSemiCN }, + { "CN=dummy,T=test", sizeof(encodedDummyCN), encodedDummyCN }, + { " CN = Wine Test,T = 123, C = BR", sizeof(encodedFields), encodedFields }, }; static void test_CertStrToNameA(void) @@ -849,6 +860,10 @@ static const WCHAR simpleCN2_W[] = { 'C','N','=','"','1','"',0 }; static const WCHAR simpleCN3_W[] = { 'C','N',' ','=',' ','"','1','"',0 }; static const WCHAR japaneseCN_W[] = { 'C','N','=',0x226f,0x575b,0 }; +static const WCHAR dummyCN_W[] = { 'C','N','=','d','u','m','m','y',',','T','=','t','e','s','t',0 }; +static const WCHAR encodedFields_W[] = { ' ','C','N',' ','=',' ',' ',' ','W','i','n','e',' ','T', + 'e','s','t',',','T',' ','=',' ','1','2','3',',',' ','C', + ' ','=',' ','B','R',0 }; static const BYTE encodedJapaneseCN[] = { 0x30,0x0f,0x31,0x0d,0x30,0x0b,0x06, 0x03,0x55,0x04,0x03,0x1e,0x04,0x22,0x6f,0x57,0x5b }; @@ -867,6 +882,8 @@ { greaterThanCN_W, sizeof(encodedGreaterThanCN), encodedGreaterThanCN }, { hashCN_W, sizeof(encodedHashCN), encodedHashCN }, { semiCN_W, sizeof(encodedSemiCN), encodedSemiCN }, + { dummyCN_W, sizeof(encodedDummyCN), encodedDummyCN }, + { encodedFields_W, sizeof(encodedFields), encodedFields }, }; static void test_CertStrToNameW(void) @@ -922,7 +939,7 @@ size); if (ret) ok(!memcmp(buf, namesW[i].encoded, size), - "Index %d: unexpected value\n", i); + "Index %d: unexpected value for string %s\n", i, wine_dbgstr_w(namesW[i].x500)); } } diff -Nru wine1.7-1.7.21/dlls/cryptnet/cryptnet_main.c wine1.7-1.7.24/dlls/cryptnet/cryptnet_main.c --- wine1.7-1.7.21/dlls/cryptnet/cryptnet_main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/cryptnet/cryptnet_main.c 2014-08-08 20:19:29.000000000 +0000 @@ -1553,7 +1553,8 @@ endTime = timeout = 0; if (!ret) error = GetLastError(); - for (j = 0; !error && j < urlArray->cUrl; j++) + /* continue looping if one was offline; break if revoked or timed out */ + for (j = 0; (!error || error == CRYPT_E_REVOCATION_OFFLINE) && j < urlArray->cUrl; j++) { PCCRL_CONTEXT crl; diff -Nru wine1.7-1.7.21/dlls/d2d1/d2d1_private.h wine1.7-1.7.24/dlls/d2d1/d2d1_private.h --- wine1.7-1.7.21/dlls/d2d1/d2d1_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/d2d1_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -28,6 +28,8 @@ { ID2D1RenderTarget ID2D1RenderTarget_iface; LONG refcount; + + D2D1_MATRIX_3X2_F transform; }; void d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory, @@ -55,4 +57,13 @@ const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient) DECLSPEC_HIDDEN; +struct d2d_stroke_style +{ + ID2D1StrokeStyle ID2D1StrokeStyle_iface; + LONG refcount; +}; + +void d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory, + const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count) DECLSPEC_HIDDEN; + #endif /* __WINE_D2D1_PRIVATE_H */ diff -Nru wine1.7-1.7.21/dlls/d2d1/d2d1.spec wine1.7-1.7.24/dlls/d2d1/d2d1.spec --- wine1.7-1.7.21/dlls/d2d1/d2d1.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/d2d1.spec 2014-08-08 20:19:29.000000000 +0000 @@ -1,5 +1,5 @@ @ stdcall D2D1CreateFactory(long ptr ptr ptr) -@ stub D2D1MakeRotateMatrix +@ stdcall D2D1MakeRotateMatrix(float float float ptr) @ stub D2D1MakeSkewMatrix @ stub D2D1IsMatrixInvertible @ stub D2D1InvertMatrix diff -Nru wine1.7-1.7.21/dlls/d2d1/factory.c wine1.7-1.7.24/dlls/d2d1/factory.c --- wine1.7-1.7.21/dlls/d2d1/factory.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/factory.c 2014-08-08 20:19:29.000000000 +0000 @@ -144,10 +144,20 @@ const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count, ID2D1StrokeStyle **stroke_style) { - FIXME("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p stub!\n", + struct d2d_stroke_style *object; + + TRACE("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p.\n", iface, desc, dashes, dash_count, stroke_style); - return E_NOTIMPL; + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + d2d_stroke_style_init(object, iface, desc, dashes, dash_count); + + TRACE("Created stroke style %p.\n", object); + *stroke_style = &object->ID2D1StrokeStyle_iface; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factory *iface, @@ -254,3 +264,22 @@ return hr; } + +void WINAPI D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix) +{ + float theta, sin_theta, cos_theta; + + TRACE("angle %.8e, center {%.8e, %.8e}, matrix %p.\n", angle, center.x, center.y, matrix); + + theta = angle * (M_PI / 180.0f); + sin_theta = sinf(theta); + cos_theta = cosf(theta); + + /* translate(center) * rotate(theta) * translate(-center) */ + matrix->_11 = cos_theta; + matrix->_12 = sin_theta; + matrix->_21 = -sin_theta; + matrix->_22 = cos_theta; + matrix->_31 = center.x - center.x * cos_theta + center.y * sin_theta; + matrix->_32 = center.y - center.x * sin_theta - center.y * cos_theta; +} diff -Nru wine1.7-1.7.21/dlls/d2d1/Makefile.in wine1.7-1.7.24/dlls/d2d1/Makefile.in --- wine1.7-1.7.21/dlls/d2d1/Makefile.in 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/Makefile.in 2014-08-08 20:19:29.000000000 +0000 @@ -5,6 +5,7 @@ C_SRCS = \ brush.c \ factory.c \ - render_target.c + render_target.c \ + stroke.c RC_SRCS = version.rc diff -Nru wine1.7-1.7.21/dlls/d2d1/render_target.c wine1.7-1.7.24/dlls/d2d1/render_target.c --- wine1.7-1.7.21/dlls/d2d1/render_target.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/render_target.c 2014-08-08 20:19:29.000000000 +0000 @@ -316,13 +316,21 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTransform(ID2D1RenderTarget *iface, const D2D1_MATRIX_3X2_F *transform) { - FIXME("iface %p, transform %p stub!\n", iface, transform); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + + TRACE("iface %p, transform %p.\n", iface, transform); + + render_target->transform = *transform; } static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTransform(ID2D1RenderTarget *iface, D2D1_MATRIX_3X2_F *transform) { - FIXME("iface %p, transform %p stub!\n", iface, transform); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + + TRACE("iface %p, transform %p.\n", iface, transform); + + *transform = render_target->transform; } static void STDMETHODCALLTYPE d2d_d3d_render_target_SetAntialiasMode(ID2D1RenderTarget *iface, @@ -556,8 +564,17 @@ void d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory, IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) { + static const D2D1_MATRIX_3X2_F identity = + { + 1.0f, 0.0f, + 0.0f, 1.0f, + 0.0f, 0.0f, + }; + FIXME("Ignoring render target properties.\n"); render_target->ID2D1RenderTarget_iface.lpVtbl = &d2d_d3d_render_target_vtbl; render_target->refcount = 1; + + render_target->transform = identity; } diff -Nru wine1.7-1.7.21/dlls/d2d1/stroke.c wine1.7-1.7.24/dlls/d2d1/stroke.c --- wine1.7-1.7.21/dlls/d2d1/stroke.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.24/dlls/d2d1/stroke.c 2014-08-08 20:19:29.000000000 +0000 @@ -0,0 +1,165 @@ +/* + * Copyright 2014 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_stroke_style *impl_from_ID2D1StrokeStyle(ID2D1StrokeStyle *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_stroke_style, ID2D1StrokeStyle_iface); +} + +static HRESULT STDMETHODCALLTYPE d2d_stroke_style_QueryInterface(ID2D1StrokeStyle *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID2D1StrokeStyle) + || IsEqualGUID(iid, &IID_ID2D1Resource) + || IsEqualGUID(iid, &IID_IUnknown)) + { + ID2D1StrokeStyle_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_stroke_style_AddRef(ID2D1StrokeStyle *iface) +{ + struct d2d_stroke_style *style = impl_from_ID2D1StrokeStyle(iface); + ULONG refcount = InterlockedIncrement(&style->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d2d_stroke_style_Release(ID2D1StrokeStyle *iface) +{ + struct d2d_stroke_style *style = impl_from_ID2D1StrokeStyle(iface); + ULONG refcount = InterlockedDecrement(&style->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, style); + + return refcount; +} + +static void STDMETHODCALLTYPE d2d_stroke_style_GetFactory(ID2D1StrokeStyle *iface, ID2D1Factory **factory) +{ + FIXME("iface %p, factory %p stub!\n", iface, factory); + + *factory = NULL; +} + +static D2D1_CAP_STYLE STDMETHODCALLTYPE d2d_stroke_style_GetStartCap(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_CAP_STYLE_FLAT; +} + +static D2D1_CAP_STYLE STDMETHODCALLTYPE d2d_stroke_style_GetEndCap(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_CAP_STYLE_FLAT; +} + +static D2D1_CAP_STYLE STDMETHODCALLTYPE d2d_stroke_style_GetDashCap(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_CAP_STYLE_FLAT; +} + +static float STDMETHODCALLTYPE d2d_stroke_style_GetMiterLimit(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0.0f; +} + +static D2D1_LINE_JOIN STDMETHODCALLTYPE d2d_stroke_style_GetLineJoin(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_LINE_JOIN_MITER; +} + +static float STDMETHODCALLTYPE d2d_stroke_style_GetDashOffset(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0.0f; +} + +static D2D1_DASH_STYLE STDMETHODCALLTYPE d2d_stroke_style_GetDashStyle(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_DASH_STYLE_SOLID; +} + +static UINT32 STDMETHODCALLTYPE d2d_stroke_style_GetDashesCount(ID2D1StrokeStyle *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static void STDMETHODCALLTYPE d2d_stroke_style_GetDashes(ID2D1StrokeStyle *iface, float *dashes, UINT32 count) +{ + FIXME("iface %p, dashes %p, count %u stub!\n", iface, dashes, count); +} + +static const struct ID2D1StrokeStyleVtbl d2d_stroke_style_vtbl = +{ + d2d_stroke_style_QueryInterface, + d2d_stroke_style_AddRef, + d2d_stroke_style_Release, + d2d_stroke_style_GetFactory, + d2d_stroke_style_GetStartCap, + d2d_stroke_style_GetEndCap, + d2d_stroke_style_GetDashCap, + d2d_stroke_style_GetMiterLimit, + d2d_stroke_style_GetLineJoin, + d2d_stroke_style_GetDashOffset, + d2d_stroke_style_GetDashStyle, + d2d_stroke_style_GetDashesCount, + d2d_stroke_style_GetDashes, +}; + +void d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory, + const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count) +{ + FIXME("Ignoring stroke style properties.\n"); + + style->ID2D1StrokeStyle_iface.lpVtbl = &d2d_stroke_style_vtbl; + style->refcount = 1; +} diff -Nru wine1.7-1.7.21/dlls/d3d10core/d3d10core_private.h wine1.7-1.7.24/dlls/d3d10core/d3d10core_private.h --- wine1.7-1.7.21/dlls/d3d10core/d3d10core_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d10core/d3d10core_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -60,6 +60,7 @@ DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN; enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN; DWORD wined3d_usage_from_d3d10core(UINT bind_flags, enum D3D10_USAGE usage) DECLSPEC_HIDDEN; +struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN; static inline void read_dword(const char **ptr, DWORD *d) { @@ -86,6 +87,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_device *device, const D3D10_TEXTURE2D_DESC *desc) DECLSPEC_HIDDEN; +struct d3d10_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) DECLSPEC_HIDDEN; /* ID3D10Texture3D */ struct d3d10_texture3d diff -Nru wine1.7-1.7.21/dlls/d3d10core/device.c wine1.7-1.7.24/dlls/d3d10core/device.c --- wine1.7-1.7.21/dlls/d3d10core/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d10core/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -514,7 +514,14 @@ static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, ID3D10Resource *dst_resource, ID3D10Resource *src_resource) { - FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource); + struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; + struct d3d10_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, dst_resource %p, src_resource %p.\n", iface, dst_resource, src_resource); + + wined3d_dst_resource = wined3d_resource_from_resource(dst_resource); + wined3d_src_resource = wined3d_resource_from_resource(src_resource); + wined3d_device_copy_resource(device->wined3d_device, wined3d_dst_resource, wined3d_src_resource); } static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device1 *iface, diff -Nru wine1.7-1.7.21/dlls/d3d10core/texture.c wine1.7-1.7.24/dlls/d3d10core/texture.c --- wine1.7-1.7.21/dlls/d3d10core/texture.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d10core/texture.c 2014-08-08 20:19:29.000000000 +0000 @@ -236,6 +236,14 @@ d3d10_texture2d_GetDesc, }; +struct d3d10_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d10_texture2d_vtbl); + return CONTAINING_RECORD(iface, struct d3d10_texture2d, ID3D10Texture2D_iface); +} + static const struct wined3d_parent_ops d3d10_texture2d_wined3d_parent_ops = { d3d10_texture2d_wined3d_object_released, @@ -253,6 +261,7 @@ if (desc->MipLevels == 1 && desc->ArraySize == 1) { + DXGI_SURFACE_DESC surface_desc; IWineDXGIDevice *wine_device; if (FAILED(hr = ID3D10Device1_QueryInterface(&device->ID3D10Device1_iface, &IID_IWineDXGIDevice, @@ -262,7 +271,12 @@ return E_FAIL; } - hr = IWineDXGIDevice_create_surface(wine_device, NULL, 0, NULL, + surface_desc.Width = desc->Width; + surface_desc.Height = desc->Height; + surface_desc.Format = desc->Format; + surface_desc.SampleDesc = desc->SampleDesc; + + hr = IWineDXGIDevice_create_surface(wine_device, &surface_desc, 0, NULL, (IUnknown *)&texture->ID3D10Texture2D_iface, (void **)&texture->dxgi_surface); IWineDXGIDevice_Release(wine_device); if (FAILED(hr)) diff -Nru wine1.7-1.7.21/dlls/d3d10core/utils.c wine1.7-1.7.24/dlls/d3d10core/utils.c --- wine1.7-1.7.21/dlls/d3d10core/utils.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d10core/utils.c 2014-08-08 20:19:29.000000000 +0000 @@ -367,6 +367,28 @@ return wined3d_usage; } +struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *resource) +{ + D3D10_RESOURCE_DIMENSION dimension; + + ID3D10Resource_GetType(resource, &dimension); + + switch (dimension) + { + case D3D10_RESOURCE_DIMENSION_BUFFER: + return wined3d_buffer_get_resource(unsafe_impl_from_ID3D10Buffer( + (ID3D10Buffer *)resource)->wined3d_buffer); + + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture2D( + (ID3D10Texture2D *)resource)->wined3d_texture); + + default: + FIXME("Unhandled resource dimension %#x.\n", dimension); + return NULL; + } +} + void skip_dword_unknown(const char **ptr, unsigned int count) { unsigned int i; diff -Nru wine1.7-1.7.21/dlls/d3d10core/view.c wine1.7-1.7.24/dlls/d3d10core/view.c --- wine1.7-1.7.21/dlls/d3d10core/view.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d10core/view.c 2014-08-08 20:19:29.000000000 +0000 @@ -25,26 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10core); -static struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *resource) -{ - D3D10_RESOURCE_DIMENSION dimension; - - ID3D10Resource_GetType(resource, &dimension); - - switch(dimension) - { - case D3D10_RESOURCE_DIMENSION_BUFFER: - return wined3d_buffer_get_resource(((struct d3d10_buffer *)resource)->wined3d_buffer); - - case D3D10_RESOURCE_DIMENSION_TEXTURE2D: - return wined3d_texture_get_resource(((struct d3d10_texture2d *)resource)->wined3d_texture); - - default: - FIXME("Unhandled resource dimension %#x.\n", dimension); - return NULL; - } -} - static HRESULT set_dsdesc_from_resource(D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10Resource *resource) { D3D10_RESOURCE_DIMENSION dimension; diff -Nru wine1.7-1.7.21/dlls/d3d8/buffer.c wine1.7-1.7.24/dlls/d3d8/buffer.c --- wine1.7-1.7.21/dlls/d3d8/buffer.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/buffer.c 2014-08-08 20:19:29.000000000 +0000 @@ -131,12 +131,14 @@ static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -145,12 +147,14 @@ static DWORD WINAPI d3d8_vertexbuffer_GetPriority(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; @@ -404,12 +408,14 @@ static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -418,12 +424,14 @@ static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; diff -Nru wine1.7-1.7.21/dlls/d3d8/d3d8_private.h wine1.7-1.7.24/dlls/d3d8/d3d8_private.h --- wine1.7-1.7.21/dlls/d3d8/d3d8_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/d3d8_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -144,6 +144,13 @@ struct d3d8_vertex_declaration *declaration; }; +enum d3d8_device_state +{ + D3D8_DEVICE_STATE_OK, + D3D8_DEVICE_STATE_LOST, + D3D8_DEVICE_STATE_NOT_RESET, +}; + struct d3d8_device { /* IUnknown fields */ @@ -166,14 +173,19 @@ UINT index_buffer_size; UINT index_buffer_pos; + LONG device_state; /* Avoids recursion with nested ReleaseRef to 0 */ BOOL inDestruction; - BOOL lost; }; HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN; +static inline struct d3d8_device *impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface) +{ + return CONTAINING_RECORD(iface, struct d3d8_device, IDirect3DDevice8_iface); +} + struct d3d8_resource { LONG refcount; diff -Nru wine1.7-1.7.21/dlls/d3d8/device.c wine1.7-1.7.24/dlls/d3d8/device.c --- wine1.7-1.7.21/dlls/d3d8/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -301,11 +301,6 @@ return entry->object; } -static inline struct d3d8_device *impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface) -{ - return CONTAINING_RECORD(iface, struct d3d8_device, IDirect3DDevice8_iface); -} - static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID riid, void **out) { TRACE("iface %p, riid %s, out %p.\n", @@ -388,13 +383,18 @@ TRACE("iface %p.\n", iface); - if (device->lost) + TRACE("device state: %#x.\n", device->device_state); + + switch (device->device_state) { - TRACE("Device is lost.\n"); - return D3DERR_DEVICENOTRESET; + default: + case D3D8_DEVICE_STATE_OK: + return D3D_OK; + case D3D8_DEVICE_STATE_LOST: + return D3DERR_DEVICELOST; + case D3D8_DEVICE_STATE_NOT_RESET: + return D3DERR_DEVICENOTRESET; } - - return D3D_OK; } static UINT WINAPI d3d8_device_GetAvailableTextureMem(IDirect3DDevice8 *iface) @@ -641,11 +641,11 @@ NULL, reset_enum_callback, TRUE))) { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); - device->lost = FALSE; + device->device_state = D3D8_DEVICE_STATE_OK; } else { - device->lost = TRUE; + device->device_state = D3D8_DEVICE_STATE_NOT_RESET; } wined3d_mutex_unlock(); @@ -661,6 +661,9 @@ TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); + if (device->device_state != D3D8_DEVICE_STATE_OK) + return D3DERR_DEVICELOST; + wined3d_mutex_lock(); hr = wined3d_device_present(device->wined3d_device, src_rect, dst_rect, dst_window_override, dirty_region, 0); @@ -2923,7 +2926,14 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate) { + struct d3d8_device *device = device_from_device_parent(device_parent); + TRACE("device_parent %p, activate %#x.\n", device_parent, activate); + + if (!activate) + InterlockedCompareExchange(&device->device_state, D3D8_DEVICE_STATE_LOST, D3D8_DEVICE_STATE_OK); + else + InterlockedCompareExchange(&device->device_state, D3D8_DEVICE_STATE_NOT_RESET, D3D8_DEVICE_STATE_LOST); } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, diff -Nru wine1.7-1.7.21/dlls/d3d8/swapchain.c wine1.7-1.7.24/dlls/d3d8/swapchain.c --- wine1.7-1.7.21/dlls/d3d8/swapchain.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/swapchain.c 2014-08-08 20:19:29.000000000 +0000 @@ -91,11 +91,15 @@ const RGNDATA *dirty_region) { struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface); + struct d3d8_device *device = impl_from_IDirect3DDevice8(swapchain->parent_device); HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); + if (device->device_state != D3D8_DEVICE_STATE_OK) + return D3DERR_DEVICELOST; + wined3d_mutex_lock(); hr = wined3d_swapchain_present(swapchain->wined3d_swapchain, src_rect, dst_rect, dst_window_override, dirty_region, 0); diff -Nru wine1.7-1.7.21/dlls/d3d8/tests/device.c wine1.7-1.7.24/dlls/d3d8/tests/device.c --- wine1.7-1.7.21/dlls/d3d8/tests/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/tests/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -1919,17 +1919,18 @@ HWND window; HRESULT hr; - struct nvertex + static const struct { - float x, y, z; - float nx, ny, nz; + struct vec3 position; + struct vec3 normal; DWORD diffuse; - } quad[] = + } + quad[] = { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, }; window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, @@ -6281,18 +6282,18 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirect3DDevice8_TestCooperativeLevel(device); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); ret = ShowWindow(window, SW_RESTORE); ok(ret, "Failed to restore window.\n"); ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirect3DDevice8_TestCooperativeLevel(device); - todo_wine ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, FALSE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -6336,6 +6337,95 @@ DestroyWindow(window); } +static void test_resource_priority(void) +{ + IDirect3DDevice8 *device; + IDirect3DTexture8 *texture; + IDirect3DVertexBuffer8 *buffer; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct + { + D3DPOOL pool; + const char *name; + BOOL can_set_priority; + } + test_data[] = + { + {D3DPOOL_DEFAULT, "D3DPOOL_DEFAULT", FALSE}, + {D3DPOOL_SYSTEMMEM, "D3DPOOL_SYSTEMMEM", FALSE}, + {D3DPOOL_MANAGED, "D3DPOOL_MANAGED", TRUE}, + {D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH", FALSE} + }; + unsigned int i; + DWORD priority; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); i++) + { + hr = IDirect3DDevice8_CreateTexture(device, 16, 16, 0, 0, D3DFMT_X8R8G8B8, + test_data[i].pool, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DTexture8_GetPriority(texture); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_SetPriority(texture, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_GetPriority(texture); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_SetPriority(texture, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DTexture8_Release(texture); + + if (test_data[i].pool != D3DPOOL_SCRATCH) + { + hr = IDirect3DDevice8_CreateVertexBuffer(device, 256, 0, 0, + test_data[i].pool, &buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DVertexBuffer8_GetPriority(buffer); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_SetPriority(buffer, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_GetPriority(buffer); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_SetPriority(buffer, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DVertexBuffer8_Release(buffer); + } + } + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" ); @@ -6422,6 +6512,7 @@ test_mipmap_lock(); test_writeonly_resource(); test_lost_device(); + test_resource_priority(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.21/dlls/d3d8/tests/visual.c wine1.7-1.7.24/dlls/d3d8/tests/visual.c --- wine1.7-1.7.21/dlls/d3d8/tests/visual.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/tests/visual.c 2014-08-08 20:19:29.000000000 +0000 @@ -133,25 +133,6 @@ return NULL; } -struct vertex -{ - float x, y, z; - DWORD diffuse; -}; - -struct tvertex -{ - float x, y, z, w; - DWORD diffuse; -}; - -struct nvertex -{ - float x, y, z; - float nx, ny, nz; - DWORD diffuse; -}; - static void test_sanity(void) { IDirect3DDevice8 *device; @@ -205,33 +186,44 @@ HWND window; HRESULT hr; - static const struct vertex unlitquad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, - }; - static const struct vertex litquad[] = + struct vec3 position; + DWORD diffuse; + } + unlitquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, - }; - static const struct nvertex unlitnquad[] = + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000}, + }, + litquad[] = { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + {{-1.0f, 0.0f, 0.1f}, 0xff00ff00}, + {{-1.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00}, }; - static const struct nvertex litnquad[] = + static const struct + { + struct vec3 position; + struct vec3 normal; + DWORD diffuse; + } + unlitnquad[] = + { + {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + }, + litnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, }; static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; static const D3DMATRIX mat = @@ -754,12 +746,17 @@ 0x00000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ 0x0000ffff }; - static struct vertex quad[] = + static struct { - {-1.0f, -1.0f, 0.0f, 0xffff0000}, - {-1.0f, 1.0f, 0.0f, 0xffff0000}, - { 1.0f, -1.0f, 0.0f, 0xffff0000}, - { 1.0f, 1.0f, 0.0f, 0xffff0000}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.0f}, 0xffff0000}, }; static const DWORD decl[] = { @@ -980,10 +977,10 @@ for(j = 0; j < 11; ++j) { /* Don't use the whole zrange to prevent rounding errors */ - quad[0].z = 0.001f + j / 10.02f; - quad[1].z = 0.001f + j / 10.02f; - quad[2].z = 0.001f + j / 10.02f; - quad[3].z = 0.001f + j / 10.02f; + quad[0].position.z = 0.001f + j / 10.02f; + quad[1].position.z = 0.001f + j / 10.02f; + quad[2].position.z = 0.001f + j / 10.02f; + quad[3].position.z = 0.001f + j / 10.02f; hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); @@ -1580,33 +1577,43 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct { - {-1.0f, 0.0f, 1.1f, 0xffff0000}, - {-1.0f, 1.0f, 1.1f, 0xffff0000}, - { 1.0f, 0.0f, -1.1f, 0xffff0000}, - { 1.0f, 1.0f, -1.1f, 0xffff0000}, - }; - static const struct vertex quad2[] = + struct vec3 position; + DWORD diffuse; + } + quad[] = { - {-1.0f, 0.0f, 1.1f, 0xff0000ff}, - {-1.0f, 1.0f, 1.1f, 0xff0000ff}, - { 1.0f, 0.0f, -1.1f, 0xff0000ff}, - { 1.0f, 1.0f, -1.1f, 0xff0000ff}, - }; - static const struct tvertex quad3[] = + {{-1.0f, 0.0f, 1.1f}, 0xffff0000}, + {{-1.0f, 1.0f, 1.1f}, 0xffff0000}, + {{ 1.0f, 0.0f, -1.1f}, 0xffff0000}, + {{ 1.0f, 1.0f, -1.1f}, 0xffff0000}, + }, + quad2[] = { - {640.0f, 240.0f, -1.1f, 1.0f, 0xffffff00}, - {640.0f, 480.0f, -1.1f, 1.0f, 0xffffff00}, - { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, + {{-1.0f, 0.0f, 1.1f}, 0xff0000ff}, + {{-1.0f, 1.0f, 1.1f}, 0xff0000ff}, + {{ 1.0f, 0.0f, -1.1f}, 0xff0000ff}, + {{ 1.0f, 1.0f, -1.1f}, 0xff0000ff}, }; - static const struct tvertex quad4[] = + static const struct + { + struct vec4 position; + DWORD diffuse; + } + quad3[] = { - {640.0f, 240.0f, -1.1f, 1.0f, 0xff00ff00}, - {640.0f, 480.0f, -1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, + {{640.0f, 240.0f, -1.1f, 1.0f}, 0xffffff00}, + {{640.0f, 480.0f, -1.1f, 1.0f}, 0xffffff00}, + {{ 0.0f, 240.0f, 1.1f, 1.0f}, 0xffffff00}, + {{ 0.0f, 480.0f, 1.1f, 1.0f}, 0xffffff00}, + }, + quad4[] = + { + {{640.0f, 240.0f, -1.1f, 1.0f}, 0xff00ff00}, + {{640.0f, 480.0f, -1.1f, 1.0f}, 0xff00ff00}, + {{ 0.0f, 240.0f, 1.1f, 1.0f}, 0xff00ff00}, + {{ 0.0f, 480.0f, 1.1f, 1.0f}, 0xff00ff00}, }; static const DWORD shader_code[] = { @@ -2108,19 +2115,24 @@ HWND window; HRESULT hr; - static const struct vertex quad1[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0x4000ff00}, - {-1.0f, 0.0f, 0.1f, 0x4000ff00}, - { 1.0f, -1.0f, 0.1f, 0x4000ff00}, - { 1.0f, 0.0f, 0.1f, 0x4000ff00}, - }; - static const struct vertex quad2[] = - { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{-1.0f, 0.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, 0.0f, 0.1f}, 0x4000ff00}, + }, + quad2[] = + { + {{-1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{-1.0f, 1.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 1.0f, 0.1f}, 0xc00000ff}, }; static const float composite_quad[][5] = { @@ -2639,47 +2651,57 @@ HWND window; HRESULT hr; - static const struct tvertex quad1[] = + static const struct { - { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - }; - static const struct tvertex quad2[] = + struct vec4 position; + DWORD diffuse; + } + quad1[] = { - { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - }; - static const struct tvertex quad3[] = + {{ 0.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{ 0.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + }, + quad2[] = { - {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - }; - static const struct tvertex quad4[] = + {{ 0.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{ 0.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + }, + quad3[] = { - { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - }; - static const struct vertex quad5[] = + {{112.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{112.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + }, + quad4[] = { - { -0.5f, 0.5f, 10.0f, 0xff14f914}, - { 0.5f, 0.5f, 10.0f, 0xff14f914}, - { -0.5f, -0.5f, 10.0f, 0xff14f914}, - { 0.5f, -0.5f, 10.0f, 0xff14f914}, + {{ 42.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{ 42.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, }; - static const struct vertex quad6[] = + static const struct { - { -1.0f, 0.5f, 10.0f, 0xfff91414}, - { 1.0f, 0.5f, 10.0f, 0xfff91414}, - { -1.0f, 0.25f, 10.0f, 0xfff91414}, - { 1.0f, 0.25f, 10.0f, 0xfff91414}, + struct vec3 position; + DWORD diffuse; + } + quad5[] = + { + {{-0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{-0.5f, -0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, -0.5f, 10.0f}, 0xff14f914}, + }, + quad6[] = + { + {{-1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{-1.0f, 0.25f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.25f, 10.0f}, 0xfff91414}, }; window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -2803,26 +2825,31 @@ HWND window; HRESULT hr; - static const struct vertex quad1[] = + static const struct { - { -1.0, 1.0, 0.33f, 0xff00ff00}, - { 1.0, 1.0, 0.33f, 0xff00ff00}, - { -1.0, -1.0, 0.33f, 0xff00ff00}, - { 1.0, -1.0, 0.33f, 0xff00ff00}, - }; - static const struct vertex quad2[] = - { - { -1.0, 1.0, 0.50f, 0xffff00ff}, - { 1.0, 1.0, 0.50f, 0xffff00ff}, - { -1.0, -1.0, 0.50f, 0xffff00ff}, - { 1.0, -1.0, 0.50f, 0xffff00ff}, - }; - static const struct vertex quad3[] = - { - { -1.0, 1.0, 0.66f, 0xffff0000}, - { 1.0, 1.0, 0.66f, 0xffff0000}, - { -1.0, -1.0, 0.66f, 0xffff0000}, - { 1.0, -1.0, 0.66f, 0xffff0000}, + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, 1.0f, 0.33f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.33f}, 0xff00ff00}, + {{-1.0f, -1.0f, 0.33f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.33f}, 0xff00ff00}, + }, + quad2[] = + { + {{-1.0f, 1.0f, 0.50f}, 0xffff00ff}, + {{ 1.0f, 1.0f, 0.50f}, 0xffff00ff}, + {{-1.0f, -1.0f, 0.50f}, 0xffff00ff}, + {{ 1.0f, -1.0f, 0.50f}, 0xffff00ff}, + }, + quad3[] = + { + {{-1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{-1.0f, -1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.66f}, 0xffff0000}, }; static const DWORD expected_colors[4][4] = { @@ -2959,12 +2986,17 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = { - { -1.0, 1.0, 0.66f, 0xffff0000}, - { 1.0, 1.0, 0.66f, 0xffff0000}, - { -1.0, -1.0, 0.66f, 0xffff0000}, - { 1.0, -1.0, 0.66f, 0xffff0000}, + {{-1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{-1.0f, -1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.66f}, 0xffff0000}, }; window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, diff -Nru wine1.7-1.7.21/dlls/d3d8/texture.c wine1.7-1.7.24/dlls/d3d8/texture.c --- wine1.7-1.7.21/dlls/d3d8/texture.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d8/texture.c 2014-08-08 20:19:29.000000000 +0000 @@ -140,12 +140,14 @@ static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -154,12 +156,14 @@ static DWORD WINAPI d3d8_texture_2d_GetPriority(IDirect3DTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; @@ -486,12 +490,14 @@ static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -500,12 +506,14 @@ static DWORD WINAPI d3d8_texture_cube_GetPriority(IDirect3DCubeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; @@ -853,12 +861,14 @@ static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -867,12 +877,14 @@ static DWORD WINAPI d3d8_texture_3d_GetPriority(IDirect3DVolumeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; diff -Nru wine1.7-1.7.21/dlls/d3d9/buffer.c wine1.7-1.7.24/dlls/d3d9/buffer.c --- wine1.7-1.7.21/dlls/d3d9/buffer.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/buffer.c 2014-08-08 20:19:29.000000000 +0000 @@ -132,12 +132,14 @@ static DWORD WINAPI d3d9_vertexbuffer_SetPriority(IDirect3DVertexBuffer9 *iface, DWORD priority) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -146,12 +148,14 @@ static DWORD WINAPI d3d9_vertexbuffer_GetPriority(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; @@ -404,12 +408,14 @@ static DWORD WINAPI d3d9_indexbuffer_SetPriority(IDirect3DIndexBuffer9 *iface, DWORD priority) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -418,12 +424,14 @@ static DWORD WINAPI d3d9_indexbuffer_GetPriority(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; diff -Nru wine1.7-1.7.21/dlls/d3d9/device.c wine1.7-1.7.24/dlls/d3d9/device.c --- wine1.7-1.7.21/dlls/d3d9/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -3147,14 +3147,26 @@ static HRESULT WINAPI d3d9_device_CheckDeviceState(IDirect3DDevice9Ex *iface, HWND dst_window) { - static int i; + struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + struct wined3d_swapchain_desc swapchain_desc; + struct wined3d_swapchain *swapchain; - TRACE("iface %p, dst_window %p stub!\n", iface, dst_window); + TRACE("iface %p, dst_window %p.\n", iface, dst_window); - if (!i++) - FIXME("iface %p, dst_window %p stub!\n", iface, dst_window); + wined3d_mutex_lock(); + swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); + wined3d_swapchain_get_desc(swapchain, &swapchain_desc); + wined3d_mutex_unlock(); - return D3D_OK; + if (swapchain_desc.windowed) + return D3D_OK; + + /* FIXME: This is actually supposed to check if any other device is in + * fullscreen mode. */ + if (dst_window != swapchain_desc.device_window) + return device->device_state == D3D9_DEVICE_STATE_OK ? S_PRESENT_OCCLUDED : D3D_OK; + + return device->device_state == D3D9_DEVICE_STATE_OK ? D3D_OK : S_PRESENT_OCCLUDED; } static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface, diff -Nru wine1.7-1.7.21/dlls/d3d9/surface.c wine1.7-1.7.24/dlls/d3d9/surface.c --- wine1.7-1.7.21/dlls/d3d9/surface.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/surface.c 2014-08-08 20:19:29.000000000 +0000 @@ -169,30 +169,14 @@ static DWORD WINAPI d3d9_surface_SetPriority(IDirect3DSurface9 *iface, DWORD priority) { - struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - DWORD ret; - - TRACE("iface %p, priority %u.\n", iface, priority); - - wined3d_mutex_lock(); - ret = wined3d_surface_set_priority(surface->wined3d_surface, priority); - wined3d_mutex_unlock(); - - return ret; + TRACE("iface %p, priority %u. Ignored on surfaces.\n", iface, priority); + return 0; } static DWORD WINAPI d3d9_surface_GetPriority(IDirect3DSurface9 *iface) { - struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - DWORD ret; - - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); - ret = wined3d_surface_get_priority(surface->wined3d_surface); - wined3d_mutex_unlock(); - - return ret; + TRACE("iface %p. Ignored on surfaces.\n", iface); + return 0; } static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface) diff -Nru wine1.7-1.7.21/dlls/d3d9/tests/d3d9ex.c wine1.7-1.7.24/dlls/d3d9/tests/d3d9ex.c --- wine1.7-1.7.21/dlls/d3d9/tests/d3d9ex.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/tests/d3d9ex.c 2014-08-08 20:19:29.000000000 +0000 @@ -1219,7 +1219,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -1230,7 +1230,7 @@ hr = IDirect3DDevice9Ex_PresentEx(device, NULL, NULL, NULL, NULL, 0); ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1245,7 +1245,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, FALSE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1258,7 +1258,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, TRUE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1323,7 +1323,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); refcount = IDirect3DDevice9Ex_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); diff -Nru wine1.7-1.7.21/dlls/d3d9/tests/device.c wine1.7-1.7.24/dlls/d3d9/tests/device.c --- wine1.7-1.7.21/dlls/d3d9/tests/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/tests/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -7279,7 +7279,7 @@ } else { - ok (locked_box.pBits == NULL, "Failed lock set pBits = %p, expected NULL.\n", locked_box.pBits); + ok(locked_box.pBits == NULL, "Failed lock set pBits = %p, expected NULL.\n", locked_box.pBits); } IDirect3DVolumeTexture9_Release(texture); } @@ -8885,13 +8885,13 @@ hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &ptr, 0); ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); - ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); + ok(!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer9_Unlock(buffer); ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &ptr, D3DLOCK_READONLY); ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); - ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); + ok(!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer9_Unlock(buffer); ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); @@ -8987,6 +8987,135 @@ DestroyWindow(window); } +static void test_resource_priority(void) +{ + IDirect3DDevice9 *device; + IDirect3DSurface9 *surface; + IDirect3DTexture9 *texture; + IDirect3DVertexBuffer9 *buffer; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct + { + D3DPOOL pool; + const char *name; + BOOL can_set_priority; + } + test_data[] = + { + {D3DPOOL_DEFAULT, "D3DPOOL_DEFAULT", FALSE}, + {D3DPOOL_SYSTEMMEM, "D3DPOOL_SYSTEMMEM", FALSE}, + {D3DPOOL_MANAGED, "D3DPOOL_MANAGED", TRUE}, + {D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH", FALSE} + }; + unsigned int i; + DWORD priority; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); i++) + { + hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 0, 0, D3DFMT_X8R8G8B8, + test_data[i].pool, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x, pool %s.\n", hr, test_data[i].name); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + priority = IDirect3DTexture9_GetPriority(texture); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_SetPriority(texture, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_GetPriority(texture); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_SetPriority(texture, 2); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DSurface9_Release(surface); + IDirect3DTexture9_Release(texture); + + if (test_data[i].pool != D3DPOOL_MANAGED) + { + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 16, 16, D3DFMT_X8R8G8B8, + test_data[i].pool, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DSurface9_Release(surface); + } + + if (test_data[i].pool != D3DPOOL_SCRATCH) + { + hr = IDirect3DDevice9_CreateVertexBuffer(device, 256, 0, 0, + test_data[i].pool, &buffer, NULL); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DVertexBuffer9_GetPriority(buffer); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_SetPriority(buffer, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_GetPriority(buffer); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_SetPriority(buffer, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DVertexBuffer9_Release(buffer); + } + } + + hr = IDirect3DDevice9_CreateRenderTarget(device, 16, 16, D3DFMT_X8R8G8B8, + D3DMULTISAMPLE_NONE, 0, FALSE, &surface, NULL); + + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + + IDirect3DSurface9_Release(surface); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { WNDCLASSA wc = {0}; @@ -9086,6 +9215,7 @@ test_mipmap_lock(); test_writeonly_resource(); test_lost_device(); + test_resource_priority(); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.21/dlls/d3d9/tests/visual.c wine1.7-1.7.24/dlls/d3d9/tests/visual.c --- wine1.7-1.7.21/dlls/d3d9/tests/visual.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/tests/visual.c 2014-08-08 20:19:29.000000000 +0000 @@ -209,25 +209,6 @@ } } -struct vertex -{ - float x, y, z; - DWORD diffuse; -}; - -struct tvertex -{ - float x, y, z, rhw; - DWORD diffuse; -}; - -struct nvertex -{ - float x, y, z; - float nx, ny, nz; - DWORD diffuse; -}; - static void test_sanity(void) { IDirect3DDevice9 *device; @@ -289,40 +270,51 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }}}; - static const struct vertex unlitquad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, - }; - static const struct vertex litquad[] = + struct vec3 position; + DWORD diffuse; + } + unlitquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, - }; - static const struct vertex lighting_test[] = + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000}, + }, + litquad[] = { - {-1.0f, -1.0f, 0.1f, 0x8000ff00}, - { 1.0f, -1.0f, 0.1f, 0x80000000}, - {-1.0f, 1.0f, 0.1f, 0x8000ff00}, - { 1.0f, 1.0f, 0.1f, 0x80000000}, - }; - static const struct nvertex unlitnquad[] = + {{-1.0f, 0.0f, 0.1f}, 0xff00ff00}, + {{-1.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00}, + }, + lighting_test[] = { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + {{-1.0f, -1.0f, 0.1f}, 0x8000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x80000000}, + {{-1.0f, 1.0f, 0.1f}, 0x8000ff00}, + {{ 1.0f, 1.0f, 0.1f}, 0x80000000}, }; - static const struct nvertex litnquad[] = + static const struct + { + struct vec3 position; + struct vec3 normal; + DWORD diffuse; + } + unlitnquad[] = + { + {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + }, + litnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, }; static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; @@ -1059,27 +1051,32 @@ {640.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, {320.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, }; - static const struct vertex rev_fog_quads[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + rev_fog_quads[] = { - {-1.0f, -1.0f, 0.1f, 0x000000ff}, - {-1.0f, 0.0f, 0.1f, 0x000000ff}, - { 0.0f, 0.0f, 0.1f, 0x000000ff}, - { 0.0f, -1.0f, 0.1f, 0x000000ff}, - - { 0.0f, -1.0f, 0.9f, 0x000000ff}, - { 0.0f, 0.0f, 0.9f, 0x000000ff}, - { 1.0f, 0.0f, 0.9f, 0x000000ff}, - { 1.0f, -1.0f, 0.9f, 0x000000ff}, - - { 0.0f, 0.0f, 0.4f, 0x000000ff}, - { 0.0f, 1.0f, 0.4f, 0x000000ff}, - { 1.0f, 1.0f, 0.4f, 0x000000ff}, - { 1.0f, 0.0f, 0.4f, 0x000000ff}, - - {-1.0f, 0.0f, 0.7f, 0x000000ff}, - {-1.0f, 1.0f, 0.7f, 0x000000ff}, - { 0.0f, 1.0f, 0.7f, 0x000000ff}, - { 0.0f, 0.0f, 0.7f, 0x000000ff}, + {{-1.0f, -1.0f, 0.1f}, 0x000000ff}, + {{-1.0f, 0.0f, 0.1f}, 0x000000ff}, + {{ 0.0f, 0.0f, 0.1f}, 0x000000ff}, + {{ 0.0f, -1.0f, 0.1f}, 0x000000ff}, + + {{ 0.0f, -1.0f, 0.9f}, 0x000000ff}, + {{ 0.0f, 0.0f, 0.9f}, 0x000000ff}, + {{ 1.0f, 0.0f, 0.9f}, 0x000000ff}, + {{ 1.0f, -1.0f, 0.9f}, 0x000000ff}, + + {{ 0.0f, 0.0f, 0.4f}, 0x000000ff}, + {{ 0.0f, 1.0f, 0.4f}, 0x000000ff}, + {{ 1.0f, 1.0f, 0.4f}, 0x000000ff}, + {{ 1.0f, 0.0f, 0.4f}, 0x000000ff}, + + {{-1.0f, 0.0f, 0.7f}, 0x000000ff}, + {{-1.0f, 1.0f, 0.7f}, 0x000000ff}, + {{ 0.0f, 1.0f, 0.7f}, 0x000000ff}, + {{ 0.0f, 0.0f, 0.7f}, 0x000000ff}, }; static const D3DMATRIX ident_mat = {{{ @@ -1903,12 +1900,17 @@ 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ 0x0000ffff }; - static struct vertex quad[] = + struct { - {-1.0f, -1.0f, 0.0f, 0xffff0000 }, - {-1.0f, 1.0f, 0.0f, 0xffff0000 }, - { 1.0f, -1.0f, 0.0f, 0xffff0000 }, - { 1.0f, 1.0f, 0.0f, 0xffff0000 }, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.0f}, 0xffff0000}, }; static const D3DVERTEXELEMENT9 decl_elements[] = { @@ -2190,10 +2192,10 @@ for(j=0; j < 11; j++) { /* Don't use the whole zrange to prevent rounding errors */ - quad[0].z = 0.001f + (float)j / 10.02f; - quad[1].z = 0.001f + (float)j / 10.02f; - quad[2].z = 0.001f + (float)j / 10.02f; - quad[3].z = 0.001f + (float)j / 10.02f; + quad[0].position.z = 0.001f + (float)j / 10.02f; + quad[1].position.z = 0.001f + (float)j / 10.02f; + quad[2].position.z = 0.001f + (float)j / 10.02f; + quad[3].position.z = 0.001f + (float)j / 10.02f; hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); @@ -2622,33 +2624,43 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct { - {-1.0f, 0.0f, 1.1f, 0xffff0000}, - {-1.0f, 1.0f, 1.1f, 0xffff0000}, - { 1.0f, 0.0f, -1.1f, 0xffff0000}, - { 1.0f, 1.0f, -1.1f, 0xffff0000}, - }; - static const struct vertex quad2[] = + struct vec3 position; + DWORD diffuse; + } + quad[] = { - {-1.0f, 0.0f, 1.1f, 0xff0000ff}, - {-1.0f, 1.0f, 1.1f, 0xff0000ff}, - { 1.0f, 0.0f, -1.1f, 0xff0000ff}, - { 1.0f, 1.0f, -1.1f, 0xff0000ff}, - }; - static const struct tvertex quad3[] = + {{-1.0f, 0.0f, 1.1f}, 0xffff0000}, + {{-1.0f, 1.0f, 1.1f}, 0xffff0000}, + {{ 1.0f, 0.0f, -1.1f}, 0xffff0000}, + {{ 1.0f, 1.0f, -1.1f}, 0xffff0000}, + }, + quad2[] = { - {640.0f, 240.0f, -1.1f, 1.0f, 0xffffff00}, - {640.0f, 480.0f, -1.1f, 1.0f, 0xffffff00}, - { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, + {{-1.0f, 0.0f, 1.1f}, 0xff0000ff}, + {{-1.0f, 1.0f, 1.1f}, 0xff0000ff}, + {{ 1.0f, 0.0f, -1.1f}, 0xff0000ff}, + {{ 1.0f, 1.0f, -1.1f}, 0xff0000ff}, }; - static const struct tvertex quad4[] = + static const struct + { + struct vec4 position; + DWORD diffuse; + } + quad3[] = + { + {{640.0f, 240.0f, -1.1f, 1.0f}, 0xffffff00}, + {{640.0f, 480.0f, -1.1f, 1.0f}, 0xffffff00}, + {{ 0.0f, 240.0f, 1.1f, 1.0f}, 0xffffff00}, + {{ 0.0f, 480.0f, 1.1f, 1.0f}, 0xffffff00}, + }, + quad4[] = { - {640.0f, 240.0f, -1.1f, 1.0f, 0xff00ff00}, - {640.0f, 480.0f, -1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, + {{640.0f, 240.0f, -1.1f, 1.0f}, 0xff00ff00}, + {{640.0f, 480.0f, -1.1f, 1.0f}, 0xff00ff00}, + {{ 0.0f, 240.0f, 1.1f, 1.0f}, 0xff00ff00}, + {{ 0.0f, 480.0f, 1.1f, 1.0f}, 0xff00ff00}, }; static const DWORD shader_code[] = { @@ -3635,15 +3647,20 @@ LONG ref; static const short indices[] = {3, 4, 5}; - static const struct vertex quad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 1.0f, 0.1f, 0xffff0000}, - { 1.0f, 1.0f, 0.1f, 0xffff0000}, - - {-1.0f, -1.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 1.0f, 1.0f, 0.1f, 0xff00ff00}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.1f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0xffff0000}, + + {{-1.0f, -1.0f, 0.1f}, 0xff00ff00}, + {{-1.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.1f}, 0xff00ff00}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -7143,26 +7160,31 @@ 1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, }; - static const struct vertex quad1_color[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad1_color[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x00ff8040}, + {{-1.0f, 0.0f, 0.1f}, 0x00ff8040}, + {{ 0.0f, -1.0f, 0.1f}, 0x00ff8040}, + {{ 0.0f, 0.0f, 0.1f}, 0x00ff8040}, + }, + quad2_color[] = { - {-1.0f, -1.0f, 0.1f, 0x00ff8040}, - {-1.0f, 0.0f, 0.1f, 0x00ff8040}, - { 0.0f, -1.0f, 0.1f, 0x00ff8040}, - { 0.0f, 0.0f, 0.1f, 0x00ff8040}, - }; - static const struct vertex quad2_color[] = - { - { 0.0f, -1.0f, 0.1f, 0x00ff8040}, - { 0.0f, 0.0f, 0.1f, 0x00ff8040}, - { 1.0f, -1.0f, 0.1f, 0x00ff8040}, - { 1.0f, 0.0f, 0.1f, 0x00ff8040}, - }; - static const struct vertex quad3_color[] = - { - {-1.0f, 0.0f, 0.1f, 0x00ff8040}, - {-1.0f, 1.0f, 0.1f, 0x00ff8040}, - { 0.0f, 0.0f, 0.1f, 0x00ff8040}, - { 0.0f, 1.0f, 0.1f, 0x00ff8040}, + {{ 0.0f, -1.0f, 0.1f}, 0x00ff8040}, + {{ 0.0f, 0.0f, 0.1f}, 0x00ff8040}, + {{ 1.0f, -1.0f, 0.1f}, 0x00ff8040}, + {{ 1.0f, 0.0f, 0.1f}, 0x00ff8040}, + }, + quad3_color[] = + { + {{-1.0f, 0.0f, 0.1f}, 0x00ff8040}, + {{-1.0f, 1.0f, 0.1f}, 0x00ff8040}, + {{ 0.0f, 0.0f, 0.1f}, 0x00ff8040}, + {{ 0.0f, 1.0f, 0.1f}, 0x00ff8040}, }; static const float quad4_color[] = { @@ -7612,22 +7634,27 @@ HRESULT hr; UINT i, j; - static const struct vertex quad_strip[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad_strip[] = { - {-1.0f, -1.0f, 0.0f, 0xffff0000}, - {-1.0f, 1.0f, 0.0f, 0xff00ff00}, - { 1.0f, -1.0f, 0.0f, 0xff0000ff}, - { 1.0f, 1.0f, 0.0f, 0xffffffff}, - }; - static const struct vertex quad_list[] = - { - {-1.0f, -1.0f, 0.0f, 0xffff0000}, - {-1.0f, 1.0f, 0.0f, 0xff00ff00}, - { 1.0f, -1.0f, 0.0f, 0xff0000ff}, - - { 1.0f, -1.0f, 0.0f, 0xff0000ff}, - {-1.0f, 1.0f, 0.0f, 0xff00ff00}, - { 1.0f, 1.0f, 0.0f, 0xffffffff}, + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }, + quad_list[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -7760,19 +7787,24 @@ HWND window; HRESULT hr; - static const struct vertex quad1[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{-1.0f, 0.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, 0.0f, 0.1f}, 0x4000ff00}, + }, + quad2[] = { - {-1.0f, -1.0f, 0.1f, 0x4000ff00}, - {-1.0f, 0.0f, 0.1f, 0x4000ff00}, - { 1.0f, -1.0f, 0.1f, 0x4000ff00}, - { 1.0f, 0.0f, 0.1f, 0x4000ff00}, - }; - static const struct vertex quad2[] = - { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + {{-1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{-1.0f, 1.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 1.0f, 0.1f}, 0xc00000ff}, }; static const float composite_quad[][5] = { @@ -7911,15 +7943,6 @@ DestroyWindow(window); } -struct vertex_shortcolor { - float x, y, z; - unsigned short r, g, b, a; -}; -struct vertex_floatcolor { - float x, y, z; - float r, g, b, a; -}; - static void fixed_function_decl_test(void) { IDirect3DVertexDeclaration9 *dcl_float = NULL, *dcl_short = NULL, *dcl_ubyte = NULL, *dcl_color = NULL; @@ -7970,33 +7993,48 @@ {0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - static const struct vertex quad1[] = /* D3DCOLOR */ + static const struct { - {-1.0f, -1.0f, 0.1f, 0x00ffff00}, - {-1.0f, 0.0f, 0.1f, 0x00ffff00}, - { 0.0f, -1.0f, 0.1f, 0x00ffff00}, - { 0.0f, 0.0f, 0.1f, 0x00ffff00}, - }; - static const struct vertex quad2[] = /* UBYTE4N */ + struct vec3 position; + DWORD diffuse; + } + quad1[] = /* D3DCOLOR */ { - {-1.0f, 0.0f, 0.1f, 0x00ffff00}, - {-1.0f, 1.0f, 0.1f, 0x00ffff00}, - { 0.0f, 0.0f, 0.1f, 0x00ffff00}, - { 0.0f, 1.0f, 0.1f, 0x00ffff00}, + {{-1.0f, -1.0f, 0.1f}, 0x00ffff00}, + {{-1.0f, 0.0f, 0.1f}, 0x00ffff00}, + {{ 0.0f, -1.0f, 0.1f}, 0x00ffff00}, + {{ 0.0f, 0.0f, 0.1f}, 0x00ffff00}, + }, + quad2[] = /* UBYTE4N */ + { + {{-1.0f, 0.0f, 0.1f}, 0x00ffff00}, + {{-1.0f, 1.0f, 0.1f}, 0x00ffff00}, + {{ 0.0f, 0.0f, 0.1f}, 0x00ffff00}, + {{ 0.0f, 1.0f, 0.1f}, 0x00ffff00}, }; - static const struct vertex_shortcolor quad3[] = /* short */ + static const struct + { + struct vec3 position; + struct { unsigned short x, y, z, w; } color; + } + quad3[] = /* USHORT4N */ { - { 0.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, - { 0.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, - { 1.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, - { 1.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, + {{0.0f, -1.0f, 0.1f}, {0x0000, 0x0000, 0xffff, 0xffff}}, + {{0.0f, 0.0f, 0.1f}, {0x0000, 0x0000, 0xffff, 0xffff}}, + {{1.0f, -1.0f, 0.1f}, {0x0000, 0x0000, 0xffff, 0xffff}}, + {{1.0f, 0.0f, 0.1f}, {0x0000, 0x0000, 0xffff, 0xffff}}, }; - static const struct vertex_floatcolor quad4[] = + static const struct + { + struct vec3 position; + struct vec4 color; + } + quad4[] = { - { 0.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, - { 0.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, - { 1.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, - { 1.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 0.0f, 0.0f, 0.0f}}, + {{0.0f, 1.0f, 0.1f}, {1.0f, 0.0f, 0.0f, 0.0f}}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 0.0f, 0.0f, 0.0f}}, + {{1.0f, 1.0f, 0.1f}, {1.0f, 0.0f, 0.0f, 0.0f}}, }; static const DWORD colors[] = { @@ -8039,12 +8077,17 @@ 0.0f, 0.0f, 0.1f, 0.0f, 1.0f, 0.1f, }; - static const struct tvertex quad_transformed[] = + static const struct { - { 90, 110, 0.1, 2.0, 0x00ffff00}, - { 570, 110, 0.1, 2.0, 0x00ffff00}, - { 90, 300, 0.1, 2.0, 0x00ffff00}, - { 570, 300, 0.1, 2.0, 0x00ffff00} + struct vec4 position; + DWORD diffuse; + } + quad_transformed[] = + { + {{ 90.0f, 110.0f, 0.1f, 2.0f}, 0x00ffff00}, + {{570.0f, 110.0f, 0.1f, 2.0f}, 0x00ffff00}, + {{ 90.0f, 300.0f, 0.1f, 2.0f}, 0x00ffff00}, + {{570.0f, 300.0f, 0.1f, 2.0f}, 0x00ffff00}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -9200,12 +9243,17 @@ -1.0, 1.0, 0.1, 0.0, 1.0, 0.1, }; - struct vertex painter[] = + struct + { + struct vec3 position; + DWORD diffuse; + } + painter[] = { - {-1.0, -1.0, 0.0, 0x00000000}, - { 1.0, -1.0, 0.0, 0x00000000}, - {-1.0, 1.0, 0.0, 0x00000000}, - { 1.0, 1.0, 0.0, 0x00000000}, + {{-1.0f, -1.0f, 0.0f}, 0x00000000}, + {{ 1.0f, -1.0f, 0.0f}, 0x00000000}, + {{-1.0f, 1.0f, 0.0f}, 0x00000000}, + {{ 1.0f, 1.0f, 0.0f}, 0x00000000}, }; static const WORD indices_cw[] = {0, 1, 3}; static const WORD indices_ccw[] = {0, 2, 3}; @@ -10126,21 +10174,26 @@ { 0.5f, -0.5f, 0.1f, 1.0f, 0.0f}, { 0.5f, 0.5f, 0.1f, 1.0f, 1.0f}, }; + static const struct + { + struct vec3 position; + DWORD diffuse; + } /* Quad with R=0x10, G=0x20 */ - static const struct vertex quad1[] = + quad1[] = { - {-1.0f, -1.0f, 0.1f, 0x80102000}, - {-1.0f, 1.0f, 0.1f, 0x80102000}, - { 1.0f, -1.0f, 0.1f, 0x80102000}, - { 1.0f, 1.0f, 0.1f, 0x80102000}, - }; + {{-1.0f, -1.0f, 0.1f}, 0x80102000}, + {{-1.0f, 1.0f, 0.1f}, 0x80102000}, + {{ 1.0f, -1.0f, 0.1f}, 0x80102000}, + {{ 1.0f, 1.0f, 0.1f}, 0x80102000}, + }, /* Quad with R=0x20, G=0x10 */ - static const struct vertex quad2[] = + quad2[] = { - {-1.0f, -1.0f, 0.1f, 0x80201000}, - {-1.0f, 1.0f, 0.1f, 0x80201000}, - { 1.0f, -1.0f, 0.1f, 0x80201000}, - { 1.0f, 1.0f, 0.1f, 0x80201000}, + {{-1.0f, -1.0f, 0.1f}, 0x80201000}, + {{-1.0f, 1.0f, 0.1f}, 0x80201000}, + {{ 1.0f, -1.0f, 0.1f}, 0x80201000}, + {{ 1.0f, 1.0f, 0.1f}, 0x80201000}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -10296,12 +10349,17 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0x00ff0000}, - {-1.0f, 1.0f, 0.1f, 0x00ff0000}, - { 1.0f, -1.0f, 0.1f, 0x00ff0000}, - { 1.0f, 1.0f, 0.1f, 0x00ff0000}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x00ff0000}, + {{-1.0f, 1.0f, 0.1f}, 0x00ff0000}, + {{ 1.0f, -1.0f, 0.1f}, 0x00ff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0x00ff0000}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -11430,12 +11488,17 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0x80ff00ff}, - {-1.0f, 1.0f, 0.1f, 0x80ff00ff}, - { 1.0f, -1.0f, 0.1f, 0x80ff00ff}, - { 1.0f, 1.0f, 0.1f, 0x80ff00ff}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x80ff00ff}, + {{-1.0f, 1.0f, 0.1f}, 0x80ff00ff}, + {{ 1.0f, -1.0f, 0.1f}, 0x80ff00ff}, + {{ 1.0f, 1.0f, 0.1f}, 0x80ff00ff}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -11489,12 +11552,17 @@ HWND window; HRESULT hr; - static const struct vertex quad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0x408080c0}, - {-1.0f, 1.0f, 0.1f, 0x408080c0}, - { 1.0f, -1.0f, 0.1f, 0x408080c0}, - { 1.0f, 1.0f, 0.1f, 0x408080c0}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x408080c0}, + {{-1.0f, 1.0f, 0.1f}, 0x408080c0}, + {{ 1.0f, -1.0f, 0.1f}, 0x408080c0}, + {{ 1.0f, 1.0f, 0.1f}, 0x408080c0}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -11581,19 +11649,24 @@ HWND window; HRESULT hr; - static const struct vertex quad1[] = + static const struct { - {-1.0f, -1.0f, 0.1f, 0x00ff0000}, - {-1.0f, 1.0f, 0.1f, 0x00ff0000}, - { 1.0f, -1.0f, 0.1f, 0x00ff0000}, - { 1.0f, 1.0f, 0.1f, 0x00ff0000}, - }; - static const struct vertex quad2[] = - { - {-1.0f, -1.0f, 0.9f, 0x0000ff00}, - {-1.0f, 1.0f, 0.9f, 0x0000ff00}, - { 1.0f, -1.0f, 0.9f, 0x0000ff00}, - { 1.0f, 1.0f, 0.9f, 0x0000ff00}, + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x00ff0000}, + {{-1.0f, 1.0f, 0.1f}, 0x00ff0000}, + {{ 1.0f, -1.0f, 0.1f}, 0x00ff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0x00ff0000}, + }, + quad2[] = + { + {{-1.0f, -1.0f, 0.9f}, 0x0000ff00}, + {{-1.0f, 1.0f, 0.9f}, 0x0000ff00}, + {{ 1.0f, -1.0f, 0.9f}, 0x0000ff00}, + {{ 1.0f, 1.0f, 0.9f}, 0x0000ff00}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -11685,12 +11758,17 @@ {D3DCMP_GREATEREQUAL, ALPHATEST_FAILED, ALPHATEST_PASSED, ALPHATEST_PASSED}, {D3DCMP_ALWAYS, ALPHATEST_PASSED, ALPHATEST_PASSED, ALPHATEST_PASSED}, }; - static const struct vertex quad[] = + static const struct { - {-1.0f, -1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, - {-1.0f, 1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, - { 1.0f, -1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, - { 1.0f, 1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, ALPHATEST_PASSED | 0x80000000}, + {{-1.0f, 1.0f, 0.1f}, ALPHATEST_PASSED | 0x80000000}, + {{ 1.0f, -1.0f, 0.1f}, ALPHATEST_PASSED | 0x80000000}, + {{ 1.0f, 1.0f, 0.1f}, ALPHATEST_PASSED | 0x80000000}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -12238,47 +12316,57 @@ HWND window; HRESULT hr; - static const struct tvertex quad1[] = + static const struct { - { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - }; - static const struct tvertex quad2[] = + struct vec4 position; + DWORD diffuse; + } + quad1[] = { - { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - }; - static const struct tvertex quad3[] = + {{ 0.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{ 0.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + }, + quad2[] = { - {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - }; - static const struct tvertex quad4[] = + {{ 0.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{ 0.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + }, + quad3[] = { - { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - }; - static const struct vertex quad5[] = + {{112.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{112.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + }, + quad4[] = { - { -0.5f, 0.5f, 10.0f, 0xff14f914}, - { 0.5f, 0.5f, 10.0f, 0xff14f914}, - { -0.5f, -0.5f, 10.0f, 0xff14f914}, - { 0.5f, -0.5f, 10.0f, 0xff14f914}, + {{ 42.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{ 42.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, }; - static const struct vertex quad6[] = + static const struct { - { -1.0f, 0.5f, 10.0f, 0xfff91414}, - { 1.0f, 0.5f, 10.0f, 0xfff91414}, - { -1.0f, 0.25f, 10.0f, 0xfff91414}, - { 1.0f, 0.25f, 10.0f, 0xfff91414}, + struct vec3 position; + DWORD diffuse; + } + quad5[] = + { + {{-0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{-0.5f, -0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, -0.5f, 10.0f}, 0xff14f914}, + }, + quad6[] = + { + {{-1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{-1.0f, 0.25f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.25f, 10.0f}, 0xfff91414}, }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -12403,26 +12491,31 @@ static void depth_bounds_test(void) { - const struct tvertex quad1[] = + static const struct { - { 0, 0, 0.0f, 1, 0xfff9e814}, - { 640, 0, 0.0f, 1, 0xfff9e814}, - { 0, 480, 1.0f, 1, 0xfff9e814}, - { 640, 480, 1.0f, 1, 0xfff9e814}, - }; - const struct tvertex quad2[] = - { - { 0, 0, 0.6f, 1, 0xff002b7f}, - { 640, 0, 0.6f, 1, 0xff002b7f}, - { 0, 480, 0.6f, 1, 0xff002b7f}, - { 640, 480, 0.6f, 1, 0xff002b7f}, - }; - const struct tvertex quad3[] = - { - { 0, 100, 0.6f, 1, 0xfff91414}, - { 640, 100, 0.6f, 1, 0xfff91414}, - { 0, 160, 0.6f, 1, 0xfff91414}, - { 640, 160, 0.6f, 1, 0xfff91414}, + struct vec4 position; + DWORD diffuse; + } + quad1[] = + { + {{ 0.0f, 0.0f, 0.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 0.0f, 0.0f, 1.0f}, 0xfff9e814}, + {{ 0.0f, 480.0f, 1.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 480.0f, 1.0f, 1.0f}, 0xfff9e814}, + }, + quad2[] = + { + {{ 0.0f, 0.0f, 0.6f, 1.0f}, 0xff002b7f}, + {{640.0f, 0.0f, 0.6f, 1.0f}, 0xff002b7f}, + {{ 0.0f, 480.0f, 0.6f, 1.0f}, 0xff002b7f}, + {{640.0f, 480.0f, 0.6f, 1.0f}, 0xff002b7f}, + }, + quad3[] = + { + {{ 0.0f, 100.0f, 0.6f, 1.0f}, 0xfff91414}, + {{640.0f, 100.0f, 0.6f, 1.0f}, 0xfff91414}, + {{ 0.0f, 160.0f, 0.6f, 1.0f}, 0xfff91414}, + {{640.0f, 160.0f, 0.6f, 1.0f}, 0xfff91414}, }; union { @@ -12534,26 +12627,31 @@ static void depth_buffer_test(void) { - static const struct vertex quad1[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad1[] = { - { -1.0, 1.0, 0.33f, 0xff00ff00}, - { 1.0, 1.0, 0.33f, 0xff00ff00}, - { -1.0, -1.0, 0.33f, 0xff00ff00}, - { 1.0, -1.0, 0.33f, 0xff00ff00}, - }; - static const struct vertex quad2[] = - { - { -1.0, 1.0, 0.50f, 0xffff00ff}, - { 1.0, 1.0, 0.50f, 0xffff00ff}, - { -1.0, -1.0, 0.50f, 0xffff00ff}, - { 1.0, -1.0, 0.50f, 0xffff00ff}, - }; - static const struct vertex quad3[] = - { - { -1.0, 1.0, 0.66f, 0xffff0000}, - { 1.0, 1.0, 0.66f, 0xffff0000}, - { -1.0, -1.0, 0.66f, 0xffff0000}, - { 1.0, -1.0, 0.66f, 0xffff0000}, + {{-1.0, 1.0, 0.33f}, 0xff00ff00}, + {{ 1.0, 1.0, 0.33f}, 0xff00ff00}, + {{-1.0, -1.0, 0.33f}, 0xff00ff00}, + {{ 1.0, -1.0, 0.33f}, 0xff00ff00}, + }, + quad2[] = + { + {{-1.0, 1.0, 0.50f}, 0xffff00ff}, + {{ 1.0, 1.0, 0.50f}, 0xffff00ff}, + {{-1.0, -1.0, 0.50f}, 0xffff00ff}, + {{ 1.0, -1.0, 0.50f}, 0xffff00ff}, + }, + quad3[] = + { + {{-1.0, 1.0, 0.66f}, 0xffff0000}, + {{ 1.0, 1.0, 0.66f}, 0xffff0000}, + {{-1.0, -1.0, 0.66f}, 0xffff0000}, + {{ 1.0, -1.0, 0.66f}, 0xffff0000}, }; static const DWORD expected_colors[4][4] = { @@ -12686,12 +12784,17 @@ * the following draw should only copy back the part that was modified. */ static void depth_buffer2_test(void) { - static const struct vertex quad[] = + static const struct { - { -1.0, 1.0, 0.66f, 0xffff0000}, - { 1.0, 1.0, 0.66f, 0xffff0000}, - { -1.0, -1.0, 0.66f, 0xffff0000}, - { 1.0, -1.0, 0.66f, 0xffff0000}, + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.66f}, 0xffff0000}, + {{-1.0f, -1.0f, 0.66f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.66f}, 0xffff0000}, }; IDirect3DSurface9 *backbuffer, *rt1, *rt2; @@ -12799,19 +12902,24 @@ static void depth_blit_test(void) { - static const struct vertex quad1[] = + static const struct { - { -1.0, 1.0, 0.33f, 0xff00ff00}, - { 1.0, 1.0, 0.33f, 0xff00ff00}, - { -1.0, -1.0, 0.33f, 0xff00ff00}, - { 1.0, -1.0, 0.33f, 0xff00ff00}, - }; - static const struct vertex quad2[] = - { - { -1.0, 1.0, 0.66f, 0xff0000ff}, - { 1.0, 1.0, 0.66f, 0xff0000ff}, - { -1.0, -1.0, 0.66f, 0xff0000ff}, - { 1.0, -1.0, 0.66f, 0xff0000ff}, + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, 1.0f, 0.33f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.33f}, 0xff00ff00}, + {{-1.0f, -1.0f, 0.33f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.33f}, 0xff00ff00}, + }, + quad2[] = + { + {{-1.0f, 1.0f, 0.66f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.66f}, 0xff0000ff}, + {{-1.0f, -1.0f, 0.66f}, 0xff0000ff}, + {{ 1.0f, -1.0f, 0.66f}, 0xff0000ff}, }; static const DWORD expected_colors[4][4] = { @@ -13479,19 +13587,24 @@ static void clip_planes(IDirect3DDevice9 *device, const char *test_name) { - static const struct vertex quad1[] = + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xfff9e814}, + {{-1.0f, 1.0f, 0.0f}, 0xfff9e814}, + {{ 1.0f, -1.0f, 0.0f}, 0xfff9e814}, + {{ 1.0f, 1.0f, 0.0f}, 0xfff9e814}, + }, + quad2[] = { - {-1.0f, -1.0f, 0.0f, 0xfff9e814}, - {-1.0f, 1.0f, 0.0f, 0xfff9e814}, - { 1.0f, -1.0f, 0.0f, 0xfff9e814}, - { 1.0f, 1.0f, 0.0f, 0xfff9e814}, - }; - static const struct vertex quad2[] = - { - {-1.0f, -1.0f, 0.0f, 0xff002b7f}, - {-1.0f, 1.0f, 0.0f, 0xff002b7f}, - { 1.0f, -1.0f, 0.0f, 0xff002b7f}, - { 1.0f, 1.0f, 0.0f, 0xff002b7f}, + {{-1.0f, -1.0f, 0.0f}, 0xff002b7f}, + {{-1.0f, 1.0f, 0.0f}, 0xff002b7f}, + {{ 1.0f, -1.0f, 0.0f}, 0xff002b7f}, + {{ 1.0f, 1.0f, 0.0f}, 0xff002b7f}, }; D3DCOLOR color; HRESULT hr; diff -Nru wine1.7-1.7.21/dlls/d3d9/texture.c wine1.7-1.7.24/dlls/d3d9/texture.c --- wine1.7-1.7.21/dlls/d3d9/texture.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3d9/texture.c 2014-08-08 20:19:29.000000000 +0000 @@ -142,12 +142,14 @@ static DWORD WINAPI d3d9_texture_2d_SetPriority(IDirect3DTexture9 *iface, DWORD priority) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -156,12 +158,14 @@ static DWORD WINAPI d3d9_texture_2d_GetPriority(IDirect3DTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; @@ -531,12 +535,14 @@ static DWORD WINAPI d3d9_texture_cube_SetPriority(IDirect3DCubeTexture9 *iface, DWORD priority) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -545,12 +551,14 @@ static DWORD WINAPI d3d9_texture_cube_GetPriority(IDirect3DCubeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; @@ -944,12 +952,14 @@ static DWORD WINAPI d3d9_texture_3d_SetPriority(IDirect3DVolumeTexture9 *iface, DWORD priority) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); + struct wined3d_resource *resource; DWORD ret; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - ret = wined3d_texture_set_priority(texture->wined3d_texture, priority); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return ret; @@ -958,12 +968,14 @@ static DWORD WINAPI d3d9_texture_3d_GetPriority(IDirect3DVolumeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); + const struct wined3d_resource *resource; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_texture_get_priority(texture->wined3d_texture); + resource = wined3d_texture_get_resource(texture->wined3d_texture); + ret = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return ret; diff -Nru wine1.7-1.7.21/dlls/d3dx9_36/d3dx9_36.spec wine1.7-1.7.24/dlls/d3dx9_36/d3dx9_36.spec --- wine1.7-1.7.21/dlls/d3dx9_36/d3dx9_36.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dx9_36/d3dx9_36.spec 2014-08-08 20:19:29.000000000 +0000 @@ -105,7 +105,7 @@ @ stdcall D3DXCreateTextureFromResourceW(ptr ptr wstr ptr) @ stub D3DXCreateTextureGutterHelper(long long ptr long ptr) @ stub D3DXCreateTextureShader(ptr ptr) -@ stub D3DXCreateTorus(ptr long long long long ptr ptr) +@ stdcall D3DXCreateTorus(ptr long long long long ptr ptr) @ stdcall D3DXCreateVolumeTexture(ptr long long long long long long long ptr) @ stdcall D3DXCreateVolumeTextureFromFileA(ptr ptr ptr) @ stdcall D3DXCreateVolumeTextureFromFileExA(ptr ptr long long long long long long long long long long ptr ptr ptr) diff -Nru wine1.7-1.7.21/dlls/d3dx9_36/mesh.c wine1.7-1.7.24/dlls/d3dx9_36/mesh.c --- wine1.7-1.7.21/dlls/d3dx9_36/mesh.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dx9_36/mesh.c 2014-08-08 20:19:29.000000000 +0000 @@ -4693,12 +4693,6 @@ return D3DERR_INVALIDCALL; } - if (adjacency) - { - FIXME("Case of adjacency != NULL not implemented.\n"); - return E_NOTIMPL; - } - number_of_vertices = 2 + slices * (stacks-1); number_of_faces = 2 * slices + (stacks - 2) * (2 * slices); @@ -4836,6 +4830,24 @@ free_sincos_table(&phi); sphere->lpVtbl->UnlockIndexBuffer(sphere); sphere->lpVtbl->UnlockVertexBuffer(sphere); + + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(number_of_faces * sizeof(DWORD) * 3, adjacency))) + { + sphere->lpVtbl->Release(sphere); + return hr; + } + + if (FAILED(hr = sphere->lpVtbl->GenerateAdjacency(sphere, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + sphere->lpVtbl->Release(sphere); + return hr; + } + } + *mesh = sphere; return D3D_OK; @@ -5056,6 +5068,113 @@ return hr; } +HRESULT WINAPI D3DXCreateTorus(struct IDirect3DDevice9 *device, + float innerradius, float outerradius, UINT sides, UINT rings, struct ID3DXMesh **mesh, ID3DXBuffer **adjacency) +{ + HRESULT hr; + ID3DXMesh *torus; + WORD (*faces)[3]; + struct vertex *vertices; + float phi, phi_step, sin_phi, cos_phi; + float theta, theta_step, sin_theta, cos_theta; + unsigned int i, j, numvert, numfaces; + + TRACE("device %p, innerradius %.8e, outerradius %.8e, sides %u, rings %u, mesh %p, adjacency %p.\n", + device, innerradius, outerradius, sides, rings, mesh, adjacency); + + numvert = sides * rings; + numfaces = numvert * 2; + + if (!device || innerradius < 0.0f || outerradius < 0.0f || sides < 3 || rings < 3 || !mesh) + { + WARN("Invalid arguments.\n"); + return D3DERR_INVALIDCALL; + } + + if (FAILED(hr = D3DXCreateMeshFVF(numfaces, numvert, D3DXMESH_MANAGED, D3DFVF_XYZ | D3DFVF_NORMAL, device, &torus))) + return hr; + + if (FAILED(hr = torus->lpVtbl->LockVertexBuffer(torus, 0, (void **)&vertices))) + { + torus->lpVtbl->Release(torus); + return hr; + } + + if (FAILED(hr = torus->lpVtbl->LockIndexBuffer(torus, 0, (void **)&faces))) + { + torus->lpVtbl->UnlockVertexBuffer(torus); + torus->lpVtbl->Release(torus); + return hr; + } + + phi_step = D3DX_PI / sides * 2.0f; + theta_step = D3DX_PI / rings * -2.0f; + + theta = 0.0f; + + for (i = 0; i < rings; ++i) + { + phi = 0.0f; + + sin_theta = sinf(theta); + cos_theta = cosf(theta); + + for (j = 0; j < sides; ++j) + { + sin_phi = sinf(phi); + cos_phi = cosf(phi); + + vertices[i * sides + j].position.x = (innerradius * cos_phi + outerradius) * cos_theta; + vertices[i * sides + j].position.y = (innerradius * cos_phi + outerradius) * sin_theta; + vertices[i * sides + j].position.z = innerradius * sin_phi; + vertices[i * sides + j].normal.x = cos_phi * cos_theta; + vertices[i * sides + j].normal.y = cos_phi * sin_theta; + vertices[i * sides + j].normal.z = sin_phi; + + phi += phi_step; + } + + theta += theta_step; + } + + for (i = 0; i < numfaces - sides * 2; ++i) + { + faces[i][0] = i % 2 ? i / 2 + sides : i / 2; + faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + faces[i][2] = (i + 1) % (sides * 2) ? (i + 1) / 2 + sides : (i + 1) / 2; + } + + for (j = 0; i < numfaces; ++i, ++j) + { + faces[i][0] = i % 2 ? j / 2 : i / 2; + faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + faces[i][2] = i == numfaces - 1 ? 0 : (j + 1) / 2; + } + + torus->lpVtbl->UnlockIndexBuffer(torus); + torus->lpVtbl->UnlockVertexBuffer(torus); + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(numfaces * sizeof(DWORD) * 3, adjacency))) + { + torus->lpVtbl->Release(torus); + return hr; + } + + if (FAILED(hr = torus->lpVtbl->GenerateAdjacency(torus, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + torus->lpVtbl->Release(torus); + return hr; + } + } + + *mesh = torus; + + return D3D_OK; +} + enum pointtype { POINTTYPE_CURVE = 0, POINTTYPE_CORNER, diff -Nru wine1.7-1.7.21/dlls/d3dx9_36/surface.c wine1.7-1.7.24/dlls/d3dx9_36/surface.c --- wine1.7-1.7.21/dlls/d3dx9_36/surface.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dx9_36/surface.c 2014-08-08 20:19:29.000000000 +0000 @@ -1030,7 +1030,7 @@ * * RETURNS * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcData or SrcDataSize are NULL + * Failure: D3DERR_INVALIDCALL, if pDestSurface, pSrcData or SrcDataSize is NULL * D3DXERR_INVALIDDATA, if pSrcData is no valid image file * */ @@ -1720,7 +1720,7 @@ * RETURNS * Success: D3D_OK, if we successfully load the pixel data into our surface or * if pSrcMemory is NULL but the other parameters are valid - * Failure: D3DERR_INVALIDCALL, if pDestSurface, SrcPitch or pSrcRect are NULL or + * Failure: D3DERR_INVALIDCALL, if pDestSurface, SrcPitch or pSrcRect is NULL or * if SrcFormat is an invalid format (other than D3DFMT_UNKNOWN) or * if DestRect is invalid * D3DXERR_INVALIDDATA, if we fail to lock pDestSurface @@ -1871,7 +1871,7 @@ * * RETURNS * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcSurface are NULL + * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcSurface is NULL * D3DXERR_INVALIDDATA, if one of the surfaces is not lockable * */ diff -Nru wine1.7-1.7.21/dlls/d3dx9_36/tests/mesh.c wine1.7-1.7.24/dlls/d3dx9_36/tests/mesh.c --- wine1.7-1.7.21/dlls/d3dx9_36/tests/mesh.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dx9_36/tests/mesh.c 2014-08-08 20:19:29.000000000 +0000 @@ -3157,6 +3157,165 @@ DestroyWindow(wnd); } +static BOOL compute_torus(struct mesh *mesh, float innerradius, float outerradius, UINT sides, UINT rings) +{ + float phi, phi_step, sin_phi, cos_phi; + float theta, theta_step, sin_theta, cos_theta; + unsigned int numvert, numfaces, i, j; + + numvert = sides * rings; + numfaces = numvert * 2; + + if (!new_mesh(mesh, numvert, numfaces)) + return FALSE; + + phi_step = D3DX_PI / sides * 2.0f; + theta_step = D3DX_PI / rings * -2.0f; + + theta = 0.0f; + + for (i = 0; i < rings; ++i) + { + phi = 0.0f; + + cos_theta = cosf(theta); + sin_theta = sinf(theta); + + for (j = 0; j < sides; ++j) + { + sin_phi = sinf(phi); + cos_phi = cosf(phi); + + mesh->vertices[i * sides + j].position.x = (innerradius * cos_phi + outerradius) * cos_theta; + mesh->vertices[i * sides + j].position.y = (innerradius * cos_phi + outerradius) * sin_theta; + mesh->vertices[i * sides + j].position.z = innerradius * sin_phi; + mesh->vertices[i * sides + j].normal.x = cos_phi * cos_theta; + mesh->vertices[i * sides + j].normal.y = cos_phi * sin_theta; + mesh->vertices[i * sides + j].normal.z = sin_phi; + + phi += phi_step; + } + + theta += theta_step; + } + + for (i = 0; i < numfaces - sides * 2; ++i) + { + mesh->faces[i][0] = i % 2 ? i / 2 + sides : i / 2; + mesh->faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + mesh->faces[i][2] = (i + 1) % (sides * 2) ? (i + 1) / 2 + sides : (i + 1) / 2; + } + + for (j = 0; i < numfaces; ++i, ++j) + { + mesh->faces[i][0] = i % 2 ? j / 2 : i / 2; + mesh->faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + mesh->faces[i][2] = i == numfaces - 1 ? 0 : (j + 1) / 2; + } + + return TRUE; +} + +static void test_torus(IDirect3DDevice9 *device, float innerradius, float outerradius, UINT sides, UINT rings) +{ + HRESULT hr; + ID3DXMesh *torus; + struct mesh mesh; + char name[256]; + + hr = D3DXCreateTorus(device, innerradius, outerradius, sides, rings, &torus, NULL); + ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK)\n", hr); + if (hr != D3D_OK) + { + skip("Couldn't create torus\n"); + return; + } + + if (!compute_torus(&mesh, innerradius, outerradius, sides, rings)) + { + skip("Couldn't create mesh\n"); + torus->lpVtbl->Release(torus); + return; + } + + mesh.fvf = D3DFVF_XYZ | D3DFVF_NORMAL; + + sprintf(name, "torus (%g, %g, %u, %u)", innerradius, outerradius, sides, rings); + compare_mesh(name, torus, &mesh); + + free_mesh(&mesh); + + torus->lpVtbl->Release(torus); +} + +static void D3DXCreateTorusTest(void) +{ + + HRESULT hr; + HWND wnd; + IDirect3D9* d3d; + IDirect3DDevice9* device; + D3DPRESENT_PARAMETERS d3dpp; + ID3DXMesh* torus = NULL; + + if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, + 640, 480, NULL, NULL, NULL, NULL))) + { + skip("Couldn't create application window\n"); + return; + } + + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Couldn't create IDirect3D9 object\n"); + DestroyWindow(wnd); + return; + } + + ZeroMemory(&d3dpp, sizeof(d3dpp)); + d3dpp.Windowed = TRUE; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#x\n", hr); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); + return; + } + + hr = D3DXCreateTorus(NULL, 0.0f, 0.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, -1.0f, 0.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, -1.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 2, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 3, 2, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 3, 3, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + test_torus(device, 0.0f, 0.0f, 3, 3); + test_torus(device, 1.0f, 1.0f, 3, 3); + test_torus(device, 1.0f, 1.0f, 32, 64); + test_torus(device, 0.0f, 1.0f, 5, 5); + test_torus(device, 1.0f, 0.0f, 5, 5); + test_torus(device, 5.0f, 0.2f, 8, 8); + test_torus(device, 0.2f, 1.0f, 60, 3); + test_torus(device, 0.2f, 1.0f, 8, 70); + + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); +} + struct dynamic_array { int count, capacity; @@ -3528,7 +3687,7 @@ } HeapFree(GetProcessHeap(), 0, raw_outline); raw_outline = HeapAlloc(GetProcessHeap(), 0, datasize); - if (!glyphs) { + if (!raw_outline) { hr = E_OUTOFMEMORY; goto error; } @@ -10302,6 +10461,7 @@ D3DXCreateSphereTest(); D3DXCreateCylinderTest(); D3DXCreateTextTest(); + D3DXCreateTorusTest(); test_get_decl_length(); test_get_decl_vertex_size(); test_fvf_decl_conversion(); diff -Nru wine1.7-1.7.21/dlls/d3dx9_36/util.c wine1.7-1.7.24/dlls/d3dx9_36/util.c --- wine1.7-1.7.21/dlls/d3dx9_36/util.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dx9_36/util.c 2014-08-08 20:19:29.000000000 +0000 @@ -181,6 +181,7 @@ HRESULT hr = S_OK; void *buffer_pointer; DWORD buffer_size; + DWORD bytes_written; HANDLE file = CreateFileW(dst_filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (file == INVALID_HANDLE_VALUE) return HRESULT_FROM_WIN32(GetLastError()); @@ -188,7 +189,7 @@ buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); buffer_size = ID3DXBuffer_GetBufferSize(buffer); - if (!WriteFile(file, buffer_pointer, buffer_size, NULL, NULL)) + if (!WriteFile(file, buffer_pointer, buffer_size, &bytes_written, NULL)) hr = HRESULT_FROM_WIN32(GetLastError()); CloseHandle(file); diff -Nru wine1.7-1.7.21/dlls/d3dxof/d3dxof.c wine1.7-1.7.24/dlls/d3dxof/d3dxof.c --- wine1.7-1.7.21/dlls/d3dxof/d3dxof.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/d3dxof/d3dxof.c 2014-08-08 20:19:29.000000000 +0000 @@ -136,6 +136,7 @@ HRESULT hr; LPBYTE file_buffer; DWORD file_size; + DWORD bytes_written; TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, pvSource, dwLoadOptions, ppEnumObj); @@ -240,7 +241,7 @@ file = CreateFileA(tmp, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL); if (file != INVALID_HANDLE_VALUE) { - WriteFile(file, file_buffer, file_size, NULL, NULL); + WriteFile(file, file_buffer, file_size, &bytes_written, NULL); CloseHandle(file); } } @@ -304,6 +305,7 @@ parse_buffer buf; HRESULT hr; LPBYTE decomp_buffer = NULL; + DWORD bytes_written; ZeroMemory(&buf, sizeof(buf)); buf.buffer = pvData; @@ -325,7 +327,7 @@ file = CreateFileA(tmp, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL); if (file != INVALID_HANDLE_VALUE) { - WriteFile(file, pvData, cbSize, NULL, NULL); + WriteFile(file, pvData, cbSize, &bytes_written, NULL); CloseHandle(file); } } diff -Nru wine1.7-1.7.21/dlls/dbghelp/macho_module.c wine1.7-1.7.24/dlls/dbghelp/macho_module.c --- wine1.7-1.7.21/dlls/dbghelp/macho_module.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dbghelp/macho_module.c 2014-08-08 20:19:29.000000000 +0000 @@ -398,6 +398,11 @@ TRACE("Ignoring special Wine segment %s\n", debugstr_an(sc->segname, sizeof(sc->segname))); return 0; } + if (!strncmp(sc->segname, "__PAGEZERO", 10)) + { + TRACE("Ignoring __PAGEZERO segment\n"); + return 0; + } /* If this segment starts before previously-known earliest, record * new earliest. */ @@ -1020,6 +1025,8 @@ struct module_format* modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct macho_module_info)); if (!modfmt) goto leave; + if (!load_addr) + load_addr = fmap.segs_start; macho_info->module = module_new(pcs, filename, DMT_MACHO, FALSE, load_addr, fmap.segs_size, 0, calc_crc32(fmap.fd)); if (!macho_info->module) diff -Nru wine1.7-1.7.21/dlls/dbghelp/msc.c wine1.7-1.7.24/dlls/dbghelp/msc.c --- wine1.7-1.7.21/dlls/dbghelp/msc.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dbghelp/msc.c 2014-08-08 20:19:29.000000000 +0000 @@ -1988,7 +1988,12 @@ case S_SECTINFO_V3: case S_SUBSECTINFO_V3: case S_ENTRYPOINT_V3: + case 0x113e: case 0x1139: + case 0x1141: + case 0x1142: + case 0x1143: + case 0x1144: TRACE("Unsupported symbol id %x\n", sym->generic.id); break; @@ -2919,8 +2924,8 @@ struct hash_table_elt elt; }; -#define PEV_ERROR(pev, msg) snprintf((pev)->error, sizeof((pev)->error), "%s", (msg)),FALSE -#define PEV_ERROR1(pev, msg, pmt) snprintf((pev)->error, sizeof((pev)->error), (msg), (pmt)),FALSE +#define PEV_ERROR(pev, msg) snprintf((pev)->error, sizeof((pev)->error), "%s", (msg)) +#define PEV_ERROR1(pev, msg, pmt) snprintf((pev)->error, sizeof((pev)->error), (msg), (pmt)) #if 0 static void pev_dump_stack(struct pevaluator* pev) diff -Nru wine1.7-1.7.21/dlls/ddraw/ddraw.c wine1.7-1.7.24/dlls/ddraw/ddraw.c --- wine1.7-1.7.21/dlls/ddraw/ddraw.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/ddraw.c 2014-08-08 20:19:29.000000000 +0000 @@ -2185,23 +2185,13 @@ return ddraw7_GetScanLine(&ddraw->IDirectDraw7_iface, line); } -/***************************************************************************** - * IDirectDraw7::TestCooperativeLevel - * - * Informs the application about the state of the video adapter, depending - * on the cooperative level - * - * Returns: - * DD_OK if the device is in a sane state - * DDERR_NOEXCLUSIVEMODE or DDERR_EXCLUSIVEMODEALREADYSET - * if the state is not correct(See below) - * - *****************************************************************************/ static HRESULT WINAPI ddraw7_TestCooperativeLevel(IDirectDraw7 *iface) { + struct ddraw *ddraw = impl_from_IDirectDraw7(iface); + TRACE("iface %p.\n", iface); - return DD_OK; + return ddraw->device_state == DDRAW_DEVICE_STATE_OK ? DD_OK : DDERR_NOEXCLUSIVEMODE; } static HRESULT WINAPI ddraw4_TestCooperativeLevel(IDirectDraw4 *iface) @@ -2685,27 +2675,20 @@ return hr; } -/***************************************************************************** - * IDirectDraw7::RestoreAllSurfaces - * - * Calls the restore method of all surfaces - * - * Params: - * - * Returns: - * Always returns DD_OK because it's a stub - * - *****************************************************************************/ +static HRESULT CALLBACK restore_callback(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context) +{ + IDirectDrawSurface_Restore(surface); + IDirectDrawSurface_Release(surface); + + return DDENUMRET_OK; +} + static HRESULT WINAPI ddraw7_RestoreAllSurfaces(IDirectDraw7 *iface) { - FIXME("iface %p stub!\n", iface); + TRACE("iface %p.\n", iface); - /* This isn't hard to implement: Enumerate all WineD3D surfaces, - * get their parent and call their restore method. Do not implement - * it in WineD3D, as restoring a surface means re-creating the - * WineD3DDSurface - */ - return DD_OK; + return IDirectDraw7_EnumSurfaces(iface, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, + NULL, NULL, restore_callback); } static HRESULT WINAPI ddraw4_RestoreAllSurfaces(IDirectDraw4 *iface) @@ -4724,7 +4707,14 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate) { + struct ddraw *ddraw = ddraw_from_device_parent(device_parent); + TRACE("device_parent %p, activate %#x.\n", device_parent, activate); + + if (!activate) + InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_LOST, DDRAW_DEVICE_STATE_OK); + else + InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_OK, DDRAW_DEVICE_STATE_LOST); } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, diff -Nru wine1.7-1.7.21/dlls/ddraw/ddraw_private.h wine1.7-1.7.24/dlls/ddraw/ddraw_private.h --- wine1.7-1.7.21/dlls/ddraw/ddraw_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/ddraw_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -58,6 +58,12 @@ #define DDRAW_STRIDE_ALIGNMENT 8 +enum ddraw_device_state +{ + DDRAW_DEVICE_STATE_OK, + DDRAW_DEVICE_STATE_LOST, +}; + struct ddraw { /* Interfaces */ @@ -77,6 +83,7 @@ struct wined3d *wined3d; struct wined3d_device *wined3d_device; DWORD flags; + LONG device_state; struct ddraw_surface *primary; RECT primary_lock; @@ -200,6 +207,8 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture, struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; ULONG ddraw_surface_release_iface(struct ddraw_surface *This) DECLSPEC_HIDDEN; +HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, + const RECT *rect, BOOL read) DECLSPEC_HIDDEN; static inline struct ddraw_surface *impl_from_IDirect3DTexture(IDirect3DTexture *iface) { diff -Nru wine1.7-1.7.21/dlls/ddraw/palette.c wine1.7-1.7.24/dlls/ddraw/palette.c --- wine1.7-1.7.21/dlls/ddraw/palette.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/palette.c 2014-08-08 20:19:29.000000000 +0000 @@ -175,6 +175,10 @@ wined3d_mutex_lock(); hr = wined3d_palette_set_entries(palette->wineD3DPalette, flags, start, count, entries); + + if (SUCCEEDED(hr) && palette->flags & DDPCAPS_PRIMARYSURFACE) + ddraw_surface_update_frontbuffer(palette->ddraw->primary, NULL, FALSE); + wined3d_mutex_unlock(); return hr; diff -Nru wine1.7-1.7.21/dlls/ddraw/surface.c wine1.7-1.7.24/dlls/ddraw/surface.c --- wine1.7-1.7.21/dlls/ddraw/surface.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/surface.c 2014-08-08 20:19:29.000000000 +0000 @@ -40,7 +40,7 @@ * applications from drawing to the screen while we've locked the frontbuffer. * We'd like to do this in wined3d instead, but for that to work wined3d needs * to support windowless rendering first. */ -static HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read) +HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read) { HDC surface_dc, screen_dc; int x, y, w, h; @@ -473,17 +473,15 @@ prev->flags &= ~DDPCAPS_PRIMARYSURFACE; if (palette_impl) palette_impl->flags |= DDPCAPS_PRIMARYSURFACE; - /* Update the wined3d frontbuffer if this is the primary. */ - if (surface->ddraw->wined3d_frontbuffer) - wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer, - palette_impl ? palette_impl->wineD3DPalette : NULL); + wined3d_swapchain_set_palette(surface->ddraw->wined3d_swapchain, + palette_impl ? palette_impl->wineD3DPalette : NULL); + ddraw_surface_update_frontbuffer(surface, NULL, FALSE); } if (palette_impl) IDirectDrawPalette_AddRef(&palette_impl->IDirectDrawPalette_iface); if (prev) IDirectDrawPalette_Release(&prev->IDirectDrawPalette_iface); surface->palette = palette_impl; - wined3d_surface_set_palette(surface->wined3d_surface, palette_impl ? palette_impl->wineD3DPalette : NULL); wined3d_mutex_unlock(); @@ -1229,6 +1227,9 @@ if (src == iface || !(dst_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY))) return DDERR_NOTFLIPPABLE; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + return DDERR_SURFACELOST; + wined3d_mutex_lock(); tmp = dst_impl->wined3d_surface; @@ -2228,63 +2229,63 @@ return hr; } -/***************************************************************************** - * IDirectDrawSurface7::SetPriority - * - * Sets a texture priority for managed textures. - * - * Params: - * Priority: The new priority - * - * Returns: - * DD_OK on success - * For more details, see IWineD3DSurface::SetPriority - * - *****************************************************************************/ -static HRESULT WINAPI ddraw_surface7_SetPriority(IDirectDrawSurface7 *iface, DWORD Priority) +static HRESULT WINAPI ddraw_surface7_SetPriority(IDirectDrawSurface7 *iface, DWORD priority) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); + DWORD managed = DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE; HRESULT hr; + struct wined3d_resource *resource; - TRACE("iface %p, priority %u.\n", iface, Priority); + TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - hr = wined3d_surface_set_priority(surface->wined3d_surface, Priority); + /* No need to check for offscreen plain surfaces or mipmap sublevels. SetPriority + * calls on such surfaces segfault on Windows. */ + if (!(surface->surface_desc.ddsCaps.dwCaps2 & managed)) + { + WARN("Called on non-managed texture returning DDERR_INVALIDPARAMS.\n"); + hr = DDERR_INVALIDPARAMS; + } + else + { + resource = wined3d_texture_get_resource(surface->wined3d_texture); + wined3d_resource_set_priority(resource, priority); + hr = DD_OK; + } wined3d_mutex_unlock(); return hr; } -/***************************************************************************** - * IDirectDrawSurface7::GetPriority - * - * Returns the surface's priority - * - * Params: - * Priority: Address of a variable to write the priority to - * - * Returns: - * D3D_OK on success - * DDERR_INVALIDPARAMS if Priority == NULL - * For more details, see IWineD3DSurface::GetPriority - * - *****************************************************************************/ -static HRESULT WINAPI ddraw_surface7_GetPriority(IDirectDrawSurface7 *iface, DWORD *Priority) +static HRESULT WINAPI ddraw_surface7_GetPriority(IDirectDrawSurface7 *iface, DWORD *priority) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); + const struct wined3d_resource *resource; + DWORD managed = DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE; + HRESULT hr; - TRACE("iface %p, priority %p.\n", iface, Priority); + TRACE("iface %p, priority %p.\n", iface, priority); - if(!Priority) + wined3d_mutex_lock(); + if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) { - return DDERR_INVALIDPARAMS; + WARN("Called on offscreenplain surface, returning DDERR_INVALIDOBJECT.\n"); + hr = DDERR_INVALIDOBJECT; + } + else if (!(surface->surface_desc.ddsCaps.dwCaps2 & managed) || !surface->wined3d_texture) + { + WARN("Called on non-managed texture or mipmap sublevel, returning DDERR_INVALIDPARAMS.\n"); + hr = DDERR_INVALIDPARAMS; + } + else + { + resource = wined3d_texture_get_resource(surface->wined3d_texture); + *priority = wined3d_resource_get_priority(resource); + hr = DD_OK; } - - wined3d_mutex_lock(); - *Priority = wined3d_surface_get_priority(surface->wined3d_surface); wined3d_mutex_unlock(); - return DD_OK; + return hr; } /***************************************************************************** @@ -4514,6 +4515,11 @@ if (!palette) return DDERR_INVALIDPARAMS; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } wined3d_mutex_lock(); if ((palette_impl = surface->palette)) @@ -4704,6 +4710,11 @@ if (surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL) return DDERR_NOTONMIPMAPSUBLEVEL; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } return ddraw_surface_set_palette(surface, palette); } @@ -4714,6 +4725,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface4_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4723,6 +4740,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface3_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4732,6 +4755,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface2_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4741,6 +4770,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } diff -Nru wine1.7-1.7.21/dlls/ddraw/tests/ddraw1.c wine1.7-1.7.24/dlls/ddraw/tests/ddraw1.c --- wine1.7-1.7.21/dlls/ddraw/tests/ddraw1.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/tests/ddraw1.c 2014-08-08 20:19:29.000000000 +0000 @@ -4777,10 +4777,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -4793,10 +4793,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); diff -Nru wine1.7-1.7.21/dlls/ddraw/tests/ddraw2.c wine1.7-1.7.24/dlls/ddraw/tests/ddraw2.c --- wine1.7-1.7.21/dlls/ddraw/tests/ddraw2.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/tests/ddraw2.c 2014-08-08 20:19:29.000000000 +0000 @@ -5862,10 +5862,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -5878,10 +5878,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -6610,7 +6610,7 @@ hr = IDirectDrawSurface_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ diff -Nru wine1.7-1.7.21/dlls/ddraw/tests/ddraw4.c wine1.7-1.7.24/dlls/ddraw/tests/ddraw4.c --- wine1.7-1.7.21/dlls/ddraw/tests/ddraw4.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/tests/ddraw4.c 2014-08-08 20:19:29.000000000 +0000 @@ -6850,10 +6850,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -6866,10 +6866,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -7644,7 +7644,7 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw4_TestCooperativeLevel(ddraw); - todo_wine ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); @@ -7675,7 +7675,7 @@ hr = IDirectDrawSurface4_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ @@ -7718,7 +7718,7 @@ hr = IDirectDraw4_TestCooperativeLevel(ddraw); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); IDirectDrawSurface4_Release(surface); refcount = IDirectDraw4_Release(ddraw); diff -Nru wine1.7-1.7.21/dlls/ddraw/tests/ddraw7.c wine1.7-1.7.24/dlls/ddraw/tests/ddraw7.c --- wine1.7-1.7.21/dlls/ddraw/tests/ddraw7.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/tests/ddraw7.c 2014-08-08 20:19:29.000000000 +0000 @@ -6680,10 +6680,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -6696,10 +6696,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -7366,7 +7366,7 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw7_TestCooperativeLevel(ddraw); - todo_wine ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); @@ -7397,7 +7397,7 @@ hr = IDirectDrawSurface7_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ @@ -7440,7 +7440,7 @@ hr = IDirectDraw7_TestCooperativeLevel(ddraw); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); IDirectDrawSurface7_Release(surface); refcount = IDirectDraw7_Release(ddraw); @@ -7448,6 +7448,127 @@ DestroyWindow(window); } +static void test_resource_priority(void) +{ + IDirectDrawSurface7 *surface, *mipmap; + DDSURFACEDESC2 surface_desc; + IDirectDraw7 *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DDCAPS hal_caps; + DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_MIPMAP; + unsigned int i; + DWORD priority; + static const struct + { + DWORD caps, caps2; + const char *name; + HRESULT hr; + /* SetPriority on offscreenplain surfaces crashes on AMD GPUs on Win7. */ + BOOL crash; + } + test_data[] = + { + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", DDERR_INVALIDPARAMS, FALSE}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", DDERR_INVALIDPARAMS, FALSE}, + {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", DD_OK, FALSE}, + {DDSCAPS_TEXTURE, DDSCAPS2_D3DTEXTUREMANAGE, "managed texture", DD_OK, FALSE}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", DDERR_INVALIDOBJECT, TRUE}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", DDERR_INVALIDOBJECT, TRUE}, + }; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & needed_caps) != needed_caps + || !(hal_caps.ddsCaps.dwCaps & DDSCAPS2_TEXTUREMANAGE)) + { + skip("Required surface types not supported, skipping test.\n"); + goto done; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); i++) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + surface_desc.ddsCaps.dwCaps = test_data[i].caps; + surface_desc.ddsCaps.dwCaps2 = test_data[i].caps2; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, test_data[i].name); + + /* Priority == NULL segfaults. */ + priority = 0xdeadbeef; + hr = IDirectDrawSurface7_GetPriority(surface, &priority); + ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + if (SUCCEEDED(test_data[i].hr)) + ok(priority == 0, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + else + ok(priority == 0xdeadbeef, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + + if (!test_data[i].crash) + { + hr = IDirectDrawSurface7_SetPriority(surface, 1); + ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + hr = IDirectDrawSurface7_GetPriority(surface, &priority); + ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + if (SUCCEEDED(test_data[i].hr)) + { + ok(priority == 1, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + hr = IDirectDrawSurface7_SetPriority(surface, 2); + ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + } + else + ok(priority == 0xdeadbeef, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + } + + IDirectDrawSurface7_Release(surface); + } + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; + U2(surface_desc).dwMipMapCount = 2; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + priority = 0xdeadbeef; + hr = IDirectDrawSurface7_GetPriority(mipmap, &priority); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type managed mipmap.\n", hr); + ok(priority == 0xdeadbeef, "Got unexpected priority %u, type managed mipmap.\n", priority); + /* SetPriority on the mipmap surface crashes. */ + hr = IDirectDrawSurface7_GetPriority(surface, &priority); + ok(SUCCEEDED(hr), "Failed to get priority, hr %#x.\n", hr); + ok(priority == 0, "Got unexpected priority %u, type managed mipmap.\n", priority); + + IDirectDrawSurface7_Release(mipmap); + refcount = IDirectDrawSurface7_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + +done: + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); @@ -7519,4 +7640,5 @@ test_palette_alpha(); test_vb_writeonly(); test_lost_device(); + test_resource_priority(); } diff -Nru wine1.7-1.7.21/dlls/ddraw/tests/visual.c wine1.7-1.7.24/dlls/ddraw/tests/visual.c --- wine1.7-1.7.21/dlls/ddraw/tests/visual.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ddraw/tests/visual.c 2014-08-08 20:19:29.000000000 +0000 @@ -23,6 +23,16 @@ #include "ddraw.h" #include "d3d.h" +struct vec3 +{ + float x, y, z; +}; + +struct vec4 +{ + float x, y, z, w; +}; + static HWND window; static IDirectDraw7 *DirectDraw; static IDirectDrawSurface7 *Surface; @@ -264,25 +274,6 @@ return; } -struct vertex -{ - float x, y, z; - DWORD diffuse; -}; - -struct tvertex -{ - float x, y, z, w; - DWORD diffuse; -}; - -struct nvertex -{ - float x, y, z; - float nx, ny, nz; - DWORD diffuse; -}; - static void lighting_test(IDirect3DDevice7 *device) { HRESULT hr; @@ -297,33 +288,44 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; - struct vertex unlitquad[] = + struct { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, - }; - struct vertex litquad[] = + struct vec3 position; + DWORD diffuse; + } + unlitquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000}, + }, + litquad[] = + { + {{-1.0f, 0.0f, 0.1f}, 0xff00ff00}, + {{-1.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00}, }; - struct nvertex unlitnquad[] = + struct { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - }; - struct nvertex litnquad[] = + struct vec3 position; + struct vec3 normal; + DWORD diffuse; + } + unlitnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + }, + litnquad[] = + { + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, }; WORD Indices[] = {0, 1, 2, 2, 3, 0}; @@ -444,18 +446,6 @@ ok(color == 0x00ffffff, "Clear rectangle 4(neg, neg) has color %08x\n", color); } -struct sVertex { - float x, y, z; - DWORD diffuse; - DWORD specular; -}; - -struct sVertexT { - float x, y, z, rhw; - DWORD diffuse; - DWORD specular; -}; - static void fog_test(IDirect3DDevice7 *device) { HRESULT hr; @@ -463,34 +453,64 @@ float start = 0.0, end = 1.0; D3DDEVICEDESC7 caps; + struct + { + struct vec3 position; + DWORD diffuse; + DWORD specular; + } /* Gets full z based fog with linear fog, no fog with specular color */ - struct sVertex untransformed_1[] = { - {-1, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - {-1, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - }; + untransformed_1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000, 0xff000000}, + }, /* Ok, I am too lazy to deal with transform matrices */ - struct sVertex untransformed_2[] = { - {-1, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, - {-1, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, - }; - /* Untransformed ones. Give them a different diffuse color to make the test look - * nicer. It also makes making sure that they are drawn correctly easier. - */ - struct sVertexT transformed_1[] = { - {320, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - }; - struct sVertexT transformed_2[] = { - {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {320, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, + untransformed_2[] = + { + {{-1.0f, 0.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{-1.0f, 1.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 1.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 1.0f}, 0xffff0000, 0xff000000}, + }, + far_quad1[] = + { + {{-1.0f, -1.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{-1.0f, 0.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, -1.0f, 0.5f}, 0xffff0000, 0xff000000}, + }, + far_quad2[] = + { + {{-1.0f, 0.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{-1.0f, 1.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 1.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 1.5f}, 0xffff0000, 0xff000000}, + }; + /* Untransformed ones. Give them a different diffuse color to make the + * test look nicer. It also makes making sure that they are drawn + * correctly easier. */ + struct + { + struct vec4 position; + DWORD diffuse; + DWORD specular; + } + transformed_1[] = + { + {{320.0f, 0.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{640.0f, 0.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{640.0f, 240.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{320.0f, 240.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + }, + transformed_2[] = + { + {{320.0f, 240.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{640.0f, 240.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{640.0f, 480.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, + {{320.0f, 480.0f, 1.0f, 1.0f}, 0xffffff00, 0xff000000}, }; WORD Indices[] = {0, 1, 2, 2, 3, 0}; D3DMATRIX ident_mat = @@ -521,20 +541,6 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, }; - struct sVertex far_quad1[] = - { - {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - }; - struct sVertex far_quad2[] = - { - {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - }; memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice7_GetCaps(device, &caps); @@ -930,19 +936,24 @@ DWORD color, red, green, blue; DDSURFACEDESC2 ddsd; - struct vertex quad1[] = + struct { - {-1.0f, -1.0f, 0.1f, 0x4000ff00}, - {-1.0f, 0.0f, 0.1f, 0x4000ff00}, - { 1.0f, -1.0f, 0.1f, 0x4000ff00}, - { 1.0f, 0.0f, 0.1f, 0x4000ff00}, - }; - struct vertex quad2[] = + struct vec3 position; + DWORD diffuse; + } + quad1[] = { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + {{-1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{-1.0f, 0.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, 0.0f, 0.1f}, 0x4000ff00}, + }, + quad2[] = + { + {{-1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{-1.0f, 1.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 1.0f, 0.1f}, 0xc00000ff}, }; static float composite_quad[][5] = { { 0.0f, -1.0f, 0.1f, 0.0f, 1.0f}, @@ -2237,12 +2248,17 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; - struct vertex quad[] = + struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = { - {-1.0f, -1.0f, 0.1f, 0xffffffff}, - {-1.0f, 1.0f, 0.1f, 0xffffffff}, - { 1.0f, 1.0f, 0.1f, 0xffffffff}, - { 1.0f, -1.0f, 0.1f, 0xffffffff}, + {{-1.0f, -1.0f, 0.1f}, 0xffffffff}, + {{-1.0f, 1.0f, 0.1f}, 0xffffffff}, + {{ 1.0f, 1.0f, 0.1f}, 0xffffffff}, + {{ 1.0f, -1.0f, 0.1f}, 0xffffffff}, }; WORD Indices[] = {0, 1, 2, 2, 3, 0}; @@ -2967,47 +2983,57 @@ */ static void depth_clamp_test(IDirect3DDevice7 *device) { - struct tvertex quad1[] = - { - { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - }; - struct tvertex quad2[] = + struct { - { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - }; - struct tvertex quad3[] = - { - {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - }; - struct tvertex quad4[] = + struct vec4 position; + DWORD diffuse; + } + quad1[] = { - { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, + {{ 0.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{ 0.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + }, + quad2[] = + { + {{ 0.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{ 0.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + }, + quad3[] = + { + {{112.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{112.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + }, + quad4[] = + { + {{ 42.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{ 42.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, }; - struct vertex quad5[] = + struct { - { -0.5f, 0.5f, 10.0f, 0xff14f914}, - { 0.5f, 0.5f, 10.0f, 0xff14f914}, - { -0.5f, -0.5f, 10.0f, 0xff14f914}, - { 0.5f, -0.5f, 10.0f, 0xff14f914}, - }; - struct vertex quad6[] = + struct vec3 position; + DWORD diffuse; + } + quad5[] = { - { -1.0f, 0.5f, 10.0f, 0xfff91414}, - { 1.0f, 0.5f, 10.0f, 0xfff91414}, - { -1.0f, 0.25f, 10.0f, 0xfff91414}, - { 1.0f, 0.25f, 10.0f, 0xfff91414}, + {{-0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{-0.5f, -0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, -0.5f, 10.0f}, 0xff14f914}, + }, + quad6[] = + { + {{-1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{-1.0f, 0.25f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.25f, 10.0f}, 0xfff91414}, }; D3DVIEWPORT7 vp; diff -Nru wine1.7-1.7.21/dlls/dinput/tests/dinput.c wine1.7-1.7.24/dlls/dinput/tests/dinput.c --- wine1.7-1.7.21/dlls/dinput/tests/dinput.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dinput/tests/dinput.c 2014-08-08 20:19:29.000000000 +0000 @@ -603,6 +603,7 @@ "IDirectInput_CreateDevice failed with guid from GetConfig hr = 0x%08x\n", hr); } + IDirectInput_Release(pDI); } START_TEST(dinput) diff -Nru wine1.7-1.7.21/dlls/dmime/performance.c wine1.7-1.7.24/dlls/dmime/performance.c --- wine1.7-1.7.21/dlls/dmime/performance.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dmime/performance.c 2014-08-08 20:19:29.000000000 +0000 @@ -388,9 +388,6 @@ return E_POINTER; } pItem = DMUS_PMSGToItem(pPMSG); - if (NULL == pItem) { - return E_POINTER; - } if (pItem->bInUse) { return DMUS_E_ALREADY_SENT; } @@ -512,9 +509,6 @@ return E_POINTER; } pItem = DMUS_PMSGToItem(pPMSG); - if (NULL == pItem) { - return E_POINTER; - } if (pItem->bInUse) { /** prevent for freeing PMsg in queue (ie to be processed) */ return DMUS_E_CANNOT_FREE; diff -Nru wine1.7-1.7.21/dlls/dmime/tests/dmime.c wine1.7-1.7.24/dlls/dmime/tests/dmime.c --- wine1.7-1.7.21/dlls/dmime/tests/dmime.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dmime/tests/dmime.c 2014-08-08 20:19:29.000000000 +0000 @@ -380,6 +380,10 @@ hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (void**)&dmo); + if (hr == REGDB_E_CLASSNOTREG) { + win_skip("DirectMusicAudioPathConfig not registered\n"); + return; + } ok(hr == S_OK, "DirectMusicAudioPathConfig create failed: %08x, expected S_OK\n", hr); /* IPersistStream */ diff -Nru wine1.7-1.7.21/dlls/dnsapi/query.c wine1.7-1.7.24/dlls/dnsapi/query.c --- wine1.7-1.7.21/dlls/dnsapi/query.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dnsapi/query.c 2014-08-08 20:19:29.000000000 +0000 @@ -147,7 +147,9 @@ case HOST_NOT_FOUND: return DNS_ERROR_RCODE_NAME_ERROR; case TRY_AGAIN: return DNS_ERROR_RCODE_SERVER_FAILURE; case NO_RECOVERY: return DNS_ERROR_RCODE_REFUSED; +#ifdef NETDB_INTERNAL case NETDB_INTERNAL: return DNS_ERROR_RCODE; +#endif default: FIXME( "unmapped error code: %d\n", error ); return DNS_ERROR_RCODE_NOT_IMPLEMENTED; diff -Nru wine1.7-1.7.21/dlls/dsound/dsound_main.c wine1.7-1.7.24/dlls/dsound/dsound_main.c --- wine1.7-1.7.21/dlls/dsound/dsound_main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dsound/dsound_main.c 2014-08-08 20:19:29.000000000 +0000 @@ -178,7 +178,8 @@ hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)devenum); if(FAILED(hr)){ - CoUninitialize(); + if(SUCCEEDED(init_hr)) + CoUninitialize(); *devenum = NULL; ERR("CoCreateInstance failed: %08x\n", hr); return hr; diff -Nru wine1.7-1.7.21/dlls/dssenh/tests/dssenh.c wine1.7-1.7.24/dlls/dssenh/tests/dssenh.c --- wine1.7-1.7.21/dlls/dssenh/tests/dssenh.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dssenh/tests/dssenh.c 2014-08-08 20:19:29.000000000 +0000 @@ -704,6 +704,27 @@ result = CryptDestroyHash(hHash); ok(result, "Expected destruction of hash after deriving key.\n"); + /* the default algorithm is CBC, test that without setting a mode */ + mode = 0xdeadbeef; + dataLen = sizeof(mode); + result = CryptGetKeyParam(pKey, KP_MODE, (BYTE*)&mode, &dataLen, 0); + ok(result, "Expected getting of KP_MODE, got %x.\n", GetLastError()); + ok(mode == CRYPT_MODE_CBC, "Default mode should be CBC\n"); + + memcpy(pbData, plainText, plainLen); + dataLen = plainLen; + result = CryptEncrypt(pKey, 0, TRUE, 0, pbData, &dataLen, 36); + ok(result, "Expected data encryption, got %x.\n", GetLastError()); + + /* Verify we have the correct encrypted data */ + ok(!memcmp(pbData, tests[1].encrypted, dataLen), "Incorrect encrypted data.\n"); + + result = CryptDecrypt(pKey, 0, TRUE, 0, pbData, &dataLen); + ok(result, "Expected data decryption, got %x.\n", GetLastError()); + + /* Verify we have the correct decrypted data */ + ok(!memcmp(pbData, (BYTE *)plainText, dataLen), "Incorrect decrypted data.\n"); + /* test block cipher modes */ for(i = 0; i < testLen; i++) { diff -Nru wine1.7-1.7.21/dlls/dwrite/analyzer.c wine1.7-1.7.24/dlls/dwrite/analyzer.c --- wine1.7-1.7.21/dlls/dwrite/analyzer.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/analyzer.c 2014-08-08 20:19:29.000000000 +0000 @@ -23,8 +23,6 @@ #include "dwrite.h" #include "dwrite_private.h" -#include "wine/debug.h" - WINE_DEFAULT_DEBUG_CHANNEL(dwrite); enum scriptcode { diff -Nru wine1.7-1.7.21/dlls/dwrite/dwrite_private.h wine1.7-1.7.24/dlls/dwrite/dwrite_private.h --- wine1.7-1.7.21/dlls/dwrite/dwrite_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/dwrite_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "wine/debug.h" #include "wine/unicode.h" static inline void *heap_alloc(size_t len) @@ -71,11 +72,16 @@ return ret; } +static inline const char *debugstr_range(const DWRITE_TEXT_RANGE *range) +{ + return wine_dbg_sprintf("%u:%u", range->startPosition, range->length); +} + extern HRESULT create_font_from_logfont(const LOGFONTW*, IDWriteFont**) DECLSPEC_HIDDEN; extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC_HIDDEN; extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; -extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,IDWriteTextLayout**) DECLSPEC_HIDDEN; +extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; extern HRESULT create_trimmingsign(IDWriteInlineObject**) DECLSPEC_HIDDEN; extern HRESULT get_gdiinterop(IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.21/dlls/dwrite/font.c wine1.7-1.7.24/dlls/dwrite/font.c --- wine1.7-1.7.21/dlls/dwrite/font.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/font.c 2014-08-08 20:19:29.000000000 +0000 @@ -23,8 +23,6 @@ #include "dwrite.h" #include "dwrite_private.h" -#include "wine/debug.h" - WINE_DEFAULT_DEBUG_CHANNEL(dwrite); /* PANOSE is 10 bytes in size, need to pack the structure properly */ diff -Nru wine1.7-1.7.21/dlls/dwrite/gdiinterop.c wine1.7-1.7.24/dlls/dwrite/gdiinterop.c --- wine1.7-1.7.21/dlls/dwrite/gdiinterop.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/gdiinterop.c 2014-08-08 20:19:29.000000000 +0000 @@ -36,10 +36,33 @@ IDWriteBitmapRenderTarget IDWriteBitmapRenderTarget_iface; LONG ref; + DWRITE_MATRIX m; SIZE size; HDC hdc; }; +static HRESULT create_target_dibsection(HDC hdc, UINT32 width, UINT32 height) +{ + char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; + BITMAPINFO *bmi = (BITMAPINFO*)bmibuf; + HBITMAP hbm; + + memset(bmi, 0, sizeof(bmibuf)); + bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); + bmi->bmiHeader.biHeight = height; + bmi->bmiHeader.biWidth = width; + bmi->bmiHeader.biBitCount = 32; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biCompression = BI_RGB; + + hbm = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + if (!hbm) + hbm = CreateBitmap(1, 1, 1, 1, NULL); + + DeleteObject(SelectObject(hdc, hbm)); + return S_OK; +} + static inline struct rendertarget *impl_from_IDWriteBitmapRenderTarget(IDWriteBitmapRenderTarget *iface) { return CONTAINING_RECORD(iface, struct rendertarget, IDWriteBitmapRenderTarget_iface); @@ -122,8 +145,11 @@ static HRESULT WINAPI rendertarget_GetCurrentTransform(IDWriteBitmapRenderTarget *iface, DWRITE_MATRIX *transform) { struct rendertarget *This = impl_from_IDWriteBitmapRenderTarget(iface); - FIXME("(%p)->(%p): stub\n", This, transform); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, transform); + + *transform = This->m; + return S_OK; } static HRESULT WINAPI rendertarget_SetCurrentTransform(IDWriteBitmapRenderTarget *iface, DWRITE_MATRIX const *transform) @@ -145,8 +171,13 @@ static HRESULT WINAPI rendertarget_Resize(IDWriteBitmapRenderTarget *iface, UINT32 width, UINT32 height) { struct rendertarget *This = impl_from_IDWriteBitmapRenderTarget(iface); - FIXME("(%p)->(%u %u): stub\n", This, width, height); - return E_NOTIMPL; + + TRACE("(%p)->(%u %u)\n", This, width, height); + + if (This->size.cx == width && This->size.cy == height) + return S_OK; + + return create_target_dibsection(This->hdc, width, height); } static const IDWriteBitmapRenderTargetVtbl rendertargetvtbl = { @@ -163,38 +194,34 @@ rendertarget_Resize }; -static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **target) +static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **ret) { - char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; - BITMAPINFO *bmi = (BITMAPINFO*)bmibuf; - struct rendertarget *This; - HBITMAP dib; + struct rendertarget *target; + HRESULT hr; - *target = NULL; + *ret = NULL; - This = heap_alloc(sizeof(struct rendertarget)); - if (!This) return E_OUTOFMEMORY; + target = heap_alloc(sizeof(struct rendertarget)); + if (!target) return E_OUTOFMEMORY; - This->IDWriteBitmapRenderTarget_iface.lpVtbl = &rendertargetvtbl; - This->ref = 1; + target->IDWriteBitmapRenderTarget_iface.lpVtbl = &rendertargetvtbl; + target->ref = 1; - This->size.cx = width; - This->size.cy = height; + target->size.cx = width; + target->size.cy = height; - This->hdc = CreateCompatibleDC(hdc); - - memset(bmi, 0, sizeof(bmibuf)); - bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); - bmi->bmiHeader.biHeight = height; - bmi->bmiHeader.biWidth = width; - bmi->bmiHeader.biBitCount = 32; - bmi->bmiHeader.biPlanes = 1; - bmi->bmiHeader.biCompression = BI_RGB; + target->hdc = CreateCompatibleDC(hdc); + hr = create_target_dibsection(target->hdc, width, height); + if (FAILED(hr)) { + IDWriteBitmapRenderTarget_Release(&target->IDWriteBitmapRenderTarget_iface); + return hr; + } - dib = CreateDIBSection(This->hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); - SelectObject(This->hdc, dib); + target->m.m11 = target->m.m22 = 1.0; + target->m.m12 = target->m.m21 = 0.0; + target->m.dx = target->m.dy = 0.0; - *target = &This->IDWriteBitmapRenderTarget_iface; + *ret = &target->IDWriteBitmapRenderTarget_iface; return S_OK; } diff -Nru wine1.7-1.7.21/dlls/dwrite/layout.c wine1.7-1.7.24/dlls/dwrite/layout.c --- wine1.7-1.7.21/dlls/dwrite/layout.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/layout.c 2014-08-08 20:19:29.000000000 +0000 @@ -28,8 +28,6 @@ #include "dwrite.h" #include "dwrite_private.h" -#include "wine/debug.h" - WINE_DEFAULT_DEBUG_CHANNEL(dwrite); struct dwrite_textformat_data { @@ -66,6 +64,8 @@ WCHAR *str; UINT32 len; struct dwrite_textformat_data format; + FLOAT maxwidth; + FLOAT maxheight; }; struct dwrite_textformat { @@ -340,113 +340,115 @@ static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout *iface, FLOAT maxWidth) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%f): stub\n", This, maxWidth); - return E_NOTIMPL; + TRACE("(%p)->(%.1f)\n", This, maxWidth); + This->maxwidth = maxWidth; + return S_OK; } static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout *iface, FLOAT maxHeight) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%f): stub\n", This, maxHeight); - return E_NOTIMPL; + TRACE("(%p)->(%.1f)\n", This, maxHeight); + This->maxheight = maxHeight; + return S_OK; } static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%p %u:%u): stub\n", This, collection, range.startPosition, range.length); + FIXME("(%p)->(%p %s): stub\n", This, collection, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetFontFamilyName(IDWriteTextLayout *iface, WCHAR const *name, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(name), range.startPosition, range.length); + FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(name), debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetFontWeight(IDWriteTextLayout *iface, DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%d %u:%u): stub\n", This, weight, range.startPosition, range.length); + FIXME("(%p)->(%d %s): stub\n", This, weight, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetFontStyle(IDWriteTextLayout *iface, DWRITE_FONT_STYLE style, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%d %u:%u): stub\n", This, style, range.startPosition, range.length); + FIXME("(%p)->(%d %s): stub\n", This, style, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetFontStretch(IDWriteTextLayout *iface, DWRITE_FONT_STRETCH stretch, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%d %u:%u): stub\n", This, stretch, range.startPosition, range.length); + FIXME("(%p)->(%d %s): stub\n", This, stretch, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetFontSize(IDWriteTextLayout *iface, FLOAT size, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%f %u:%u): stub\n", This, size, range.startPosition, range.length); + FIXME("(%p)->(%f %s): stub\n", This, size, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetUnderline(IDWriteTextLayout *iface, BOOL underline, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%d %u:%u): stub\n", This, underline, range.startPosition, range.length); + FIXME("(%p)->(%d %s): stub\n", This, underline, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetStrikethrough(IDWriteTextLayout *iface, BOOL strikethrough, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%d %u:%u): stub\n", This, strikethrough, range.startPosition, range.length); + FIXME("(%p)->(%d %s): stub\n", This, strikethrough, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetDrawingEffect(IDWriteTextLayout *iface, IUnknown* effect, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%p %u:%u): stub\n", This, effect, range.startPosition, range.length); + FIXME("(%p)->(%p %s): stub\n", This, effect, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetInlineObject(IDWriteTextLayout *iface, IDWriteInlineObject *object, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%p %u:%u): stub\n", This, object, range.startPosition, range.length); + FIXME("(%p)->(%p %s): stub\n", This, object, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetTypography(IDWriteTextLayout *iface, IDWriteTypography* typography, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%p %u:%u): stub\n", This, typography, range.startPosition, range.length); + FIXME("(%p)->(%p %s): stub\n", This, typography, debugstr_range(&range)); return E_NOTIMPL; } static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout *iface, WCHAR const* locale, DWRITE_TEXT_RANGE range) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(locale), range.startPosition, range.length); + FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(locale), debugstr_range(&range)); return E_NOTIMPL; } static FLOAT WINAPI dwritetextlayout_GetMaxWidth(IDWriteTextLayout *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p): stub\n", This); - return 0.0; + TRACE("(%p)\n", This); + return This->maxwidth; } static FLOAT WINAPI dwritetextlayout_GetMaxHeight(IDWriteTextLayout *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p): stub\n", This); - return 0.0; + TRACE("(%p)\n", This); + return This->maxheight; } static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayout *iface, UINT32 pos, @@ -752,7 +754,7 @@ IDWriteTextFormat_GetFontCollection(format, &layout->format.collection); } -HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, IDWriteTextLayout **layout) +HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, IDWriteTextLayout **layout) { struct dwrite_textlayout *This; @@ -765,6 +767,8 @@ This->ref = 1; This->str = heap_strdupnW(str, len); This->len = len; + This->maxwidth = maxwidth; + This->maxheight = maxheight; layout_format_from_textformat(This, format); *layout = &This->IDWriteTextLayout_iface; diff -Nru wine1.7-1.7.21/dlls/dwrite/main.c wine1.7-1.7.24/dlls/dwrite/main.c --- wine1.7-1.7.21/dlls/dwrite/main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/main.c 2014-08-08 20:19:29.000000000 +0000 @@ -359,14 +359,30 @@ return S_OK; } +struct dwritefactory{ + IDWriteFactory IDWriteFactory_iface; + LONG ref; + + IDWriteFontCollectionLoader **loaders; + LONG loader_count; +}; + +static inline struct dwritefactory *impl_from_IDWriteFactory(IDWriteFactory *iface) +{ + return CONTAINING_RECORD(iface, struct dwritefactory, IDWriteFactory_iface); +} + static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory *iface, REFIID riid, void **obj) { - TRACE("(%s %p)\n", debugstr_guid(riid), obj); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteFactory)) { *obj = iface; + IDWriteFactory_AddRef(iface); return S_OK; } @@ -377,18 +393,36 @@ static ULONG WINAPI dwritefactory_AddRef(IDWriteFactory *iface) { - return 2; + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; } static ULONG WINAPI dwritefactory_Release(IDWriteFactory *iface) { - return 1; + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) { + int i; + for (i = 0; i < This->loader_count; i++) + if (This->loaders[i]) + IDWriteFontCollectionLoader_Release(This->loaders[i]); + heap_free(This->loaders); + heap_free(This); + } + + return ref; } static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory *iface, IDWriteFontCollection **collection, BOOL check_for_updates) { - TRACE("(%p %d)\n", collection, check_for_updates); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%p %d)\n", This, collection, check_for_updates); if (check_for_updates) FIXME("checking for system font updates not implemented\n"); @@ -399,35 +433,78 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory *iface, IDWriteFontCollectionLoader *loader, void const *key, UINT32 key_size, IDWriteFontCollection **collection) { - FIXME("(%p %p %u %p): stub\n", loader, key, key_size, collection); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p %p %u %p): stub\n", This, loader, key, key_size, collection); return E_NOTIMPL; } static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory *iface, IDWriteFontCollectionLoader *loader) { - FIXME("(%p): stub\n", loader); - return E_NOTIMPL; + int i; + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + + TRACE("(%p)->(%p)\n", This, loader); + + for (i = 0; i < This->loader_count; i++) + if (This->loaders[i] == loader) + return DWRITE_E_ALREADYREGISTERED; + else if (This->loaders[i] == NULL) + break; + + if (i == This->loader_count) + { + IDWriteFontCollectionLoader **new_list = NULL; + int new_count = 0; + + new_count = This->loader_count * 2; + new_list = heap_realloc(This->loaders, new_count * sizeof(*This->loaders)); + + if (!new_list) + return E_OUTOFMEMORY; + else + { + This->loader_count = new_count; + This->loaders = new_list; + } + } + IDWriteFontCollectionLoader_AddRef(loader); + This->loaders[i] = loader; + + return S_OK; } static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactory *iface, IDWriteFontCollectionLoader *loader) { - FIXME("(%p): stub\n", loader); - return E_NOTIMPL; + int i; + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + + TRACE("(%p)->(%p)\n", This, loader); + + for (i = 0; i < This->loader_count; i++) + if (This->loaders[i] == loader) break; + if (i == This->loader_count) + return E_INVALIDARG; + IDWriteFontCollectionLoader_Release(This->loaders[i]); + This->loaders[i] = NULL; + + return S_OK; } static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory *iface, WCHAR const *path, FILETIME const *writetime, IDWriteFontFile **font_file) { - FIXME("(%s %p %p): stub\n", debugstr_w(path), writetime, font_file); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%s %p %p): stub\n", This, debugstr_w(path), writetime, font_file); return E_NOTIMPL; } static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory *iface, void const *reference_key, UINT32 key_size, IDWriteFontFileLoader *loader, IDWriteFontFile **font_file) { - FIXME("(%p %u %p %p): stub\n", reference_key, key_size, loader, font_file); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p %u %p %p): stub\n", This, reference_key, key_size, loader, font_file); return E_NOTIMPL; } @@ -435,16 +512,18 @@ DWRITE_FONT_FACE_TYPE facetype, UINT32 files_number, IDWriteFontFile* const* font_files, UINT32 index, DWRITE_FONT_SIMULATIONS sim_flags, IDWriteFontFace **font_face) { - FIXME("(%d %u %p %u 0x%x %p): stub\n", facetype, files_number, font_files, index, sim_flags, font_face); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%d %u %p %u 0x%x %p): stub\n", This, facetype, files_number, font_files, index, sim_flags, font_face); return E_NOTIMPL; } static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory *iface, IDWriteRenderingParams **params) { + struct dwritefactory *This = impl_from_IDWriteFactory(iface); HMONITOR monitor; POINT pt; - TRACE("(%p)\n", params); + TRACE("(%p)->(%p)\n", This, params); pt.x = pt.y = 0; monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); @@ -454,9 +533,10 @@ static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory *iface, HMONITOR monitor, IDWriteRenderingParams **params) { + struct dwritefactory *This = impl_from_IDWriteFactory(iface); static int fixme_once = 0; - TRACE("(%p %p)\n", monitor, params); + TRACE("(%p)->(%p %p)\n", This, monitor, params); if (!fixme_once++) FIXME("(%p): monitor setting ignored\n", monitor); @@ -467,19 +547,22 @@ static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory *iface, FLOAT gamma, FLOAT enhancedContrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode, IDWriteRenderingParams **params) { - TRACE("(%f %f %f %d %d %p)\n", gamma, enhancedContrast, cleartype_level, geometry, mode, params); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%f %f %f %d %d %p)\n", This, gamma, enhancedContrast, cleartype_level, geometry, mode, params); return create_renderingparams(gamma, enhancedContrast, cleartype_level, geometry, mode, params); } static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory *iface, IDWriteFontFileLoader *loader) { - FIXME("(%p): stub\n", loader); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p): stub\n", This, loader); return E_NOTIMPL; } static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory *iface, IDWriteFontFileLoader *loader) { - FIXME("(%p): stub\n", loader); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p): stub\n", This, loader); return E_NOTIMPL; } @@ -487,60 +570,68 @@ IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style, DWRITE_FONT_STRETCH stretch, FLOAT size, WCHAR const *locale, IDWriteTextFormat **format) { - TRACE("(%s %p %d %d %d %f %s %p)\n", debugstr_w(family_name), collection, weight, style, stretch, + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%s %p %d %d %d %f %s %p)\n", This, debugstr_w(family_name), collection, weight, style, stretch, size, debugstr_w(locale), format); return create_textformat(family_name, collection, weight, style, stretch, size, locale, format); } static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory *iface, IDWriteTypography **typography) { - FIXME("(%p): stub\n", typography); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p): stub\n", This, typography); return E_NOTIMPL; } static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory *iface, IDWriteGdiInterop **gdi_interop) { - TRACE("(%p)\n", gdi_interop); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%p)\n", This, gdi_interop); return get_gdiinterop(gdi_interop); } static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory *iface, WCHAR const* string, UINT32 len, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout) { - TRACE("(%s %u %p %f %f %p)\n", debugstr_w(string), len, format, max_width, max_height, layout); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%s %u %p %f %f %p)\n", This, debugstr_w(string), len, format, max_width, max_height, layout); if (!format) return E_INVALIDARG; - return create_textlayout(string, len, format, layout); + return create_textlayout(string, len, format, max_width, max_height, layout); } static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory *iface, WCHAR const* string, UINT32 len, IDWriteTextFormat *format, FLOAT layout_width, FLOAT layout_height, FLOAT pixels_per_dip, DWRITE_MATRIX const* transform, BOOL use_gdi_natural, IDWriteTextLayout **layout) { - FIXME("(%s:%u %p %f %f %f %p %d %p): semi-stub\n", debugstr_wn(string, len), len, format, layout_width, layout_height, + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%s:%u %p %f %f %f %p %d %p): semi-stub\n", This, debugstr_wn(string, len), len, format, layout_width, layout_height, pixels_per_dip, transform, use_gdi_natural, layout); if (!format) return E_INVALIDARG; - return create_textlayout(string, len, format, layout); + return create_textlayout(string, len, format, layout_width, layout_height, layout); } static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory *iface, IDWriteTextFormat *format, IDWriteInlineObject **trimming_sign) { - FIXME("(%p %p): semi-stub\n", format, trimming_sign); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p %p): semi-stub\n", This, format, trimming_sign); return create_trimmingsign(trimming_sign); } static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory *iface, IDWriteTextAnalyzer **analyzer) { - TRACE("(%p)\n", analyzer); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + TRACE("(%p)->(%p)\n", This, analyzer); return get_textanalyzer(analyzer); } static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory *iface, DWRITE_NUMBER_SUBSTITUTION_METHOD method, WCHAR const* locale, BOOL ignore_user_override, IDWriteNumberSubstitution **substitution) { - FIXME("(%d %s %d %p): stub\n", method, debugstr_w(locale), ignore_user_override, substitution); + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%d %s %d %p): stub\n", This, method, debugstr_w(locale), ignore_user_override, substitution); return E_NOTIMPL; } @@ -548,7 +639,8 @@ FLOAT pixels_per_dip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, FLOAT baseline_x, FLOAT baseline_y, IDWriteGlyphRunAnalysis **analysis) { - FIXME("(%p %f %p %d %d %f %f %p): stub\n", glyph_run, pixels_per_dip, transform, rendering_mode, + struct dwritefactory *This = impl_from_IDWriteFactory(iface); + FIXME("(%p)->(%p %f %p %d %d %f %f %p): stub\n", This, glyph_run, pixels_per_dip, transform, rendering_mode, measuring_mode, baseline_x, baseline_y, analysis); return E_NOTIMPL; } @@ -580,15 +672,23 @@ dwritefactory_CreateGlyphRunAnalysis }; -static IDWriteFactory dwritefactory = { &dwritefactoryvtbl }; - HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnknown **factory) { + struct dwritefactory *This; + TRACE("(%d, %s, %p)\n", type, debugstr_guid(riid), factory); if (!IsEqualIID(riid, &IID_IDWriteFactory)) return E_FAIL; - *factory = (IUnknown*)&dwritefactory; + This = heap_alloc(sizeof(struct dwritefactory)); + if (!This) return E_OUTOFMEMORY; + + This->IDWriteFactory_iface.lpVtbl = &dwritefactoryvtbl; + This->ref = 1; + This->loader_count = 2; + This->loaders = heap_alloc_zero(sizeof(*This->loaders) * 2); + + *factory = (IUnknown*)&This->IDWriteFactory_iface; return S_OK; } diff -Nru wine1.7-1.7.21/dlls/dwrite/tests/analyzer.c wine1.7-1.7.24/dlls/dwrite/tests/analyzer.c --- wine1.7-1.7.21/dlls/dwrite/tests/analyzer.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/tests/analyzer.c 2014-08-08 20:19:29.000000000 +0000 @@ -25,6 +25,7 @@ #include "initguid.h" #include "windows.h" #include "dwrite.h" +#include "dwrite_2.h" #include "wine/test.h" diff -Nru wine1.7-1.7.21/dlls/dwrite/tests/font.c wine1.7-1.7.24/dlls/dwrite/tests/font.c --- wine1.7-1.7.21/dlls/dwrite/tests/font.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/tests/font.c 2014-08-08 20:19:29.000000000 +0000 @@ -198,8 +198,9 @@ { IDWriteBitmapRenderTarget *target, *target2; IDWriteGdiInterop *interop; + HBITMAP hbm, hbm2; + DWRITE_MATRIX m; DIBSECTION ds; - HBITMAP hbm; HRESULT hr; SIZE size; HDC hdc; @@ -272,8 +273,66 @@ ok(size.cx == 10, "got %d\n", size.cx); ok(size.cy == 5, "got %d\n", size.cy); - IDWriteBitmapRenderTarget_Release(target); + /* resize to same size */ + hr = IDWriteBitmapRenderTarget_Resize(target, 10, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 == hbm, "got %p, %p\n", hbm2, hbm); + + /* shrink */ + hr = IDWriteBitmapRenderTarget_Resize(target, 5, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + hr = IDWriteBitmapRenderTarget_Resize(target, 20, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + hr = IDWriteBitmapRenderTarget_Resize(target, 1, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + ret = GetObjectW(hbm2, sizeof(ds), &ds); + ok(ret == sizeof(ds), "got %d\n", ret); + ok(ds.dsBm.bmWidth == 1, "got %d\n", ds.dsBm.bmWidth); + ok(ds.dsBm.bmHeight == 5, "got %d\n", ds.dsBm.bmHeight); + ok(ds.dsBm.bmPlanes == 1, "got %d\n", ds.dsBm.bmPlanes); + ok(ds.dsBm.bmBitsPixel == 32, "got %d\n", ds.dsBm.bmBitsPixel); + ok(ds.dsBm.bmBits != NULL, "got %p\n", ds.dsBm.bmBits); + + /* empty rectangle */ + hr = IDWriteBitmapRenderTarget_Resize(target, 0, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + ret = GetObjectW(hbm2, sizeof(ds), &ds); + ok(ret == sizeof(BITMAP), "got %d\n", ret); + ok(ds.dsBm.bmWidth == 1, "got %d\n", ds.dsBm.bmWidth); + ok(ds.dsBm.bmHeight == 1, "got %d\n", ds.dsBm.bmHeight); + ok(ds.dsBm.bmPlanes == 1, "got %d\n", ds.dsBm.bmPlanes); + ok(ds.dsBm.bmBitsPixel == 1, "got %d\n", ds.dsBm.bmBitsPixel); + ok(!ds.dsBm.bmBits, "got %p\n", ds.dsBm.bmBits); + /* transform tests */ +if (0) /* crashes on native */ + hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, NULL); + + memset(&m, 0xcc, sizeof(m)); + hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21); + ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy); + + IDWriteBitmapRenderTarget_Release(target); IDWriteGdiInterop_Release(interop); } @@ -614,6 +673,55 @@ IDWriteFontFace_Release(fontface); } +static HRESULT WINAPI fontcollectionloader_QueryInterface(IDWriteFontCollectionLoader *iface, REFIID riid, void **obj) +{ + *obj = iface; + return S_OK; +} + +static ULONG WINAPI fontcollectionloader_AddRef(IDWriteFontCollectionLoader *iface) +{ + return 2; +} + +static ULONG WINAPI fontcollectionloader_Release(IDWriteFontCollectionLoader *iface) +{ + return 1; +} + +static HRESULT WINAPI fontcollectionloader_CreateEnumeratorFromKey(IDWriteFontCollectionLoader *iface, IDWriteFactory * factory, const void * collectionKey, UINT32 collectionKeySize, IDWriteFontFileEnumerator ** fontFileEnumerator) +{ + return S_OK; +} + +static const struct IDWriteFontCollectionLoaderVtbl dwritefontcollectionloadervtbl = { + fontcollectionloader_QueryInterface, + fontcollectionloader_AddRef, + fontcollectionloader_Release, + fontcollectionloader_CreateEnumeratorFromKey +}; + +static void test_CustomFontCollection(void) +{ + IDWriteFontCollectionLoader collection = { &dwritefontcollectionloadervtbl }; + IDWriteFontCollectionLoader collection2 = { &dwritefontcollectionloadervtbl }; + HRESULT hr; + + hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &collection); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &collection2); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &collection); + ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr); + + hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, &collection); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, &collection); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, &collection2); + ok(hr == S_OK, "got 0x%08x\n", hr); +} + START_TEST(font) { HRESULT hr; @@ -634,6 +742,7 @@ test_GetMetrics(); test_system_fontcollection(); test_ConvertFontFaceToLOGFONT(); + test_CustomFontCollection(); IDWriteFactory_Release(factory); } diff -Nru wine1.7-1.7.21/dlls/dwrite/tests/layout.c wine1.7-1.7.24/dlls/dwrite/tests/layout.c --- wine1.7-1.7.21/dlls/dwrite/tests/layout.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dwrite/tests/layout.c 2014-08-08 20:19:29.000000000 +0000 @@ -20,8 +20,11 @@ #define COBJMACROS +#include + #include "windows.h" #include "dwrite.h" +#include "dwrite_2.h" #include "wine/test.h" @@ -38,6 +41,271 @@ ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); } +enum drawcall_kind { + DRAW_GLYPHRUN = 0, + DRAW_UNDERLINE, + DRAW_STRIKETHROUGH, + DRAW_INLINE, + DRAW_LAST_KIND +}; + +static const char *get_draw_kind_name(enum drawcall_kind kind) +{ + static const char *kind_names[] = { "GLYPH_RUN", "UNDERLINE", "STRIKETHROUGH", "INLINE", "END_OF_SEQ" }; + return kind > DRAW_LAST_KIND ? "unknown" : kind_names[kind]; +} + +struct drawcall_entry { + enum drawcall_kind kind; +}; + +struct drawcall_sequence +{ + int count; + int size; + struct drawcall_entry *sequence; +}; + +struct drawtestcontext { + enum drawcall_kind kind; + BOOL todo; + int *failcount; + const char *file; + int line; +}; + +#define NUM_CALL_SEQUENCES 1 +#define RENDERER_ID 0 +static struct drawcall_sequence *sequences[NUM_CALL_SEQUENCES]; +static struct drawcall_sequence *expected_seq[1]; + +static void add_call(struct drawcall_sequence **seq, int sequence_index, const struct drawcall_entry *call) +{ + struct drawcall_sequence *call_seq = seq[sequence_index]; + + if (!call_seq->sequence) { + call_seq->size = 10; + call_seq->sequence = HeapAlloc(GetProcessHeap(), 0, call_seq->size * sizeof (struct drawcall_entry)); + } + + if (call_seq->count == call_seq->size) { + call_seq->size *= 2; + call_seq->sequence = HeapReAlloc(GetProcessHeap(), 0, + call_seq->sequence, + call_seq->size * sizeof (struct drawcall_entry)); + } + + assert(call_seq->sequence); + call_seq->sequence[call_seq->count++] = *call; +} + +static inline void flush_sequence(struct drawcall_sequence **seg, int sequence_index) +{ + struct drawcall_sequence *call_seq = seg[sequence_index]; + + HeapFree(GetProcessHeap(), 0, call_seq->sequence); + call_seq->sequence = NULL; + call_seq->count = call_seq->size = 0; +} + +static inline void flush_sequences(struct drawcall_sequence **seq, int n) +{ + int i; + for (i = 0; i < n; i++) + flush_sequence(seq, i); +} + +static void init_call_sequences(struct drawcall_sequence **seq, int n) +{ + int i; + + for (i = 0; i < n; i++) + seq[i] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct drawcall_sequence)); +} + +static void ok_sequence_(struct drawcall_sequence **seq, int sequence_index, + const struct drawcall_entry *expected, const char *context, BOOL todo, + const char *file, int line) +{ + static const struct drawcall_entry end_of_sequence = { DRAW_LAST_KIND }; + struct drawcall_sequence *call_seq = seq[sequence_index]; + const struct drawcall_entry *actual, *sequence; + int failcount = 0; + + add_call(seq, sequence_index, &end_of_sequence); + + sequence = call_seq->sequence; + actual = sequence; + + while (expected->kind != DRAW_LAST_KIND && actual->kind != DRAW_LAST_KIND) { + if (expected->kind != actual->kind) { + if (todo) { + failcount++; + todo_wine + 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)); + + flush_sequence(seq, sequence_index); + return; + } + else + 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)); + } + expected++; + actual++; + } + + if (todo) { + todo_wine { + if (expected->kind != DRAW_LAST_KIND || actual->kind != DRAW_LAST_KIND) { + failcount++; + ok_(file, line) (0, "%s: the call sequence is not complete: expected %s - actual %s\n", + context, get_draw_kind_name(expected->kind), get_draw_kind_name(actual->kind)); + } + } + } + else if (expected->kind != DRAW_LAST_KIND || actual->kind != DRAW_LAST_KIND) + ok_(file, line) (0, "%s: the call sequence is not complete: expected %s - actual %s\n", + context, get_draw_kind_name(expected->kind), get_draw_kind_name(actual->kind)); + + if (todo && !failcount) /* succeeded yet marked todo */ + todo_wine + ok_(file, line)(1, "%s: marked \"todo_wine\" but succeeds\n", context); + + flush_sequence(seq, sequence_index); +} + +#define ok_sequence(seq, index, exp, contx, todo) \ + ok_sequence_(seq, index, (exp), (contx), (todo), __FILE__, __LINE__) + +static HRESULT WINAPI testrenderer_QI(IDWriteTextRenderer *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IDWriteTextRenderer) || + IsEqualIID(riid, &IID_IDWritePixelSnapping) || + IsEqualIID(riid, &IID_IUnknown) + ) { + *obj = iface; + return S_OK; + } + + *obj = NULL; + + /* IDWriteTextRenderer1 overrides drawing calls, ignore for now */ + if (IsEqualIID(riid, &IID_IDWriteTextRenderer1)) + return E_NOINTERFACE; + + ok(0, "unexpected QI %s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI testrenderer_AddRef(IDWriteTextRenderer *iface) +{ + return 2; +} + +static ULONG WINAPI testrenderer_Release(IDWriteTextRenderer *iface) +{ + return 1; +} + +static HRESULT WINAPI testrenderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface, + void *client_drawingcontext, BOOL *disabled) +{ + *disabled = TRUE; + return S_OK; +} + +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; +} + +static HRESULT WINAPI testrenderer_GetPixelsPerDip(IDWriteTextRenderer *iface, + void *client_drawingcontext, FLOAT *pixels_per_dip) +{ + *pixels_per_dip = 1.0; + return S_OK; +} + +static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface, + void* client_drawingcontext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE mode, + DWRITE_GLYPH_RUN const *glyph_run, + DWRITE_GLYPH_RUN_DESCRIPTION const *run_descr, + IUnknown *drawing_effect) +{ + struct drawcall_entry entry; + entry.kind = DRAW_GLYPHRUN; + add_call(sequences, RENDERER_ID, &entry); + return S_OK; +} + +static HRESULT WINAPI testrenderer_DrawUnderline(IDWriteTextRenderer *iface, + void *client_drawingcontext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_UNDERLINE const* underline, + IUnknown *drawing_effect) +{ + struct drawcall_entry entry; + entry.kind = DRAW_UNDERLINE; + add_call(sequences, RENDERER_ID, &entry); + return S_OK; +} + +static HRESULT WINAPI testrenderer_DrawStrikethrough(IDWriteTextRenderer *iface, + void *client_drawingcontext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_STRIKETHROUGH const* strikethrough, + IUnknown *drawing_effect) +{ + struct drawcall_entry entry; + entry.kind = DRAW_STRIKETHROUGH; + add_call(sequences, RENDERER_ID, &entry); + return S_OK; +} + +static HRESULT WINAPI testrenderer_DrawInlineObject(IDWriteTextRenderer *iface, + void *client_drawingcontext, + FLOAT originX, + FLOAT originY, + IDWriteInlineObject *object, + BOOL is_sideways, + BOOL is_rtl, + IUnknown *drawing_effect) +{ + struct drawcall_entry entry; + entry.kind = DRAW_INLINE; + add_call(sequences, RENDERER_ID, &entry); + return S_OK; +} + +static const IDWriteTextRendererVtbl testrenderervtbl = { + testrenderer_QI, + testrenderer_AddRef, + testrenderer_Release, + testrenderer_IsPixelSnappingDisabled, + testrenderer_GetCurrentTransform, + testrenderer_GetPixelsPerDip, + testrenderer_DrawGlyphRun, + testrenderer_DrawUnderline, + testrenderer_DrawStrikethrough, + testrenderer_DrawInlineObject +}; + +static IDWriteTextRenderer testrenderer = { &testrenderervtbl }; + static void test_CreateTextLayout(void) { static const WCHAR strW[] = {'s','t','r','i','n','g',0}; @@ -65,6 +333,7 @@ static const WCHAR strW[] = {'s','t','r','i','n','g',0}; IDWriteTextLayout *layout; IDWriteTextFormat *format; + FLOAT dimension; HRESULT hr; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout); @@ -102,8 +371,14 @@ /* zero length string is okay */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 0, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); - IDWriteTextLayout_Release(layout); + dimension = IDWriteTextLayout_GetMaxWidth(layout); + ok(dimension == 100.0, "got %f\n", dimension); + + dimension = IDWriteTextLayout_GetMaxHeight(layout); + ok(dimension == 100.0, "got %f\n", dimension); + + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); } @@ -262,6 +537,210 @@ IDWriteTextFormat_Release(format); } +static void test_fontweight(void) +{ + static const WCHAR strW[] = {'s','t','r','i','n','g',0}; + static const WCHAR ruW[] = {'r','u',0}; + IDWriteTextFormat *format, *fmt2; + IDWriteTextLayout *layout; + DWRITE_FONT_WEIGHT weight; + DWRITE_TEXT_RANGE range; + HRESULT hr; + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, ruW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 0, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&fmt2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + weight = IDWriteTextFormat_GetFontWeight(fmt2); +todo_wine + ok(weight == DWRITE_FONT_WEIGHT_BOLD, "got %u\n", weight); + + range.startPosition = 0; + range.length = 6; + hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* IDWriteTextFormat methods output doesn't reflect layout changes */ + weight = IDWriteTextFormat_GetFontWeight(fmt2); +todo_wine + ok(weight == DWRITE_FONT_WEIGHT_BOLD, "got %u\n", weight); + + range.length = 0; + weight = DWRITE_FONT_WEIGHT_BOLD; + hr = layout->lpVtbl->IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight); + ok(range.length == 6, "got %d\n", range.length); +} + IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(fmt2); + IDWriteTextFormat_Release(format); +} + +static void test_SetInlineObject(void) +{ + static const WCHAR strW[] = {'s','t','r','i','n','g',0}; + static const WCHAR ruW[] = {'r','u',0}; + + IDWriteInlineObject *inlineobj, *inlineobj2, *inlinetest; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + DWRITE_TEXT_RANGE range; + HRESULT hr; + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, ruW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 0, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + inlinetest = (void*)0x1; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(inlinetest == NULL, "got %p\n", inlineobj); +} + range.startPosition = 0; + range.length = 2; + hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + inlinetest = (void*)0x1; + hr = IDWriteTextLayout_GetInlineObject(layout, 2, &inlinetest, NULL); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(inlinetest == NULL, "got %p\n", inlinetest); +} + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} + range.startPosition = 1; + range.length = 1; + hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj2, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj2, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} + range.startPosition = 1; + range.length = 1; + hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 1; + range.length = 2; + hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(format); +} + +/* drawing calls sequence doesn't depend on run order, instead all runs are + drawn first, inline objects next and then underline/strikes */ +static const struct drawcall_entry draw_seq[] = { + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_INLINE }, + { DRAW_UNDERLINE }, + { DRAW_STRIKETHROUGH }, + { DRAW_LAST_KIND } +}; + +static void test_draw_sequence(void) +{ + static const WCHAR strW[] = {'s','t','r','i','n','g',0}; + static const WCHAR ruW[] = {'r','u',0}; + + IDWriteInlineObject *inlineobj; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + DWRITE_TEXT_RANGE range; + HRESULT hr; + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, ruW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + 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); + + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj); + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 5; + range.length = 1; + hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 1; + range.length = 1; + hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 4; + range.length = 1; + hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown*)inlineobj, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 0; + range.length = 1; + hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE); + + IDWriteTextFormat_Release(format); + IDWriteTextLayout_Release(layout); +} + START_TEST(layout) { HRESULT hr; @@ -274,11 +753,17 @@ return; } + init_call_sequences(sequences, NUM_CALL_SEQUENCES); + init_call_sequences(expected_seq, 1); + test_CreateTextLayout(); test_CreateGdiCompatibleTextLayout(); test_CreateTextFormat(); test_GetLocaleName(); test_CreateEllipsisTrimmingSign(); + test_fontweight(); + test_SetInlineObject(); + test_draw_sequence(); IDWriteFactory_Release(factory); } diff -Nru wine1.7-1.7.21/dlls/dxgi/device.c wine1.7-1.7.24/dlls/dxgi/device.c --- wine1.7-1.7.21/dlls/dxgi/device.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dxgi/device.c 2014-08-08 20:19:29.000000000 +0000 @@ -276,8 +276,7 @@ return E_OUTOFMEMORY; } - hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer); - if (FAILED(hr)) + if (FAILED(hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer, desc))) { WARN("Failed to initialize surface, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff -Nru wine1.7-1.7.21/dlls/dxgi/dxgi_private.h wine1.7-1.7.24/dlls/dxgi/dxgi_private.h --- wine1.7-1.7.21/dlls/dxgi/dxgi_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dxgi/dxgi_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -142,8 +142,11 @@ IUnknown *outer_unknown; LONG refcount; IDXGIDevice *device; + + DXGI_SURFACE_DESC desc; }; -HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer) DECLSPEC_HIDDEN; +HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, + IUnknown *outer, const DXGI_SURFACE_DESC *desc) DECLSPEC_HIDDEN; #endif /* __WINE_DXGI_PRIVATE_H */ diff -Nru wine1.7-1.7.21/dlls/dxgi/factory.c wine1.7-1.7.24/dlls/dxgi/factory.c --- wine1.7-1.7.21/dlls/dxgi/factory.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dxgi/factory.c 2014-08-08 20:19:29.000000000 +0000 @@ -161,7 +161,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags) { - FIXME("iface %p, window %p, flags %#x stub!\n\n", iface, window, flags); + FIXME("iface %p, window %p, flags %#x stub!\n", iface, window, flags); return E_NOTIMPL; } diff -Nru wine1.7-1.7.21/dlls/dxgi/surface.c wine1.7-1.7.24/dlls/dxgi/surface.c --- wine1.7-1.7.21/dlls/dxgi/surface.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/dxgi/surface.c 2014-08-08 20:19:29.000000000 +0000 @@ -154,9 +154,13 @@ /* IDXGISurface methods */ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_SURFACE_DESC *desc) { - FIXME("iface %p, desc %p stub!\n", iface, desc); + struct dxgi_surface *surface = impl_from_IDXGISurface(iface); - return E_NOTIMPL; + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = surface->desc; + + return S_OK; } static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags) @@ -200,13 +204,15 @@ dxgi_surface_inner_Release, }; -HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer) +HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, + IUnknown *outer, const DXGI_SURFACE_DESC *desc) { surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl; surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl; surface->refcount = 1; surface->outer_unknown = outer ? outer : &surface->IUnknown_iface; surface->device = device; + surface->desc = *desc; return S_OK; } diff -Nru wine1.7-1.7.21/dlls/gdi32/enhmfdrv/init.c wine1.7-1.7.24/dlls/gdi32/enhmfdrv/init.c --- wine1.7-1.7.21/dlls/gdi32/enhmfdrv/init.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdi32/enhmfdrv/init.c 2014-08-08 20:19:29.000000000 +0000 @@ -193,6 +193,7 @@ BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr ) { DWORD len; + DWORD bytes_written; ENHMETAHEADER *emh; EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev; @@ -205,7 +206,7 @@ physDev->emh->nRecords++; if(physDev->hFile) { - if (!WriteFile(physDev->hFile, emr, emr->nSize, NULL, NULL)) + if (!WriteFile(physDev->hFile, emr, emr->nSize, &bytes_written, NULL)) return FALSE; } else { DWORD nEmfSize = HeapSize(GetProcessHeap(), 0, physDev->emh); @@ -316,6 +317,7 @@ EMFDRV_PDEVICE *physDev; HANDLE hFile; DWORD size = 0, length = 0; + DWORD bytes_written; TRACE("%s\n", debugstr_w(filename) ); @@ -407,7 +409,7 @@ free_dc_ptr( dc ); return 0; } - if (!WriteFile( hFile, physDev->emh, size, NULL, NULL )) { + if (!WriteFile( hFile, physDev->emh, size, &bytes_written, NULL )) { free_dc_ptr( dc ); CloseHandle( hFile ); return 0; diff -Nru wine1.7-1.7.21/dlls/gdi32/mfdrv/init.c wine1.7-1.7.24/dlls/gdi32/mfdrv/init.c --- wine1.7-1.7.21/dlls/gdi32/mfdrv/init.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdi32/mfdrv/init.c 2014-08-08 20:19:29.000000000 +0000 @@ -321,6 +321,7 @@ DC *dc; METAFILEDRV_PDEVICE *physDev; HANDLE hFile; + DWORD bytes_written; TRACE("%s\n", debugstr_w(filename) ); @@ -335,8 +336,8 @@ free_dc_ptr( dc ); return 0; } - if (!WriteFile( hFile, physDev->mh, sizeof(*physDev->mh), NULL, - NULL )) { + if (!WriteFile( hFile, physDev->mh, sizeof(*physDev->mh), + &bytes_written, NULL )) { free_dc_ptr( dc ); CloseHandle (hFile ); return 0; @@ -387,6 +388,7 @@ { DC *dc; METAFILEDRV_PDEVICE *physDev; + DWORD bytes_written; TRACE("(%p)\n", hdc ); @@ -423,7 +425,7 @@ physDev->mh->mtType = METAFILE_MEMORY; /* This is what windows does */ if (!WriteFile(physDev->hFile, physDev->mh, sizeof(*physDev->mh), - NULL, NULL)) { + &bytes_written, NULL)) { free_dc_ptr( dc ); return 0; } diff -Nru wine1.7-1.7.21/dlls/gdi32/tests/font.c wine1.7-1.7.24/dlls/gdi32/tests/font.c --- wine1.7-1.7.21/dlls/gdi32/tests/font.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdi32/tests/font.c 2014-08-08 20:19:29.000000000 +0000 @@ -3357,7 +3357,12 @@ return r; } +#define TT_PLATFORM_APPLE_UNICODE 0 +#define TT_PLATFORM_MACINTOSH 1 #define TT_PLATFORM_MICROSOFT 3 +#define TT_APPLE_ID_DEFAULT 0 +#define TT_APPLE_ID_ISO_10646 2 +#define TT_APPLE_ID_UNICODE_2_0 3 #define TT_MS_ID_SYMBOL_CS 0 #define TT_MS_ID_UNICODE_CS 1 #define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 @@ -3365,6 +3370,194 @@ #define TT_NAME_ID_FONT_SUBFAMILY 2 #define TT_NAME_ID_UNIQUE_ID 3 #define TT_NAME_ID_FULL_NAME 4 +#define TT_MAC_ID_SIMPLIFIED_CHINESE 25 + +typedef struct sfnt_name +{ + USHORT platform_id; + USHORT encoding_id; + USHORT language_id; + USHORT name_id; + USHORT length; + USHORT offset; +} sfnt_name; + +static const LANGID mac_langid_table[] = +{ + MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ENGLISH */ + MAKELANGID(LANG_FRENCH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FRENCH */ + MAKELANGID(LANG_GERMAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GERMAN */ + MAKELANGID(LANG_ITALIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ITALIAN */ + MAKELANGID(LANG_DUTCH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_DUTCH */ + MAKELANGID(LANG_SWEDISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SWEDISH */ + MAKELANGID(LANG_SPANISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SPANISH */ + MAKELANGID(LANG_DANISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_DANISH */ + MAKELANGID(LANG_PORTUGUESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PORTUGUESE */ + MAKELANGID(LANG_NORWEGIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_NORWEGIAN */ + MAKELANGID(LANG_HEBREW,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HEBREW */ + MAKELANGID(LANG_JAPANESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_JAPANESE */ + MAKELANGID(LANG_ARABIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ARABIC */ + MAKELANGID(LANG_FINNISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FINNISH */ + MAKELANGID(LANG_GREEK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GREEK */ + MAKELANGID(LANG_ICELANDIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ICELANDIC */ + MAKELANGID(LANG_MALTESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALTESE */ + MAKELANGID(LANG_TURKISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TURKISH */ + MAKELANGID(LANG_CROATIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CROATIAN */ + MAKELANGID(LANG_CHINESE_TRADITIONAL,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CHINESE_TRADITIONAL */ + MAKELANGID(LANG_URDU,SUBLANG_DEFAULT), /* TT_MAC_LANGID_URDU */ + MAKELANGID(LANG_HINDI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HINDI */ + MAKELANGID(LANG_THAI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_THAI */ + MAKELANGID(LANG_KOREAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KOREAN */ + MAKELANGID(LANG_LITHUANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LITHUANIAN */ + MAKELANGID(LANG_POLISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_POLISH */ + MAKELANGID(LANG_HUNGARIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HUNGARIAN */ + MAKELANGID(LANG_ESTONIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ESTONIAN */ + MAKELANGID(LANG_LATVIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LETTISH */ + MAKELANGID(LANG_SAMI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SAAMISK */ + MAKELANGID(LANG_FAEROESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FAEROESE */ + MAKELANGID(LANG_FARSI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FARSI */ + MAKELANGID(LANG_RUSSIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_RUSSIAN */ + MAKELANGID(LANG_CHINESE_SIMPLIFIED,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CHINESE_SIMPLIFIED */ + MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH_BELGIAN), /* TT_MAC_LANGID_FLEMISH */ + MAKELANGID(LANG_IRISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_IRISH */ + MAKELANGID(LANG_ALBANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ALBANIAN */ + MAKELANGID(LANG_ROMANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ROMANIAN */ + MAKELANGID(LANG_CZECH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CZECH */ + MAKELANGID(LANG_SLOVAK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SLOVAK */ + MAKELANGID(LANG_SLOVENIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SLOVENIAN */ + 0, /* TT_MAC_LANGID_YIDDISH */ + MAKELANGID(LANG_SERBIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SERBIAN */ + MAKELANGID(LANG_MACEDONIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MACEDONIAN */ + MAKELANGID(LANG_BULGARIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BULGARIAN */ + MAKELANGID(LANG_UKRAINIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UKRAINIAN */ + MAKELANGID(LANG_BELARUSIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BYELORUSSIAN */ + MAKELANGID(LANG_UZBEK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UZBEK */ + MAKELANGID(LANG_KAZAK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KAZAKH */ + MAKELANGID(LANG_AZERI,SUBLANG_AZERI_CYRILLIC), /* TT_MAC_LANGID_AZERBAIJANI */ + 0, /* TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT */ + MAKELANGID(LANG_ARMENIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ARMENIAN */ + MAKELANGID(LANG_GEORGIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GEORGIAN */ + 0, /* TT_MAC_LANGID_MOLDAVIAN */ + MAKELANGID(LANG_KYRGYZ,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KIRGHIZ */ + MAKELANGID(LANG_TAJIK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TAJIKI */ + MAKELANGID(LANG_TURKMEN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TURKMEN */ + MAKELANGID(LANG_MONGOLIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MONGOLIAN */ + MAKELANGID(LANG_MONGOLIAN,SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA), /* TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT */ + MAKELANGID(LANG_PASHTO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PASHTO */ + 0, /* TT_MAC_LANGID_KURDISH */ + MAKELANGID(LANG_KASHMIRI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KASHMIRI */ + MAKELANGID(LANG_SINDHI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SINDHI */ + MAKELANGID(LANG_TIBETAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TIBETAN */ + MAKELANGID(LANG_NEPALI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_NEPALI */ + MAKELANGID(LANG_SANSKRIT,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SANSKRIT */ + MAKELANGID(LANG_MARATHI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MARATHI */ + MAKELANGID(LANG_BENGALI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BENGALI */ + MAKELANGID(LANG_ASSAMESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ASSAMESE */ + MAKELANGID(LANG_GUJARATI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GUJARATI */ + MAKELANGID(LANG_PUNJABI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PUNJABI */ + MAKELANGID(LANG_ORIYA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ORIYA */ + MAKELANGID(LANG_MALAYALAM,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAYALAM */ + MAKELANGID(LANG_KANNADA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KANNADA */ + MAKELANGID(LANG_TAMIL,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TAMIL */ + MAKELANGID(LANG_TELUGU,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TELUGU */ + MAKELANGID(LANG_SINHALESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SINHALESE */ + 0, /* TT_MAC_LANGID_BURMESE */ + MAKELANGID(LANG_KHMER,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KHMER */ + MAKELANGID(LANG_LAO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LAO */ + MAKELANGID(LANG_VIETNAMESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_VIETNAMESE */ + MAKELANGID(LANG_INDONESIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_INDONESIAN */ + 0, /* TT_MAC_LANGID_TAGALOG */ + MAKELANGID(LANG_MALAY,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAY_ROMAN_SCRIPT */ + 0, /* TT_MAC_LANGID_MALAY_ARABIC_SCRIPT */ + MAKELANGID(LANG_AMHARIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_AMHARIC */ + MAKELANGID(LANG_TIGRIGNA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TIGRINYA */ + 0, /* TT_MAC_LANGID_GALLA */ + 0, /* TT_MAC_LANGID_SOMALI */ + MAKELANGID(LANG_SWAHILI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SWAHILI */ + 0, /* TT_MAC_LANGID_RUANDA */ + 0, /* TT_MAC_LANGID_RUNDI */ + 0, /* TT_MAC_LANGID_CHEWA */ + MAKELANGID(LANG_MALAGASY,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAGASY */ + MAKELANGID(LANG_ESPERANTO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ESPERANTO */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 95-111 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 112-127 */ + MAKELANGID(LANG_WELSH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_WELSH */ + MAKELANGID(LANG_BASQUE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BASQUE */ + MAKELANGID(LANG_CATALAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CATALAN */ + 0, /* TT_MAC_LANGID_LATIN */ + MAKELANGID(LANG_QUECHUA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_QUECHUA */ + 0, /* TT_MAC_LANGID_GUARANI */ + 0, /* TT_MAC_LANGID_AYMARA */ + MAKELANGID(LANG_TATAR,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TATAR */ + MAKELANGID(LANG_UIGHUR,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UIGHUR */ + 0, /* TT_MAC_LANGID_DZONGKHA */ + 0, /* TT_MAC_LANGID_JAVANESE */ + 0, /* TT_MAC_LANGID_SUNDANESE */ + MAKELANGID(LANG_GALICIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GALICIAN */ + MAKELANGID(LANG_AFRIKAANS,SUBLANG_DEFAULT), /* TT_MAC_LANGID_AFRIKAANS */ + MAKELANGID(LANG_BRETON,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BRETON */ + MAKELANGID(LANG_INUKTITUT,SUBLANG_DEFAULT), /* TT_MAC_LANGID_INUKTITUT */ + MAKELANGID(LANG_SCOTTISH_GAELIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SCOTTISH_GAELIC */ + MAKELANGID(LANG_MANX_GAELIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MANX_GAELIC */ + MAKELANGID(LANG_IRISH,SUBLANG_IRISH_IRELAND), /* TT_MAC_LANGID_IRISH_GAELIC */ + 0, /* TT_MAC_LANGID_TONGAN */ + 0, /* TT_MAC_LANGID_GREEK_POLYTONIC */ + MAKELANGID(LANG_GREENLANDIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GREELANDIC */ + MAKELANGID(LANG_AZERI,SUBLANG_AZERI_LATIN), /* TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT */ +}; + +static inline WORD get_mac_code_page( const sfnt_name *name ) +{ + if (GET_BE_WORD(name->encoding_id) == TT_MAC_ID_SIMPLIFIED_CHINESE) return 10008; /* special case */ + return 10000 + GET_BE_WORD(name->encoding_id); +} + +static int match_name_table_language( const sfnt_name *name, LANGID lang ) +{ + LANGID name_lang; + int res = 0; + + switch (GET_BE_WORD(name->platform_id)) + { + case TT_PLATFORM_MICROSOFT: + res += 5; /* prefer the Microsoft name */ + switch (GET_BE_WORD(name->encoding_id)) + { + case TT_MS_ID_UNICODE_CS: + case TT_MS_ID_SYMBOL_CS: + name_lang = GET_BE_WORD(name->language_id); + break; + default: + return 0; + } + break; + case TT_PLATFORM_MACINTOSH: + if (!IsValidCodePage( get_mac_code_page( name ))) return 0; + if (GET_BE_WORD(name->language_id) >= sizeof(mac_langid_table)/sizeof(mac_langid_table[0])) return 0; + name_lang = mac_langid_table[GET_BE_WORD(name->language_id)]; + break; + case TT_PLATFORM_APPLE_UNICODE: + res += 2; /* prefer Unicode encodings */ + switch (GET_BE_WORD(name->encoding_id)) + { + case TT_APPLE_ID_DEFAULT: + case TT_APPLE_ID_ISO_10646: + case TT_APPLE_ID_UNICODE_2_0: + if (GET_BE_WORD(name->language_id) >= sizeof(mac_langid_table)/sizeof(mac_langid_table[0])) return 0; + name_lang = mac_langid_table[GET_BE_WORD(name->language_id)]; + break; + default: + return 0; + } + break; + default: + return 0; + } + if (name_lang == lang) res += 30; + else if (PRIMARYLANGID( name_lang ) == PRIMARYLANGID( lang )) res += 20; + else if (name_lang == MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )) res += 10; + return res; +} static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size, LCID language_id) { @@ -3374,21 +3567,14 @@ USHORT number_of_record; USHORT storage_offset; } *header; - struct sfnt_name - { - USHORT platform_id; - USHORT encoding_id; - USHORT language_id; - USHORT name_id; - USHORT length; - USHORT offset; - } *entry; + sfnt_name *entry; BOOL r = FALSE; LONG size, offset, length; LONG c, ret; WCHAR *name; BYTE *data; USHORT i; + int res, best_lang = 0, best_index = -1; size = GetFontData(hdc, MS_NAME_TAG, 0, NULL, 0); ok(size != GDI_ERROR, "no name table found\n"); @@ -3421,35 +3607,34 @@ entry = (void *)&header[1]; for (i = 0; i < header->number_of_record; i++) { - if (GET_BE_WORD(entry[i].platform_id) != TT_PLATFORM_MICROSOFT || - (GET_BE_WORD(entry[i].encoding_id) != TT_MS_ID_UNICODE_CS && GET_BE_WORD(entry[i].encoding_id) != TT_MS_ID_SYMBOL_CS) || - GET_BE_WORD(entry[i].language_id) != language_id || - GET_BE_WORD(entry[i].name_id) != name_id) + if (GET_BE_WORD(entry[i].name_id) != name_id) continue; + res = match_name_table_language( &entry[i], language_id); + if (res > best_lang) { - continue; + best_lang = res; + best_index = i; } + } - offset = header->storage_offset + GET_BE_WORD(entry[i].offset); - length = GET_BE_WORD(entry[i].length); - if (offset + length > size) - { - trace("entry %d is out of range\n", i); - break; - } - if (length >= out_size) - { - trace("buffer too small for entry %d\n", i); - break; - } + offset = header->storage_offset + GET_BE_WORD(entry[best_index].offset); + length = GET_BE_WORD(entry[best_index].length); + if (offset + length > size) + { + trace("entry %d is out of range\n", best_index); + goto out; + } + if (length >= out_size) + { + trace("buffer too small for entry %d\n", best_index); + goto out; + } - name = (WCHAR *)(data + offset); - for (c = 0; c < length / 2; c++) - out_buf[c] = GET_BE_WORD(name[c]); - out_buf[c] = 0; + name = (WCHAR *)(data + offset); + for (c = 0; c < length / 2; c++) + out_buf[c] = GET_BE_WORD(name[c]); + out_buf[c] = 0; - r = TRUE; - break; - } + r = TRUE; out: HeapFree(GetProcessHeap(), 0, data); diff -Nru wine1.7-1.7.21/dlls/gdi32/vertical.c wine1.7-1.7.24/dlls/gdi32/vertical.c --- wine1.7-1.7.21/dlls/gdi32/vertical.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdi32/vertical.c 2014-08-08 20:19:29.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.unicode.org/Public/vertical/revision-11/VerticalOrientation-11.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short vertical_orientation_table[1536] = { /* level 1 offsets */ diff -Nru wine1.7-1.7.21/dlls/gdiplus/graphics.c wine1.7-1.7.24/dlls/gdiplus/graphics.c --- wine1.7-1.7.21/dlls/gdiplus/graphics.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdiplus/graphics.c 2014-08-08 20:19:29.000000000 +0000 @@ -1995,6 +1995,24 @@ rect->Height = GetDeviceCaps(graphics->hdc, VERTRES); } + if (graphics->hdc && + (GetMapMode(graphics->hdc) != MM_TEXT || GetGraphicsMode(graphics->hdc) != GM_COMPATIBLE)) + { + POINT points[2]; + + points[0].x = rect->X; + points[0].y = rect->Y; + points[1].x = rect->X + rect->Width; + points[1].y = rect->Y + rect->Height; + + DPtoLP(graphics->hdc, points, sizeof(points)/sizeof(points[0])); + + rect->X = min(points[0].x, points[1].x); + rect->Y = min(points[0].y, points[1].y); + rect->Width = abs(points[1].x - points[0].x); + rect->Height = abs(points[1].y - points[0].y); + } + return stat; } diff -Nru wine1.7-1.7.21/dlls/gdiplus/image.c wine1.7-1.7.24/dlls/gdiplus/image.c --- wine1.7-1.7.21/dlls/gdiplus/image.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdiplus/image.c 2014-08-08 20:19:29.000000000 +0000 @@ -1387,6 +1387,8 @@ if(!filename || !bitmap) return InvalidParameter; + *bitmap = NULL; + stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if(stat != Ok) @@ -2945,6 +2947,8 @@ if (!filename || !image) return InvalidParameter; + *image = NULL; + stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if (stat != Ok) diff -Nru wine1.7-1.7.21/dlls/gdiplus/tests/image.c wine1.7-1.7.24/dlls/gdiplus/tests/image.c --- wine1.7-1.7.21/dlls/gdiplus/tests/image.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/gdiplus/tests/image.c 2014-08-08 20:19:29.000000000 +0000 @@ -374,24 +374,48 @@ static void test_LoadingImages(void) { GpStatus stat; + GpBitmap *bm; + GpImage *img; + static const WCHAR nonexistentW[] = {'n','o','n','e','x','i','s','t','e','n','t',0}; stat = GdipCreateBitmapFromFile(0, 0); expect(InvalidParameter, stat); - stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef); + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(0, &bm); expect(InvalidParameter, stat); + ok(bm == (GpBitmap *)0xdeadbeef, "returned %p\n", bm); + + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(nonexistentW, &bm); + todo_wine expect(InvalidParameter, stat); + ok(!bm, "returned %p\n", bm); stat = GdipLoadImageFromFile(0, 0); expect(InvalidParameter, stat); - stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(0, &img); expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img); stat = GdipLoadImageFromFileICM(0, 0); expect(InvalidParameter, stat); - stat = GdipLoadImageFromFileICM(0, (GpImage**)0xdeadbeef); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(0, &img); expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img); } static void test_SavingImages(void) diff -Nru wine1.7-1.7.21/dlls/hid/hid.spec wine1.7-1.7.24/dlls/hid/hid.spec --- wine1.7-1.7.21/dlls/hid/hid.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/hid/hid.spec 2014-08-08 20:19:29.000000000 +0000 @@ -11,7 +11,7 @@ @ stub HidD_GetNumInputBuffers @ stub HidD_GetPhysicalDescriptor @ stub HidD_GetPreparsedData -@ stub HidD_GetProductString +@ stdcall HidD_GetProductString(long ptr long) @ stub HidD_GetSerialNumberString @ stub HidD_Hello @ stub HidD_SetConfiguration diff -Nru wine1.7-1.7.21/dlls/hid/main.c wine1.7-1.7.24/dlls/hid/main.c --- wine1.7-1.7.21/dlls/hid/main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/hid/main.c 2014-08-08 20:19:29.000000000 +0000 @@ -73,3 +73,9 @@ 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 wine1.7-1.7.21/dlls/ieframe/ieframe.h wine1.7-1.7.24/dlls/ieframe/ieframe.h --- wine1.7-1.7.21/dlls/ieframe/ieframe.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ieframe/ieframe.h 2014-08-08 20:19:29.000000000 +0000 @@ -310,8 +310,6 @@ HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; -const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; - extern LONG module_ref DECLSPEC_HIDDEN; extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.21/dlls/ieframe/ieframe_main.c wine1.7-1.7.24/dlls/ieframe/ieframe_main.c --- wine1.7-1.7.21/dlls/ieframe/ieframe_main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/ieframe/ieframe_main.c 2014-08-08 20:19:29.000000000 +0000 @@ -29,33 +29,6 @@ LONG module_ref = 0; HINSTANCE ieframe_instance; -const char *debugstr_variant(const VARIANT *v) -{ - if(!v) - return "(null)"; - - switch(V_VT(v)) { - case VT_EMPTY: - return "{VT_EMPTY}"; - case VT_NULL: - return "{VT_NULL}"; - case VT_I4: - return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); - case VT_R8: - return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); - case VT_BSTR: - return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v))); - case VT_DISPATCH: - return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); - case VT_BOOL: - return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); - case VT_ERROR: - return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v)); - default: - return wine_dbg_sprintf("{vt %d}", V_VT(v)); - } -} - static ITypeLib *typelib; static ITypeInfo *typeinfos[LAST_tid]; diff -Nru wine1.7-1.7.21/dlls/imagehlp/tests/image.c wine1.7-1.7.24/dlls/imagehlp/tests/image.c --- wine1.7-1.7.21/dlls/imagehlp/tests/image.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/imagehlp/tests/image.c 2014-08-08 20:19:29.000000000 +0000 @@ -31,6 +31,8 @@ static HMODULE hImageHlp; static BOOL (WINAPI *pImageGetDigestStream)(HANDLE, DWORD, DIGEST_FUNCTION, DIGEST_HANDLE); +static BOOL (WINAPI *pBindImageEx)(DWORD Flags, const char *ImageName, const char *DllPath, + const char *SymbolPath, PIMAGEHLP_STATUS_ROUTINE StatusRoutine); /* minimal PE file image */ #define VA_START 0x400000 @@ -149,6 +151,9 @@ BOOL todo; }; +static int status_routine_called[BindSymbolsNotUpdated+1]; + + static BOOL WINAPI accumulating_stream_output(DIGEST_HANDLE handle, BYTE *pb, DWORD cb) { @@ -273,6 +278,40 @@ bin.nt_headers.OptionalHeader.CheckSum = sum; } +static BOOL CALLBACK testing_status_routine(IMAGEHLP_STATUS_REASON reason, const char *ImageName, + const char *DllName, ULONG_PTR Va, ULONG_PTR Parameter) +{ + char kernel32_path[MAX_PATH]; + + if (0 <= (int)reason && reason <= BindSymbolsNotUpdated) + status_routine_called[reason]++; + else + ok(0, "expected reason between 0 and %d, got %d\n", BindSymbolsNotUpdated+1, reason); + + switch(reason) + { + case BindImportModule: + ok(!strcmp(DllName, "KERNEL32.DLL"), "expected DllName to be KERNEL32.DLL, got %s\n", + DllName); + break; + + case BindImportProcedure: + case BindForwarderNOT: + GetSystemDirectoryA(kernel32_path, MAX_PATH); + strcat(kernel32_path, "\\KERNEL32.DLL"); + ok(!lstrcmpiA(DllName, kernel32_path), "expected DllName to be %s, got %s\n", + kernel32_path, DllName); + ok(!strcmp((char *)Parameter, "ExitProcess"), + "expected Parameter to be ExitProcess, got %s\n", (char *)Parameter); + break; + + default: + ok(0, "got unexpected reason %d\n", reason); + break; + } + return TRUE; +} + static void test_get_digest_stream(void) { BOOL ret; @@ -281,6 +320,11 @@ DWORD count; struct update_accum accum = { 0, NULL }; + if (!pImageGetDigestStream) + { + win_skip("ImageGetDigestStream function is not available\n"); + return; + } SetLastError(0xdeadbeef); ret = pImageGetDigestStream(NULL, 0, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, @@ -329,6 +373,55 @@ DeleteFileA(temp_file); } +static void test_bind_image_ex(void) +{ + BOOL ret; + HANDLE file; + char temp_file[MAX_PATH]; + DWORD count; + + if (!pBindImageEx) + { + win_skip("BindImageEx function is not available\n"); + return; + } + + /* call with a non-existent file */ + SetLastError(0xdeadbeef); + ret = pBindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, "nonexistent.dll", 0, 0, + testing_status_routine); + todo_wine ok(!ret && ((GetLastError() == ERROR_FILE_NOT_FOUND) || + (GetLastError() == ERROR_INVALID_PARAMETER)), + "expected ERROR_FILE_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n", + GetLastError()); + + file = create_temp_file(temp_file); + if (file == INVALID_HANDLE_VALUE) + { + skip("couldn't create temp file\n"); + return; + } + + WriteFile(file, &bin, sizeof(bin), &count, NULL); + CloseHandle(file); + + /* call with a proper PE file */ + ret = pBindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, temp_file, 0, 0, + testing_status_routine); + ok(ret, "BindImageEx failed: %d\n", GetLastError()); + + todo_wine ok(status_routine_called[BindImportModule] == 1, + "StatusRoutine was called %d times\n", status_routine_called[BindImportModule]); + + todo_wine ok((status_routine_called[BindImportProcedure] == 1) +#if defined(_WIN64) + || broken(status_routine_called[BindImportProcedure] == 0) /* < Win8 */ +#endif + , "StatusRoutine was called %d times\n", status_routine_called[BindImportProcedure]); + + DeleteFileA(temp_file); +} + START_TEST(image) { hImageHlp = LoadLibraryA("imagehlp.dll"); @@ -340,14 +433,10 @@ } pImageGetDigestStream = (void *) GetProcAddress(hImageHlp, "ImageGetDigestStream"); + pBindImageEx = (void *) GetProcAddress(hImageHlp, "BindImageEx"); - if (!pImageGetDigestStream) - { - win_skip("ImageGetDigestStream function is not available\n"); - } else - { - test_get_digest_stream(); - } + test_get_digest_stream(); + test_bind_image_ex(); FreeLibrary(hImageHlp); } diff -Nru wine1.7-1.7.21/dlls/iphlpapi/iphlpapi_main.c wine1.7-1.7.24/dlls/iphlpapi/iphlpapi_main.c --- wine1.7-1.7.21/dlls/iphlpapi/iphlpapi_main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/iphlpapi/iphlpapi_main.c 2014-08-08 20:19:29.000000000 +0000 @@ -1068,10 +1068,21 @@ #ifdef HAVE_STRUCT___RES_STATE /* call res_init() just once because of a bug in Mac OS X 10.4 */ /* Call once per thread on systems that have per-thread _res. */ + +static CRITICAL_SECTION res_init_cs; +static CRITICAL_SECTION_DEBUG res_init_cs_debug = { + 0, 0, &res_init_cs, + { &res_init_cs_debug.ProcessLocksList, &res_init_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": res_init_cs") } +}; +static CRITICAL_SECTION res_init_cs = { &res_init_cs_debug, -1, 0, 0, 0, 0 }; + static void initialise_resolver(void) { + EnterCriticalSection(&res_init_cs); if ((_res.options & RES_INIT) == 0) res_init(); + LeaveCriticalSection(&res_init_cs); } static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only ) @@ -2499,6 +2510,33 @@ return ERROR_CALL_NOT_IMPLEMENTED; } +/****************************************************************** + * PfUnBindInterface (IPHLPAPI.@) + */ +DWORD WINAPI PfUnBindInterface(INTERFACE_HANDLE interface) +{ + FIXME("(%p) stub\n", interface); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/****************************************************************** + * PfDeleteInterface(IPHLPAPI.@) + */ +DWORD WINAPI PfDeleteInterface(INTERFACE_HANDLE interface) +{ + FIXME("(%p) stub\n", interface); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/****************************************************************** + * PfBindInterfaceToIPAddress(IPHLPAPI.@) + */ +DWORD WINAPI PfBindInterfaceToIPAddress(INTERFACE_HANDLE interface, PFADDRESSTYPE type, PBYTE ip) +{ + FIXME("(%p %d %p) stub\n", interface, type, ip); + return ERROR_CALL_NOT_IMPLEMENTED; +} + /****************************************************************** * GetTcpTable2 (IPHLPAPI.@) */ diff -Nru wine1.7-1.7.21/dlls/iphlpapi/iphlpapi.spec wine1.7-1.7.24/dlls/iphlpapi/iphlpapi.spec --- wine1.7-1.7.21/dlls/iphlpapi/iphlpapi.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/iphlpapi/iphlpapi.spec 2014-08-08 20:19:29.000000000 +0000 @@ -245,10 +245,10 @@ #@ stub ParseNetworkString @ stub _PfAddFiltersToInterface@24 @ stub _PfAddGlobalFilterToInterface@8 -@ stub _PfBindInterfaceToIPAddress@12 +@ stdcall _PfBindInterfaceToIPAddress@12(long long ptr) PfBindInterfaceToIPAddress @ stub _PfBindInterfaceToIndex@16 @ stdcall _PfCreateInterface@24(long long long long long ptr) PfCreateInterface -@ stub _PfDeleteInterface@4 +@ stdcall _PfDeleteInterface@4(long) PfDeleteInterface @ stub _PfDeleteLog@0 @ stub _PfGetInterfaceStatistics@16 @ stub _PfMakeLog@4 @@ -258,7 +258,7 @@ @ stub _PfRemoveGlobalFilterFromInterface@8 @ stub _PfSetLogBuffer@28 @ stub _PfTestPacket@20 -@ stub _PfUnBindInterface@4 +@ stdcall _PfUnBindInterface@4(long) PfUnBindInterface #@ stub register_icmp #@ stub ResolveIpNetEntry2 #@ stub ResolveNeighbor diff -Nru wine1.7-1.7.21/dlls/jscript/jscript.h wine1.7-1.7.24/dlls/jscript/jscript.h --- wine1.7-1.7.21/dlls/jscript/jscript.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/jscript/jscript.h 2014-08-08 20:19:29.000000000 +0000 @@ -525,7 +525,6 @@ return HRESULT_FACILITY(hres) == FACILITY_JSCRIPT; } -const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; const char *debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN; HRESULT create_jscript_object(BOOL,REFIID,void**) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.21/dlls/jscript/jsutils.c wine1.7-1.7.24/dlls/jscript/jsutils.c --- wine1.7-1.7.21/dlls/jscript/jsutils.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/jscript/jsutils.c 2014-08-08 20:19:29.000000000 +0000 @@ -30,35 +30,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); WINE_DECLARE_DEBUG_CHANNEL(heap); -const char *debugstr_variant(const VARIANT *v) -{ - if(!v) - return "(null)"; - - switch(V_VT(v)) { - case VT_EMPTY: - return "{VT_EMPTY}"; - case VT_NULL: - return "{VT_NULL}"; - case VT_I4: - return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); - case VT_UI4: - return wine_dbg_sprintf("{VT_UI4: %u}", V_UI4(v)); - case VT_R8: - return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); - case VT_BSTR: - return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v))); - case VT_DISPATCH: - return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); - case VT_BOOL: - return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); - case VT_ARRAY|VT_VARIANT: - return "{VT_ARRAY|VT_VARIANT: ...}"; - default: - return wine_dbg_sprintf("{vt %d}", V_VT(v)); - } -} - const char *debugstr_jsval(const jsval_t v) { switch(jsval_type(v)) { diff -Nru wine1.7-1.7.21/dlls/kernel32/environ.c wine1.7-1.7.24/dlls/kernel32/environ.c --- wine1.7-1.7.21/dlls/kernel32/environ.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/environ.c 2014-08-08 20:19:29.000000000 +0000 @@ -491,3 +491,23 @@ RtlReleasePebLock(); } + +/*********************************************************************** + * GetFirmwareEnvironmentVariableA (KERNEL32.@) + */ +DWORD WINAPI GetFirmwareEnvironmentVariableA(LPCSTR name, LPCSTR guid, PVOID buffer, DWORD size) +{ + FIXME("stub: %s %s %p %u\n", debugstr_a(name), debugstr_a(guid), buffer, size); + SetLastError(ERROR_INVALID_FUNCTION); + return 0; +} + +/*********************************************************************** + * GetFirmwareEnvironmentVariableA (KERNEL32.@) + */ +DWORD WINAPI GetFirmwareEnvironmentVariableW(LPCWSTR name, LPCWSTR guid, PVOID buffer, DWORD size) +{ + FIXME("stub: %s %s %p %u\n", debugstr_w(name), debugstr_w(guid), buffer, size); + SetLastError(ERROR_INVALID_FUNCTION); + return 0; +} diff -Nru wine1.7-1.7.21/dlls/kernel32/kernel32.spec wine1.7-1.7.24/dlls/kernel32/kernel32.spec --- wine1.7-1.7.21/dlls/kernel32/kernel32.spec 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/kernel32.spec 2014-08-08 20:19:29.000000000 +0000 @@ -542,8 +542,8 @@ @ stdcall GetFileSizeEx(long ptr) @ stdcall GetFileTime(long ptr ptr ptr) @ stdcall GetFileType(long) -# @ stub GetFirmwareEnvironmentVariableA -# @ stub GetFirmwareEnvironmentVariableW +@ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) @ stdcall GetFullPathNameW(wstr long ptr ptr) @ stdcall GetGeoInfoA(long long ptr long long) diff -Nru wine1.7-1.7.21/dlls/kernel32/locale.c wine1.7-1.7.24/dlls/kernel32/locale.c --- wine1.7-1.7.21/dlls/kernel32/locale.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/locale.c 2014-08-08 20:19:29.000000000 +0000 @@ -2504,6 +2504,9 @@ if ((c>=0x0600)&&(c<=0x06FF)) type3 |= C3_KASHIDA; if ((c>=0x3000)&&(c<=0x303F)) type3 |= C3_SYMBOL; + if ((c>=0xD800)&&(c<=0xDBFF)) type3 |= C3_HIGHSURROGATE; + if ((c>=0xDC00)&&(c<=0xDFFF)) type3 |= C3_LOWSURROGATE; + if ((c>=0xFF00)&&(c<=0xFF60)) type3 |= C3_FULLWIDTH; if ((c>=0xFF00)&&(c<=0xFF20)) type3 |= C3_SYMBOL; if ((c>=0xFF3B)&&(c<=0xFF40)) type3 |= C3_SYMBOL; @@ -3364,29 +3367,6 @@ return hkey; } -static BOOL NLS_RegEnumSubKey(HANDLE hKey, UINT ulIndex, LPWSTR szKeyName, - ULONG keyNameSize) -{ - BYTE buffer[80]; - KEY_BASIC_INFORMATION *info = (KEY_BASIC_INFORMATION *)buffer; - DWORD dwLen; - - if (NtEnumerateKey( hKey, ulIndex, KeyBasicInformation, buffer, - sizeof(buffer), &dwLen) != STATUS_SUCCESS || - info->NameLength > keyNameSize) - { - return FALSE; - } - - TRACE("info->Name %s info->NameLength %d\n", debugstr_w(info->Name), info->NameLength); - - memcpy( szKeyName, info->Name, info->NameLength); - szKeyName[info->NameLength / sizeof(WCHAR)] = '\0'; - - TRACE("returning %s\n", debugstr_w(szKeyName)); - return TRUE; -} - static BOOL NLS_RegEnumValue(HANDLE hKey, UINT ulIndex, LPWSTR szValueName, ULONG valueNameSize, LPWSTR szValueData, ULONG valueDataSize) @@ -3833,70 +3813,6 @@ } /****************************************************************************** - * EnumSystemGeoID (KERNEL32.@) - * - * Call a users function for every location available on the system. - * - * PARAMS - * geoclass [I] Type of information desired (SYSGEOTYPE enum from "winnls.h") - * reserved [I] Reserved, set to 0 - * pGeoEnumProc [I] Callback function to call for each location - * - * RETURNS - * Success: TRUE. - * Failure: FALSE. Use GetLastError() to determine the cause. - */ -BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID reserved, GEO_ENUMPROC pGeoEnumProc) -{ - static const WCHAR szCountryCodeValueName[] = { - 'C','o','u','n','t','r','y','C','o','d','e','\0' - }; - WCHAR szNumber[10]; - HANDLE hKey; - ULONG ulIndex = 0; - - TRACE("(0x%08X,0x%08X,%p)\n", geoclass, reserved, pGeoEnumProc); - - if (geoclass != GEOCLASS_NATION || reserved || !pGeoEnumProc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - hKey = NLS_RegOpenKey( 0, szCountryListName ); - - while (NLS_RegEnumSubKey( hKey, ulIndex, szNumber, sizeof(szNumber) )) - { - BOOL bContinue = TRUE; - DWORD dwGeoId; - HANDLE hSubKey = NLS_RegOpenKey( hKey, szNumber ); - - if (hSubKey) - { - if (NLS_RegGetDword( hSubKey, szCountryCodeValueName, &dwGeoId )) - { - TRACE("Got geoid %d\n", dwGeoId); - - if (!pGeoEnumProc( dwGeoId )) - bContinue = FALSE; - } - - NtClose( hSubKey ); - } - - if (!bContinue) - break; - - ulIndex++; - } - - if (hKey) - NtClose( hKey ); - - return TRUE; -} - -/****************************************************************************** * InvalidateNLSCache (KERNEL32.@) * * Invalidate the cache of NLS values. @@ -4078,18 +3994,495 @@ return TRUE; } -INT WINAPI GetGeoInfoW(GEOID GeoId, GEOTYPE GeoType, LPWSTR lpGeoData, - int cchData, LANGID language) +enum locationkind { + LOCATION_NATION = 0, + LOCATION_REGION, + LOCATION_BOTH +}; + +struct geoinfo_t { + GEOID id; + WCHAR iso2W[3]; + WCHAR iso3W[4]; + GEOID parent; + INT uncode; + enum locationkind kind; +}; + +static const struct geoinfo_t geoinfodata[] = { + { 2, {'A','G',0}, {'A','T','G',0}, 10039880, 28 }, /* Antigua and Barbuda */ + { 3, {'A','F',0}, {'A','F','G',0}, 47614, 4 }, /* Afghanistan */ + { 4, {'D','Z',0}, {'D','Z','A',0}, 42487, 12 }, /* Algeria */ + { 5, {'A','Z',0}, {'A','Z','E',0}, 47611, 31 }, /* Azerbaijan */ + { 6, {'A','L',0}, {'A','L','B',0}, 47610, 8 }, /* Albania */ + { 7, {'A','M',0}, {'A','R','M',0}, 47611, 51 }, /* Armenia */ + { 8, {'A','D',0}, {'A','N','D',0}, 47610, 20 }, /* Andorra */ + { 9, {'A','O',0}, {'A','G','O',0}, 42484, 24 }, /* Angola */ + { 10, {'A','S',0}, {'A','S','M',0}, 26286, 16 }, /* American Samoa */ + { 11, {'A','R',0}, {'A','R','G',0}, 31396, 32 }, /* Argentina */ + { 12, {'A','U',0}, {'A','U','S',0}, 10210825, 36 }, /* Australia */ + { 14, {'A','T',0}, {'A','U','T',0}, 10210824, 40 }, /* Austria */ + { 17, {'B','H',0}, {'B','H','R',0}, 47611, 48 }, /* Bahrain */ + { 18, {'B','B',0}, {'B','R','B',0}, 10039880, 52 }, /* Barbados */ + { 19, {'B','W',0}, {'B','W','A',0}, 10039883, 72 }, /* Botswana */ + { 20, {'B','M',0}, {'B','M','U',0}, 23581, 60 }, /* Bermuda */ + { 21, {'B','E',0}, {'B','E','L',0}, 10210824, 56 }, /* Belgium */ + { 22, {'B','S',0}, {'B','H','S',0}, 10039880, 44 }, /* Bahamas, The */ + { 23, {'B','D',0}, {'B','G','D',0}, 47614, 50 }, /* Bangladesh */ + { 24, {'B','Z',0}, {'B','L','Z',0}, 27082, 84 }, /* Belize */ + { 25, {'B','A',0}, {'B','I','H',0}, 47610, 70 }, /* Bosnia and Herzegovina */ + { 26, {'B','O',0}, {'B','O','L',0}, 31396, 68 }, /* Bolivia */ + { 27, {'M','M',0}, {'M','M','R',0}, 47599, 104 }, /* Myanmar */ + { 28, {'B','J',0}, {'B','E','N',0}, 42483, 204 }, /* Benin */ + { 29, {'B','Y',0}, {'B','L','R',0}, 47609, 112 }, /* Belarus */ + { 30, {'S','B',0}, {'S','L','B',0}, 20900, 90 }, /* Solomon Islands */ + { 32, {'B','R',0}, {'B','R','A',0}, 31396, 76 }, /* Brazil */ + { 34, {'B','T',0}, {'B','T','N',0}, 47614, 64 }, /* Bhutan */ + { 35, {'B','G',0}, {'B','G','R',0}, 47609, 100 }, /* Bulgaria */ + { 37, {'B','N',0}, {'B','R','N',0}, 47599, 96 }, /* Brunei */ + { 38, {'B','I',0}, {'B','D','I',0}, 47603, 108 }, /* Burundi */ + { 39, {'C','A',0}, {'C','A','N',0}, 23581, 124 }, /* Canada */ + { 40, {'K','H',0}, {'K','H','M',0}, 47599, 116 }, /* Cambodia */ + { 41, {'T','D',0}, {'T','C','D',0}, 42484, 148 }, /* Chad */ + { 42, {'L','K',0}, {'L','K','A',0}, 47614, 144 }, /* Sri Lanka */ + { 43, {'C','G',0}, {'C','O','G',0}, 42484, 178 }, /* Congo */ + { 44, {'C','D',0}, {'C','O','D',0}, 42484, 180 }, /* Congo (DRC) */ + { 45, {'C','N',0}, {'C','H','N',0}, 47600, 156 }, /* China */ + { 46, {'C','L',0}, {'C','H','L',0}, 31396, 152 }, /* Chile */ + { 49, {'C','M',0}, {'C','M','R',0}, 42484, 120 }, /* Cameroon */ + { 50, {'K','M',0}, {'C','O','M',0}, 47603, 174 }, /* Comoros */ + { 51, {'C','O',0}, {'C','O','L',0}, 31396, 170 }, /* Colombia */ + { 54, {'C','R',0}, {'C','R','I',0}, 27082, 188 }, /* Costa Rica */ + { 55, {'C','F',0}, {'C','A','F',0}, 42484, 140 }, /* Central African Republic */ + { 56, {'C','U',0}, {'C','U','B',0}, 10039880, 192 }, /* Cuba */ + { 57, {'C','V',0}, {'C','P','V',0}, 42483, 132 }, /* Cape Verde */ + { 59, {'C','Y',0}, {'C','Y','P',0}, 47611, 196 }, /* Cyprus */ + { 61, {'D','K',0}, {'D','N','K',0}, 10039882, 208 }, /* Denmark */ + { 62, {'D','J',0}, {'D','J','I',0}, 47603, 262 }, /* Djibouti */ + { 63, {'D','M',0}, {'D','M','A',0}, 10039880, 212 }, /* Dominica */ + { 65, {'D','O',0}, {'D','O','M',0}, 10039880, 214 }, /* Dominican Republic */ + { 66, {'E','C',0}, {'E','C','U',0}, 31396, 218 }, /* Ecuador */ + { 67, {'E','G',0}, {'E','G','Y',0}, 42487, 818 }, /* Egypt */ + { 68, {'I','E',0}, {'I','R','L',0}, 10039882, 372 }, /* Ireland */ + { 69, {'G','Q',0}, {'G','N','Q',0}, 42484, 226 }, /* Equatorial Guinea */ + { 70, {'E','E',0}, {'E','S','T',0}, 10039882, 233 }, /* Estonia */ + { 71, {'E','R',0}, {'E','R','I',0}, 47603, 232 }, /* Eritrea */ + { 72, {'S','V',0}, {'S','L','V',0}, 27082, 222 }, /* El Salvador */ + { 73, {'E','T',0}, {'E','T','H',0}, 47603, 231 }, /* Ethiopia */ + { 75, {'C','Z',0}, {'C','Z','E',0}, 47609, 203 }, /* Czech Republic */ + { 77, {'F','I',0}, {'F','I','N',0}, 10039882, 246 }, /* Finland */ + { 78, {'F','J',0}, {'F','J','I',0}, 20900, 242 }, /* Fiji Islands */ + { 80, {'F','M',0}, {'F','S','M',0}, 21206, 583 }, /* Micronesia */ + { 81, {'F','O',0}, {'F','R','O',0}, 10039882, 234 }, /* Faroe Islands */ + { 84, {'F','R',0}, {'F','R','A',0}, 10210824, 250 }, /* France */ + { 86, {'G','M',0}, {'G','M','B',0}, 42483, 270 }, /* Gambia, The */ + { 87, {'G','A',0}, {'G','A','B',0}, 42484, 266 }, /* Gabon */ + { 88, {'G','E',0}, {'G','E','O',0}, 47611, 268 }, /* Georgia */ + { 89, {'G','H',0}, {'G','H','A',0}, 42483, 288 }, /* Ghana */ + { 90, {'G','I',0}, {'G','I','B',0}, 47610, 292 }, /* Gibraltar */ + { 91, {'G','D',0}, {'G','R','D',0}, 10039880, 308 }, /* Grenada */ + { 93, {'G','L',0}, {'G','R','L',0}, 23581, 304 }, /* Greenland */ + { 94, {'D','E',0}, {'D','E','U',0}, 10210824, 276 }, /* Germany */ + { 98, {'G','R',0}, {'G','R','C',0}, 47610, 300 }, /* Greece */ + { 99, {'G','T',0}, {'G','T','M',0}, 27082, 320 }, /* Guatemala */ + { 100, {'G','N',0}, {'G','I','N',0}, 42483, 324 }, /* Guinea */ + { 101, {'G','Y',0}, {'G','U','Y',0}, 31396, 328 }, /* Guyana */ + { 103, {'H','T',0}, {'H','T','I',0}, 10039880, 332 }, /* Haiti */ + { 104, {'H','K',0}, {'H','K','G',0}, 47600, 344 }, /* Hong Kong S.A.R. */ + { 106, {'H','N',0}, {'H','N','D',0}, 27082, 340 }, /* Honduras */ + { 108, {'H','R',0}, {'H','R','V',0}, 47610, 191 }, /* Croatia */ + { 109, {'H','U',0}, {'H','U','N',0}, 47609, 348 }, /* Hungary */ + { 110, {'I','S',0}, {'I','S','L',0}, 10039882, 352 }, /* Iceland */ + { 111, {'I','D',0}, {'I','D','N',0}, 47599, 360 }, /* Indonesia */ + { 113, {'I','N',0}, {'I','N','D',0}, 47614, 356 }, /* India */ + { 114, {'I','O',0}, {'I','O','T',0}, 39070, 86 }, /* British Indian Ocean Territory */ + { 116, {'I','R',0}, {'I','R','N',0}, 47614, 364 }, /* Iran */ + { 117, {'I','L',0}, {'I','S','R',0}, 47611, 376 }, /* Israel */ + { 118, {'I','T',0}, {'I','T','A',0}, 47610, 380 }, /* Italy */ + { 119, {'C','I',0}, {'C','I','V',0}, 42483, 384 }, /* Côte d'Ivoire */ + { 121, {'I','Q',0}, {'I','R','Q',0}, 47611, 368 }, /* Iraq */ + { 122, {'J','P',0}, {'J','P','N',0}, 47600, 392 }, /* Japan */ + { 124, {'J','M',0}, {'J','A','M',0}, 10039880, 388 }, /* Jamaica */ + { 125, {'S','J',0}, {'S','J','M',0}, 10039882, 744 }, /* Jan Mayen */ + { 126, {'J','O',0}, {'J','O','R',0}, 47611, 400 }, /* Jordan */ + { 127, {'X','X',0}, {'X','X',0}, 161832256 }, /* Johnston Atoll */ + { 129, {'K','E',0}, {'K','E','N',0}, 47603, 404 }, /* Kenya */ + { 130, {'K','G',0}, {'K','G','Z',0}, 47590, 417 }, /* Kyrgyzstan */ + { 131, {'K','P',0}, {'P','R','K',0}, 47600, 408 }, /* North Korea */ + { 133, {'K','I',0}, {'K','I','R',0}, 21206, 296 }, /* Kiribati */ + { 134, {'K','R',0}, {'K','O','R',0}, 47600, 410 }, /* Korea */ + { 136, {'K','W',0}, {'K','W','T',0}, 47611, 414 }, /* Kuwait */ + { 137, {'K','Z',0}, {'K','A','Z',0}, 47590, 398 }, /* Kazakhstan */ + { 138, {'L','A',0}, {'L','A','O',0}, 47599, 418 }, /* Laos */ + { 139, {'L','B',0}, {'L','B','N',0}, 47611, 422 }, /* Lebanon */ + { 140, {'L','V',0}, {'L','V','A',0}, 10039882, 428 }, /* Latvia */ + { 141, {'L','T',0}, {'L','T','U',0}, 10039882, 440 }, /* Lithuania */ + { 142, {'L','R',0}, {'L','B','R',0}, 42483, 430 }, /* Liberia */ + { 143, {'S','K',0}, {'S','V','K',0}, 47609, 703 }, /* Slovakia */ + { 145, {'L','I',0}, {'L','I','E',0}, 10210824, 438 }, /* Liechtenstein */ + { 146, {'L','S',0}, {'L','S','O',0}, 10039883, 426 }, /* Lesotho */ + { 147, {'L','U',0}, {'L','U','X',0}, 10210824, 442 }, /* Luxembourg */ + { 148, {'L','Y',0}, {'L','B','Y',0}, 42487, 434 }, /* Libya */ + { 149, {'M','G',0}, {'M','D','G',0}, 47603, 450 }, /* Madagascar */ + { 151, {'M','O',0}, {'M','A','C',0}, 47600, 446 }, /* Macao S.A.R. */ + { 152, {'M','D',0}, {'M','D','A',0}, 47609, 498 }, /* Moldova */ + { 154, {'M','N',0}, {'M','N','G',0}, 47600, 496 }, /* Mongolia */ + { 156, {'M','W',0}, {'M','W','I',0}, 47603, 454 }, /* Malawi */ + { 157, {'M','L',0}, {'M','L','I',0}, 42483, 466 }, /* Mali */ + { 158, {'M','C',0}, {'M','C','O',0}, 10210824, 492 }, /* Monaco */ + { 159, {'M','A',0}, {'M','A','R',0}, 42487, 504 }, /* Morocco */ + { 160, {'M','U',0}, {'M','U','S',0}, 47603, 480 }, /* Mauritius */ + { 162, {'M','R',0}, {'M','R','T',0}, 42483, 478 }, /* Mauritania */ + { 163, {'M','T',0}, {'M','L','T',0}, 47610, 470 }, /* Malta */ + { 164, {'O','M',0}, {'O','M','N',0}, 47611, 512 }, /* Oman */ + { 165, {'M','V',0}, {'M','D','V',0}, 47614, 462 }, /* Maldives */ + { 166, {'M','X',0}, {'M','E','X',0}, 27082, 484 }, /* Mexico */ + { 167, {'M','Y',0}, {'M','Y','S',0}, 47599, 458 }, /* Malaysia */ + { 168, {'M','Z',0}, {'M','O','Z',0}, 47603, 508 }, /* Mozambique */ + { 173, {'N','E',0}, {'N','E','R',0}, 42483, 562 }, /* Niger */ + { 174, {'V','U',0}, {'V','U','T',0}, 20900, 548 }, /* Vanuatu */ + { 175, {'N','G',0}, {'N','G','A',0}, 42483, 566 }, /* Nigeria */ + { 176, {'N','L',0}, {'N','L','D',0}, 10210824, 528 }, /* Netherlands */ + { 177, {'N','O',0}, {'N','O','R',0}, 10039882, 578 }, /* Norway */ + { 178, {'N','P',0}, {'N','P','L',0}, 47614, 524 }, /* Nepal */ + { 180, {'N','R',0}, {'N','R','U',0}, 21206, 520 }, /* Nauru */ + { 181, {'S','R',0}, {'S','U','R',0}, 31396, 740 }, /* Suriname */ + { 182, {'N','I',0}, {'N','I','C',0}, 27082, 558 }, /* Nicaragua */ + { 183, {'N','Z',0}, {'N','Z','L',0}, 10210825, 554 }, /* New Zealand */ + { 184, {'P','S',0}, {'P','S','E',0}, 47611, 275 }, /* Palestinian Authority */ + { 185, {'P','Y',0}, {'P','R','Y',0}, 31396, 600 }, /* Paraguay */ + { 187, {'P','E',0}, {'P','E','R',0}, 31396, 604 }, /* Peru */ + { 190, {'P','K',0}, {'P','A','K',0}, 47614, 586 }, /* Pakistan */ + { 191, {'P','L',0}, {'P','O','L',0}, 47609, 616 }, /* Poland */ + { 192, {'P','A',0}, {'P','A','N',0}, 27082, 591 }, /* Panama */ + { 193, {'P','T',0}, {'P','R','T',0}, 47610, 620 }, /* Portugal */ + { 194, {'P','G',0}, {'P','N','G',0}, 20900, 598 }, /* Papua New Guinea */ + { 195, {'P','W',0}, {'P','L','W',0}, 21206, 585 }, /* Palau */ + { 196, {'G','W',0}, {'G','N','B',0}, 42483, 624 }, /* Guinea-Bissau */ + { 197, {'Q','A',0}, {'Q','A','T',0}, 47611, 634 }, /* Qatar */ + { 198, {'R','E',0}, {'R','E','U',0}, 47603, 638 }, /* Reunion */ + { 199, {'M','H',0}, {'M','H','L',0}, 21206, 584 }, /* Marshall Islands */ + { 200, {'R','O',0}, {'R','O','U',0}, 47609, 642 }, /* Romania */ + { 201, {'P','H',0}, {'P','H','L',0}, 47599, 608 }, /* Philippines */ + { 202, {'P','R',0}, {'P','R','I',0}, 10039880, 630 }, /* Puerto Rico */ + { 203, {'R','U',0}, {'R','U','S',0}, 47609, 643 }, /* Russia */ + { 204, {'R','W',0}, {'R','W','A',0}, 47603, 646 }, /* Rwanda */ + { 205, {'S','A',0}, {'S','A','U',0}, 47611, 682 }, /* Saudi Arabia */ + { 206, {'P','M',0}, {'S','P','M',0}, 23581, 666 }, /* St. Pierre and Miquelon */ + { 207, {'K','N',0}, {'K','N','A',0}, 10039880, 659 }, /* St. Kitts and Nevis */ + { 208, {'S','C',0}, {'S','Y','C',0}, 47603, 690 }, /* Seychelles */ + { 209, {'Z','A',0}, {'Z','A','F',0}, 10039883, 710 }, /* South Africa */ + { 210, {'S','N',0}, {'S','E','N',0}, 42483, 686 }, /* Senegal */ + { 212, {'S','I',0}, {'S','V','N',0}, 47610, 705 }, /* Slovenia */ + { 213, {'S','L',0}, {'S','L','E',0}, 42483, 694 }, /* Sierra Leone */ + { 214, {'S','M',0}, {'S','M','R',0}, 47610, 674 }, /* San Marino */ + { 215, {'S','G',0}, {'S','G','P',0}, 47599, 702 }, /* Singapore */ + { 216, {'S','O',0}, {'S','O','M',0}, 47603, 706 }, /* Somalia */ + { 217, {'E','S',0}, {'E','S','P',0}, 47610, 724 }, /* Spain */ + { 218, {'L','C',0}, {'L','C','A',0}, 10039880, 662 }, /* St. Lucia */ + { 219, {'S','D',0}, {'S','D','N',0}, 42487, 736 }, /* Sudan */ + { 220, {'S','J',0}, {'S','J','M',0}, 10039882, 744 }, /* Svalbard */ + { 221, {'S','E',0}, {'S','W','E',0}, 10039882, 752 }, /* Sweden */ + { 222, {'S','Y',0}, {'S','Y','R',0}, 47611, 760 }, /* Syria */ + { 223, {'C','H',0}, {'C','H','E',0}, 10210824, 756 }, /* Switzerland */ + { 224, {'A','E',0}, {'A','R','E',0}, 47611, 784 }, /* United Arab Emirates */ + { 225, {'T','T',0}, {'T','T','O',0}, 10039880, 780 }, /* Trinidad and Tobago */ + { 227, {'T','H',0}, {'T','H','A',0}, 47599, 764 }, /* Thailand */ + { 228, {'T','J',0}, {'T','J','K',0}, 47590, 762 }, /* Tajikistan */ + { 231, {'T','O',0}, {'T','O','N',0}, 26286, 776 }, /* Tonga */ + { 232, {'T','G',0}, {'T','G','O',0}, 42483, 768 }, /* Togo */ + { 233, {'S','T',0}, {'S','T','P',0}, 42484, 678 }, /* São Tomé and Príncipe */ + { 234, {'T','N',0}, {'T','U','N',0}, 42487, 788 }, /* Tunisia */ + { 235, {'T','R',0}, {'T','U','R',0}, 47611, 792 }, /* Turkey */ + { 236, {'T','V',0}, {'T','U','V',0}, 26286, 798 }, /* Tuvalu */ + { 237, {'T','W',0}, {'T','W','N',0}, 47600, 158 }, /* Taiwan */ + { 238, {'T','M',0}, {'T','K','M',0}, 47590, 795 }, /* Turkmenistan */ + { 239, {'T','Z',0}, {'T','Z','A',0}, 47603, 834 }, /* Tanzania */ + { 240, {'U','G',0}, {'U','G','A',0}, 47603, 800 }, /* Uganda */ + { 241, {'U','A',0}, {'U','K','R',0}, 47609, 804 }, /* Ukraine */ + { 242, {'G','B',0}, {'G','B','R',0}, 10039882, 826 }, /* United Kingdom */ + { 244, {'U','S',0}, {'U','S','A',0}, 23581, 840 }, /* United States */ + { 245, {'B','F',0}, {'B','F','A',0}, 42483, 854 }, /* Burkina Faso */ + { 246, {'U','Y',0}, {'U','R','Y',0}, 31396, 858 }, /* Uruguay */ + { 247, {'U','Z',0}, {'U','Z','B',0}, 47590, 860 }, /* Uzbekistan */ + { 248, {'V','C',0}, {'V','C','T',0}, 10039880, 670 }, /* St. Vincent and the Grenadines */ + { 249, {'V','E',0}, {'V','E','N',0}, 31396, 862 }, /* Bolivarian Republic of Venezuela */ + { 251, {'V','N',0}, {'V','N','M',0}, 47599, 704 }, /* Vietnam */ + { 252, {'V','I',0}, {'V','I','R',0}, 10039880, 850 }, /* Virgin Islands */ + { 253, {'V','A',0}, {'V','A','T',0}, 47610, 336 }, /* Vatican City */ + { 254, {'N','A',0}, {'N','A','M',0}, 10039883, 516 }, /* Namibia */ + { 257, {'E','H',0}, {'E','S','H',0}, 42487, 732 }, /* Western Sahara (disputed) */ + { 258, {'X','X',0}, {'X','X',0}, 161832256 }, /* Wake Island */ + { 259, {'W','S',0}, {'W','S','M',0}, 26286, 882 }, /* Samoa */ + { 260, {'S','Z',0}, {'S','W','Z',0}, 10039883, 748 }, /* Swaziland */ + { 261, {'Y','E',0}, {'Y','E','M',0}, 47611, 887 }, /* Yemen */ + { 263, {'Z','M',0}, {'Z','M','B',0}, 47603, 894 }, /* Zambia */ + { 264, {'Z','W',0}, {'Z','W','E',0}, 47603, 716 }, /* Zimbabwe */ + { 269, {'C','S',0}, {'S','C','G',0}, 47610, 891 }, /* Serbia and Montenegro (Former) */ + { 270, {'M','E',0}, {'M','N','E',0}, 47610, 499 }, /* Montenegro */ + { 271, {'R','S',0}, {'S','R','B',0}, 47610, 688 }, /* Serbia */ + { 273, {'C','W',0}, {'C','U','W',0}, 10039880, 531 }, /* Curaçao */ + { 276, {'S','S',0}, {'S','S','D',0}, 42487, 728 }, /* South Sudan */ + { 300, {'A','I',0}, {'A','I','A',0}, 10039880, 660 }, /* Anguilla */ + { 301, {'A','Q',0}, {'A','T','A',0}, 39070, 10 }, /* Antarctica */ + { 302, {'A','W',0}, {'A','B','W',0}, 10039880, 533 }, /* Aruba */ + { 303, {'X','X',0}, {'X','X',0}, 39070 }, /* Ascension Island */ + { 304, {'X','X',0}, {'X','X',0}, 10210825 }, /* Ashmore and Cartier Islands */ + { 305, {'X','X',0}, {'X','X',0}, 161832256 }, /* Baker Island */ + { 306, {'B','V',0}, {'B','V','T',0}, 39070, 74 }, /* Bouvet Island */ + { 307, {'K','Y',0}, {'C','Y','M',0}, 10039880, 136 }, /* Cayman Islands */ + { 308, {'X','X',0}, {'X','X',0}, 10210824, 0, LOCATION_BOTH }, /* Channel Islands */ + { 309, {'C','X',0}, {'C','X','R',0}, 12, 162 }, /* Christmas Island */ + { 310, {'X','X',0}, {'X','X',0}, 27114 }, /* Clipperton Island */ + { 311, {'C','C',0}, {'C','C','K',0}, 10210825, 166 }, /* Cocos (Keeling) Islands */ + { 312, {'C','K',0}, {'C','O','K',0}, 26286, 184 }, /* Cook Islands */ + { 313, {'X','X',0}, {'X','X',0}, 10210825 }, /* Coral Sea Islands */ + { 314, {'X','X',0}, {'X','X',0}, 114 }, /* Diego Garcia */ + { 315, {'F','K',0}, {'F','L','K',0}, 31396, 238 }, /* Falkland Islands (Islas Malvinas) */ + { 317, {'G','F',0}, {'G','U','F',0}, 31396, 254 }, /* French Guiana */ + { 318, {'P','F',0}, {'P','Y','F',0}, 26286, 258 }, /* French Polynesia */ + { 319, {'T','F',0}, {'A','T','F',0}, 39070, 260 }, /* French Southern and Antarctic Lands */ + { 321, {'G','P',0}, {'G','L','P',0}, 10039880, 312 }, /* Guadeloupe */ + { 322, {'G','U',0}, {'G','U','M',0}, 21206, 316 }, /* Guam */ + { 323, {'X','X',0}, {'X','X',0}, 39070 }, /* Guantanamo Bay */ + { 324, {'G','G',0}, {'G','G','Y',0}, 308, 831 }, /* Guernsey */ + { 325, {'H','M',0}, {'H','M','D',0}, 39070, 334 }, /* Heard Island and McDonald Islands */ + { 326, {'X','X',0}, {'X','X',0}, 161832256 }, /* Howland Island */ + { 327, {'X','X',0}, {'X','X',0}, 161832256 }, /* Jarvis Island */ + { 328, {'J','E',0}, {'J','E','Y',0}, 308, 832 }, /* Jersey */ + { 329, {'X','X',0}, {'X','X',0}, 161832256 }, /* Kingman Reef */ + { 330, {'M','Q',0}, {'M','T','Q',0}, 10039880, 474 }, /* Martinique */ + { 331, {'Y','T',0}, {'M','Y','T',0}, 47603, 175 }, /* Mayotte */ + { 332, {'M','S',0}, {'M','S','R',0}, 10039880, 500 }, /* Montserrat */ + { 333, {'A','N',0}, {'A','N','T',0}, 10039880, 530, LOCATION_BOTH }, /* Netherlands Antilles (Former) */ + { 334, {'N','C',0}, {'N','C','L',0}, 20900, 540 }, /* New Caledonia */ + { 335, {'N','U',0}, {'N','I','U',0}, 26286, 570 }, /* Niue */ + { 336, {'N','F',0}, {'N','F','K',0}, 10210825, 574 }, /* Norfolk Island */ + { 337, {'M','P',0}, {'M','N','P',0}, 21206, 580 }, /* Northern Mariana Islands */ + { 338, {'X','X',0}, {'X','X',0}, 161832256 }, /* Palmyra Atoll */ + { 339, {'P','N',0}, {'P','C','N',0}, 26286, 612 }, /* Pitcairn Islands */ + { 340, {'X','X',0}, {'X','X',0}, 337 }, /* Rota Island */ + { 341, {'X','X',0}, {'X','X',0}, 337 }, /* Saipan */ + { 342, {'G','S',0}, {'S','G','S',0}, 39070, 239 }, /* South Georgia and the South Sandwich Islands */ + { 343, {'S','H',0}, {'S','H','N',0}, 42483, 654 }, /* St. Helena */ + { 346, {'X','X',0}, {'X','X',0}, 337 }, /* Tinian Island */ + { 347, {'T','K',0}, {'T','K','L',0}, 26286, 772 }, /* Tokelau */ + { 348, {'X','X',0}, {'X','X',0}, 39070 }, /* Tristan da Cunha */ + { 349, {'T','C',0}, {'T','C','A',0}, 10039880, 796 }, /* Turks and Caicos Islands */ + { 351, {'V','G',0}, {'V','G','B',0}, 10039880, 92 }, /* Virgin Islands, British */ + { 352, {'W','F',0}, {'W','L','F',0}, 26286, 876 }, /* Wallis and Futuna */ + { 742, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* Africa */ + { 2129, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* Asia */ + { 10541, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* Europe */ + { 15126, {'I','M',0}, {'I','M','N',0}, 10039882, 833 }, /* Man, Isle of */ + { 19618, {'M','K',0}, {'M','K','D',0}, 47610, 807 }, /* Macedonia, Former Yugoslav Republic of */ + { 20900, {'X','X',0}, {'X','X',0}, 27114, 0, LOCATION_REGION }, /* Melanesia */ + { 21206, {'X','X',0}, {'X','X',0}, 27114, 0, LOCATION_REGION }, /* Micronesia */ + { 21242, {'X','X',0}, {'X','X',0}, 161832256 }, /* Midway Islands */ + { 23581, {'X','X',0}, {'X','X',0}, 10026358, 0, LOCATION_REGION }, /* Northern America */ + { 26286, {'X','X',0}, {'X','X',0}, 27114, 0, LOCATION_REGION }, /* Polynesia */ + { 27082, {'X','X',0}, {'X','X',0}, 161832257, 0, LOCATION_REGION }, /* Central America */ + { 27114, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* Oceania */ + { 30967, {'S','X',0}, {'S','X','M',0}, 10039880, 534 }, /* Sint Maarten (Dutch part) */ + { 31396, {'X','X',0}, {'X','X',0}, 161832257, 0, LOCATION_REGION }, /* South America */ + { 31706, {'M','F',0}, {'M','A','F',0}, 10039880, 663 }, /* Saint Martin (French part) */ + { 39070, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* World */ + { 42483, {'X','X',0}, {'X','X',0}, 742, 0, LOCATION_REGION }, /* Western Africa */ + { 42484, {'X','X',0}, {'X','X',0}, 742, 0, LOCATION_REGION }, /* Middle Africa */ + { 42487, {'X','X',0}, {'X','X',0}, 742, 0, LOCATION_REGION }, /* Northern Africa */ + { 47590, {'X','X',0}, {'X','X',0}, 2129, 0, LOCATION_REGION }, /* Central Asia */ + { 47599, {'X','X',0}, {'X','X',0}, 2129, 0, LOCATION_REGION }, /* South-Eastern Asia */ + { 47600, {'X','X',0}, {'X','X',0}, 2129, 0, LOCATION_REGION }, /* Eastern Asia */ + { 47603, {'X','X',0}, {'X','X',0}, 742, 0, LOCATION_REGION }, /* Eastern Africa */ + { 47609, {'X','X',0}, {'X','X',0}, 10541, 0, LOCATION_REGION }, /* Eastern Europe */ + { 47610, {'X','X',0}, {'X','X',0}, 10541, 0, LOCATION_REGION }, /* Southern Europe */ + { 47611, {'X','X',0}, {'X','X',0}, 2129, 0, LOCATION_REGION }, /* Middle East */ + { 47614, {'X','X',0}, {'X','X',0}, 2129, 0, LOCATION_REGION }, /* Southern Asia */ + { 7299303, {'T','L',0}, {'T','L','S',0}, 47599, 626 }, /* Democratic Republic of Timor-Leste */ + { 10026358, {'X','X',0}, {'X','X',0}, 39070, 0, LOCATION_REGION }, /* Americas */ + { 10028789, {'A','X',0}, {'A','L','A',0}, 10039882, 248 }, /* Åland Islands */ + { 10039880, {'X','X',0}, {'X','X',0}, 161832257, 0, LOCATION_REGION }, /* Caribbean */ + { 10039882, {'X','X',0}, {'X','X',0}, 10541, 0, LOCATION_REGION }, /* Northern Europe */ + { 10039883, {'X','X',0}, {'X','X',0}, 742, 0, LOCATION_REGION }, /* Southern Africa */ + { 10210824, {'X','X',0}, {'X','X',0}, 10541, 0, LOCATION_REGION }, /* Western Europe */ + { 10210825, {'X','X',0}, {'X','X',0}, 27114, 0, LOCATION_REGION }, /* Australia and New Zealand */ + { 161832015, {'B','L',0}, {'B','L','M',0}, 10039880, 652 }, /* Saint Barthélemy */ + { 161832256, {'U','M',0}, {'U','M','I',0}, 27114, 581 }, /* U.S. Minor Outlying Islands */ + { 161832257, {'X','X',0}, {'X','X',0}, 10026358, 0, LOCATION_REGION }, /* Latin America and the Caribbean */ +}; + +static const struct geoinfo_t *get_geoinfo_dataptr(GEOID geoid) +{ + int min, max; + + min = 0; + max = sizeof(geoinfodata)/sizeof(struct geoinfo_t)-1; + + while (min <= max) { + const struct geoinfo_t *ptr; + int n = (min+max)/2; + + ptr = &geoinfodata[n]; + if (geoid == ptr->id) + /* we don't need empty entry */ + return *ptr->iso2W ? ptr : NULL; + + if (ptr->id > geoid) + max = n-1; + else + min = n+1; + } + + return NULL; +} + +/****************************************************************************** + * GetGeoInfoW (KERNEL32.@) + */ +INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang) { - FIXME("%d %d %p %d %d\n", GeoId, GeoType, lpGeoData, cchData, language); - return 0; + const struct geoinfo_t *ptr; + const WCHAR *str = NULL; + WCHAR buffW[12]; + LONG val = 0; + INT len; + + TRACE("%d %d %p %d %d\n", geoid, geotype, data, data_len, lang); + + if (!(ptr = get_geoinfo_dataptr(geoid))) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + switch (geotype) { + case GEO_NATION: + val = geoid; + break; + case GEO_ISO_UN_NUMBER: + val = ptr->uncode; + break; + case GEO_PARENT: + val = ptr->parent; + break; + case GEO_ISO2: + case GEO_ISO3: + { + str = geotype == GEO_ISO2 ? ptr->iso2W : ptr->iso3W; + break; + } + case GEO_RFC1766: + case GEO_LCID: + case GEO_FRIENDLYNAME: + case GEO_OFFICIALNAME: + case GEO_TIMEZONES: + case GEO_OFFICIALLANGUAGES: + case GEO_LATITUDE: + case GEO_LONGITUDE: + FIXME("type %d is not supported\n", geotype); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; + default: + WARN("unrecognized type %d\n", geotype); + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + + if (val) { + static const WCHAR fmtW[] = {'%','d',0}; + sprintfW(buffW, fmtW, val); + str = buffW; + } + + len = strlenW(str) + 1; + if (!data || !data_len) + return len; + + memcpy(data, str, min(len, data_len)*sizeof(WCHAR)); + if (data_len < len) + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return data_len < len ? 0 : len; } -INT WINAPI GetGeoInfoA(GEOID GeoId, GEOTYPE GeoType, LPSTR lpGeoData, - int cchData, LANGID language) +/****************************************************************************** + * GetGeoInfoA (KERNEL32.@) + */ +INT WINAPI GetGeoInfoA(GEOID geoid, GEOTYPE geotype, LPSTR data, int data_len, LANGID lang) { - FIXME("%d %d %p %d %d\n", GeoId, GeoType, lpGeoData, cchData, language); - return 0; + WCHAR *buffW; + INT len; + + TRACE("%d %d %p %d %d\n", geoid, geotype, data, data_len, lang); + + len = GetGeoInfoW(geoid, geotype, NULL, 0, lang); + if (!len) + return 0; + + buffW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + if (!buffW) + return 0; + + GetGeoInfoW(geoid, geotype, buffW, len, lang); + len = WideCharToMultiByte(CP_ACP, 0, buffW, -1, NULL, 0, NULL, NULL); + if (!data || !data_len) { + HeapFree(GetProcessHeap(), 0, buffW); + return len; + } + + len = WideCharToMultiByte(CP_ACP, 0, buffW, -1, data, data_len, NULL, NULL); + HeapFree(GetProcessHeap(), 0, buffW); + + if (data_len < len) + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return data_len < len ? 0 : len; +} + +/****************************************************************************** + * EnumSystemGeoID (KERNEL32.@) + * + * Call a users function for every location available on the system. + * + * PARAMS + * geoclass [I] Type of information desired (SYSGEOTYPE enum from "winnls.h") + * parent [I] GEOID for the parent + * enumproc [I] Callback function to call for each location + * + * RETURNS + * Success: TRUE. + * Failure: FALSE. Use GetLastError() to determine the cause. + */ +BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumproc) +{ + INT i; + + TRACE("(%d, %d, %p)\n", geoclass, parent, enumproc); + + if (!enumproc) { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (geoclass != GEOCLASS_NATION && geoclass != GEOCLASS_REGION) { + SetLastError(ERROR_INVALID_FLAGS); + return FALSE; + } + + for (i = 0; i < sizeof(geoinfodata)/sizeof(struct geoinfo_t); i++) { + const struct geoinfo_t *ptr = &geoinfodata[i]; + + if (geoclass == GEOCLASS_NATION && (ptr->kind == LOCATION_REGION)) + continue; + + if (geoclass == GEOCLASS_REGION && (ptr->kind == LOCATION_NATION)) + continue; + + if (parent && ptr->parent != parent) + continue; + + if (!enumproc(ptr->id)) + return TRUE; + } + + return TRUE; } INT WINAPI GetUserDefaultLocaleName(LPWSTR localename, int buffersize) diff -Nru wine1.7-1.7.21/dlls/kernel32/nameprep.c wine1.7-1.7.24/dlls/kernel32/nameprep.c --- wine1.7-1.7.21/dlls/kernel32/nameprep.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/nameprep.c 2014-08-08 20:19:29.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.rfc-editor.org/rfc/rfc3454.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short nameprep_char_type[4432] = { /* level 1 offsets */ @@ -564,7 +562,7 @@ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002 }; -const WCHAR nameprep_mapping[5856] = +const unsigned short nameprep_mapping[5856] = { /* index */ 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0100, 0x0100, diff -Nru wine1.7-1.7.21/dlls/kernel32/sync.c wine1.7-1.7.24/dlls/kernel32/sync.c --- wine1.7-1.7.21/dlls/kernel32/sync.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/sync.c 2014-08-08 20:19:29.000000000 +0000 @@ -458,7 +458,7 @@ */ HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventExW( SECURITY_ATTRIBUTES *sa, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; @@ -632,7 +632,7 @@ */ HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexExW( SECURITY_ATTRIBUTES *sa, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; @@ -777,7 +777,7 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreExW( SECURITY_ATTRIBUTES *sa, LONG initial, LONG max, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; diff -Nru wine1.7-1.7.21/dlls/kernel32/tests/locale.c wine1.7-1.7.24/dlls/kernel32/tests/locale.c --- wine1.7-1.7.21/dlls/kernel32/tests/locale.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/tests/locale.c 2014-08-08 20:19:29.000000000 +0000 @@ -90,27 +90,36 @@ static INT (WINAPI *pCompareStringOrdinal)(const WCHAR *, INT, const WCHAR *, INT, BOOL); static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT, LPNLSVERSIONINFO, LPVOID, LPARAM); +static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID); +static INT (WINAPI *pGetGeoInfoW)(GEOID, GEOTYPE, LPWSTR, INT, LANGID); +static BOOL (WINAPI *pEnumSystemGeoID)(GEOCLASS, GEOID, GEO_ENUMPROC); static void InitFunctionPointers(void) { hKernel32 = GetModuleHandleA("kernel32"); - pEnumSystemLanguageGroupsA = (void*)GetProcAddress(hKernel32, "EnumSystemLanguageGroupsA"); - pEnumLanguageGroupLocalesA = (void*)GetProcAddress(hKernel32, "EnumLanguageGroupLocalesA"); - pLocaleNameToLCID = (void*)GetProcAddress(hKernel32, "LocaleNameToLCID"); - pLCIDToLocaleName = (void*)GetProcAddress(hKernel32, "LCIDToLocaleName"); - pLCMapStringEx = (void*)GetProcAddress(hKernel32, "LCMapStringEx"); - pFoldStringA = (void*)GetProcAddress(hKernel32, "FoldStringA"); - pFoldStringW = (void*)GetProcAddress(hKernel32, "FoldStringW"); - pIsValidLanguageGroup = (void*)GetProcAddress(hKernel32, "IsValidLanguageGroup"); - pEnumUILanguagesA = (void*)GetProcAddress(hKernel32, "EnumUILanguagesA"); - pEnumSystemLocalesEx = (void*)GetProcAddress(hKernel32, "EnumSystemLocalesEx"); - pIdnToNameprepUnicode = (void*)GetProcAddress(hKernel32, "IdnToNameprepUnicode"); - pIdnToAscii = (void*)GetProcAddress(hKernel32, "IdnToAscii"); - pIdnToUnicode = (void*)GetProcAddress(hKernel32, "IdnToUnicode"); - pGetLocaleInfoEx = (void*)GetProcAddress(hKernel32, "GetLocaleInfoEx"); - pIsValidLocaleName = (void*)GetProcAddress(hKernel32, "IsValidLocaleName"); - pCompareStringOrdinal = (void*)GetProcAddress(hKernel32, "CompareStringOrdinal"); - pCompareStringEx = (void*)GetProcAddress(hKernel32, "CompareStringEx"); + +#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) + X(EnumSystemLanguageGroupsA); + X(EnumLanguageGroupLocalesA); + X(LocaleNameToLCID); + X(LCIDToLocaleName); + X(LCMapStringEx); + X(FoldStringA); + X(FoldStringW); + X(IsValidLanguageGroup); + X(EnumUILanguagesA); + X(EnumSystemLocalesEx); + X(IdnToNameprepUnicode); + X(IdnToAscii); + X(IdnToUnicode); + X(GetLocaleInfoEx); + X(IsValidLocaleName); + X(CompareStringOrdinal); + X(CompareStringEx); + X(GetGeoInfoA); + X(GetGeoInfoW); + X(EnumSystemGeoID); +#undef X } #define eq(received, expected, label, type) \ @@ -3119,7 +3128,7 @@ ret = EnumDateFormatsA(enum_datetime_procA, lcid, DATE_YEARMONTH); if (!ret && (GetLastError() == ERROR_INVALID_FLAGS)) { - skip("DATE_YEARMONTH is only present on W2K and later\n"); + win_skip("DATE_YEARMONTH is only present on W2K and later\n"); return; } ok(ret, "EnumDateFormatsA(DATE_YEARMONTH) error %d\n", GetLastError()); @@ -3174,7 +3183,7 @@ ret = GetCPInfo(CP_UTF7, &cpinfo); if (!ret && GetLastError() == ERROR_INVALID_PARAMETER) { - skip("Codepage CP_UTF7 is not installed/available\n"); + win_skip("Codepage CP_UTF7 is not installed/available\n"); } else { @@ -3190,7 +3199,7 @@ ret = GetCPInfo(CP_UTF8, &cpinfo); if (!ret && GetLastError() == ERROR_INVALID_PARAMETER) { - skip("Codepage CP_UTF8 is not installed/available\n"); + win_skip("Codepage CP_UTF8 is not installed/available\n"); } else { @@ -3271,6 +3280,7 @@ static const WCHAR space_special[] = {0x09, 0x0d, 0x85}; WORD types[20]; + WCHAR ch; int i; memset(types,0,sizeof(types)); @@ -3327,6 +3337,21 @@ GetStringTypeW(CT_CTYPE1, space_special, 3, types); for (i = 0; i < 3; i++) ok(types[i] & C1_SPACE || broken(types[i] == C1_CNTRL) || broken(types[i] == 0), "incorrect types returned for %x -> (%x does not have %x)\n",space_special[i], types[i], C1_SPACE ); + + /* surrogate pairs */ + ch = 0xd800; + memset(types, 0, sizeof(types)); + GetStringTypeW(CT_CTYPE3, &ch, 1, types); + if (types[0] == C3_NOTAPPLICABLE) + win_skip("C3_HIGHSURROGATE/C3_LOWSURROGATE are not supported.\n"); + else { + ok(types[0] == C3_HIGHSURROGATE, "got %x\n", types[0]); + + ch = 0xdc00; + memset(types, 0, sizeof(types)); + GetStringTypeW(CT_CTYPE3, &ch, 1, types); + ok(types[0] == C3_LOWSURROGATE, "got %x\n", types[0]); + } } static void test_IdnToNameprepUnicode(void) @@ -3821,6 +3846,153 @@ ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, CSTR_LESS_THAN); } +static void test_GetGeoInfo(void) +{ + char buffA[20]; + INT ret; + + if (!pGetGeoInfoA) + { + win_skip("GetGeoInfo is not available.\n"); + return; + } + + /* unassigned id */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(344, GEO_ISO2, NULL, 0, 0); + ok(ret == 0, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + + ret = pGetGeoInfoA(203, GEO_ISO2, NULL, 0, 0); + ok(ret == 3, "got %d\n", ret); + + ret = pGetGeoInfoA(203, GEO_ISO3, NULL, 0, 0); + ok(ret == 4, "got %d\n", ret); + + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 3, 0); + ok(ret == 3, "got %d\n", ret); + ok(!strcmp(buffA, "RU"), "got %s\n", buffA); + + /* buffer pointer not NULL, length is 0 - return required length */ + buffA[0] = 'a'; + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 0, 0); + ok(ret == 3, "got %d\n", ret); + ok(buffA[0] == 'a', "got %c\n", buffA[0]); + + ret = pGetGeoInfoA(203, GEO_ISO3, buffA, 4, 0); + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "RUS"), "got %s\n", buffA); + + /* shorter buffer */ + SetLastError(0xdeadbeef); + buffA[1] = buffA[2] = 0; + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 2, 0); + ok(ret == 0, "got %d\n", ret); + ok(!strcmp(buffA, "RU"), "got %s\n", buffA); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d\n", GetLastError()); + + /* GEO_NATION returns GEOID in a string form */ + buffA[0] = 0; + ret = pGetGeoInfoA(203, GEO_NATION, buffA, 20, 0); + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "203"), "got %s\n", buffA); + + /* GEO_PARENT */ + buffA[0] = 0; + ret = pGetGeoInfoA(203, GEO_PARENT, buffA, 20, 0); + if (ret == 0) + win_skip("GEO_PARENT not supported.\n"); + else + { + ok(ret == 6, "got %d\n", ret); + ok(!strcmp(buffA, "47609"), "got %s\n", buffA); + } + + buffA[0] = 0; + ret = pGetGeoInfoA(203, GEO_ISO_UN_NUMBER, buffA, 20, 0); + if (ret == 0) + win_skip("GEO_ISO_UN_NUMBER not supported.\n"); + else + { + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "643"), "got %s\n", buffA); + } + + /* try invalid type value */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(203, GEO_PARENT + 1, NULL, 0, 0); + ok(ret == 0, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); +} + +static int geoidenum_count; +static BOOL CALLBACK test_geoid_enumproc(GEOID geoid) +{ + INT ret = pGetGeoInfoA(geoid, GEO_ISO2, NULL, 0, 0); + ok(ret == 3, "got %d for %d\n", ret, geoid); + /* valid geoid starts at 2 */ + ok(geoid >= 2, "got geoid %d\n", geoid); + + return geoidenum_count++ < 5; +} + +static BOOL CALLBACK test_geoid_enumproc2(GEOID geoid) +{ + geoidenum_count++; + return TRUE; +} + +static void test_EnumSystemGeoID(void) +{ + BOOL ret; + + if (!pEnumSystemGeoID) + { + win_skip("EnumSystemGeoID is not available.\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pEnumSystemGeoID(GEOCLASS_NATION, 0, NULL); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pEnumSystemGeoID(GEOCLASS_NATION+1, 0, test_geoid_enumproc); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pEnumSystemGeoID(GEOCLASS_NATION+1, 0, NULL); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + + ret = pEnumSystemGeoID(GEOCLASS_NATION, 0, test_geoid_enumproc); + ok(ret, "got %d\n", ret); + + /* only first level is enumerated, not the whole hierarchy */ + geoidenum_count = 0; + ret = pEnumSystemGeoID(GEOCLASS_NATION, 39070, test_geoid_enumproc2); + if (ret == 0) + win_skip("Parent GEOID is not supported in EnumSystemGeoID.\n"); + else + ok(ret && geoidenum_count > 0, "got %d, count %d\n", ret, geoidenum_count); + + geoidenum_count = 0; + ret = pEnumSystemGeoID(GEOCLASS_REGION, 39070, test_geoid_enumproc2); + if (ret == 0) + win_skip("GEOCLASS_REGION is not supported in EnumSystemGeoID.\n"); + else + { + ok(ret && geoidenum_count > 0, "got %d, count %d\n", ret, geoidenum_count); + + geoidenum_count = 0; + ret = pEnumSystemGeoID(GEOCLASS_REGION, 0, test_geoid_enumproc2); + ok(ret && geoidenum_count > 0, "got %d, count %d\n", ret, geoidenum_count); + } +} + START_TEST(locale) { InitFunctionPointers(); @@ -3856,6 +4028,8 @@ test_IdnToUnicode(); test_IsValidLocaleName(); test_CompareStringOrdinal(); + test_GetGeoInfo(); + test_EnumSystemGeoID(); /* this requires collation table patch to make it MS compatible */ if (0) test_sorting(); } diff -Nru wine1.7-1.7.21/dlls/kernel32/volume.c wine1.7-1.7.24/dlls/kernel32/volume.c --- wine1.7-1.7.21/dlls/kernel32/volume.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/kernel32/volume.c 2014-08-08 20:19:29.000000000 +0000 @@ -187,6 +187,7 @@ { HANDLE mgr; struct mountmgr_unix_drive data; + DWORD br; memset( &data, 0, sizeof(data) ); if (root) data.letter = root[0]; @@ -203,7 +204,7 @@ if (mgr == INVALID_HANDLE_VALUE) return DRIVE_UNKNOWN; if (!DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, &data, sizeof(data), &data, - sizeof(data), NULL, NULL ) && GetLastError() != ERROR_MORE_DATA) + sizeof(data), &br, NULL ) && GetLastError() != ERROR_MORE_DATA) data.type = DRIVE_UNKNOWN; CloseHandle( mgr ); @@ -1044,6 +1045,7 @@ NTSTATUS status; HANDLE mgr = INVALID_HANDLE_VALUE; BOOL ret = FALSE; + DWORD br; TRACE("(%s, %p, %x)\n", debugstr_w(path), volume, size); if (path[lstrlenW(path)-1] != '\\') @@ -1110,7 +1112,7 @@ /* now get the true volume name from the mountmgr */ if (!DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_POINTS, input, i_size, - output, o_size, NULL, NULL )) + output, o_size, &br, NULL )) goto err_ret; /* Verify and return the data, note string is not null terminated */ @@ -1869,6 +1871,7 @@ { MOUNTMGR_MOUNT_POINTS *output; DWORD outsize = 1024; + DWORD br; for (;;) { @@ -1877,7 +1880,7 @@ SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } - if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_POINTS, input, insize, output, outsize, NULL, NULL )) break; + if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_POINTS, input, insize, output, outsize, &br, NULL )) break; outsize = output->Size; HeapFree( GetProcessHeap(), 0, output ); if (GetLastError() != ERROR_MORE_DATA) return NULL; @@ -2024,6 +2027,7 @@ HANDLE WINAPI FindFirstVolumeW( LPWSTR volume, DWORD len ) { DWORD size = 1024; + DWORD br; HANDLE mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); if (mgr == INVALID_HANDLE_VALUE) return INVALID_HANDLE_VALUE; @@ -2041,7 +2045,7 @@ memset( &input, 0, sizeof(input) ); if (!DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_POINTS, &input, sizeof(input), - output, size, NULL, NULL )) + output, size, &br, NULL )) { if (GetLastError() != ERROR_MORE_DATA) break; size = output->Size; diff -Nru wine1.7-1.7.21/dlls/mmdevapi/tests/capture.c wine1.7-1.7.24/dlls/mmdevapi/tests/capture.c --- wine1.7-1.7.21/dlls/mmdevapi/tests/capture.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mmdevapi/tests/capture.c 2014-08-08 20:19:29.000000000 +0000 @@ -424,7 +424,7 @@ /* Still receiving events! */ r = WaitForSingleObject(handle, 20); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); hr = IAudioClient_Reset(ac); ok(hr == S_OK, "Reset failed: %08x\n", hr); @@ -432,13 +432,13 @@ ok(ResetEvent(handle), "ResetEvent\n"); r = WaitForSingleObject(handle, 120); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); hr = IAudioClient_SetEventHandle(ac, NULL); ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); r = WaitForSingleObject(handle, 70); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); hr = IAudioClient_Start(ac); ok(hr == S_OK, "Start failed: %08x\n", hr); diff -Nru wine1.7-1.7.21/dlls/mmdevapi/tests/render.c wine1.7-1.7.24/dlls/mmdevapi/tests/render.c --- wine1.7-1.7.21/dlls/mmdevapi/tests/render.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mmdevapi/tests/render.c 2014-08-08 20:19:29.000000000 +0000 @@ -651,7 +651,7 @@ /* Still receiving events! */ r = WaitForSingleObject(event, 20); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); hr = IAudioClient_Reset(ac); ok(hr == S_OK, "Reset failed: %08x\n", hr); @@ -659,13 +659,13 @@ ok(ResetEvent(event), "ResetEvent\n"); r = WaitForSingleObject(event, 120); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); hr = IAudioClient_SetEventHandle(ac, NULL); ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); r = WaitForSingleObject(event, 70); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); /* test releasing a playing stream */ hr = IAudioClient_Start(ac); diff -Nru wine1.7-1.7.21/dlls/mpr/wnet.c wine1.7-1.7.24/dlls/mpr/wnet.c --- wine1.7-1.7.21/dlls/mpr/wnet.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mpr/wnet.c 2014-08-08 20:19:29.000000000 +0000 @@ -1763,6 +1763,7 @@ struct mountmgr_unix_drive *data = (struct mountmgr_unix_drive *)buffer; HANDLE mgr; DWORD ret = WN_NOT_CONNECTED; + DWORD bytes_returned; if ((mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, @@ -1774,7 +1775,7 @@ memset( data, 0, sizeof(*data) ); data->letter = letter; if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, data, sizeof(*data), - data, sizeof(buffer), NULL, NULL )) + data, sizeof(buffer), &bytes_returned, NULL )) { char *p, *mount_point = buffer + data->mount_point_offset; DWORD len; diff -Nru wine1.7-1.7.21/dlls/mscoree/metahost.c wine1.7-1.7.24/dlls/mscoree/metahost.c --- wine1.7-1.7.21/dlls/mscoree/metahost.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mscoree/metahost.c 2014-08-08 20:19:29.000000000 +0000 @@ -981,14 +981,12 @@ return FALSE; } -HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface, - LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime) +static HRESULT get_runtime(LPCWSTR pwzVersion, BOOL allow_short, + REFIID iid, LPVOID *ppRuntime) { int i; DWORD major, minor, build; - TRACE("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime); - if (!pwzVersion) return E_POINTER; @@ -1003,7 +1001,7 @@ for (i=0; i= 4 && build == 0))) { if (runtimes[i].found) return ICLRRuntimeInfo_QueryInterface(&runtimes[i].ICLRRuntimeInfo_iface, iid, @@ -1020,6 +1018,14 @@ return CLR_E_SHIM_RUNTIME; } +HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface, + LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime) +{ + TRACE("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime); + + return get_runtime(pwzVersion, FALSE, iid, ppRuntime); +} + HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost* iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer) { @@ -1389,7 +1395,7 @@ supported_runtime *entry; LIST_FOR_EACH_ENTRY(entry, &parsed_config.supported_runtimes, supported_runtime, entry) { - hr = CLRMetaHost_GetRuntime(0, entry->version, &IID_ICLRRuntimeInfo, (void**)result); + hr = get_runtime(entry->version, TRUE, &IID_ICLRRuntimeInfo, (void**)result); if (SUCCEEDED(hr)) { found = TRUE; diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlanchor.c wine1.7-1.7.24/dlls/mshtml/htmlanchor.c --- wine1.7-1.7.21/dlls/mshtml/htmlanchor.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlanchor.c 2014-08-08 20:19:29.000000000 +0000 @@ -98,8 +98,9 @@ if(!strcmpiW(target, _parentW)) { if(!window->parent) { - WARN("Window has no parent\n"); - return NULL; + WARN("Window has no parent, treat as self\n"); + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); + return window; } IHTMLWindow2_AddRef(&window->parent->base.IHTMLWindow2_iface); diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlelem.c wine1.7-1.7.24/dlls/mshtml/htmlelem.c --- wine1.7-1.7.21/dlls/mshtml/htmlelem.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlelem.c 2014-08-08 20:19:29.000000000 +0000 @@ -175,11 +175,12 @@ return NS_OK; } -HRESULT elem_string_attr_getter(HTMLElement *elem, const WCHAR *name, BSTR *p) +HRESULT elem_string_attr_getter(HTMLElement *elem, const WCHAR *name, BOOL use_null, BSTR *p) { const PRUnichar *val; nsAString val_str; nsresult nsres; + HRESULT hres = S_OK; nsres = get_elem_attr_value(elem->nselem, name, &val_str, &val); if(NS_FAILED(nsres)) @@ -187,9 +188,34 @@ TRACE("%s: returning %s\n", debugstr_w(name), debugstr_w(val)); - *p = SysAllocString(val); + if(*val || !use_null) { + *p = SysAllocString(val); + if(!*p) + hres = E_OUTOFMEMORY; + }else { + *p = NULL; + } nsAString_Finish(&val_str); - return *p ? S_OK : E_OUTOFMEMORY; + return hres; +} + +HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHAR *value) +{ + nsAString name_str, val_str; + nsresult nsres; + + nsAString_InitDepend(&name_str, name); + nsAString_InitDepend(&val_str, value); + nsres = nsIDOMHTMLElement_SetAttribute(elem->nselem, &name_str, &val_str); + nsAString_Finish(&name_str); + nsAString_Finish(&val_str); + + if(NS_FAILED(nsres)) { + WARN("SetAttribute failed: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; } typedef struct @@ -825,8 +851,31 @@ static HRESULT WINAPI HTMLElement_scrollIntoView(IHTMLElement *iface, VARIANT varargStart) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); - return E_NOTIMPL; + cpp_bool start = TRUE; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); + + switch(V_VT(&varargStart)) { + case VT_EMPTY: + case VT_ERROR: + break; + case VT_BOOL: + start = V_BOOL(&varargStart) != VARIANT_FALSE; + break; + default: + FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart)); + } + + if(!This->nselem) { + FIXME("Unsupported for comments\n"); + return E_NOTIMPL; + } + + nsres = nsIDOMHTMLElement_ScrollIntoView(This->nselem, start, 1); + assert(nsres == NS_OK); + + return S_OK; } static HRESULT WINAPI HTMLElement_contains(IHTMLElement *iface, IHTMLElement *pChild, diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlform.c wine1.7-1.7.24/dlls/mshtml/htmlform.c --- wine1.7-1.7.21/dlls/mshtml/htmlform.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlform.c 2014-08-08 20:19:29.000000000 +0000 @@ -286,15 +286,36 @@ static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v) { HTMLFormElement *This = impl_from_IHTMLFormElement(iface); - FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v)); - return E_NOTIMPL; + nsAString str; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v)); + + nsAString_InitDepend(&str, v); + + nsres = nsIDOMHTMLFormElement_SetTarget(This->nsform, &str); + + nsAString_Finish(&str); + if (NS_FAILED(nsres)) { + ERR("Set Target(%s) failed: %08x\n", wine_dbgstr_w(v), nsres); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p) { HTMLFormElement *This = impl_from_IHTMLFormElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString str; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&str, NULL); + nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &str); + + return return_nsstr(nsres, &str, p); } static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v) @@ -436,8 +457,16 @@ static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface) { HTMLFormElement *This = impl_from_IHTMLFormElement(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + nsresult nsres; + + TRACE("(%p)->()\n", This); + nsres = nsIDOMHTMLFormElement_Reset(This->nsform); + if (NS_FAILED(nsres)) { + ERR("Reset failed: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLFormElement_put_length(IHTMLFormElement *iface, LONG v) diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlinput.c wine1.7-1.7.24/dlls/mshtml/htmlinput.c --- wine1.7-1.7.21/dlls/mshtml/htmlinput.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlinput.c 2014-08-08 20:19:29.000000000 +0000 @@ -1337,7 +1337,7 @@ TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, forW, p); + return elem_string_attr_getter(&This->element, forW, FALSE, p); } static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v) diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlmeta.c wine1.7-1.7.24/dlls/mshtml/htmlmeta.c --- wine1.7-1.7.21/dlls/mshtml/htmlmeta.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlmeta.c 2014-08-08 20:19:29.000000000 +0000 @@ -108,7 +108,7 @@ TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, httpEquivW, p); + return elem_string_attr_getter(&This->element, httpEquivW, TRUE, p); } static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v) @@ -125,7 +125,7 @@ TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, contentW, p); + return elem_string_attr_getter(&This->element, contentW, TRUE, p); } static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v) @@ -142,7 +142,7 @@ TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, nameW, p); + return elem_string_attr_getter(&This->element, nameW, TRUE, p); } static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v) @@ -159,18 +159,24 @@ return E_NOTIMPL; } +static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0}; + static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v) { HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return elem_string_attr_setter(&This->element, charsetW, v); } static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p) { HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return elem_string_attr_getter(&This->element, charsetW, TRUE, p); } static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = { diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlstyle.c wine1.7-1.7.24/dlls/mshtml/htmlstyle.c --- wine1.7-1.7.21/dlls/mshtml/htmlstyle.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlstyle.c 2014-08-08 20:19:29.000000000 +0000 @@ -172,6 +172,8 @@ {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0}; static const WCHAR attrTextIndent[] = {'t','e','x','t','-','i','n','d','e','n','t',0}; +static const WCHAR attrTextTransform[] = + {'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0}; static const WCHAR attrTop[] = {'t','o','p',0}; static const WCHAR attrVerticalAlign[] = @@ -266,6 +268,7 @@ {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN}, {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION}, {attrTextIndent, DISPID_IHTMLSTYLE_TEXTINDENT}, + {attrTextTransform, DISPID_IHTMLSTYLE_TEXTTRANSFORM}, {attrTop, DISPID_IHTMLSTYLE_TOP}, {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN}, {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY}, @@ -1450,15 +1453,19 @@ static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_attr(This, STYLEID_TEXT_TRANSFORM, v, 0); } static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_style_attr(This, STYLEID_TEXT_TRANSFORM, p); } static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v) diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlstyle.h wine1.7-1.7.24/dlls/mshtml/htmlstyle.h --- wine1.7-1.7.21/dlls/mshtml/htmlstyle.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlstyle.h 2014-08-08 20:19:29.000000000 +0000 @@ -101,6 +101,7 @@ STYLEID_TEXT_ALIGN, STYLEID_TEXT_DECORATION, STYLEID_TEXT_INDENT, + STYLEID_TEXT_TRANSFORM, STYLEID_TOP, STYLEID_VERTICAL_ALIGN, STYLEID_VISIBILITY, diff -Nru wine1.7-1.7.21/dlls/mshtml/htmltable.c wine1.7-1.7.24/dlls/mshtml/htmltable.c --- wine1.7-1.7.21/dlls/mshtml/htmltable.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmltable.c 2014-08-08 20:19:29.000000000 +0000 @@ -869,15 +869,35 @@ static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v) { HTMLTable *This = impl_from_IHTMLTable3(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString str; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&str, v); + + nsres = nsIDOMHTMLTableElement_SetSummary(This->nstable, &str); + + nsAString_Finish(&str); + if (NS_FAILED(nsres)) { + ERR("Set summary(%s) failed: %08x\n", debugstr_w(v), nsres); + return E_FAIL; + } + return S_OK; } static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p) { HTMLTable *This = impl_from_IHTMLTable3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString str; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&str, NULL); + nsres = nsIDOMHTMLTableElement_GetSummary(This->nstable, &str); + + return return_nsstr(nsres, &str, p); } static const IHTMLTable3Vtbl HTMLTable3Vtbl = { @@ -914,10 +934,10 @@ *ppv = &This->IHTMLTable_iface; }else if(IsEqualGUID(&IID_IHTMLTable2, riid)) { TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This, ppv); - *ppv = &This->IHTMLTable_iface; + *ppv = &This->IHTMLTable2_iface; }else if(IsEqualGUID(&IID_IHTMLTable3, riid)) { TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This, ppv); - *ppv = &This->IHTMLTable_iface; + *ppv = &This->IHTMLTable3_iface; } if(*ppv) { @@ -946,6 +966,8 @@ static const tid_t HTMLTable_iface_tids[] = { HTMLELEMENT_TIDS, IHTMLTable_tid, + IHTMLTable2_tid, + IHTMLTable3_tid, 0 }; @@ -967,6 +989,8 @@ ret->element.node.vtbl = &HTMLTableImplVtbl; ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl; + ret->IHTMLTable2_iface.lpVtbl = &HTMLTable2Vtbl; + ret->IHTMLTable3_iface.lpVtbl = &HTMLTable3Vtbl; HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex); diff -Nru wine1.7-1.7.21/dlls/mshtml/htmlwindow.c wine1.7-1.7.24/dlls/mshtml/htmlwindow.c --- wine1.7-1.7.21/dlls/mshtml/htmlwindow.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/htmlwindow.c 2014-08-08 20:19:29.000000000 +0000 @@ -1010,8 +1010,10 @@ static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(url)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(url)); + + return navigate_url(This->outer_window, url, This->outer_window->uri, BINDING_NAVIGATED); } static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v) diff -Nru wine1.7-1.7.21/dlls/mshtml/main.c wine1.7-1.7.24/dlls/mshtml/main.c --- wine1.7-1.7.21/dlls/mshtml/main.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/main.c 2014-08-08 20:19:29.000000000 +0000 @@ -501,37 +501,6 @@ return hres; } -const char *debugstr_variant(const VARIANT *v) -{ - if(!v) - return "(null)"; - - switch(V_VT(v)) { - case VT_EMPTY: - return "{VT_EMPTY}"; - case VT_NULL: - return "{VT_NULL}"; - case VT_I2: - return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v)); - case VT_I4: - return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); - case VT_R8: - return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); - case VT_BSTR: - return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v))); - case VT_DISPATCH: - return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); - case VT_ERROR: - return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v)); - case VT_BOOL: - return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); - case VT_UINT: - return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v)); - default: - return wine_dbg_sprintf("{vt %d}", V_VT(v)); - } -} - const char *debugstr_mshtml_guid(const GUID *iid) { #define X(x) if(IsEqualGUID(iid, &x)) return #x diff -Nru wine1.7-1.7.21/dlls/mshtml/mshtml_private.h wine1.7-1.7.24/dlls/mshtml/mshtml_private.h --- wine1.7-1.7.21/dlls/mshtml/mshtml_private.h 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/mshtml_private.h 2014-08-08 20:19:29.000000000 +0000 @@ -959,7 +959,8 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN; nsresult get_elem_attr_value(nsIDOMHTMLElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN; -HRESULT elem_string_attr_getter(HTMLElement*,const WCHAR*,BSTR*) DECLSPEC_HIDDEN; +HRESULT elem_string_attr_getter(HTMLElement*,const WCHAR*,BOOL,BSTR*) DECLSPEC_HIDDEN; +HRESULT elem_string_attr_setter(HTMLElement*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; /* commands */ typedef struct { @@ -1027,7 +1028,6 @@ HRESULT set_task_timer(HTMLInnerWindow*,DWORD,BOOL,IDispatch*,LONG*) DECLSPEC_HIDDEN; HRESULT clear_task_timer(HTMLInnerWindow*,BOOL,DWORD) DECLSPEC_HIDDEN; -const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; const char *debugstr_mshtml_guid(const GUID*) DECLSPEC_HIDDEN; DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B); diff -Nru wine1.7-1.7.21/dlls/mshtml/navigate.c wine1.7-1.7.24/dlls/mshtml/navigate.c --- wine1.7-1.7.21/dlls/mshtml/navigate.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/navigate.c 2014-08-08 20:19:29.000000000 +0000 @@ -993,7 +993,7 @@ break; } - MultiByteToWideChar(CP_ACP, 0, bsc->buf, bsc->bsc.readed, text, len); + MultiByteToWideChar(cp, 0, bsc->buf, bsc->bsc.readed, text, len); text[len] = 0; } } diff -Nru wine1.7-1.7.21/dlls/mshtml/nsembed.c wine1.7-1.7.24/dlls/mshtml/nsembed.c --- wine1.7-1.7.21/dlls/mshtml/nsembed.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/nsembed.c 2014-08-08 20:19:29.000000000 +0000 @@ -438,8 +438,10 @@ static void set_environment(LPCWSTR gre_path) { - WCHAR path_env[MAX_PATH], buf[20]; - int len, debug_level = 0; + size_t len, gre_path_len; + int debug_level = 0; + WCHAR *path, buf[20]; + const WCHAR *ptr; static const WCHAR pathW[] = {'P','A','T','H',0}; static const WCHAR warnW[] = {'w','a','r','n',0}; @@ -449,13 +451,6 @@ {'N','S','P','R','_','L','O','G','_','M','O','D','U','L','E','S',0}; static const WCHAR debug_formatW[] = {'a','l','l',':','%','d',0}; - /* We have to modify PATH as XPCOM loads other DLLs from this directory. */ - GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR)); - len = strlenW(path_env); - path_env[len++] = ';'; - strcpyW(path_env+len, gre_path); - SetEnvironmentVariableW(pathW, path_env); - SetEnvironmentVariableW(xpcom_debug_breakW, warnW); if(TRACE_ON(gecko)) @@ -467,6 +462,23 @@ sprintfW(buf, debug_formatW, debug_level); SetEnvironmentVariableW(nspr_log_modulesW, buf); + + len = GetEnvironmentVariableW(pathW, NULL, 0); + gre_path_len = strlenW(gre_path); + path = heap_alloc((len+gre_path_len+1)*sizeof(WCHAR)); + if(!path) + return; + GetEnvironmentVariableW(pathW, path, len); + + /* We have to modify PATH as xul.dll loads other DLLs from this directory. */ + if(!(ptr = strstrW(path, gre_path)) + || (ptr > path && *(ptr-1) != ';') + || (ptr[gre_path_len] && ptr[gre_path_len] != ';')) { + if(len) + path[len-1] = ';'; + strcpyW(path+len, gre_path); + SetEnvironmentVariableW(pathW, path); + } } static BOOL load_xul(const PRUnichar *gre_path) diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/dom.c wine1.7-1.7.24/dlls/mshtml/tests/dom.c --- wine1.7-1.7.21/dlls/mshtml/tests/dom.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/dom.c 2014-08-08 20:19:29.000000000 +0000 @@ -3764,6 +3764,38 @@ IHTMLFormElement_Release(form); } +#define test_form_reset(a) _test_form_reset(__LINE__,a) +static void _test_form_reset(unsigned line, IUnknown *unk) +{ + IHTMLFormElement *form = _get_form_iface(line, unk); + HRESULT hres; + + hres = IHTMLFormElement_reset(form); + ok_(__FILE__,line)(hres == S_OK, "reset failed: %08x\n", hres); + + IHTMLFormElement_Release(form); +} + +static void test_form_target(IUnknown *unk) +{ + IHTMLFormElement *form = get_form_iface(unk); + HRESULT hres; + BSTR str; + static const char target[] = "_blank"; + + str = a2bstr(target); + hres = IHTMLFormElement_put_target(form, str); + ok(hres == S_OK, "put_target(%s) failed: %08x\n", target, hres); + SysFreeString(str); + + hres = IHTMLFormElement_get_target(form, &str); + ok(hres == S_OK, "get_target failed: %08x\n", hres); + ok(!strcmp_wa(str, target), "Expected %s, got %s\n", target, wine_dbgstr_w(str)); + SysFreeString(str); + + IHTMLFormElement_Release(form); +} + #define test_meta_name(a,b) _test_meta_name(__LINE__,a,b) static void _test_meta_name(unsigned line, IUnknown *unk, const char *exname) { @@ -3771,7 +3803,6 @@ BSTR name = NULL; HRESULT hres; - meta = _get_metaelem_iface(line, unk); hres = IHTMLMetaElement_get_name(meta, &name); ok_(__FILE__,line)(hres == S_OK, "get_name failed: %08x\n", hres); @@ -3787,7 +3818,6 @@ BSTR content = NULL; HRESULT hres; - meta = _get_metaelem_iface(line, unk); hres = IHTMLMetaElement_get_content(meta, &content); ok_(__FILE__,line)(hres == S_OK, "get_content failed: %08x\n", hres); @@ -3803,7 +3833,6 @@ BSTR val = NULL; HRESULT hres; - meta = _get_metaelem_iface(line, unk); hres = IHTMLMetaElement_get_httpEquiv(meta, &val); ok_(__FILE__,line)(hres == S_OK, "get_httpEquiv failed: %08x\n", hres); @@ -3812,6 +3841,40 @@ IHTMLMetaElement_Release(meta); } +#define test_meta_charset(a,b) _test_meta_charset(__LINE__,a,b) +static void _test_meta_charset(unsigned line, IUnknown *unk, const char *exval) +{ + IHTMLMetaElement *meta; + BSTR val = NULL; + HRESULT hres; + + meta = _get_metaelem_iface(line, unk); + hres = IHTMLMetaElement_get_charset(meta, &val); + ok_(__FILE__,line)(hres == S_OK, "get_charset failed: %08x\n", hres); + if(exval) + ok_(__FILE__,line)(!strcmp_wa(val, exval), "charset = %s, expected %s\n", wine_dbgstr_w(val), exval); + else + ok_(__FILE__,line)(!val, "charset = %s, expected NULL\n", wine_dbgstr_w(val)); + SysFreeString(val); + IHTMLMetaElement_Release(meta); +} + +#define set_meta_charset(a,b) _set_meta_charset(__LINE__,a,b) +static void _set_meta_charset(unsigned line, IUnknown *unk, const char *vala) +{ + BSTR val = a2bstr(vala); + IHTMLMetaElement *meta; + HRESULT hres; + + meta = _get_metaelem_iface(line, unk); + hres = IHTMLMetaElement_put_charset(meta, val); + ok_(__FILE__,line)(hres == S_OK, "put_charset failed: %08x\n", hres); + SysFreeString(val); + IHTMLMetaElement_Release(meta); + + _test_meta_charset(line, unk, vala); +} + #define test_link_media(a,b) _test_link_media(__LINE__,a,b) static void _test_link_media(unsigned line, IHTMLElement *elem, const char *exval) { @@ -5930,6 +5993,7 @@ { IHTMLElementCollection *col; IHTMLTable *table; + IHTMLTable3 *table3; IHTMLDOMNode *node; VARIANT v; HRESULT hres; @@ -5945,6 +6009,11 @@ if(FAILED(hres)) return; + hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTable3, (void**)&table3); + ok(hres == S_OK, "Could not get IHTMLTable3 iface: %08x\n", hres); + if(FAILED(hres)) + return; + col = NULL; hres = IHTMLTable_get_rows(table, &col); ok(hres == S_OK, "get_rows failed: %08x\n", hres); @@ -6082,6 +6151,17 @@ ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v); + bstr = a2bstr("summary"); + hres = IHTMLTable3_put_summary(table3, bstr); + ok(hres == S_OK, "put_summary = %08x\n", hres); + SysFreeString(bstr); + + hres = IHTMLTable3_get_summary(table3, &bstr); + ok(hres == S_OK, "get_summary = %08x\n", hres); + ok(!strcmp_wa(bstr, "summary"), "Expected summary, got %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + IHTMLTable3_Release(table3); IHTMLTable_Release(table); } @@ -6920,6 +7000,8 @@ test_meta_name((IUnknown*)elem, "meta name"); test_meta_content((IUnknown*)elem, "text/html; charset=utf-8"); test_meta_httpequiv((IUnknown*)elem, "Content-Type"); + test_meta_charset((IUnknown*)elem, NULL); + set_meta_charset((IUnknown*)elem, "utf-8"); IHTMLElement_Release(elem); } @@ -7313,6 +7395,8 @@ test_form_put_encoding((IUnknown*)elem, E_INVALIDARG, "image/png"); test_form_encoding((IUnknown*)elem, "multipart/form-data"); test_form_elements((IUnknown*)elem); + test_form_reset((IUnknown*)elem); + test_form_target((IUnknown*)elem); IHTMLElement_Release(elem); } diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/exectest.html wine1.7-1.7.24/dlls/mshtml/tests/exectest.html --- wine1.7-1.7.21/dlls/mshtml/tests/exectest.html 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/exectest.html 2014-08-08 20:19:29.000000000 +0000 @@ -55,7 +55,7 @@ testPutSrc(); testPutText(); }catch(e) { - ok(false, "Got an exception"); + ok(false, "Got an exception " + e.message); } function testPutSrc2() { @@ -123,7 +123,7 @@ testPutSrc2(); testPutText2(); }catch(e) { - ok(false, "got an exception"); + ok(false, "got an exception " + e.message); } external.reportSuccess(); diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/htmldoc.c wine1.7-1.7.24/dlls/mshtml/tests/htmldoc.c --- wine1.7-1.7.21/dlls/mshtml/tests/htmldoc.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/htmldoc.c 2014-08-08 20:19:29.000000000 +0000 @@ -978,6 +978,7 @@ case 3000029: case 3000030: case 3000031: + case 3000032: /* TODO */ return S_OK; } @@ -2855,6 +2856,7 @@ test_readyState(NULL); return S_OK; case OLECMDID_UPDATETRAVELENTRY_DATARECOVERY: + case OLECMDID_PAGEAVAILABLE: case 6058: return E_FAIL; /* FIXME */ default: @@ -2864,7 +2866,7 @@ } if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { - if(nCmdID != 63 && (!is_refresh || nCmdID != 37)) + if(nCmdID != 63 && nCmdID != 178 && (!is_refresh || nCmdID != 37)) test_readyState(NULL); ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt); @@ -2976,9 +2978,11 @@ case 83: case 102: + case 133: case 134: /* TODO */ case 135: case 136: /* TODO */ + case 137: case 139: /* TODO */ case 143: /* TODO */ case 144: /* TODO */ @@ -3293,13 +3297,15 @@ { static const IID IID_IIETravelLog2 = {0xb67cefd2,0xe3f1,0x478a,{0x9b,0xfa,0xd8,0x93,0x70,0x37,0x5e,0x94}}; static const IID IID_unk_travellog = {0x6afc8b7f,0xbc17,0x4a95,{0x90,0x2f,0x6f,0x5c,0xb5,0x54,0xc3,0xd8}}; + static const IID IID_unk_travellog2 = {0xf6d02767,0x9c80,0x428d,{0xb9,0x74,0x3f,0x17,0x29,0x45,0x3f,0xdb}}; if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITravelLog, riid)) { *ppv = iface; return S_OK; } - if(!IsEqualGUID(&IID_IIETravelLog2, riid) && !IsEqualGUID(&IID_unk_travellog, riid)) + if(!IsEqualGUID(&IID_IIETravelLog2, riid) && !IsEqualGUID(&IID_unk_travellog, riid) + && !IsEqualGUID(&IID_unk_travellog2, riid)) ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid)); *ppv = NULL; @@ -3433,7 +3439,7 @@ ok(!pDispatch, "pDispatch = %p\n", pDispatch); ok(!strcmp_wa(lpszUrl, nav_url), "lpszUrl = %s, expected %s\n", wine_dbgstr_w(lpszUrl), nav_url); - ok(dwFlags == 0x40 || !dwFlags || dwFlags == 0x50, "dwFlags = %x\n", dwFlags); + ok(dwFlags == 0x140 /* IE11*/ || dwFlags == 0x40 || !dwFlags || dwFlags == 0x50, "dwFlags = %x\n", dwFlags); ok(!lpszFrameName, "lpszFrameName = %s\n", wine_dbgstr_w(lpszFrameName)); if(!testing_submit) { ok(!pPostData, "pPostData = %p\n", pPostData); @@ -5294,7 +5300,7 @@ switch(load_state) { case LD_DOLOAD: case LD_NO: - if(!nav_url) + if(!nav_url && !editmode) ok(!elem, "elem != NULL\n"); default: break; @@ -5746,6 +5752,8 @@ SET_EXPECT(NavigateWithBindCtx); SET_EXPECT(Exec_Explorer_38); /* todo_wine */ } + if(editmode || is_refresh) + SET_EXPECT(Exec_ShellDocView_138); expect_status_text = (LPWSTR)0xdeadbeef; /* TODO */ while(!*b && GetMessageW(&msg, NULL, 0, 0)) { @@ -5868,6 +5876,8 @@ CHECK_CALLED(NavigateWithBindCtx); todo_wine CHECK_NOT_CALLED(Exec_Explorer_38); } + if(editmode || is_refresh) + CLEAR_CALLED(Exec_ShellDocView_138); /* IE11 */ if(!is_extern) load_state = LD_COMPLETE; @@ -5973,7 +5983,7 @@ CHECK_CALLED(TranslateUrl); if(support_wbapp) { CHECK_CALLED(FireBeforeNavigate2); - CHECK_CALLED(Exec_ShellDocView_67); + CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */ if(!is_hash) { CHECK_CALLED(Invoke_AMBIENT_SILENT); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); @@ -6039,7 +6049,7 @@ ok(hres == S_OK, "SuperNavigate failed: %08x\n", hres); CHECK_CALLED(TranslateUrl); - CHECK_CALLED(Exec_ShellDocView_67); + CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */ CHECK_CALLED(Invoke_AMBIENT_SILENT); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Exec_ShellDocView_63); @@ -6110,8 +6120,8 @@ hres = IPersistHistory_LoadHistory(per_hist, history_stream, NULL); ok(hres == S_OK, "LoadHistory failed: %08x\n", hres); - CHECK_CALLED_BROKEN(Exec_ShellDocView_138); - CHECK_CALLED(Exec_ShellDocView_67); + CLEAR_CALLED(Exec_ShellDocView_138); /* Not called by IE11 */ + CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */ CHECK_CALLED(FireBeforeNavigate2); CHECK_CALLED(Invoke_AMBIENT_SILENT); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); @@ -7834,11 +7844,11 @@ CHECK_CALLED(TranslateUrl); CHECK_CALLED(FireBeforeNavigate2); - CHECK_CALLED(Exec_ShellDocView_67); + CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */ CHECK_CALLED(Invoke_AMBIENT_SILENT); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Exec_ShellDocView_63); - todo_wine CHECK_CALLED(Exec_ShellDocView_84); + CLEAR_CALLED(Exec_ShellDocView_84); /* Not called by IE11 */ CHECK_CALLED(CreateInstance); CHECK_CALLED(Start); CHECK_CALLED(Protocol_Read); diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/jstest.html wine1.7-1.7.24/dlls/mshtml/tests/jstest.html --- wine1.7-1.7.21/dlls/mshtml/tests/jstest.html 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/jstest.html 2014-08-08 20:19:29.000000000 +0000 @@ -248,7 +248,7 @@ try { runTests(); }catch(e) { - ok(false, "got exception"); + ok(false, "got exception " + e.message); } external.reportSuccess(); diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/nav_test.html wine1.7-1.7.24/dlls/mshtml/tests/nav_test.html --- wine1.7-1.7.21/dlls/mshtml/tests/nav_test.html 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/nav_test.html 2014-08-08 20:19:29.000000000 +0000 @@ -18,6 +18,7 @@ } iframe.onload = function() { + iframe.onload = null; var href = iframe.contentWindow.location.href; ok(/.*blank2.html/.test(href), "Unexpected href " + href); next_test(); @@ -27,8 +28,24 @@ subframe.src = "blank.html"; } +function window_navigate_test() { + external.trace("Runnint window.navigate() tests..."); + + var iframe = document.getElementById("testframe"); + + iframe.onload = function() { + iframe.onlod = null; + var href = iframe.contentWindow.location.href; + ok(href === "about:blank", "Unexpected href " + href); + next_test(); + } + + iframe.contentWindow.navigate("about:blank"); +} + var tests = [ nav_back_test, + window_navigate_test, function() { external.reportSuccess(); } ]; diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/style.c wine1.7-1.7.24/dlls/mshtml/tests/style.c --- wine1.7-1.7.21/dlls/mshtml/tests/style.c 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/style.c 2014-08-08 20:19:29.000000000 +0000 @@ -1249,6 +1249,22 @@ SysFreeString(str); str = (void*)0xdeadbeef; + hres = IHTMLStyle_get_textTransform(style, &str); + ok(hres == S_OK, "get_textTransform failed: %08x\n", hres); + ok(!str, "textTransform != NULL\n"); + + str = a2bstr("lowercase"); + hres = IHTMLStyle_put_textTransform(style, str); + ok(hres == S_OK, "put_textTransform failed: %08x\n", hres); + SysFreeString(str); + + str = NULL; + hres = IHTMLStyle_get_textTransform(style, &str); + ok(hres == S_OK, "get_textTransform failed: %08x\n", hres); + ok(!strcmp_wa(str, "lowercase"), "textTransform = %s\n", wine_dbgstr_w(V_BSTR(&v))); + SysFreeString(str); + + str = (void*)0xdeadbeef; hres = IHTMLStyle_get_filter(style, &str); ok(hres == S_OK, "get_filter failed: %08x\n", hres); ok(!str, "filter != NULL\n"); diff -Nru wine1.7-1.7.21/dlls/mshtml/tests/vbtest.html wine1.7-1.7.24/dlls/mshtml/tests/vbtest.html --- wine1.7-1.7.21/dlls/mshtml/tests/vbtest.html 2014-06-27 18:10:11.000000000 +0000 +++ wine1.7-1.7.24/dlls/mshtml/tests/vbtest.html 2014-08-08 20:19:29.000000000 +0000 @@ -24,7 +24,7 @@ counter++; incCounter(2); }catch(e) { - ok(false, "got an exception"); + ok(false, "got an exception " + e.message); }