diff -Nru wine-staging-1.9.2~ubuntu12.04.1/ANNOUNCE wine-staging-1.9.3~ubuntu12.04.1/ANNOUNCE --- wine-staging-1.9.2~ubuntu12.04.1/ANNOUNCE 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/ANNOUNCE 2016-02-08 19:32:34.000000000 +0000 @@ -1,17 +1,17 @@ -The Wine development release 1.9.2 is now available. +The Wine development release 1.9.3 is now available. What's new in this release (see below for details): - - GStreamer 1.0 support. - - Support for SHA hashes in BCrypt. - - Synthesizing bold glyphs also for bitmap fonts. - - Underlines support in DirectWrite. + - New version of the Gecko engine based on Firefox 44. + - JSON support in JavaScript. + - Improved line breaking in DirectWrite. + - Some more write support in WebServices. - Still more Shader Model 4 instructions. - Various bug fixes. The source is available from the following locations: - http://dl.winehq.org/wine/source/1.9/wine-1.9.2.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.9/wine-1.9.2.tar.bz2 + http://dl.winehq.org/wine/source/1.9/wine-1.9.3.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.9/wine-1.9.3.tar.bz2 Binary packages for various distributions will be available from: @@ -27,395 +27,393 @@ ---------------------------------------------------------------- -Bugs fixed in 1.9.2 (total 41): +Bugs fixed in 1.9.3 (total 24): - 7938 Gyldendal dictionary needs ole2disp.dll.SAFEARRAYALLOCDATA - 8490 SHBrowseForFolder: BIF_NEWSTYLEDIALOG not implemented - title gets cropped in uTorrent - 11023 Lack of ole2disp.dll.SAFEARRAYDESTROYDESCRIPTOR causes Nota Bene to refuse to launch - 18932 Installshield installer text not being bolded (appinstall) - 20896 Use-after-free in DdeClientTransaction in user32 dde tests - 24658 Unimplemented function ole2.dll16.READCLASSSTM - 28113 winverbs doesn't work, needs ole2disp.dll16.SAFEARRAYALLOCDESCRIPTOR - 30557 winegstreamer broken with >=glib-2.32.0 - 31496 Render-to-fbo with WINED3D_SWAP_EFFECT_FLIP continually spammed in console - 31836 Add support for GStreamer 1.0 API/ABI - 31913 EasyPal version August 6 2012 crashes on unimplemented function msvcp60.dll.??Dstd@@YA?AV?$complex@N@0@ABNABV10@@Z - 34185 Castlevania: Lords of Shadow demo doesn't work after intro movies - 35774 MSVC 2012 needs msvcp110.dll.?_Equivalent@sys@tr2@std@@YAHPBD0@Z - 36299 valgrind shows a few possible leaks in msxml3/tests/httpreq.c - 36303 valgrind shows several leaks in msxml3/tests/schema.c - 37536 Native MSVCP120.dll override requires implementation of msvcr120.dll._W_Gettnames (Desura client) - 37908 GLFont crashes saving a .glf file (needs msvcp70.dll.?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z) - 38451 valgrind shows uninitialized variable in dlls/shlwapi/tests/ordinal.c - 38722 AVG installer wants ntdll.dll.RtlCreateUserProcess - 38781 Dungeon Keeper FX runs too quickly (differences in clock() function) - 39186 Steam client: links missing underline when DirectWrite method enabled - 39558 Unused variables xoffset, yoffset in SCROLL_TrackScrollBar - 39609 Dirt 3 requires WINED3DFMT_R8G8_UNORM - 39677 Zararadio crashes when it has to change from a playlist to another. - 39739 Cobra 11 - Burning Wheels demo: crashes when starting the tutorial - 39803 When closing a maximized microsoft word 2007 window, the program is closed but the desktop screen is not refreshed - 39805 GTAIV rendering is broken - 39818 J-Link 1.3.0 does not start at all, needs winspool.drv.EnumPrinterKeyW - 39820 Warhammer 40k: Kill Team needs BC1_UNORM - 39838 Wreckfest Server: Crashes at startup, unimplemented function KERNEL32.dll.GetConsoleScreenBufferInfoEx & SetConsoleScreenBufferInfoEx - 39874 Alien Shooter crashes often with access violation - 39901 LeapPadExplorer needs rasapi32.dll.RasSetCustomAuthDataW - 39943 Worms Armageddon opens wine explorer instead of running - 39950 Cabal II can't be opened, needs msvcp100.dll.?lowest@?$numeric_limits@M@std@@SAMXZ - 39951 KeePassX 2.0 wants KERNEL32.dll.SetSearchPathMode - 39952 trackbar thumb always at zero on dialog load. - 39953 StarCraft II: 64bit client crashing regularly due to access violation (0xC0000005) - 39954 StarCraft II: 64bit client only runs with lowest shader settings - 39958 Regression in dmime caused by change in flag handling for DSBCAPS_CTRLPAN in dsound - 39974 Thumb slider doesn't respond to key events - 39984 EveOnline launcher crashes when started, needs msvcr120.dll._dpcomp + 12652 Tom Clancy's Rainbow Six: Vegas 2 fails to launch (number of quality levels for D3DMULTISAMPLE_NONMASKABLE multiple-sample type must not exceed 8) + 14617 Multiple Visual Basic 5/6 applications using ActiveX components depend on Standard OLE Types Typelib which is missing from 'olepro32.dll' + 28488 Arcanum: Mouseclicks in character generation screen doubled with pause + 32695 Yahoo Messenger login crashes on unimplemented function nspr4.dll.PR_SetCurrentThreadName (messenger provided 'nspr4.dll' ABI incompatible with Wine Gecko) + 32852 BioEdit: changing the install directory doesn't show the change in the GUI + 33140 Photos opened in Nikon Capture NX 2.4 have inverted red and blue channel for displaying. + 33988 Star Wars: The Force Unleashed II - Crashes with a page fault + 34504 __unDName doesn't support function pointer with type "P8" + 34507 __unDName doesn't support data type "$$B" + 37632 farcry 3 display strange colors + 37911 LINE program, black window + 39092 Regression introduced with xaudio2_8 + 39181 "When Monster Strikes", "The Vanishing of Ethan Carter Redux" require msvcr120.dll._set_FMA3_enable + 39615 Multiple applications want msdrm.dll (Dassault Systemes CATIA v5, FoxitReader 5.1) + 39686 IE frame freezes after calling the print dialog + 39865 Poker Night: changing to non-fullscreen mode crashes X. + 39875 Starcraft can't see Direct Cable Connection games hosted on another computer + 39904 Spurious "You must use msvcrt" error even when __MSVCRT__ is defined (-mno-cygwin) + 39928 Star Wars: The Old Republic corruptions in dialogues when Conversation Depth of Field is enabled + 39933 iNode 3.6 client needs ndis.sys.NdisAllocateSpinLock + 39965 Lego Mindstorms EV3 Software does not find EV3 brick using Bluetooth: needs irprops.cpl + 40021 IDEA v1.7 fails to start + 40035 VMware shared folders network provider fails loading in MPR + 40052 Opening an RTF file with "A Wine application" fails with "File not found" ---------------------------------------------------------------- -Changes since 1.9.1: +Changes since 1.9.2: -Aaryaman Vasishta (3): - d3drm/tests: Add texture loading tests. - d3drm: Fix QueryInterface for IDirect3DRMTexture*. - d3drm/tests: Add QueryInterface tests for IDirect3DRMTexture*. - -Akihiro Sagawa (6): - gdi32: Add a helper function to calculate the glyph advance metric. - gdi32: Fix the advance width in synthetic bold glyphs with scaling. - gdi32: Return an boolean value whether synthesizing bold glyph is success. - gdi32: Implement synthesizing bold glyphs for bitmap fonts. - comctl32/tests: Fix a typo. - comctl32: Prevent invalid focus change notifications from LVS_OWNERDATA lists. - -Alex Henrie (5): - ntdll: Remove redundant avail_mode check and confusing comment. - winex11: Fix overflow in remove_startup_notification. - server: Fix duplicate, incorrect comment describing is_fd_signaled. - ntdll: Avoid double initialization. - ntdll: Return an error from CDROM_Open if fstat fails. - -Alexandre Julliard (28): - makefiles: Generate all makefiles at once. - makedep: Generate testlist.c directly from the makefile data. - makefiles: Generate distclean rules from makedep. - makefiles: Generate makefile dependencies from makedep. - msvcrt: Don't import atexit to avoid conflicts with the Mingw runtime. - msvcrt/tests: Don't check array pointer for NULL. - explorer: Support a quoted /desktop option. - xaudio2: Remove unnecessary kernel32 imports. - ntdll: Add a helper function to allocate the full object_attributes structure. - server: Store the attributes in the object_attributes structure. - server: Add a helper function to validate and return object attributes. - server: Allow the object attributes to be omitted in requests. - server: Pass full object attributes in the create_timer request. - server: Pass full object attributes in the create_mailslot request. - server: Pass full object attributes in the create_directory request. - server: Pass full object attributes in the create_symlink request. - server: Pass full object attributes in the create_completion request. - server: Add a helper function to skip the object attributes structure. - server: Pass full object attributes in the create_key request. - server: Pass full object attributes in the load_registry request. - server: Fix constraints on the length of NT object names. - kernel32/tests: Avoid sizeof in a trace. - ntdll/tests: Fix a test failure on restricted Windows. - server: Create window stations objects in a standard directory. - server: Store the desktop object names inside their window station. - configure: Don't check for gnutls_hash if gnutls is missing entirely. - configure: Don't check for gst/gstpad.h that we don't use. - server: Always print the full path of objects when dumping them. - -Alistair Leslie-Hughes (6): - include: Add declaration D3DXDisassembleEffect. - d3dx9: Implement GetMaxNum* functions. - d3dx9/tests: Add D3DXCreateAnimationController tests. - d3dx9/tests: DDS magic isn't part of the DDS header. - msi: Allow PathEdit controls to be updated. - msi: Refreh controls after spawned dialog is closed. - -Andrew Eikum (35): - xaudio2: Explicitly version the 2.7 coclasses. - xaudio2_8: Use shared source. - xaudio2_6: Use shared source. - include: Add TrySubmitThreadpoolCallback declaration. - mscoree: Set config path for default app domain. - xaudio2_5: Use shared source. - xaudio2_4: Use shared source. - xaudio2_3: Use shared source. - xaudio2_2: Use shared source. - xaudio2_1: Use shared source. - xaudio2_0: Use shared source. - winegstreamer: Always run gstreamer callbacks on a Wine thread. - xapofx1_5: Use shared source. - xapofx1_4: Use shared source. - xapofx1_3: Use shared source. - xapofx1_2: Use shared source. - xapofx1_1: Use shared source. - x3daudio1_7: Use shared source. - x3daudio1_6: Use shared source. - x3daudio1_5: Use shared source. - x3daudio1_4: Use shared source. - x3daudio1_3: Use shared source. - x3daudio1_2: Use shared source. - x3daudio1_1: Use shared source. - x3daudio1_0: Use shared source. - winegstreamer: Add TRACEs and improve formatting. - winegstreamer: Update to use gstreamer-1.0. - maintainers: Add DirectShow section. - mciqtz32: Support MCI_DGV_PUT_DESTINATION. - xaudio2: Remove run-time version checks for XAudio2 object. - xaudio2: Remove run-time versioning of xapo objects. - xaudio2_8: Don't use IXAudio27 interface to call Initialize. - xaudio2: Don't build interfaces for other versions. - xaudio2_9: Add xaudio2_9. - xaudio2: Use an HRESULT return code. - -Andrey Turkin (1): - d3d11: Add the ID3D11VideoContext interface. - -André Hentschel (3): - configure: Detect MinGW-w64 ARM toolchains. - configure: Check for MinGW even when cross compiling. - include: Add manifest related defines. - -Anthony Fok (1): - include: Suppress "use msvcrt" error in tchar.h when -mno-cygwin is used. - -Anton Baskanov (1): - quartz: Handle NULL target format in FilterGraph::ConvertTimeFormat. - -Aric Stewart (4): - hidclass.sys: Implement HID_Device_write. - hidclass.sys: Implement IOCTL_HID_GET_FEATURE. - hidclass.sys: Implement IOCTL_HID_SET_FEATURE. - usp10: Rewrite ScriptXtoCP. - -Austin English (5): - kernel32: Add SetSearchPathMode stub. - rpcrt4: Add a stub for RpcBindingServerFromClient. - rasapi32: Add RasSetCustomAuthDataA/W stubs. - winspool.drv: Add EnumPrinterKeyA/W stubs. - irprops.cpl: Add stub dll. - -Bernhard Übelacker (4): - msvcp110/tests: Test virtual base table size exports. - msvcp100/tests: Test virtual base table size exports. - msvcp90/tests: Test virtual base table size exports. - msvcp60/tests: Test virtual base table size exports. - -Carlo Bramini (1): - user32: Remove unused variables in SCROLL_TrackScrollBar. - -Changhui Liu (1): - hidclass.sys: Properly quit hid_device_thread when both completion event and halt event are signaled. - -Christian Costa (1): - d3dx9: Implement D3DXCreateAnimationController with a stubbed ID3DXAnimationController interface. - -François Gouget (10): - shell32/tests: The expectedArgs parameter of the DDE tests is an argument count, not a boolean. - shell32/tests: Check the hProcess field when ShellExecuteEx() fails. - shell32/tests: Create_test_association() should either succeed or fail due to insufficient permissions. - shell32/tests: Fix the shortcut vs. class interaction test. - tests: Use plain printf() calls instead of fprintf(stdout). - kernel32/tests: Help the tests portably declare printf()-syle functions. - kernel32/tests: Declare childPrintf() as a printf-style function. - shell32/tests: Tweak some overly optimistic ok() messages. - shell32/tests: Trace the effective ShellExecuteEx() flags. - shell32/tests: Use the shell_execute{_ex}() call site for its traces and error messages. - -Gerald Pfeifer (1): - wined3d: Fix incorrect indentation of several break statements in in set_tex_op. - -Hans Leidekker (17): - bcrypt: Add support for SHA hashes on Linux using GnuTLS. - bcrypt/tests: Don't load bcrypt dynamically. - bcrypt/tests: Add tests for SHA hashes. - bcrypt: Accept NULL implementation in BCryptOpenAlgorithmProvider. - bcrypt: Support retrieving hash length from algorithm handles. - include: Add missing Web Services declarations. - webservices: Avoid some casts. - webservices: Parse attribute names. - webservices: Parse element names. - webservices/tests: Add more tests for WsReadEndElement. - webservices: Simplify handling of quotes in write_attribute. - webservices: Attributes inherit the prefix from their element. - webservices: Implement WsWriteXmlBuffer. - webservices: Implement WsWriteXmlBufferToBytes. - webservices: Reject end elements without a parent in the writer. - webservices: Implement WsWriteType for a number of basic types. - webservices/tests: Add tests. - -Hugh McMaster (1): - user32/tests: Use 'start' and 'end' variables in test comparisons. - -Huw D. M. Davies (6): - bcrypt: Ensure we have gnutls_hash() available. - ole32: The type of the size of IMalloc'ed blocks is SIZE_T. - oleaut32: Use the helper to access bstr_t. - oleaut32: BSTRs should have 8 byte alignment on 64 bits. - oleaut32: Use IMalloc_GetSize to determine the cache bucket. - oleaut32: Use the default OLE allocator to allocate BSTRs. - -Jacek Caban (14): - mshtml: Added IHTMLCurrentStyle::overflowX implementation. - mshtml: Added IHTMLCurrentStyle::overflowY implementation. - mshtml: Added IHTMLCurrentStyle4::get_maxHeight implementation. - mshtml: Added IHTMLUniqueName interface stub implementation. - mshtml: Added IHTMLUniqueName::get_uniqueNumber implementation. - mshtml: Added IHTMLUniqueName::get_uniqueID implementation. - mshtml/tests: Added IHTMLUniqueName tests. - mshtml: Expose IHTMLUniqueName for IDispatch of all element objects. - oleaut32: Added more Invoke tests. - mshtml: Skip unused named args in Invoke calls. - mshtml: Added IHTMLDocument2::get_defaultCharset implementation. - mshtml: Initialize dest VARIANT before VariantCopy call. - mshtml/tests: Fixed location tests on IE11. - d3d11.idl: Added CD3D11_RENDER_TARGET_VIEW_DESC and CD3D11_SHADER_RESOURCE_VIEW_DESC declarations. +Alex Henrie (2): + kernel32: Set error if dstlen < 0 in codepage conversion functions. + user32: Avoid double initialization in IsDialogMessageW. + +Alexandre Julliard (21): + ntdll/tests: Add some more tests for kernel object names. + ntdll/tests: Fix some more failures on restricted Windows. + wine.inf: Fix the wordpad.exe path in associations. + server: Fix initialization of mailslot objects that don't have a name. + ntdll: Add tests for kernel object names in the various open functions. + wine.inf: Add quotes around the wordpad.exe path. + server: Implement NtOpenJobObject. + ntdll: Add a helper to validate attributes in open calls, and use a common pattern in all calls. + ntdll: Add tests for NULL object attributes. + server: Use a common helper function to implement open object calls. + server: Directly return a structure in get_req_unicode_str(). + include: Update stdcall and cdecl definitions in crtdefs.h. + ntdll/tests: Add a helper function to run tests across all kernel object types. + ntdll: Add tests for the length of the object attributes structure. + server: Fix checks for a valid directory in object attributes. + user32: Add some tests for window station and desktop object names. + server: Implement serial port read interval timeouts. + server: Don't return an error if the created window station already exists. + tools: Add a script to update the ANNOUNCE file at release time. + server: Add link_name and unlink_name object operations. + server: Use the link_name operation to create named objects. + +Alistair Leslie-Hughes (5): + include: Add GdipGetPenTransform, GdipSetPenTransform declarations. + gdiplus/tests: Add Pen Transform tests. + olepro32: Add typelib resource. + d3d11: Add the Direct3D 11.1 D3D11_FORMAT_SUPPORT enum elements. + gdiplus: Implement GdipGetPenTransform. + +Andrew Eikum (2): + xaudio2: Report incoming underruns to the application. + ntdll: Implement SystemLogicalProcessorInformationEx. + +Andrey Gusev (1): + d3dx9: Fix a typo. + +André Hentschel (2): + wpcap: Forward pcap_strerror to msvcrt.strerror. + include: Add more OID defines. + +Anton Baskanov (2): + user32: Correctly update caret state in the server in SetCaretPos. + strmbase: Decommit allocator when streaming stops. + +Aric Stewart (3): + imm32: Messages from ImmGenerateMessage are sent not posted. + usp10: Directional control codes force complex itemization. + usp10: Correct math punctuation handling in itemization. + +Austin English (2): + msdrm: Add stub dll. + ndis.sys: Add NdisAllocateSpinLock stub. + +Christopher Thielen (4): + comctl32: Ensure that toolbar respond only to changes in WM_CAPTURECHANGED handler. + comctl32: Ensure that trackbar respond only to changes in WM_CAPTURECHANGED handler. + user32: Ensure that button responds only to changes in WM_CAPTURECHANGED handler. + user32: A window may be notified with WM_CAPTURECHANGED about itself if SetCapture() is called twice. + +François Gouget (18): + bcrypt/tests: Add a trailing '\n' to some ok() calls. + mshtml/tests: Add a trailing '\n' to an ok() call. + bcrypt: Add a trailing '\n' to a WARN() call. + shell32/tests: Trace the last ShellExecute command whenever a corresponding test fails. + shell32/tests: Call okShell() after a shell_execute{_ex}() test. + shell32/tests: Trace the association properties for the DDE tests. + shell32/tests: Test handling of nonexistent verbs in ShellExecute() & co. + shell32/tests: Show that verbs and classes override ShellExecute()'s normal handling of executables. + shell32/tests: Fix a couple of okChildPath()/okChildString() mixups. + advapi32/tests: Trace the SIDs if they are not as expected. + shell32/tests: Add traces to the WaitForInputIdle() hooking process. + shell32/tests: Reorder the functions to avoid forward declarations. + shell32/tests: Declare childPrintf() as a printf-style function. + shell32/tests: Check the child process exit code and close the process handle. + shell32/tests: Check for failures in the child process. + shell32/tests: Test environment variable inheritance with ShellExecute(). + shell32/tests: Add server-side DDE checks. + ntdll/tests: Fix an infinite loop on platforms where NtQuerySystemInformationEx() is not implemented. + +Frédéric Delanoy (1): + po: Update French translation. + +Hans Leidekker (14): + wininet/tests: Fix test failures. + msi: Include the dialog in the check for duplicate event subscriptions. + wined3d: Don't leak the device context on failure in context_create(). + webservices: Add support for structure types in WsWriteType. + webservices: Implement WsWriteElement. + webservices: Implement WsWriteValue. + webservices: Implement WsWriteAttribute. + webservices: Implement WsReadStartAttribute. + webservices: Add support for structure types in WsReadType. + webservices: Implement WsReadEndAttribute. + webservices: Don't validate reader state in read_endelement. + webservices: Support more writer states in WsWriteText. + webservices: Parse CDATA nodes. + webservices: Implement WsWriteStartCData and WsWriteEndCData. + +Henri Verbeet (43): + ddraw: DDSD_LPSURFACE requires a non-NULL lpSurface. + ddraw: DDSCAPS_ALLOCONLOAD doesn't override DDSD_LPSURFACE. + ddraw: DDSCAPS_ALLOCONLOAD requires DDSCAPS_TEXTURE. + wined3d: Unify WINED3D_RTYPE_TEXTURE and WINED3D_RTYPE_CUBE_TEXTURE. + wined3d: Rename WINED3D_RTYPE_VOLUME_TEXTURE to WINED3D_RTYPE_TEXTURE_3D. + wined3d: Rename the texture creation flags to WINED3D_TEXTURE_CREATE_*. + wined3d: Pass non-NULL rectangles to wined3d_surface_blt() in resolve_depth_buffer(). + wined3d: Pass non-NULL rectangles to wined3d_surface_blt() in wined3d_device_copy_resource(). + ddraw: Pass non-NULL rectangles to wined3d_surface_blt() in ddraw_surface_update_frontbuffer(). + ddraw: Pass non-NULL rectangles to wined3d_surface_blt() in ddraw_surface_blt_clipped(). + ddraw: Pass non-NULL rectangles to wined3d_surface_blt() in ddraw_surface7_BltFast(). + wined3d: Pass non-NULL rectangles to wined3d_surface_blt() in wined3d_texture_blt(). + wined3d: Require non-NULL rectangles in wined3d_surface_blt(). + d3d9: Pass non-NULL rectangles to wined3d_texture_blt() in d3d9_device_StretchRect(). + d3d9: Pass non-NULL rectangles to wined3d_texture_blt() in d3d9_device_GetRenderTargetData(). + wined3d: Require non-NULL rectangles in wined3d_texture_blt(). + ddraw: Always store a pointer to the wined3d texture in the surface. + ddraw: Use wined3d_texture_blt() in ddraw_surface7_BltFast(). + ddraw: Use wined3d_texture_blt() in ddraw_surface_blt_clipped(). + ddraw: Use wined3d_texture_blt() in ddraw_surface_update_frontbuffer(). + ddraw: Use wined3d_texture_blt() in copy_mipmap_chain(). + ddraw: Print an ERR for non-zero sub-resource indices in ddraw_surface7_Flip(). + ddraw: Use wined3d_texture_preload() in d3d_device7_PreLoad(). + ddraw: Use wined3d_texture_get_dc() in ddraw_surface_update_frontbuffer(). + ddraw: Use wined3d_texture_get_dc() in ddraw_surface7_GetDC(). + ddraw: Use wined3d_texture_release_dc() in ddraw_surface7_ReleaseDC(). + wined3d: Use wined3d_texture_get_dc() in device_load_logo(). + ddraw: Use wined3d_resource_map() in d3d_texture2_Load(). + ddraw: Use wined3d_resource_map() in surface_lock(). + ddraw: Use wined3d_resource_unmap() in ddraw_surface7_Unlock(). + wined3d: Simplify wined3d_rendertarget_view_create_from_sub_resource(). + wined3d: Use wined3d_rendertarget_view_create() in wined3d_device_init_3d(). + wined3d: Use wined3d_rendertarget_view_create() in wined3d_device_reset(). + wined3d: Pass a view to blit_shader.color_fill(). + wined3d: Pass a view to blit_shader.depth_fill(). + ddraw: Use wined3d_rendertarget_view_create_from_sub_resource() in ddraw_surface_get_rendertarget_view(). + wined3d: Merge cubetexture_init() into texture_init(). + wined3d: Introduce a debug function for struct wined3d_box. + ddraw: Move the mip-level dimensions fix-up from ddraw_surface_init() to ddraw_surface_create(). + ddraw: Use wined3d_texture_get_sub_resource() in ddraw_surface7_Flip(). + wined3d: Make the "texture" parameter to wined3d_texture_get_sub_resource() const. + wined3d: Make the "icb" field in struct wined3d_shader_reg_maps const. + wined3d: Make the "icb" field in struct wined3d_shader_instruction const. + +Hugh McMaster (7): + wineconsole: Apply the new background colour to the visible screen buffer. + kernel32: Apply the new background colour to the active line. + wineconsole: Apply the selected background colour to the entire font preview dialog. + kernel32: Implement the TRUE pathway of GetCurrentConsoleFont. + kernel32/tests: Add tests for the TRUE pathway of GetCurrentConsoleFont. + wineconsole: Improve a user dialog resource string. + user32/tests: Add some expected WPARAM values to the SetFocusComboBox sequences. + +Huw D. M. Davies (4): + bcrypt/tests: Fix incorrect null termination. + include: Add IDropSourceNotify. + shell32: The attributes is not an array, so don't label it as such. + shell32: Set the stream and storage attributes where needed. + +Jacek Caban (12): + jscript: Make parse_decimal a more generic helper. + jscript: Added new is_finite helper. + jscript: Added JSON object stub implementation. + jscript: Added JSON.parse implementation. + jscript: Added JSON.stringify implementation. + jscript: Added JSON tests. + bcrypt: Make BCRYPT_HASH_LENGTH tests more generic. + bcrypt: Make BCRYPT_HASH_LENGTH implementation more generic. + bcrypt: Added BCRYPT_ALGORITHM_NAME property implementation. + mshtml: Use script versioning 2 if we're not in quirks mode. + jscript: Fixed tests on some old jscript versions. + mshtml: Wine Gecko 2.44 release. Jactry Zeng (1): - user32/tests: Fix a leak. + winecfg: Use better shortcut keys. -Julian Rüger (1): - po: Update German translation. +Jeremy White (1): + winspool.drv: If the call to cupsPrintFile fails, print the cups error message. -Józef Kucia (25): - wined3d: Recognize SM4 ftou opcode. - wined3d: Recognize SM4 ilt opcode. - wined3d: Recognize SM4 imad opcode. - wined3d: Recognize SM4 ine opcode. - wined3d: Recognize SM4 ineg opcode. - wined3d: Implement SM4 ftou instruction. - wined3d: Reduce code duplication in shader_glsl_to_ functions. - wined3d: Enable ARB_texture_query_levels extension. - wined3d: Recognize SM4 resinfo opcode. - wined3d: Implement SM4 resinfo instruction. - d3d11/tests: Add test for SM4 resinfo instruction. - d3d10core/tests: Add test for SM4 resinfo instruction. - wined3d: Handle swizzle type equal to 0 as NOSWIZZLE. - wined3d: Fix destination swizzle in few SM4 instructions. - wined3d: Allow both SM4 parameter modifiers simultaneously. - wined3d: Recognize SM4 oDepth register. - wined3d: Implement SM4 imad instruction. - wined3d: Recognize SM4 _sat instruction modifier. - wined3d: Fix SM4 udiv instruction. - wined3d: Do not update surface when empty box is passed. - d3d11/tests: Extend test for ID3D11DeviceContext::UpdateSubresource(). - d3d10core/tests: Extend test for ID3D10Device::UpdateSubresource(). - wined3d: Do not copy surface region when empty box is passed. - d3d11/tests: Add test for ID3D11DeviceContext::CopySubresourceRegion(). - d3d10core/tests: Port test_copy_subresource_region() from d3d11. - -Michael Stefaniuc (1): - dmime: Don't set DSBCAPS_CTRLPAN together with DSBCAPS_CTRL3D. - -Nikolay Sivov (41): - comctl32/trackbar: Update thumb immediately on TBM_SETPOS. - msi: Fixed same file handle closed twice (Coverity). - avifil32: Use typed pointers in sizeof() and va_arg() (Coverity). - comdlg32: Don't use BOOL constants for regular integer type. - crypt32: Fix a leak on error path (Coverity). - ole2: Fix error handling in ReadClassStg(). - ole2: Implement ReadClassStm(). - ole2disp: Implement SafeArrayAllocDescriptor(). - dwrite: Consistently use explicit float literals. - dwrite: Make position snapping more compact. - dwrite: Fix a leak on error path. - ole2disp: Implement SafeArrayDestroyDescriptor(). - ole2disp: Implement SafeArrayAllocData(). - dwrite: Start new effective run on strikethrough, underline or effect change. - dwrite: Keep underlines in separate list. - dwrite: Pass drawing effect to renderer in DrawGlyphRun(). - dwrite: Pass drawing effect to renderer in DrawStrikethrough(). - dwrite: Fix strikethrough baseline origin. - ole2disp: Implement SafeArrayGetDim(). - ole2disp: Implement SafeArrayGetElemsize(). - ole2disp: Implement SafeArrayLock()/SafeArrayUnlock(). - dwrite: Handle bitmap allocation error when rendering to bitmap target. - dwrite: Scale strikethrough thickness and position with current font size. - ole2disp: Implement SafeArrayAccessData()/SafeArrayUnaccessData(). - dwrite: Implement support for underlines. - dwrite: Store locale name range attribute in lower case. - dwrite: Always initialize out pointers. - dwrite: Fix comment typos. - dwrite/tests: A test to compare font metrics with bold simulation and without. - comctl32/trackbar: Update thumb immediately on key press. - dwrite: Use callback freetype API to implement GetGlyphRunOutline(). - dwrite: Underline origin is always at the left run boundary. - dwrite: Underline reading direction matches run direction. - d3dx9/tests: Fix some test failures. - d2d1: Don't update target dpi if only one SetDpi() argument is zero. - d2d1: Support different measuring modes in DrawText(). - d2d1: Block target creation on invalid dpi values. - d2d1: SetDpi() rejects negative values too. - dwrite: Ask freetype once about kerning pairs support and monospaced property. - dwrite: Return earlier from GetKerningPairAdjustments() when pair kerning is not supported. - d2d1/tests: A test for DrawTextLayout() with drawing effect. - -Paul Gofman (4): - ole32: Fix behaviour of OLE init/uninit. - ole32: Zero output interface pointer in OleGetClipboard() on error. - ole32/tests: OleGetClipboard should succeed when COM/OLE is not inited. - mscoree: Fix calling convention for mono callback functions. +Joachim Priesner (5): + scrrun: Implement filesys_DriveExists. + scrrun/tests: Move code to get a fixed drive to a function. + scrrun: Implement filesys_GetDrive for local drives. + comctl32: Fix comments explaining visibleOrder and firstVisible. + comctl32: Treeview: Fix crash when deleting the first visible item while bRedraw == false. + +Justas Lavišius (1): + include: Force stack alignment on x86_64. + +Józef Kucia (48): + wined3d: Add EXT_texture_integer extension. + wined3d: Set default sampler filtering to NEAREST. + wined3d: Add support for integer samplers. + wined3d: Make distinction between sampler index and sampler bind index. + wined3d: Add ARB_texture_rgb10_a2ui extension. + wined3d: Add support for WINED3DFMT_R8G8B8A8_UINT textures. + wined3d: Add support for WINED3DFMT_R8G8B8A8_SINT textures. + d3d11/tests: Add test for integer textures. + d3d10core/tests: Add test for integer textures. + wined3d: Recognize SM4 dcl_temps opcode. + wined3d: Recognize SM4 else opcode. + wined3d: Implement SM4 ieq instruction. + wined3d: Implement SM4 ilt instruction. + wined3d: Implement SM4 ineg instruction. + wined3d: Recognize SM4 not opcode. + wined3d: Implement SM4 not instruction. + wined3d: Implement SM4 ine instruction. + wined3d: Recognize SM4 round_pi opcode. + wined3d: Recognize SM4 round_z opcode. + wined3d: Implement SM4 round_pi instruction. + wined3d: Implement SM4 round_z instruction. + wined3d: Recognize SM4 sample_c_lz opcode. + wined3d: Recognize SM4 sample_b opcode. + wined3d: Validate render state in wined3d_device_set_render_state(). + ddraw: Return DDERR_INVALIDPARAMS for render states >= D3DSTATE_OVERRIDE_BIAS. + wined3d: Add support for WINED3DFMT_R32G32B32_FLOAT format. + wined3d: Add support for WINED3DFMT_R16_UNORM format. + wined3d: Recognize SM4 icb register. + wined3d: Recognize SM4 dcl_immediateConstantBuffer. + wined3d: Recognize SM4 dcl_output opcode. + wined3d: Recognize SM4 dcl_sampler opcode. + wined3d: Fix SM4 exp, log and rsq instructions. + wined3d: Clean up naming in shader_sm1.c. + wined3d: Recognize SM4 dcl_input_ps opcode. + wined3d: Recognize SM4 dcl_input opcode. + wined3d: Recognize SM4 dcl_input_ps_sgv opcode. + wined3d: Recognize SM4 dcl_input_ps_siv opcode. + wined3d: Recognize SM4 dcl_input_sgv opcode. + wined3d: Recognize SM4 dcl_output_siv opcode. + wined3d: Recognize SM4 dcl_input_siv opcode. + wined3d: Recognize SM4 dcl_globalFlags opcode. + wined3d: Recognize SM4 sample_c opcode. + wined3d: Merge shader_glsl_sample() and shader_glsl_sample_lod(). + wined3d: Implement SM4 sample_b instruction. + wined3d: Implement SM4 sample_d instruction. + d3d11/tests: Add test for SM4 sample_b instruction. + d3d10core/tests: Add test for SM4 sample_b instruction. + d3d11: Rename WINE_D3D10_TO_STR to WINE_D3D_TO_STR. + +Ken Thomases (3): + winemac: Make macdrv_process_text_input() asynchronous and process internal events while awaiting its result. + winemac: Change the processEvents parameter of -[WineEventQueue query:timeout:processEvents:] to a flags bitmask. + winemac: Don't process QUERY_IME_CHAR_RECT while waiting in OnMainThread(). + +Kira Backes (1): + user32: Add MOUSEHOOKSTRUCTEX for mouse wheel support. + +Lauri Kenttä (1): + po: Update Finnish translation. + +Matteo Bruni (16): + wined3d: Improve wined3d_popcount() implementation. + wined3d: Limit the number of WINED3D_MULTISAMPLE_NON_MASKABLE quality levels reported. + wined3d: Add ARB_internalformat_query extension. + d3d9: Return one quality level when the multisampling type isn't available. + wined3d: Add a real implementation of wined3d_check_device_multisample_type(). + wined3d: Fail texture creation when invalid multisample settings are specified. + d3d9/tests: Extend test_checkdevicemultisampletype(). + d3d9/tests: Test the creation of render targets with invalid multisample settings. + d3d8/tests: Port test_checkdevicemultisampletype() from d3d9. + d3d8/tests: Test the creation of render targets with invalid multisample settings. + d3d11: Implement d3d11_device_CheckMultisampleQualityLevels(). + d3d11: Implement d3d10_device_CheckMultisampleQualityLevels(). + d3d11/tests: Add a test for CheckMultisampleQualityLevels(). + d3d11/tests: Test the creation of textures with invalid multisample settings. + d3d10core/tests: Add a test for CheckMultisampleQualityLevels(). + d3d10core/tests: Test the creation of textures with invalid multisample settings. + +Nikolay Sivov (44): + dwrite: Cluster text position is relative to initial run. + dwrite: Fix off by one issue in line breaking rule LB21a. + dwrite: Update line breaking logic with Unicode 8.0.0 modifications. + dwrite: Don't check for line overflow for DWRITE_WORD_WRAPPING_NO_WRAP mode. + dwrite: Remove useless assignment (Coverity). + dwrite: Fix underline/strikethrough position adjustment caused by text alignment. + ctl3d32: Claim success in Ctl3dRegister(). + d2d1: Support underlined text in DrawTextLayout(). + po: Update Russian translation. + dwrite: Zero width space U+200b is not a whitespace from analyzer/layout point of view. + dwrite: Reuse linebreaking whitespace flag when filling cluster metrics. + dwrite: Reuse linebreaking isSoftHyphen flag for cluster metrics. + dwrite: Fix setting canWrapLineAfter cluster flag. + dwrite: Implement DetermineMinWidth() using line breaking info. + oleaut32/tests: Fix some test failures. + d2d1: Use drawing effect at DrawGlyphRun(). + dwrite: Fix invalid cluster metrics array index access. + dwrite: Line height/baseline includes lineGap as well. + dwrite: Fix parameter validation in CreateTextLayout()/CreateGdiCompatibleTextLayout(). + dwrite/tests: Some tests for layout based on empty text. + dwrite: Return valid metrics for layout created on empty text. + dwrite: Inline object origin is at top-left corner, not baseline. + dwrite: Don't use BOOL defined values for fields that are not BOOL. + d2d1: Use drawing effect for underlines. + dwrite: Return NULL file pointer on CreateCustomFontFileReference() failure. + dwrite: Set isNewline cluster flag. + dwrite: Update callback analysis interfaces used by layout internally. + dwrite: Use regular refcounting pattern for layout internal sink/source interfaces. + dwrite: Implement GetLocaleName() for layout analysis source. + dwrite: Implement GetTextBeforePosition() for layout analysis source. + dwrite: Remove some redundant includes. + dwrite: Fix newlineLength metric to include all newline chars at the end of the line. + dwrite: Don't use BOOL values to set bit fields. + dwrite: Improve SetScriptAnalysis()/SetBidiLevel() tracing. + dwrite: Release drawing effect after trimming sign Draw(). + dwrite/tests: Test that soft hyphen is not marked as a whitespace. + dwrite: Add a zero width line after last mandatory breakpoint. + dwrite: Invalidate layout on all cases of attribute change. + dwrite: Implement SetFlowDirection() for layout. + dwrite: Implement SetLineSpacing() for layout. + dwrite/tests: Skip tests if no English family name was returned. + dwrite: Rework Analyze() to make it easier to extend. + dwrite: Recognize Type1 .pfb files in Analyze(). + dwrite/tests: Remove failing test line, we have skips for this now. + +Paul Gofman (5): + mscoree: Make vtable and tokens local declarations arch independent. + mscoree: Implement VTable fixup for x86_64 architecture. + msvcrt: Handle of thread created by _beginthread should not be closed on thread detach. + mscoree: Add FixupVTable_Assembly function which takes preloaded assembly headers. + mscoree: Call native DllEntryPoint when it is defined in COR header. Pierre Schweitzer (2): - mpr: Implement WNetAddConnectionW(), WNetAddConnection2W(), WNetAddConnection3W(). - mpr: Implement WNetAddConnectionA(), WNetAddConnection2A(), WNetAddConnection3A(). + mpr: Add support for REG_EXPAND_SZ for providers path. + mpr/tests: Add tests for WNetUseConnectionA(). -Piotr Caban (19): - msvcp120: Fix layout of classes with vtordisp field. - oleaut32/tests: Add tests for safearray unmarshaling into passed variant. - oleaut32: Set safearray pointer to NULL in LPSAFEARRAY_UserFree. - oleaut32: Pass safearray from VARIANT_UserUnmarshal to LPSAFEARRAY_UserUnmarshal so it can be reused. - oleaut32: Reuse safearray passed to LPSAFEARRAY_UserUnmarshal if possible. - oleaut32: Don't overwrite pointers in VARIANT_UserUnmarshal so we may free or reuse them. - oleaut32/tests: Show that VARIANT_UserUnmarshal may reuse passed in BSTR. - msvcp100: Add numeric_limits<*>::lowest implementation. - msvcp60: Export more complex numbers operators. - msvcrt: Fix modff signature. - msvcr120: Add _dpcomp implementation. - msvcr120: Add _set_FMA3_enable stub. - msvcr: Sync spec files. - msvcrt: Add _crt_debugger_hook implementation. - msvcrt: Fix size test of structure returned by _Gettnames. - msvcr110: Fix __lc_time_data definition. - msvcr110: Add _W_Gettnames implementation. - msvcrt: Add support for member function pointers demangling in unDName function. - msvcrt: Add support for $$B datatype description format in unDName. - -Riccardo Bortolato (2): - d3d11: Handle NULL source box in d3d10_device_CopySubresourceRegion(). - d3d11: Implement d3d11_immediate_context_CopySubresourceRegion(). +Piotr Caban (7): + oleaut32: Fix best version handling in QueryPathOfRegTypeLib when type library redirection is used. + oleaut32: Add support for best version argument in LoadRegTypeLib. + server: Avoid infinite loop when we're out of timers in set_win_timer server call. + user32: Test error returned in out of timers case. + oleaut32: Update cdguid on data reallocation in WMSFT_compile_custdata. + oleaut32: Add ICreateTypeLib2::SetCustData implementation. + oleaut32: Add ICreateTypeLib2::SetCustData tests. + +Riccardo Bortolato (3): + d3d9: Implement d3d9_device_UpdateSurface() on top of wined3d_device_copy_sub_resource_region(). + d3d9: Replace wined3d surface refcounting with texture refcounting. + wined3d: Get rid of the surface refcounting functions. Sebastian Lackner (2): - server: Fix invalid memory accesss caused by destroying winstation before desktop. - oleaut32: Fix invalid memory access on 64-bit when warn+heap is used. + server: Add missing check for objattr variable in load_registry wineserver call (Coverity). + server: Avoid invalid memory access if creation of namespace fails in create_directory (Coverity). -Stefan Dösinger (10): - d3d10core/tests: Multisampled render targets are zeroed on creation. - d3d11/tests: Multisampled render targets are zeroed on creation. - d3d10core/tests: Viewport properties are integers. - wined3d: Prepare GL textures in surface_load_ds_location. - wined3d: Block validation checks the surface size too. - d3d9/tests: Block validation checks the surface size too. - d3d8: Don't validate 2D texture lock coordinates. - d3d8/tests: Test invalid locks with textures. - d3d9/tests: Test invalid locks with textures. - d3d8/tests: Block validation checks the surface size too. - -Stefan Leichter (2): - kernel32: Add stub for GetSystemPreferredUILanguages. - kernel32/tests: Add tests for GetSystemPreferredUILanguages. +Snorri Sturluson (1): + ntdll: Fill in memory counters under OS X. -Thomas Faller (1): - dde: Fix use-after-free. +Stefan Dösinger (1): + ddraw/tests: Port test_lockrect_invalid to other versions. Vincent Povirk (2): - mscoree: Remove search fallbacks when Wine Mono isn't installed. - mscoree: Remove "Install Mono for Windows" message. - -YongHao Hu (1): - msvcp110: Add tr2_sys__Link implementation and test. + kernel32/tests: Add tests for GetTimeZoneInformationForYear. + kernel32: Implement GetTimeZoneInformationForYear. -- Alexandre Julliard diff -Nru wine-staging-1.9.2~ubuntu12.04.1/AUTHORS wine-staging-1.9.3~ubuntu12.04.1/AUTHORS --- wine-staging-1.9.2~ubuntu12.04.1/AUTHORS 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/AUTHORS 2016-02-08 19:32:34.000000000 +0000 @@ -259,6 +259,7 @@ Christopher Berner Christopher Gautier Christopher Harvey +Christopher Thielen Christoph Frick Christoph von Wittich Chris Wilson @@ -756,6 +757,7 @@ Juraj Hercek Juris Smotrovs Jussi Jumppanen +Justas Lavišius Justin Bradford Justin Chevrier Justin Santa Barbara @@ -796,6 +798,7 @@ Kim Jung Eon Kim Lilliestierna Kimmo Myllyvirta +Kira Backes Kirill K. Smirnov Kirill Smelkov Kjell Rune Skaaraas @@ -1313,6 +1316,7 @@ Sin-ta Hsiea Slava Monich Slaven Rezic +Snorri Sturluson Srivatsa Kanchi, R Stas Cymbalov Stas Sergeev diff -Nru wine-staging-1.9.2~ubuntu12.04.1/configure wine-staging-1.9.3~ubuntu12.04.1/configure --- wine-staging-1.9.2~ubuntu12.04.1/configure 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/configure 2016-02-08 19:32:34.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.9.2. +# Generated by GNU Autoconf 2.69 for Wine 1.9.3. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.9.2' -PACKAGE_STRING='Wine 1.9.2' +PACKAGE_VERSION='1.9.3' +PACKAGE_STRING='Wine 1.9.3' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -1176,6 +1176,7 @@ enable_msdaps enable_msdelta enable_msdmo +enable_msdrm enable_msftedit enable_msg711_acm enable_msgsm32_acm @@ -2109,7 +2110,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.9.2 to adapt to many kinds of systems. +\`configure' configures Wine 1.9.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2179,7 +2180,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.9.2:";; + short | recursive ) echo "Configuration of Wine 1.9.3:";; esac cat <<\_ACEOF @@ -2381,7 +2382,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.9.2 +Wine configure 1.9.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2899,7 +2900,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.9.2, which was +It was created by Wine $as_me 1.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -16882,6 +16883,39 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 +$as_echo_n "checking for __builtin_popcount... " >&6; } +if ${ac_cv_have___builtin_popcount+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return __builtin_popcount(1) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_have___builtin_popcount="yes" +else + ac_cv_have___builtin_popcount="no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___builtin_popcount" >&5 +$as_echo "$ac_cv_have___builtin_popcount" >&6; } +if test "$ac_cv_have___builtin_popcount" = "yes" +then + +$as_echo "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h + +fi + case $host_cpu in *i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to define __i386__" >&5 @@ -17667,6 +17701,7 @@ wine_fn_config_dll msdelta enable_msdelta wine_fn_config_dll msdmo enable_msdmo implib wine_fn_config_test dlls/msdmo/tests msdmo_test +wine_fn_config_dll msdrm enable_msdrm wine_fn_config_dll msftedit enable_msftedit wine_fn_config_dll msg711.acm enable_msg711_acm wine_fn_config_dll msgsm32.acm enable_msgsm32_acm @@ -17779,7 +17814,7 @@ wine_fn_config_test dlls/oledb32/tests oledb32_test clean wine_fn_config_dll oledlg enable_oledlg implib,po wine_fn_config_test dlls/oledlg/tests oledlg_test -wine_fn_config_dll olepro32 enable_olepro32 implib +wine_fn_config_dll olepro32 enable_olepro32 clean,implib wine_fn_config_dll olesvr.dll16 enable_win16 wine_fn_config_dll olesvr32 enable_olesvr32 implib wine_fn_config_dll olethk32 enable_olethk32 @@ -18820,7 +18855,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.9.2, which was +This file was extended by Wine $as_me 1.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18891,7 +18926,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.9.2 +Wine config.status 1.9.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/configure.ac wine-staging-1.9.3~ubuntu12.04.1/configure.ac --- wine-staging-1.9.2~ubuntu12.04.1/configure.ac 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/configure.ac 2016-02-08 19:32:34.000000000 +0000 @@ -2551,6 +2551,15 @@ AC_DEFINE(HAVE___BUILTIN_CLZ, 1, [Define to 1 if you have the `__builtin_clz' built-in function.]) fi +dnl Check for __builtin_popcount +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_have___builtin_popcount, + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[return __builtin_popcount(1)]])], + [ac_cv_have___builtin_popcount="yes"], [ac_cv_have___builtin_popcount="no"])) +if test "$ac_cv_have___builtin_popcount" = "yes" +then + AC_DEFINE(HAVE___BUILTIN_POPCOUNT, 1, [Define to 1 if you have the `__builtin_popcount' built-in function.]) +fi + dnl *** check for the need to define platform-specific symbols case $host_cpu in @@ -3036,6 +3045,7 @@ WINE_CONFIG_DLL(msdelta) WINE_CONFIG_DLL(msdmo,,[implib]) WINE_CONFIG_TEST(dlls/msdmo/tests) +WINE_CONFIG_DLL(msdrm) WINE_CONFIG_DLL(msftedit) WINE_CONFIG_DLL(msg711.acm) WINE_CONFIG_DLL(msgsm32.acm) @@ -3148,7 +3158,7 @@ WINE_CONFIG_TEST(dlls/oledb32/tests,[clean]) WINE_CONFIG_DLL(oledlg,,[implib,po]) WINE_CONFIG_TEST(dlls/oledlg/tests) -WINE_CONFIG_DLL(olepro32,,[implib]) +WINE_CONFIG_DLL(olepro32,,[clean,implib]) WINE_CONFIG_DLL(olesvr.dll16,enable_win16) WINE_CONFIG_DLL(olesvr32,,[implib]) WINE_CONFIG_DLL(olethk32) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/debian/bzr-builder.manifest wine-staging-1.9.3~ubuntu12.04.1/debian/bzr-builder.manifest --- wine-staging-1.9.2~ubuntu12.04.1/debian/bzr-builder.manifest 2016-01-24 18:22:28.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/debian/bzr-builder.manifest 2016-02-08 22:05:48.000000000 +0000 @@ -1,4 +1,4 @@ -# bzr-builder format 0.4 deb-version 1.9.2 -lp:wine revid:git-v1:e5132e5a91208253e67c0eff709ab5c96d79b790 -merge wine-staging-files lp:wine-compholio revid:git-v1:f2d347b8977b371f2568f4959b291132eac8342f -merge wine-build-staging lp:~wine/wine/build-staging revid:sebastian@fds-team.de-20160124170204-adn2yux8dnii9trz +# bzr-builder format 0.4 deb-version 1.9.3 +lp:wine revid:git-v1:c266d373deb417abef4883f59daa5d517b77e76c +merge wine-staging-files lp:wine-compholio revid:git-v1:089f367941129142040984054a8776b354380536 +merge wine-build-staging lp:~wine/wine/build-staging revid:sebastian@fds-team.de-20160208192346-iz9n1kt5gz89pg0b diff -Nru wine-staging-1.9.2~ubuntu12.04.1/debian/changelog wine-staging-1.9.3~ubuntu12.04.1/debian/changelog --- wine-staging-1.9.2~ubuntu12.04.1/debian/changelog 2016-01-24 18:22:28.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/debian/changelog 2016-02-08 22:05:48.000000000 +0000 @@ -1,9 +1,9 @@ -wine-staging (1.9.2~ubuntu12.04.1) precise; urgency=low +wine-staging (1.9.3~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Sebastian Lackner Sun, 24 Jan 2016 18:22:28 +0000 + -- Sebastian Lackner Mon, 08 Feb 2016 22:05:48 +0000 -wine-staging (1.9.2) unstable; urgency=low +wine-staging (1.9.3) unstable; urgency=low * Auto build. - -- Michael Müller Sun, 24 Jan 2016 16:35:36 -0000 + -- Michael Müller Mon, 08 Feb 2016 19:19:00 -0000 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/advapi32/tests/security.c wine-staging-1.9.3~ubuntu12.04.1/dlls/advapi32/tests/security.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/advapi32/tests/security.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/advapi32/tests/security.c 2016-02-08 19:32:34.000000000 +0000 @@ -146,6 +146,35 @@ #define STRSID_OK 0 #define STRSID_OPT 1 +#define SID_SLOTS 4 +static char debugsid_str[SID_SLOTS][256]; +static int debugsid_index = 0; +static const char* debugstr_sid(PSID sid) +{ + LPSTR sidstr; + DWORD le = GetLastError(); + char* res = debugsid_str[debugsid_index]; + debugsid_index = (debugsid_index + 1) % SID_SLOTS; + if (!pConvertSidToStringSidA) + strcpy(res, "missing ConvertSidToStringSidA"); + else if (!pConvertSidToStringSidA(sid, &sidstr)) + sprintf(res, "ConvertSidToStringSidA failed le=%u", GetLastError()); + else if (strlen(sidstr) > sizeof(*debugsid_str) - 1) + { + memcpy(res, sidstr, sizeof(*debugsid_str) - 4); + strcpy(res + sizeof(*debugsid_str) - 4, "..."); + LocalFree(sidstr); + } + else + { + strcpy(res, sidstr); + LocalFree(sidstr); + } + /* Restore the last error in case ConvertSidToStringSidA() modified it */ + SetLastError(le); + return res; +} + struct sidRef { SID_IDENTIFIER_AUTHORITY auth; @@ -240,7 +269,8 @@ 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)(EqualSid(owner, expected), "Owner SIDs are not equal %s != %s\n", + debugstr_sid(owner), debugstr_sid(expected)); ok_(__FILE__, line)(!owner_defaulted, "Defaulted is true\n"); HeapFree(GetProcessHeap(), 0, queriedSD); @@ -258,7 +288,8 @@ 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)(EqualSid(group, expected), "Group SIDs are not equal %s != %s\n", + debugstr_sid(group), debugstr_sid(expected)); ok_(__FILE__, line)(!group_defaulted, "Defaulted is true\n"); HeapFree(GetProcessHeap(), 0, queriedSD); @@ -2186,7 +2217,8 @@ ok(ret, "Failed to lookup account name %s\n",name); ok(sid_size != 0, "sid_size was zero\n"); - ok(EqualSid(psid,wk_sid),"(%s) Sids fail to match well known sid!\n",name); + ok(EqualSid(psid,wk_sid),"%s Sid %s fails to match well known sid %s!\n", + name, debugstr_sid(psid), debugstr_sid(wk_sid)); ok(!lstrcmpA(account, wk_account), "Expected %s , got %s\n", account, wk_account); ok(!lstrcmpA(domain, wk_domain), "Expected %s, got %s\n", wk_domain, domain); @@ -3145,9 +3177,9 @@ bret = EqualSid(&ace->SidStart, user_sid); if (todo_sid) todo_wine - ok_(__FILE__, line)(bret, "Current User ACE != Current User SID\n"); + ok_(__FILE__, line)(bret, "Current User ACE (%s) != Current User SID (%s)\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); else - ok_(__FILE__, line)(bret, "Current User ACE != Current User SID\n"); + ok_(__FILE__, line)(bret, "Current User ACE (%s) != Current User SID (%s)\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); if (todo_flags) todo_wine @@ -3171,9 +3203,9 @@ bret = EqualSid(&ace->SidStart, admin_sid); if (todo_sid) todo_wine - ok_(__FILE__, line)(bret, "Administators Group ACE != Administators Group SID\n"); + ok_(__FILE__, line)(bret, "Administators Group ACE (%s) != Administators Group SID (%s)\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); else - ok_(__FILE__, line)(bret, "Administators Group ACE != Administators Group SID\n"); + ok_(__FILE__, line)(bret, "Administators Group ACE (%s) != Administators Group SID (%s)\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); if (todo_flags) todo_wine @@ -3591,7 +3623,8 @@ bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE != Current User SID.\n"); + todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -3603,7 +3636,8 @@ ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); todo_wine ok(bret || broken(!bret) /* win2k */, - "Administators Group ACE != Administators Group SID.\n"); + "Administators Group ACE (%s) != Administators Group SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff || broken(ace->Mask == GENERIC_ALL) /* win2k */, @@ -3737,14 +3771,15 @@ bret = GetSecurityDescriptorOwner(pSD, &owner, &owner_defaulted); ok(bret, "GetSecurityDescriptorOwner failed with error %d\n", GetLastError()); ok(owner != NULL, "owner should not be NULL\n"); - ok(EqualSid(owner, admin_sid), "MACHINE\\Software owner SID != Administrators SID.\n"); + ok(EqualSid(owner, admin_sid), "MACHINE\\Software owner SID (%s) != Administrators SID (%s).\n", debugstr_sid(owner), debugstr_sid(admin_sid)); bret = GetSecurityDescriptorGroup(pSD, &group, &group_defaulted); ok(bret, "GetSecurityDescriptorGroup failed with error %d\n", GetLastError()); ok(group != NULL, "group should not be NULL\n"); ok(EqualSid(group, admin_sid) || broken(EqualSid(group, system_sid)) /* before Win7 */ || broken(((SID*)group)->SubAuthority[0] == SECURITY_NT_NON_UNIQUE) /* Vista */, - "MACHINE\\Software group SID != Local System SID.\n"); + "MACHINE\\Software group SID (%s) != Local System SID (%s or %s)\n", + debugstr_sid(group), debugstr_sid(admin_sid), debugstr_sid(system_sid)); LocalFree(pSD); /* Test querying the DACL of a built-in registry key */ @@ -4379,7 +4414,8 @@ bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE != Current User SID.\n"); + todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -4390,7 +4426,7 @@ bret = pGetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret, "Administators Group ACE != Administators Group SID.\n"); + todo_wine ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -4539,7 +4575,8 @@ SetLastError(0xdeadbeef); ret = EqualSid(sid1, sid2); - ok(ret, "Same sids should have been equal\n"); + ok(ret, "Same sids should have been equal %s != %s\n", + debugstr_sid(sid1), debugstr_sid(sid2)); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef), /* NT4 */ "EqualSid should have set last error to ERROR_SUCCESS instead of %d\n", @@ -5683,7 +5720,6 @@ HANDLE token; DWORD size; DWORD res; - char *sidname = NULL; static SID medium_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY}, {SECURITY_MANDATORY_HIGH_RID}}; static SID high_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY}, @@ -5715,14 +5751,10 @@ ok(tml->Label.Attributes == (SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED), "got 0x%x (expected 0x%x)\n", tml->Label.Attributes, (SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED)); - SetLastError(0xdeadbeef); - res = pConvertSidToStringSidA(tml->Label.Sid, &sidname); - ok(res, "got %u and %u\n", res, GetLastError()); - ok(EqualSid(tml->Label.Sid, &medium_level) || EqualSid(tml->Label.Sid, &high_level), - "got %s (expected 'S-1-16-8192' or 'S-1-16-12288')\n", sidname); + "got %s (expected %s or %s)\n", debugstr_sid(tml->Label.Sid), + debugstr_sid(&medium_level), debugstr_sid(&high_level)); - LocalFree(sidname); CloseHandle(token); } @@ -6037,7 +6069,8 @@ InitializeSid(domain_sid2, &domain_ident, 4); for (i = 0; i < 4; i++) *GetSidSubAuthority(domain_sid2, i) = *GetSidSubAuthority(user_sid, i); - ok(EqualSid(domain_sid, domain_sid2), "unexpected domain sid\n"); + ok(EqualSid(domain_sid, domain_sid2), "unexpected domain sid %s != %s\n", + debugstr_sid(domain_sid), debugstr_sid(domain_sid2)); HeapFree(GetProcessHeap(), 0, user); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/api-ms-win-core-sysinfo-l1-1-0/api-ms-win-core-sysinfo-l1-1-0.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/api-ms-win-core-sysinfo-l1-1-0/api-ms-win-core-sysinfo-l1-1-0.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/api-ms-win-core-sysinfo-l1-1-0/api-ms-win-core-sysinfo-l1-1-0.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/api-ms-win-core-sysinfo-l1-1-0/api-ms-win-core-sysinfo-l1-1-0.spec 2016-02-08 19:32:34.000000000 +0000 @@ -15,7 +15,7 @@ @ stdcall -ret64 GetTickCount64() kernel32.GetTickCount64 @ stdcall GetTickCount() kernel32.GetTickCount @ stdcall GetTimeZoneInformation(ptr) kernel32.GetTimeZoneInformation -@ stub GetTimeZoneInformationForYear +@ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear @ stdcall GetVersion() kernel32.GetVersion @ stdcall GetVersionExA(ptr) kernel32.GetVersionExA @ stdcall GetVersionExW(ptr) kernel32.GetVersionExW diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/api-ms-win-core-timezone-l1-1-0/api-ms-win-core-timezone-l1-1-0.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/api-ms-win-core-timezone-l1-1-0/api-ms-win-core-timezone-l1-1-0.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/api-ms-win-core-timezone-l1-1-0/api-ms-win-core-timezone-l1-1-0.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/api-ms-win-core-timezone-l1-1-0/api-ms-win-core-timezone-l1-1-0.spec 2016-02-08 19:32:34.000000000 +0000 @@ -3,7 +3,7 @@ @ stdcall GetDynamicTimeZoneInformation(ptr) kernel32.GetDynamicTimeZoneInformation @ stub GetDynamicTimeZoneInformationEffectiveYears @ stdcall GetTimeZoneInformation(ptr) kernel32.GetTimeZoneInformation -@ stub GetTimeZoneInformationForYear +@ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear @ stub SetDynamicTimeZoneInformation @ stdcall SetTimeZoneInformation(ptr) kernel32.SetTimeZoneInformation @ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/appwiz.cpl/addons.c wine-staging-1.9.3~ubuntu12.04.1/dlls/appwiz.cpl/addons.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/appwiz.cpl/addons.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/appwiz.cpl/addons.c 2016-02-08 19:32:34.000000000 +0000 @@ -51,14 +51,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl); -#define GECKO_VERSION "2.40" +#define GECKO_VERSION "2.44" #ifdef __i386__ #define ARCH_STRING "x86" -#define GECKO_SHA "7001a6ed5b02d0ae4e73b14c92018d604b87f3ad" +#define GECKO_SHA "7930300c531d975ad63ee20d5e9b3974e339e43e" #elif defined(__x86_64__) #define ARCH_STRING "x86_64" -#define GECKO_SHA "356c414527b08b015b6dc53dbbf78d752320ae90" +#define GECKO_SHA "ed473f584938ebe8da1f6e660610e616104567b3" #else #define ARCH_STRING "" #define GECKO_SHA "???" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/bcrypt/bcrypt_main.c wine-staging-1.9.3~ubuntu12.04.1/dlls/bcrypt/bcrypt_main.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/bcrypt/bcrypt_main.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/bcrypt/bcrypt_main.c 2016-02-08 19:32:34.000000000 +0000 @@ -174,10 +174,20 @@ enum alg_id { - ALG_ID_SHA1 = 1, - ALG_ID_SHA256 = 2, - ALG_ID_SHA384 = 3, - ALG_ID_SHA512 = 4 + ALG_ID_SHA1, + ALG_ID_SHA256, + ALG_ID_SHA384, + ALG_ID_SHA512 +}; + +static const struct { + ULONG hash_length; + const WCHAR *alg_name; +} alg_props[] = { + /* ALG_ID_SHA1 */ { 20, BCRYPT_SHA1_ALGORITHM }, + /* ALG_ID_SHA256 */ { 32, BCRYPT_SHA256_ALGORITHM }, + /* ALG_ID_SHA384 */ { 48, BCRYPT_SHA384_ALGORITHM }, + /* ALG_ID_SHA512 */ { 64, BCRYPT_SHA512_ALGORITHM } }; struct algorithm @@ -421,15 +431,40 @@ #define OBJECT_LENGTH_SHA384 382 #define OBJECT_LENGTH_SHA512 382 -#define HASH_DIGEST_LENGTH_SHA1 20 -#define HASH_DIGEST_LENGTH_SHA256 32 -#define HASH_DIGEST_LENGTH_SHA384 48 -#define HASH_DIGEST_LENGTH_SHA512 64 +static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) +{ + if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) + { + *ret_size = sizeof(ULONG); + if (size < sizeof(ULONG)) + return STATUS_BUFFER_TOO_SMALL; + if(buf) + *(ULONG*)buf = alg_props[id].hash_length; + return STATUS_SUCCESS; + } + + if (!strcmpW( prop, BCRYPT_ALGORITHM_NAME )) + { + *ret_size = (strlenW(alg_props[id].alg_name)+1)*sizeof(WCHAR); + if (size < *ret_size) + return STATUS_BUFFER_TOO_SMALL; + if(buf) + memcpy(buf, alg_props[id].alg_name, *ret_size); + return STATUS_SUCCESS; + } + + return STATUS_NOT_IMPLEMENTED; +} static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) { + NTSTATUS status; ULONG value; + status = generic_alg_property( id, prop, buf, size, ret_size ); + if (status != STATUS_NOT_IMPLEMENTED) + return status; + switch (id) { case ALG_ID_SHA1: @@ -438,11 +473,6 @@ value = OBJECT_LENGTH_SHA1; break; } - else if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA1; - break; - } FIXME( "unsupported sha1 algorithm property %s\n", debugstr_w(prop) ); return STATUS_NOT_IMPLEMENTED; @@ -452,11 +482,6 @@ value = OBJECT_LENGTH_SHA256; break; } - else if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA256; - break; - } FIXME( "unsupported sha256 algorithm property %s\n", debugstr_w(prop) ); return STATUS_NOT_IMPLEMENTED; @@ -466,11 +491,6 @@ value = OBJECT_LENGTH_SHA384; break; } - else if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA384; - break; - } FIXME( "unsupported sha384 algorithm property %s\n", debugstr_w(prop) ); return STATUS_NOT_IMPLEMENTED; @@ -480,11 +500,6 @@ value = OBJECT_LENGTH_SHA512; break; } - else if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA512; - break; - } FIXME( "unsupported sha512 algorithm property %s\n", debugstr_w(prop) ); return STATUS_NOT_IMPLEMENTED; @@ -506,60 +521,12 @@ static NTSTATUS get_hash_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) { - ULONG value; - - switch (id) - { - case ALG_ID_SHA1: - if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA1; - break; - } - FIXME( "unsupported sha1 hash property %s\n", debugstr_w(prop) ); - return STATUS_NOT_IMPLEMENTED; - - case ALG_ID_SHA256: - if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA256; - break; - } - FIXME( "unsupported sha256 hash property %s\n", debugstr_w(prop) ); - return STATUS_NOT_IMPLEMENTED; - - case ALG_ID_SHA384: - if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA384; - break; - } - FIXME( "unsupported sha384 hash property %s\n", debugstr_w(prop) ); - return STATUS_NOT_IMPLEMENTED; - - case ALG_ID_SHA512: - if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) - { - value = HASH_DIGEST_LENGTH_SHA512; - break; - } - FIXME( "unsupported sha512 hash property %s\n", debugstr_w(prop) ); - return STATUS_NOT_IMPLEMENTED; - - default: - FIXME( "unsupported hash %u\n", id ); - return STATUS_NOT_IMPLEMENTED; - } - - if (size < sizeof(ULONG)) - { - *ret_size = sizeof(ULONG); - return STATUS_BUFFER_TOO_SMALL; - } - if (buf) *(ULONG *)buf = value; - *ret_size = sizeof(ULONG); + NTSTATUS status; - return STATUS_SUCCESS; + status = generic_alg_property( id, prop, buf, size, ret_size ); + if (status == STATUS_NOT_IMPLEMENTED) + FIXME( "unsupported property %s\n", debugstr_w(prop) ); + return status; } NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags ) @@ -584,7 +551,7 @@ return get_hash_property( hash->alg_id, prop, buffer, count, res ); } default: - WARN( "unknown magic %08x", object->magic ); + WARN( "unknown magic %08x\n", object->magic ); return STATUS_INVALID_HANDLE; } } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/bcrypt/tests/bcrypt.c wine-staging-1.9.3~ubuntu12.04.1/dlls/bcrypt/tests/bcrypt.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/bcrypt/tests/bcrypt.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/bcrypt/tests/bcrypt.c 2016-02-08 19:32:34.000000000 +0000 @@ -68,15 +68,48 @@ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got 0x%x\n", ret); } -static const char *format_hash(const UCHAR *bytes, ULONG size, char *buf) +static void format_hash(const UCHAR *bytes, ULONG size, char *buf) { ULONG i; + buf[0] = '\0'; for (i = 0; i < size; i++) { - buf += sprintf(buf, "%02x", bytes[i]); + sprintf(buf + i * 2, "%02x", bytes[i]); } - buf[i * 2] = 0; - return buf; + return; +} + +static int strcmp_wa(const WCHAR *strw, const char *stra) +{ + WCHAR buf[512]; + MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(buf[0])); + return lstrcmpW(strw, buf); +} + +#define test_hash_length(a,b) _test_hash_length(__LINE__,a,b) +static void _test_hash_length(unsigned line, void *handle, ULONG exlen) +{ + ULONG len = 0xdeadbeef, size = 0xdeadbeef; + NTSTATUS status; + + status = BCryptGetProperty(handle, BCRYPT_HASH_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); + ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status); + ok_(__FILE__,line)(size == sizeof(len), "got %u\n", size); + ok_(__FILE__,line)(len == exlen, "len = %u, expected %u\n", len, exlen); +} + +#define test_alg_name(a,b) _test_alg_name(__LINE__,a,b) +static void _test_alg_name(unsigned line, void *handle, const char *exname) +{ + ULONG size = 0xdeadbeef; + UCHAR buf[256]; + const WCHAR *name = (const WCHAR*)buf; + NTSTATUS status; + + status = BCryptGetProperty(handle, BCRYPT_ALGORITHM_NAME, buf, sizeof(buf), &size, 0); + ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status); + ok_(__FILE__,line)(size == (strlen(exname)+1)*sizeof(WCHAR), "got %u\n", size); + ok_(__FILE__,line)(!strcmp_wa(name, exname), "alg name = %s, expected %s\n", wine_dbgstr_w(name), exname); } static void test_sha1(void) @@ -92,7 +125,7 @@ alg = NULL; ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA1_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(alg != NULL, "alg not set"); + ok(alg != NULL, "alg not set\n"); len = size = 0xdeadbeef; ret = BCryptGetProperty(NULL, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); @@ -123,11 +156,8 @@ ok(len != 0xdeadbeef, "len not set\n"); ok(size == sizeof(len), "got %u\n", size); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(alg, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 20, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(alg, 20); + test_alg_name(alg, "SHA1"); hash = NULL; len = sizeof(buf); @@ -138,11 +168,8 @@ ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(hash, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 20, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(hash, 20); + test_alg_name(hash, "SHA1"); memset(sha1, 0, sizeof(sha1)); ret = BCryptFinishHash(hash, sha1, sizeof(sha1), 0); @@ -171,7 +198,7 @@ alg = NULL; ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA256_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(alg != NULL, "alg not set"); + ok(alg != NULL, "alg not set\n"); len = size = 0xdeadbeef; ret = BCryptGetProperty(NULL, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); @@ -202,11 +229,8 @@ ok(len != 0xdeadbeef, "len not set\n"); ok(size == sizeof(len), "got %u\n", size); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(alg, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 32, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(alg, 32); + test_alg_name(alg, "SHA256"); hash = NULL; len = sizeof(buf); @@ -217,11 +241,8 @@ ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(hash, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 32, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(hash, 32); + test_alg_name(hash, "SHA256"); memset(sha256, 0, sizeof(sha256)); ret = BCryptFinishHash(hash, sha256, sizeof(sha256), 0); @@ -250,7 +271,7 @@ alg = NULL; ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA384_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(alg != NULL, "alg not set"); + ok(alg != NULL, "alg not set\n"); len = size = 0xdeadbeef; ret = BCryptGetProperty(NULL, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); @@ -281,11 +302,8 @@ ok(len != 0xdeadbeef, "len not set\n"); ok(size == sizeof(len), "got %u\n", size); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(alg, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 48, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(alg, 48); + test_alg_name(alg, "SHA384"); hash = NULL; len = sizeof(buf); @@ -296,11 +314,8 @@ ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(hash, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 48, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(hash, 48); + test_alg_name(hash, "SHA384"); memset(sha384, 0, sizeof(sha384)); ret = BCryptFinishHash(hash, sha384, sizeof(sha384), 0); @@ -330,7 +345,7 @@ alg = NULL; ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA512_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(alg != NULL, "alg not set"); + ok(alg != NULL, "alg not set\n"); len = size = 0xdeadbeef; ret = BCryptGetProperty(NULL, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); @@ -361,11 +376,8 @@ ok(len != 0xdeadbeef, "len not set\n"); ok(size == sizeof(len), "got %u\n", size); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(alg, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 64, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(alg, 64); + test_alg_name(alg, "SHA512"); hash = NULL; len = sizeof(buf); @@ -376,11 +388,8 @@ ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - len = size = 0xdeadbeef; - ret = BCryptGetProperty(hash, BCRYPT_HASH_LENGTH, (UCHAR *)&len , sizeof(len), &size, 0); - ok(ret == STATUS_SUCCESS, "got %08x\n", ret); - ok(len == 64, "got %u\n", len); - ok(size == sizeof(len), "got %u\n", size); + test_hash_length(hash, 64); + test_alg_name(hash, "SHA512"); memset(sha512, 0, sizeof(sha512)); ret = BCryptFinishHash(hash, sha512, sizeof(sha512), 0); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/tests/treeview.c wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/tests/treeview.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/tests/treeview.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/tests/treeview.c 2016-02-08 19:32:34.000000000 +0000 @@ -1878,8 +1878,13 @@ { const struct message *msg; HWND hTree; + HTREEITEM hItem1, hItem2; + TVINSERTSTRUCTA ins; INT ret; + static CHAR item1[] = "Item 1"; + static CHAR item2[] = "Item 2"; + hTree = create_treeview_control(0); fill_tree(hTree); @@ -1901,6 +1906,34 @@ ok(ret == 0, "got %d\n", ret); DestroyWindow(hTree); + + /* Regression test for a crash when deleting the first visible item while bRedraw == false. */ + hTree = create_treeview_control(0); + + ins.hParent = TVI_ROOT; + ins.hInsertAfter = TVI_ROOT; + U(ins).item.mask = TVIF_TEXT; + U(ins).item.pszText = item1; + hItem1 = TreeView_InsertItemA(hTree, &ins); + ok(hItem1 != NULL, "InsertItem failed\n"); + + ins.hParent = TVI_ROOT; + ins.hInsertAfter = hItem1; + U(ins).item.mask = TVIF_TEXT; + U(ins).item.pszText = item2; + hItem2 = TreeView_InsertItemA(hTree, &ins); + ok(hItem2 != NULL, "InsertItem failed\n"); + + ret = SendMessageA(hTree, WM_SETREDRAW, FALSE, 0); + ok(ret == 0, "got %d\n", ret); + + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hItem1); + ok(ret == TRUE, "got %d\n", ret); + + ret = SendMessageA(hTree, WM_SETREDRAW, TRUE, 0); + ok(ret == 0, "got %d\n", ret); + + DestroyWindow(hTree); } static void test_cchildren(void) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/toolbar.c wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/toolbar.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/toolbar.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/toolbar.c 2016-02-08 19:32:34.000000000 +0000 @@ -6807,6 +6807,7 @@ return TOOLBAR_MouseLeave (infoPtr); case WM_CAPTURECHANGED: + if (hwnd == (HWND)lParam) return 0; return TOOLBAR_CaptureChanged(infoPtr); case WM_NCACTIVATE: diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/trackbar.c wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/trackbar.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/trackbar.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/trackbar.c 2016-02-08 19:32:34.000000000 +0000 @@ -1979,6 +1979,7 @@ case WM_CAPTURECHANGED: + if (hwnd == (HWND)lParam) return 0; return TRACKBAR_CaptureChanged (infoPtr); case WM_CREATE: diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/treeview.c wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/treeview.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/comctl32/treeview.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/comctl32/treeview.c 2016-02-08 19:32:34.000000000 +0000 @@ -96,7 +96,7 @@ HTREEITEM focusedItem; /* item that was under the cursor when WM_LBUTTONDOWN was received */ HTREEITEM editItem; /* item being edited with builtin edit box */ - HTREEITEM firstVisible; /* handle to first visible item */ + HTREEITEM firstVisible; /* handle to item whose top edge is at y = 0 */ LONG maxVisibleOrder; HTREEITEM dropItem; /* handle to item selected by drag cursor */ HTREEITEM insertMarkItem; /* item after which insertion mark is placed */ @@ -162,7 +162,10 @@ LONG imageOffset; LONG textOffset; LONG textWidth; /* horizontal text extent for pszText */ - LONG visibleOrder; /* visible ordering, 0 is first visible item */ + LONG visibleOrder; /* Depth-first numbering of the items whose ancestors are all expanded, + corresponding to a top-to-bottom ordering in the tree view. + Each item takes up "item.iIntegral" spots in the visible order. + 0 is the root's first child. */ const TREEVIEW_INFO *infoPtr; /* tree data this item belongs to */ } TREEVIEW_ITEM; @@ -1577,11 +1580,13 @@ TREEVIEW_VerifyTree(infoPtr); + if (visible) + TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE); + if (!infoPtr->bRedraw) return TRUE; if (visible) { - TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE); TREEVIEW_RecalculateVisibleOrder(infoPtr, prev); TREEVIEW_UpdateScrollBars(infoPtr); TREEVIEW_Invalidate(infoPtr, NULL); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ctl3d32/ctl3d32.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ctl3d32/ctl3d32.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ctl3d32/ctl3d32.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ctl3d32/ctl3d32.c 2016-02-08 19:32:34.000000000 +0000 @@ -75,7 +75,7 @@ BOOL WINAPI Ctl3dRegister(HINSTANCE hInst) { - return FALSE; + return TRUE; } BOOL WINAPI Ctl3dSubclassCtl(HWND hwnd) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d2d1/render_target.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d2d1/render_target.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d2d1/render_target.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d2d1/render_target.c 2016-02-08 19:32:34.000000000 +0000 @@ -32,6 +32,17 @@ D2D1_DRAW_TEXT_OPTIONS options; }; +static ID2D1Brush *d2d_draw_get_text_brush(struct d2d_draw_text_layout_ctx *context, IUnknown *effect) +{ + ID2D1Brush *brush = NULL; + + if (effect && SUCCEEDED(IUnknown_QueryInterface(effect, &IID_ID2D1Brush, (void**)&brush))) + return brush; + + ID2D1Brush_AddRef(context->brush); + return context->brush; +} + static void d2d_point_set(D2D1_POINT_2F *dst, float x, float y) { dst->x = x; @@ -1638,6 +1649,7 @@ struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface); D2D1_POINT_2F baseline_origin = {baseline_origin_x, baseline_origin_y}; struct d2d_draw_text_layout_ctx *context = ctx; + ID2D1Brush *brush; TRACE("iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, " "measuring_mode %#x, glyph_run %p, desc %p, effect %p.\n", @@ -1646,14 +1658,16 @@ if (desc) WARN("Ignoring glyph run description %p.\n", desc); - if (effect) - FIXME("Ignoring effect %p.\n", effect); if (context->options & ~D2D1_DRAW_TEXT_OPTIONS_NO_SNAP) FIXME("Ignoring options %#x.\n", context->options); + brush = d2d_draw_get_text_brush(context, effect); + TRACE("%s\n", debugstr_wn(desc->string, desc->stringLength)); ID2D1RenderTarget_DrawGlyphRun(&render_target->ID2D1RenderTarget_iface, - baseline_origin, glyph_run, context->brush, measuring_mode); + baseline_origin, glyph_run, brush, measuring_mode); + + ID2D1Brush_Release(brush); return S_OK; } @@ -1661,10 +1675,31 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRenderer *iface, void *ctx, float baseline_origin_x, float baseline_origin_y, const DWRITE_UNDERLINE *underline, IUnknown *effect) { - FIXME("iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, underline %p, effect %p stub!\n", + struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface); + const D2D1_MATRIX_3X2_F *m = &render_target->drawing_state.transform; + struct d2d_draw_text_layout_ctx *context = ctx; + float min_thickness; + ID2D1Brush *brush; + D2D1_RECT_F rect; + + TRACE("iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, underline %p, effect %p\n", iface, ctx, baseline_origin_x, baseline_origin_y, underline, effect); - return E_NOTIMPL; + /* minimal thickness in DIPs that will result in at least 1 pixel thick line */ + min_thickness = 96.0f / (render_target->dpi_y * sqrtf(m->_21 * m->_21 + m->_22 * m->_22)); + + rect.left = baseline_origin_x; + rect.top = baseline_origin_y + underline->offset; + rect.right = baseline_origin_x + underline->width; + rect.bottom = baseline_origin_y + underline->offset + max(underline->thickness, min_thickness); + + brush = d2d_draw_get_text_brush(context, effect); + + ID2D1RenderTarget_FillRectangle(&render_target->ID2D1RenderTarget_iface, &rect, brush); + + ID2D1Brush_Release(brush); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawStrikethrough(IDWriteTextRenderer *iface, void *ctx, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d10core/tests/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d10core/tests/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d10core/tests/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d10core/tests/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -305,6 +305,7 @@ ID3D10Device *device, *tmp; D3D10_TEXTURE2D_DESC desc; ID3D10Texture2D *texture; + UINT quality_level_count; IDXGISurface *surface; HRESULT hr; @@ -389,6 +390,25 @@ if (SUCCEEDED(hr)) IDXGISurface_Release(surface); ID3D10Texture2D_Release(texture); + ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_level_count); + desc.ArraySize = 1; + desc.SampleDesc.Count = 2; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + if (quality_level_count) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ID3D10Texture2D_Release(texture); + desc.SampleDesc.Quality = quality_level_count; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + } + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + /* We assume 15 samples multisampling is never supported in practice. */ + desc.SampleDesc.Count = 15; + desc.SampleDesc.Quality = 0; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); } @@ -3320,6 +3340,75 @@ 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, }; + static const DWORD ps_ld_sint8_code[] = + { +#if 0 + Texture2D t; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float3 p, s; + int4 c; + + p = float3(position.x / 640.0f, position.y / 480.0f, 0.0f); + t.GetDimensions(0, s.x, s.y, s.z); + p *= s; + + c = t.Load(int3(p)); + return (max(c / (float4)127, (float4)-1) + (float4)1) / 2.0f; + } +#endif + 0x43425844, 0xb3d0b0fc, 0x0e486f4a, 0xf67eec12, 0xfb9dd52f, 0x00000001, 0x00000240, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x000001a4, 0x00000040, + 0x00000069, 0x04001858, 0x00107000, 0x00000000, 0x00003333, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700003d, 0x001000f2, + 0x00000000, 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x0a000038, 0x00100032, 0x00000001, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x08000036, + 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100f46, 0x00000000, 0x00100e46, 0x00000001, 0x0500001b, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00107e46, 0x00000000, 0x0500002b, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x0a000038, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0x3c010204, 0x3c010204, 0x3c010204, + 0x3c010204, 0x0a000034, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0xbf800000, + 0xbf800000, 0xbf800000, 0xbf800000, 0x0a000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0a000038, 0x001020f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00004002, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, 0x0100003e, + }; + static const DWORD ps_ld_uint8_code[] = + { +#if 0 + Texture2D t; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float3 p, s; + + p = float3(position.x / 640.0f, position.y / 480.0f, 0.0f); + t.GetDimensions(0, s.x, s.y, s.z); + p *= s; + + return t.Load(int3(p)) / (float4)255; + } +#endif + 0x43425844, 0xd09917eb, 0x4508a07e, 0xb0b7250a, 0x228c1f0e, 0x00000001, 0x000001c8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x0000012c, 0x00000040, + 0x0000004b, 0x04001858, 0x00107000, 0x00000000, 0x00004444, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700003d, 0x001000f2, + 0x00000000, 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x0a000038, 0x00100032, 0x00000001, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x08000036, + 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100f46, 0x00000000, 0x00100e46, 0x00000001, 0x0500001b, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00107e46, 0x00000000, 0x05000056, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x0a000038, + 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0x3b808081, 0x3b808081, 0x3b808081, + 0x3b808081, 0x0100003e, + }; static const DWORD ps_sample_code[] = { #if 0 @@ -3346,6 +3435,35 @@ 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, }; + static const DWORD ps_sample_b_code[] = + { +#if 0 + Texture2D t; + SamplerState s; + + float bias; + + float4 main(float4 position : SV_POSITION) : SV_Target + { + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.SampleBias(s, p, bias); + } +#endif + 0x43425844, 0xc39b0686, 0x8244a7fc, 0x14c0b97a, 0x2900b3b7, 0x00000001, 0x00000150, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x000000b4, 0x00000040, + 0x0000002d, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001, + 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0a000038, 0x00100032, 0x00000000, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x0c00004a, + 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; static const DWORD ps_sample_l_code[] = { #if 0 @@ -3376,7 +3494,10 @@ 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, }; static const struct shader ps_ld = {ps_ld_code, sizeof(ps_ld_code)}; + static const struct shader ps_ld_sint8 = {ps_ld_sint8_code, sizeof(ps_ld_sint8_code)}; + static const struct shader ps_ld_uint8 = {ps_ld_uint8_code, sizeof(ps_ld_uint8_code)}; static const struct shader ps_sample = {ps_sample_code, sizeof(ps_sample_code)}; + static const struct shader ps_sample_b = {ps_sample_b_code, sizeof(ps_sample_b_code)}; static const struct shader ps_sample_l = {ps_sample_l_code, sizeof(ps_sample_l_code)}; static const struct { @@ -3438,6 +3559,10 @@ static const struct texture bc1_texture = {8, 8, 1, DXGI_FORMAT_BC1_UNORM, {{bc1_data, 2 * 8}}}; static const struct texture bc2_texture = {8, 8, 1, DXGI_FORMAT_BC2_UNORM, {{bc2_data, 2 * 16}}}; static const struct texture bc3_texture = {8, 8, 1, DXGI_FORMAT_BC3_UNORM, {{bc3_data, 2 * 16}}}; + static const struct texture sint8_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_SINT, + {{rgba_level_0, 4 * sizeof(*rgba_level_0)}}}; + static const struct texture uint8_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_UINT, + {{rgba_level_0, 4 * sizeof(*rgba_level_0)}}}; static const DWORD level_1_colors[] = { 0xffffffff, 0xffffffff, 0xff0000ff, 0xff0000ff, @@ -3466,6 +3591,13 @@ 0xffff0000, 0xffff0000, 0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000, 0xffffffff, 0xffffffff, }; + static const DWORD sint8_colors[] = + { + 0x7e80807e, 0x7e807e7e, 0x7e807e80, 0x7e7e7e80, + 0x7e7e8080, 0x7e7e7f7f, 0x7e808080, 0x7effffff, + 0x7e7e7e7e, 0x7e7e7e7e, 0x7e7e7e7e, 0x7e808080, + 0x7e7e7e7e, 0x7e7f7f7f, 0x7e7f7f7f, 0x7e7f7f7f, + }; static const DWORD zero_colors[4 * 4] = {0}; static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; @@ -3482,47 +3614,61 @@ } tests[] = { - {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, - {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors}, - {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors}, - {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 3.0f, zero_colors}, - {&ps_ld, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_ld, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_ld, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_sample, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, - {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, -1.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.4f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.5f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.0f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.4f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 2.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 3.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 4.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, lerp_1_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, -2.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, -1.0f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors}, + {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors}, + {&ps_ld, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 3.0f, zero_colors}, + {&ps_ld, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld_sint8, &sint8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, sint8_colors}, + {&ps_ld_uint8, &uint8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_sample, &bc1_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &bc2_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &bc3_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.4f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.5f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 9.0f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 2.0f, 1.0f, rgba_level_0}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 1.0f, 9.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 9.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, -1.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.4f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.5f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.0f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.4f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 2.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 3.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 4.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, lerp_1_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, -2.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, -1.0f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 1.5f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, }; if (!(device = create_device())) @@ -4918,7 +5064,7 @@ } hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &count); - todo_wine ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr); if (!count) { skip("Multisampling not supported for DXGI_FORMAT_R8G8B8A8_UNORM, skipping tests.\n"); @@ -4948,7 +5094,6 @@ hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &multi); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); - ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); ID3D10Device_ResolveSubresource(device, (ID3D10Resource *)backbuffer, 0, (ID3D10Resource *)multi, 0, DXGI_FORMAT_R8G8B8A8_UNORM); @@ -4968,7 +5113,7 @@ break; } release_texture_readback(&rb); - ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y); + todo_wine ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y); ID3D10RenderTargetView_Release(rtview); ID3D10Texture2D_Release(backbuffer); @@ -4980,6 +5125,81 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_check_multisample_quality_levels(void) +{ + ID3D10Device *device; + UINT quality_levels; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_levels); + if (!quality_levels) + { + skip("Multisampling not supported for DXGI_FORMAT_R8G8B8A8_UNORM, skipping test.\n"); + goto done; + } + + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_UNKNOWN, 2, &quality_levels); + todo_wine ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, 65536, 2, &quality_levels); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + todo_wine ok(quality_levels == 0xdeadbeef, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 0, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 0, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 1, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 1, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels == 1, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + /* We assume 15 samples multisampling is never supported in practice. */ + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 15, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 32, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 33, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + quality_levels = 0xdeadbeef; + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 64, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_BC3_UNORM, 2, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + +done: + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + START_TEST(device) { test_feature_level(); @@ -5009,4 +5229,5 @@ test_update_subresource(); test_copy_subresource_region(); test_multisample_init(); + test_check_multisample_quality_levels(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -2423,10 +2423,41 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device *iface, DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) { - FIXME("iface %p, format %u, sample_count %u, quality_level_count %p stub!\n", - iface, format, sample_count, quality_level_count); + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct wined3d_device_creation_parameters params; + struct wined3d *wined3d; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, format %s, sample_count %u, quality_level_count %p.\n", + iface, debug_dxgi_format(format), sample_count, quality_level_count); + + if (!quality_level_count) + return E_INVALIDARG; + + *quality_level_count = 0; + + if (!sample_count) + return E_FAIL; + if (sample_count == 1) + { + *quality_level_count = 1; + return S_OK; + } + if (sample_count > D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT) + return E_FAIL; + + wined3d_mutex_lock(); + wined3d = wined3d_device_get_wined3d(device->wined3d_device); + wined3d_device_get_creation_parameters(device->wined3d_device, ¶ms); + hr = wined3d_check_device_multisample_type(wined3d, params.adapter_idx, params.device_type, + wined3dformat_from_dxgi_format(format), TRUE, sample_count, quality_level_count); + wined3d_mutex_unlock(); + + if (hr == WINED3DERR_INVALIDCALL) + return E_INVALIDARG; + if (hr == WINED3DERR_NOTAVAILABLE) + return S_OK; + return hr; } static void STDMETHODCALLTYPE d3d11_device_CheckCounterInfo(ID3D11Device *iface, D3D11_COUNTER_INFO *info) @@ -4472,10 +4503,13 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface, DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) { - FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n", + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, format %s, sample_count %u, quality_level_count %p.\n", iface, debug_dxgi_format(format), sample_count, quality_level_count); - return E_NOTIMPL; + return d3d11_device_CheckMultisampleQualityLevels(&device->ID3D11Device_iface, format, + sample_count, quality_level_count); } static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device1 *iface, D3D10_COUNTER_INFO *counter_info) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/tests/d3d11.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/tests/d3d11.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/tests/d3d11.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/tests/d3d11.c 2016-02-08 19:32:34.000000000 +0000 @@ -508,6 +508,7 @@ ID3D11Device *device, *tmp; D3D11_TEXTURE2D_DESC desc; ID3D11Texture2D *texture; + UINT quality_level_count; IDXGISurface *surface; HRESULT hr; @@ -590,6 +591,25 @@ ok(FAILED(hr), "Texture should not implement IDXGISurface.\n"); ID3D11Texture2D_Release(texture); + ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_level_count); + desc.ArraySize = 1; + desc.SampleDesc.Count = 2; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + if (quality_level_count) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ID3D11Texture2D_Release(texture); + desc.SampleDesc.Quality = quality_level_count; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + } + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + /* We assume 15 samples multisampling is never supported in practice. */ + desc.SampleDesc.Count = 15; + desc.SampleDesc.Quality = 0; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + refcount = ID3D11Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); } @@ -2944,6 +2964,75 @@ 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, }; + static const DWORD ps_ld_sint8_code[] = + { +#if 0 + Texture2D t; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float3 p, s; + int4 c; + + p = float3(position.x / 640.0f, position.y / 480.0f, 0.0f); + t.GetDimensions(0, s.x, s.y, s.z); + p *= s; + + c = t.Load(int3(p)); + return (max(c / (float4)127, (float4)-1) + (float4)1) / 2.0f; + } +#endif + 0x43425844, 0xb3d0b0fc, 0x0e486f4a, 0xf67eec12, 0xfb9dd52f, 0x00000001, 0x00000240, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x000001a4, 0x00000040, + 0x00000069, 0x04001858, 0x00107000, 0x00000000, 0x00003333, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700003d, 0x001000f2, + 0x00000000, 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x0a000038, 0x00100032, 0x00000001, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x08000036, + 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100f46, 0x00000000, 0x00100e46, 0x00000001, 0x0500001b, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00107e46, 0x00000000, 0x0500002b, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x0a000038, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0x3c010204, 0x3c010204, 0x3c010204, + 0x3c010204, 0x0a000034, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0xbf800000, + 0xbf800000, 0xbf800000, 0xbf800000, 0x0a000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0a000038, 0x001020f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00004002, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, 0x0100003e, + }; + static const DWORD ps_ld_uint8_code[] = + { +#if 0 + Texture2D t; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float3 p, s; + + p = float3(position.x / 640.0f, position.y / 480.0f, 0.0f); + t.GetDimensions(0, s.x, s.y, s.z); + p *= s; + + return t.Load(int3(p)) / (float4)255; + } +#endif + 0x43425844, 0xd09917eb, 0x4508a07e, 0xb0b7250a, 0x228c1f0e, 0x00000001, 0x000001c8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x0000012c, 0x00000040, + 0x0000004b, 0x04001858, 0x00107000, 0x00000000, 0x00004444, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700003d, 0x001000f2, + 0x00000000, 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x0a000038, 0x00100032, 0x00000001, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x08000036, + 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100f46, 0x00000000, 0x00100e46, 0x00000001, 0x0500001b, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00107e46, 0x00000000, 0x05000056, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x0a000038, + 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002, 0x3b808081, 0x3b808081, 0x3b808081, + 0x3b808081, 0x0100003e, + }; static const DWORD ps_sample_code[] = { #if 0 @@ -2970,6 +3059,35 @@ 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, }; + static const DWORD ps_sample_b_code[] = + { +#if 0 + Texture2D t; + SamplerState s; + + float bias; + + float4 main(float4 position : SV_POSITION) : SV_Target + { + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.SampleBias(s, p, bias); + } +#endif + 0x43425844, 0xc39b0686, 0x8244a7fc, 0x14c0b97a, 0x2900b3b7, 0x00000001, 0x00000150, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x000000b4, 0x00000040, + 0x0000002d, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001, + 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0a000038, 0x00100032, 0x00000000, + 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x0c00004a, + 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; static const DWORD ps_sample_l_code[] = { #if 0 @@ -3000,7 +3118,10 @@ 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, }; static const struct shader ps_ld = {ps_ld_code, sizeof(ps_ld_code)}; + static const struct shader ps_ld_sint8 = {ps_ld_sint8_code, sizeof(ps_ld_sint8_code)}; + static const struct shader ps_ld_uint8 = {ps_ld_uint8_code, sizeof(ps_ld_uint8_code)}; static const struct shader ps_sample = {ps_sample_code, sizeof(ps_sample_code)}; + static const struct shader ps_sample_b = {ps_sample_b_code, sizeof(ps_sample_b_code)}; static const struct shader ps_sample_l = {ps_sample_l_code, sizeof(ps_sample_l_code)}; static const struct { @@ -3062,6 +3183,10 @@ static const struct texture bc1_texture = {8, 8, 1, DXGI_FORMAT_BC1_UNORM, {{bc1_data, 2 * 8}}}; static const struct texture bc2_texture = {8, 8, 1, DXGI_FORMAT_BC2_UNORM, {{bc2_data, 2 * 16}}}; static const struct texture bc3_texture = {8, 8, 1, DXGI_FORMAT_BC3_UNORM, {{bc3_data, 2 * 16}}}; + static const struct texture sint8_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_SINT, + {{rgba_level_0, 4 * sizeof(*rgba_level_0)}}}; + static const struct texture uint8_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_UINT, + {{rgba_level_0, 4 * sizeof(*rgba_level_0)}}}; static const DWORD level_1_colors[] = { 0xffffffff, 0xffffffff, 0xff0000ff, 0xff0000ff, @@ -3090,6 +3215,13 @@ 0xffff0000, 0xffff0000, 0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000, 0xffffffff, 0xffffffff, }; + static const DWORD sint8_colors[] = + { + 0x7e80807e, 0x7e807e7e, 0x7e807e80, 0x7e7e7e80, + 0x7e7e8080, 0x7e7e7f7f, 0x7e808080, 0x7effffff, + 0x7e7e7e7e, 0x7e7e7e7e, 0x7e7e7e7e, 0x7e808080, + 0x7e7e7e7e, 0x7e7f7f7f, 0x7e7f7f7f, 0x7e7f7f7f, + }; static const DWORD zero_colors[4 * 4] = {0}; static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; @@ -3106,47 +3238,61 @@ } tests[] = { - {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, - {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors}, - {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors}, - {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 3.0f, zero_colors}, - {&ps_ld, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_ld, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_ld, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_ld, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, - {&ps_sample, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, - {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, - {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, -1.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.4f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.5f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.0f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.4f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 2.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 3.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 4.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, lerp_1_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, -2.0f, rgba_level_0}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, -1.0f, level_1_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, - {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors}, + {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors}, + {&ps_ld, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 3.0f, zero_colors}, + {&ps_ld, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_ld, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors}, + {&ps_ld_sint8, &sint8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, sint8_colors}, + {&ps_ld_uint8, &uint8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_sample, &bc1_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &bc2_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &bc3_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, bc_colors}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.4f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 8.5f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 9.0f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 2.0f, 1.0f, rgba_level_0}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 1.0f, 9.0f, level_1_colors}, + {&ps_sample_b, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 9.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, -1.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.4f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 0.5f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.0f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.4f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 2.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 3.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 4.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 0.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, lerp_1_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, -2.0f, rgba_level_0}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, -1.0f, level_1_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 0.0f, D3D11_FLOAT32_MAX, 1.5f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -9.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, -1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 0.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 1.0f, level_2_colors}, + {&ps_sample_l, &rgba_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 2.0f, 2.0f, 2.0f, 9.0f, level_2_colors}, }; if (!(device = create_device(NULL))) @@ -4712,7 +4858,7 @@ } hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &count); - todo_wine ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr); if (!count) { skip("Multisampling not supported for DXGI_FORMAT_R8G8B8A8_UNORM, skipping tests.\n"); @@ -4744,7 +4890,6 @@ hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &multi); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); - ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); ID3D11DeviceContext_ResolveSubresource(context, (ID3D11Resource *)backbuffer, 0, (ID3D11Resource *)multi, 0, DXGI_FORMAT_R8G8B8A8_UNORM); @@ -4764,7 +4909,7 @@ break; } release_texture_readback(&rb); - ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y); + todo_wine ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y); ID3D11DeviceContext_Release(context); ID3D11RenderTargetView_Release(rtview); @@ -4777,6 +4922,81 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_check_multisample_quality_levels(void) +{ + ID3D11Device *device; + UINT quality_levels; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_levels); + if (!quality_levels) + { + skip("Multisampling not supported for DXGI_FORMAT_R8G8B8A8_UNORM, skipping test.\n"); + goto done; + } + + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_UNKNOWN, 2, &quality_levels); + todo_wine ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, 65536, 2, &quality_levels); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + todo_wine ok(quality_levels == 0xdeadbeef, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 0, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 0, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 1, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 1, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels == 1, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + /* We assume 15 samples multisampling is never supported in practice. */ + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 15, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 32, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 33, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + quality_levels = 0xdeadbeef; + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 64, &quality_levels); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_BC3_UNORM, 2, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(!quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + +done: + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + START_TEST(d3d11) { test_create_device(); @@ -4808,4 +5028,5 @@ test_copy_subresource_region(); test_resource_map(); test_multisample_init(); + test_check_multisample_quality_levels(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/texture.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/texture.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/texture.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/texture.c 2016-02-08 19:32:34.000000000 +0000 @@ -462,7 +462,7 @@ if (desc->SampleDesc.Count > 1) FIXME("Multisampled textures not implemented.\n"); - wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE; + wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format); wined3d_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE; wined3d_desc.multisample_quality = desc->SampleDesc.Quality; @@ -482,6 +482,8 @@ WARN("Failed to create wined3d texture, hr %#x.\n", hr); wined3d_private_store_cleanup(&texture->private_store); wined3d_mutex_unlock(); + if (hr == WINED3DERR_NOTAVAILABLE) + hr = E_INVALIDARG; return hr; } texture->desc.MipLevels = levels; @@ -914,7 +916,7 @@ wined3d_private_store_init(&texture->private_store); texture->desc = *desc; - wined3d_desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; + wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_3D; wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format); wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE; wined3d_desc.multisample_quality = 0; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/utils.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/utils.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d11/utils.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d11/utils.c 2016-02-08 19:32:34.000000000 +0000 @@ -24,22 +24,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -#define WINE_D3D10_TO_STR(x) case x: return #x +#define WINE_D3D_TO_STR(x) case x: return #x const char *debug_d3d10_primitive_topology(D3D10_PRIMITIVE_TOPOLOGY topology) { switch (topology) { - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ); - WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ); + WINE_D3D_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ); default: FIXME("Unrecognized D3D10_PRIMITIVE_TOPOLOGY %#x\n", topology); return "unrecognized"; @@ -50,102 +50,102 @@ { switch(format) { - WINE_D3D10_TO_STR(DXGI_FORMAT_UNKNOWN); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32G8X24_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_D32_FLOAT_S8X24_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R11G11B10_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_D32_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R32_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R24G8_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_D24_UNORM_S8_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R24_UNORM_X8_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_X24_TYPELESS_G8_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_FLOAT); - WINE_D3D10_TO_STR(DXGI_FORMAT_D16_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R16_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8_UINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8_SINT); - WINE_D3D10_TO_STR(DXGI_FORMAT_A8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R1_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_R9G9B9E5_SHAREDEXP); - WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_B8G8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_G8R8_G8B8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_UNORM_SRGB); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_UNORM_SRGB); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_UNORM_SRGB); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_TYPELESS); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_SNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_B5G6R5_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_B5G5R5A1_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_B8G8R8A8_UNORM); - WINE_D3D10_TO_STR(DXGI_FORMAT_B8G8R8X8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_UNKNOWN); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32A32_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32A32_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32A32_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32A32_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32B32_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16B16A16_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G32_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32G8X24_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_D32_FLOAT_S8X24_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R10G10B10A2_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R10G10B10A2_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R10G10B10A2_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R11G11B10_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8B8A8_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16G16_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_D32_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R32_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R24G8_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_D24_UNORM_S8_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R24_UNORM_X8_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_X24_TYPELESS_G8_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_FLOAT); + WINE_D3D_TO_STR(DXGI_FORMAT_D16_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R16_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_R8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8_UINT); + WINE_D3D_TO_STR(DXGI_FORMAT_R8_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R8_SINT); + WINE_D3D_TO_STR(DXGI_FORMAT_A8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R1_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_R9G9B9E5_SHAREDEXP); + WINE_D3D_TO_STR(DXGI_FORMAT_R8G8_B8G8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_G8R8_G8B8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC1_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_BC1_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC1_UNORM_SRGB); + WINE_D3D_TO_STR(DXGI_FORMAT_BC2_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_BC2_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC2_UNORM_SRGB); + WINE_D3D_TO_STR(DXGI_FORMAT_BC3_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_BC3_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC3_UNORM_SRGB); + WINE_D3D_TO_STR(DXGI_FORMAT_BC4_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_BC4_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC4_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC5_TYPELESS); + WINE_D3D_TO_STR(DXGI_FORMAT_BC5_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_BC5_SNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_B5G6R5_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_B5G5R5A1_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_B8G8R8A8_UNORM); + WINE_D3D_TO_STR(DXGI_FORMAT_B8G8R8X8_UNORM); default: FIXME("Unrecognized DXGI_FORMAT %#x\n", format); return "unrecognized"; } } -#undef WINE_D3D10_TO_STR +#undef WINE_D3D_TO_STR DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -619,7 +619,7 @@ { struct d3d8_surface *surface; - if (desc.resource_type == WINED3D_RTYPE_TEXTURE) + if (desc.resource_type == WINED3D_RTYPE_TEXTURE_2D) { IUnknown *parent = wined3d_resource_get_parent(resource); IDirect3DBaseTexture8 *texture; @@ -950,7 +950,7 @@ device, width, height, format, flags, surface, usage, pool, multisample_type, multisample_quality); - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = multisample_type; desc.multisample_quality = multisample_quality; @@ -995,7 +995,7 @@ *surface = NULL; if (lockable) - flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; return d3d8_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, 0); @@ -1013,7 +1013,7 @@ *surface = NULL; /* TODO: Verify that Discard is false */ - return d3d8_device_create_surface(device, width, height, format, WINED3D_SURFACE_MAPPABLE, + return d3d8_device_create_surface(device, width, height, format, WINED3D_TEXTURE_CREATE_MAPPABLE, surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, 0); } @@ -1028,7 +1028,7 @@ *surface = NULL; - return d3d8_device_create_surface(device, width, height, format, WINED3D_SURFACE_MAPPABLE, + return d3d8_device_create_surface(device, width, height, format, WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE, 0); } @@ -3039,8 +3039,8 @@ TRACE("device_parent %p, container_parent %p, desc %p, texture %p.\n", device_parent, container_parent, desc, texture); - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, texture))) + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, + NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/directx.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/directx.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/directx.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/directx.c 2016-02-08 19:32:34.000000000 +0000 @@ -238,16 +238,38 @@ TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n", iface, adapter, device_type, adapter_format, usage, resource_type, format); + usage = usage & (WINED3DUSAGE_MASK | WINED3DUSAGE_QUERY_MASK); switch (resource_type) { + case D3DRTYPE_SURFACE: + wined3d_rtype = WINED3D_RTYPE_SURFACE; + break; + + case D3DRTYPE_VOLUME: + wined3d_rtype = WINED3D_RTYPE_VOLUME; + break; + + case D3DRTYPE_TEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_2D; + break; + + case D3DRTYPE_VOLUMETEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_3D; + break; + + case D3DRTYPE_CUBETEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_2D; + usage |= WINED3DUSAGE_LEGACY_CUBEMAP; + break; + case D3DRTYPE_VERTEXBUFFER: case D3DRTYPE_INDEXBUFFER: wined3d_rtype = WINED3D_RTYPE_BUFFER; break; default: - wined3d_rtype = resource_type; - break; + FIXME("Unhandled resource type %#x.\n", resource_type); + return WINED3DERR_INVALIDCALL; } wined3d_mutex_lock(); @@ -267,6 +289,9 @@ TRACE("iface %p, adapter %u, device_type %#x, format %#x, windowed %#x, multisample_type %#x.\n", iface, adapter, device_type, format, windowed, multisample_type); + if (multisample_type > D3DMULTISAMPLE_16_SAMPLES) + return D3DERR_INVALIDCALL; + wined3d_mutex_lock(); hr = wined3d_check_device_multisample_type(d3d8->wined3d, adapter, device_type, wined3dformat_from_d3dformat(format), windowed, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/tests/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/tests/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/tests/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/tests/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -790,6 +790,120 @@ DestroyWindow(window); } +static void test_checkdevicemultisampletype(void) +{ + IDirect3D8 *d3d; + HWND window; + HRESULT hr; + + window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES) == D3DERR_NOTAVAILABLE) + { + skip("Multisampling not supported for D3DFMT_X8R8G8B8, skipping test.\n"); + goto cleanup; + } + + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_UNKNOWN, TRUE, D3DMULTISAMPLE_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + 65536, TRUE, D3DMULTISAMPLE_NONE); + todo_wine ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONE); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, FALSE, D3DMULTISAMPLE_NONE); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + /* We assume D3DMULTISAMPLE_15_SAMPLES is never supported in practice. */ + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, 65536); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_DXT5, TRUE, D3DMULTISAMPLE_2_SAMPLES); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + +cleanup: + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_invalid_multisample(void) +{ + IDirect3DDevice8 *device; + IDirect3DSurface8 *rt; + IDirect3D8 *d3d; + BOOL available; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + goto cleanup; + } + + available = SUCCEEDED(IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES)); + + hr = IDirect3DDevice8_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, FALSE, &rt); + if (available) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + IDirect3DSurface8_Release(rt); + } + else + { + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + } + + /* We assume D3DMULTISAMPLE_15_SAMPLES is never supported in practice. */ + available = SUCCEEDED(IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES)); + hr = IDirect3DDevice8_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_15_SAMPLES, FALSE, &rt); + if (available) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + IDirect3DSurface8_Release(rt); + } + else + { + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + } + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +cleanup: + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + static void test_cursor(void) { HMODULE user32_handle = GetModuleHandleA("user32.dll"); @@ -7786,6 +7900,8 @@ test_swapchain(); test_refcount(); test_mipmap_levels(); + test_checkdevicemultisampletype(); + test_invalid_multisample(); test_cursor(); test_cursor_pos(); test_states(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/texture.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/texture.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d8/texture.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d8/texture.c 2016-02-08 19:32:34.000000000 +0000 @@ -1150,14 +1150,14 @@ UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl; d3d8_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; @@ -1170,13 +1170,13 @@ desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) levels = wined3d_log2i(max(width, height)) + 1; wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1195,19 +1195,19 @@ UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl; d3d8_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; desc.usage = usage & WINED3DUSAGE_MASK; - desc.usage |= WINED3DUSAGE_TEXTURE; + desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE; desc.pool = pool; desc.width = edge_length; desc.height = edge_length; @@ -1215,13 +1215,13 @@ desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) levels = wined3d_log2i(edge_length) + 1; wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1246,7 +1246,7 @@ d3d8_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_3D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/d3d9_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/d3d9_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/d3d9_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/d3d9_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -219,7 +219,6 @@ struct d3d9_resource resource; struct wined3d_texture *wined3d_texture; unsigned int sub_resource_idx; - struct wined3d_surface *wined3d_surface; struct list rtv_entry; struct wined3d_rendertarget_view *wined3d_rtv; IDirect3DDevice9Ex *parent_device; @@ -229,8 +228,8 @@ }; struct wined3d_rendertarget_view *d3d9_surface_get_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN; -void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; struct d3d9_surface *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN; struct d3d9_vertexbuffer diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -611,7 +611,7 @@ { struct d3d9_surface *surface; - if (desc.resource_type == WINED3D_RTYPE_TEXTURE) + if (desc.resource_type == WINED3D_RTYPE_TEXTURE_2D) { IUnknown *parent = wined3d_resource_get_parent(resource); IDirect3DBaseTexture9 *texture; @@ -1119,7 +1119,7 @@ device, width, height, format, flags, surface, usage, pool, multisample_type, multisample_quality); - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = multisample_type; desc.multisample_quality = multisample_quality; @@ -1137,6 +1137,8 @@ { wined3d_mutex_unlock(); WARN("Failed to create texture, hr %#x.\n", hr); + if (hr == WINED3DERR_NOTAVAILABLE) + hr = D3DERR_INVALIDCALL; return hr; } @@ -1182,7 +1184,7 @@ } if (lockable) - flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -1193,7 +1195,7 @@ BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - DWORD flags = WINED3D_SURFACE_MAPPABLE; + DWORD flags = WINED3D_TEXTURE_CREATE_MAPPABLE; TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n" "discard %#x, surface %p, shared_handle %p.\n", @@ -1213,7 +1215,7 @@ } if (discard) - flags |= WINED3D_SURFACE_DISCARD; + flags |= WINED3D_TEXTURE_CREATE_DISCARD; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -1227,16 +1229,32 @@ struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_surface *src = unsafe_impl_from_IDirect3DSurface9(src_surface); struct d3d9_surface *dst = unsafe_impl_from_IDirect3DSurface9(dst_surface); + struct wined3d_box src_box; HRESULT hr; TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.\n", iface, src_surface, src_rect, dst_surface, dst_point); + if (src_rect) + { + src_box.left = src_rect->left; + src_box.top = src_rect->top; + src_box.right = src_rect->right; + src_box.bottom = src_rect->bottom; + src_box.front = 0; + src_box.back = 1; + } + wined3d_mutex_lock(); - hr = wined3d_device_update_surface(device->wined3d_device, src->wined3d_surface, src_rect, - dst->wined3d_surface, dst_point); + hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0, + dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture), + src->sub_resource_idx, src_rect ? &src_box : NULL); wined3d_mutex_unlock(); + if (FAILED(hr)) + return D3DERR_INVALIDCALL; + return hr; } @@ -1267,20 +1285,32 @@ struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); struct wined3d_resource_desc wined3d_desc; struct wined3d_resource *sub_resource; + RECT dst_rect, src_rect; HRESULT hr; TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface); wined3d_mutex_lock(); + sub_resource = wined3d_texture_get_sub_resource(dst_impl->wined3d_texture, dst_impl->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); + dst_rect.left = 0; + dst_rect.top = 0; + dst_rect.right = wined3d_desc.width; + dst_rect.bottom = wined3d_desc.height; + sub_resource = wined3d_texture_get_sub_resource(rt_impl->wined3d_texture, rt_impl->sub_resource_idx); wined3d_resource_get_desc(sub_resource, &wined3d_desc); + src_rect.left = 0; + src_rect.top = 0; + src_rect.right = wined3d_desc.width; + src_rect.bottom = wined3d_desc.height; /* TODO: Check surface sizes, pools, etc. */ if (wined3d_desc.multisample_type) hr = D3DERR_INVALIDCALL; else - hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, NULL, - rt_impl->wined3d_texture, rt_impl->sub_resource_idx, NULL, 0, NULL, WINED3D_TEXF_POINT); + hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect, + rt_impl->wined3d_texture, rt_impl->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT); wined3d_mutex_unlock(); return hr; @@ -1313,6 +1343,7 @@ HRESULT hr = D3DERR_INVALIDCALL; struct wined3d_resource_desc src_desc, dst_desc; struct wined3d_resource *sub_resource; + RECT d, s; TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.\n", iface, src_surface, src_rect, dst_surface, dst_rect, filter); @@ -1320,9 +1351,25 @@ wined3d_mutex_lock(); sub_resource = wined3d_texture_get_sub_resource(dst->wined3d_texture, dst->sub_resource_idx); wined3d_resource_get_desc(sub_resource, &dst_desc); + if (!dst_rect) + { + d.left = 0; + d.top = 0; + d.right = dst_desc.width; + d.bottom = dst_desc.height; + dst_rect = &d; + } sub_resource = wined3d_texture_get_sub_resource(src->wined3d_texture, src->sub_resource_idx); wined3d_resource_get_desc(sub_resource, &src_desc); + if (!src_rect) + { + s.left = 0; + s.top = 0; + s.right = src_desc.width; + s.bottom = src_desc.height; + src_rect = &s; + } if (src_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) { @@ -1332,26 +1379,22 @@ goto done; } - if (src_rect) + if (src_rect->left || src_rect->top || src_rect->right != src_desc.width + || src_rect->bottom != src_desc.height) { - if (src_rect->left || src_rect->top || src_rect->right != src_desc.width - || src_rect->bottom != src_desc.height) - { - WARN("Rejecting depth / stencil blit with invalid source rect %s.\n", - wine_dbgstr_rect(src_rect)); - goto done; - } + WARN("Rejecting depth / stencil blit with invalid source rect %s.\n", + wine_dbgstr_rect(src_rect)); + goto done; } - if (dst_rect) + + if (dst_rect->left || dst_rect->top || dst_rect->right != dst_desc.width + || dst_rect->bottom != dst_desc.height) { - if (dst_rect->left || dst_rect->top || dst_rect->right != dst_desc.width - || dst_rect->bottom != dst_desc.height) - { - WARN("Rejecting depth / stencil blit with invalid destination rect %s.\n", - wine_dbgstr_rect(dst_rect)); - goto done; - } + WARN("Rejecting depth / stencil blit with invalid destination rect %s.\n", + wine_dbgstr_rect(dst_rect)); + goto done; } + if (src_desc.width != dst_desc.width || src_desc.height != dst_desc.height) { WARN("Rejecting depth / stencil blit with mismatched surface sizes.\n"); @@ -1465,7 +1508,7 @@ * regardless of the pool they're created in. Should we set dynamic usage * here? */ return d3d9_device_create_surface(device, width, height, format, - WINED3D_SURFACE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem); + WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem); } static HRESULT WINAPI d3d9_device_SetRenderTarget(IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 *surface) @@ -3353,7 +3396,7 @@ BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - DWORD flags = WINED3D_SURFACE_MAPPABLE; + DWORD flags = WINED3D_TEXTURE_CREATE_MAPPABLE; TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, " "discard %#x, surface %p, shared_handle %p, usage %#x.\n", @@ -3370,7 +3413,7 @@ FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle); if (discard) - flags |= WINED3D_SURFACE_DISCARD; + flags |= WINED3D_TEXTURE_CREATE_DISCARD; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -3602,7 +3645,7 @@ if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface)))) return E_OUTOFMEMORY; - surface_init(d3d_surface, wined3d_texture, sub_resource_idx, surface, parent_ops); + surface_init(d3d_surface, wined3d_texture, sub_resource_idx, parent_ops); *parent = d3d_surface; TRACE("Created surface %p.\n", d3d_surface); @@ -3642,7 +3685,7 @@ container_parent = &device->IDirect3DDevice9Ex_iface; if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, texture))) + WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/directx.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/directx.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/directx.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/directx.c 2016-02-08 19:32:34.000000000 +0000 @@ -254,16 +254,38 @@ TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n", iface, adapter, device_type, adapter_format, usage, resource_type, format); + usage = usage & (WINED3DUSAGE_MASK | WINED3DUSAGE_QUERY_MASK); switch (resource_type) { + case D3DRTYPE_SURFACE: + wined3d_rtype = WINED3D_RTYPE_SURFACE; + break; + + case D3DRTYPE_VOLUME: + wined3d_rtype = WINED3D_RTYPE_VOLUME; + break; + + case D3DRTYPE_TEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_2D; + break; + + case D3DRTYPE_VOLUMETEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_3D; + break; + + case D3DRTYPE_CUBETEXTURE: + wined3d_rtype = WINED3D_RTYPE_TEXTURE_2D; + usage |= WINED3DUSAGE_LEGACY_CUBEMAP; + break; + case D3DRTYPE_VERTEXBUFFER: case D3DRTYPE_INDEXBUFFER: wined3d_rtype = WINED3D_RTYPE_BUFFER; break; default: - wined3d_rtype = resource_type; - break; + FIXME("Unhandled resource type %#x.\n", resource_type); + return WINED3DERR_INVALIDCALL; } wined3d_mutex_lock(); @@ -283,10 +305,15 @@ TRACE("iface %p, adapter %u, device_type %#x, format %#x, windowed %#x, multisample_type %#x, levels %p.\n", iface, adapter, device_type, format, windowed, multisample_type, levels); + if (multisample_type > D3DMULTISAMPLE_16_SAMPLES) + return D3DERR_INVALIDCALL; + wined3d_mutex_lock(); hr = wined3d_check_device_multisample_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(format), windowed, multisample_type, levels); wined3d_mutex_unlock(); + if (hr == WINED3DERR_NOTAVAILABLE && levels) + *levels = 1; return hr; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/surface.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/surface.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/surface.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/surface.c 2016-02-08 19:32:34.000000000 +0000 @@ -71,7 +71,7 @@ wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); - wined3d_surface_incref(surface->wined3d_surface); + wined3d_texture_incref(surface->wined3d_texture); wined3d_mutex_unlock(); } @@ -101,7 +101,7 @@ wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); - wined3d_surface_decref(surface->wined3d_surface); + wined3d_texture_decref(surface->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, as it may cause the device to be destroyed. */ @@ -357,8 +357,8 @@ surface_wined3d_object_destroyed, }; -void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) { struct wined3d_resource_desc desc; IDirect3DBaseTexture9 *texture; @@ -366,7 +366,6 @@ surface->IDirect3DSurface9_iface.lpVtbl = &d3d9_surface_vtbl; d3d9_resource_init(&surface->resource); surface->resource.refcount = 0; - surface->wined3d_surface = wined3d_surface; list_init(&surface->rtv_entry); surface->container = wined3d_texture_get_parent(wined3d_texture); surface->wined3d_texture = wined3d_texture; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/tests/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/tests/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/tests/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/tests/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -1003,10 +1003,8 @@ static void test_checkdevicemultisampletype(void) { - IDirect3DDevice9 *device; DWORD quality_levels; IDirect3D9 *d3d; - ULONG refcount; HWND window; HRESULT hr; @@ -1015,34 +1013,145 @@ ok(!!window, "Failed to create a window.\n"); d3d = Direct3DCreate9(D3D_SDK_VERSION); ok(!!d3d, "Failed to create a D3D object.\n"); - if (!(device = create_device(d3d, window, NULL))) + + if (IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL) == D3DERR_NOTAVAILABLE) { - skip("Failed to create a 3D device, skipping test.\n"); + skip("Multisampling not supported for D3DFMT_X8R8G8B8, skipping test.\n"); goto cleanup; } + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_UNKNOWN, TRUE, D3DMULTISAMPLE_NONE, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + 65536, TRUE, D3DMULTISAMPLE_NONE, NULL); + todo_wine ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONE, NULL); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + quality_levels = 0; hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONE, &quality_levels); - ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "CheckDeviceMultiSampleType failed with (%08x)\n", hr); - if (hr == D3DERR_NOTAVAILABLE) - { - skip("IDirect3D9_CheckDeviceMultiSampleType not available\n"); - goto cleanup; - } + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); ok(quality_levels == 1, "Got unexpected quality_levels %u.\n", quality_levels); - + quality_levels = 0; hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, FALSE, D3DMULTISAMPLE_NONE, &quality_levels); - ok(SUCCEEDED(hr), "CheckDeviceMultiSampleType failed with (%08x)\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels == 1, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0; + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONMASKABLE, NULL); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONMASKABLE, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + quality_levels = 0; + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &quality_levels); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(quality_levels, "Got unexpected quality_levels %u.\n", quality_levels); + + /* We assume D3DMULTISAMPLE_15_SAMPLES is never supported in practice. */ + quality_levels = 0; + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES, NULL); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES, &quality_levels); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); ok(quality_levels == 1, "Got unexpected quality_levels %u.\n", quality_levels); + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, 65536, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_DXT5, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + cleanup: - if (device) + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_invalid_multisample(void) +{ + IDirect3DDevice9 *device; + IDirect3DSurface9 *rt; + DWORD quality_levels; + IDirect3D9 *d3d; + BOOL available; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (!(device = create_device(d3d, window, NULL))) { - refcount = IDirect3DDevice9_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + skip("Failed to create a 3D device, skipping test.\n"); + goto cleanup; } + + available = SUCCEEDED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONMASKABLE, &quality_levels)); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_NONMASKABLE, 0, FALSE, &rt, NULL); + if (available) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + IDirect3DSurface9_Release(rt); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_NONMASKABLE, quality_levels, FALSE, &rt, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + else + { + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + + available = SUCCEEDED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &quality_levels)); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, 0, FALSE, &rt, NULL); + if (available) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + IDirect3DSurface9_Release(rt); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, quality_levels, FALSE, &rt, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + else + { + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + + /* We assume D3DMULTISAMPLE_15_SAMPLES is never supported in practice. */ + hr = IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES, NULL); + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_X8R8G8B8, D3DMULTISAMPLE_15_SAMPLES, 0, FALSE, &rt, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +cleanup: IDirect3D9_Release(d3d); DestroyWindow(window); } @@ -10163,7 +10272,7 @@ hr = IDirect3DDevice9_UpdateSurface(device, surface, NULL, surface_dst, NULL); ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); hr = IDirect3DDevice9_UpdateSurface(device, surface2, NULL, surface_dst2, NULL); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); /* Apparently there's no validation on the container. */ hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)texture, @@ -10677,6 +10786,7 @@ test_refcount(); test_mipmap_levels(); test_checkdevicemultisampletype(); + test_invalid_multisample(); test_cursor(); test_cursor_pos(); test_reset_fullscreen(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/texture.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/texture.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3d9/texture.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3d9/texture.c 2016-02-08 19:32:34.000000000 +0000 @@ -1280,14 +1280,14 @@ UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl; d3d9_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; @@ -1300,7 +1300,7 @@ desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) { @@ -1311,7 +1311,7 @@ } wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1330,19 +1330,19 @@ UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl; d3d9_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; desc.usage = usage & WINED3DUSAGE_MASK; - desc.usage |= WINED3DUSAGE_TEXTURE; + desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE; desc.pool = pool; desc.width = edge_length; desc.height = edge_length; @@ -1350,7 +1350,7 @@ desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) { @@ -1361,7 +1361,7 @@ } wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1386,7 +1386,7 @@ d3d9_resource_init(&texture->resource); list_init(&texture->rtv_list); - desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_3D; desc.format = wined3dformat_from_d3dformat(format); desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3dx9_36/core.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3dx9_36/core.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3dx9_36/core.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3dx9_36/core.c 2016-02-08 19:32:34.000000000 +0000 @@ -157,7 +157,7 @@ *buffer = &object->ID3DXBuffer_iface; - TRACE("Created ID3DBuffer %p\n", *buffer); + TRACE("Created ID3DXBuffer %p.\n", *buffer); return D3D_OK; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/d3dx9_36/tests/core.c wine-staging-1.9.3~ubuntu12.04.1/dlls/d3dx9_36/tests/core.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/d3dx9_36/tests/core.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/d3dx9_36/tests/core.c 2016-02-08 19:32:34.000000000 +0000 @@ -81,7 +81,7 @@ ok(!size, "GetBufferSize failed, got %u, expected %u\n", size, 0); count = ID3DXBuffer_Release(buffer); - ok(!count, "ID3DBuffer has %u references left\n", count); + ok(!count, "ID3DXBuffer has %u references left\n", count); hr = D3DXCreateBuffer(3, &buffer); ok(hr == D3D_OK, "D3DXCreateBuffer failed, got %#x, expected %#x\n", hr, D3D_OK); @@ -90,7 +90,7 @@ ok(size == 3, "GetBufferSize failed, got %u, expected %u\n", size, 3); count = ID3DXBuffer_Release(buffer); - ok(!count, "ID3DBuffer has %u references left\n", count); + ok(!count, "ID3DXBuffer has %u references left\n", count); } static void test_ID3DXSprite(IDirect3DDevice9 *device) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/ddraw.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/ddraw.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/ddraw.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/ddraw.c 2016-02-08 19:32:34.000000000 +0000 @@ -4765,7 +4765,7 @@ return DDERR_OUTOFVIDEOMEMORY; } - ddraw_surface_init(ddraw_surface, ddraw, wined3d_texture_get_parent(wined3d_texture), surface, parent_ops); + ddraw_surface_init(ddraw_surface, ddraw, wined3d_texture, sub_resource_idx, surface, parent_ops); *parent = ddraw_surface; ddraw_update_lost_surfaces(ddraw); @@ -4816,13 +4816,13 @@ } if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, texture))) + WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; } - ddraw->wined3d_frontbuffer = wined3d_surface_from_resource(wined3d_texture_get_sub_resource(*texture, 0)); + ddraw->wined3d_frontbuffer = *texture; return hr; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/ddraw_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/ddraw_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/ddraw_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/ddraw_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -92,7 +92,7 @@ struct ddraw_surface *primary; RECT primary_lock; - struct wined3d_surface *wined3d_frontbuffer; + struct wined3d_texture *wined3d_frontbuffer; struct wined3d_swapchain *wined3d_swapchain; HWND swapchain_window; @@ -163,6 +163,7 @@ struct ddraw *ddraw; struct wined3d_surface *wined3d_surface; struct wined3d_texture *wined3d_texture; + unsigned int sub_resource_idx; struct wined3d_rendertarget_view *wined3d_rtv; struct wined3d_private_store private_store; struct d3d_device *device1; @@ -209,7 +210,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN; struct wined3d_rendertarget_view *ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface) DECLSPEC_HIDDEN; -void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture, +void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, 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, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -1091,7 +1091,7 @@ for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) { if (wined3d_check_device_format(device->ddraw->wined3d, WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, - mode.format_id, 0, WINED3D_RTYPE_TEXTURE, FormatList[i]) == D3D_OK) + mode.format_id, 0, WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK) { DDPIXELFORMAT pformat; @@ -1114,7 +1114,7 @@ { if (wined3d_check_device_format(device->ddraw->wined3d, WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, mode.format_id, WINED3DUSAGE_QUERY_LEGACYBUMPMAP, - WINED3D_RTYPE_TEXTURE, BumpFormatList[i]) == D3D_OK) + WINED3D_RTYPE_TEXTURE_2D, BumpFormatList[i]) == D3D_OK) { DDPIXELFORMAT pformat; @@ -1219,7 +1219,7 @@ for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) { if (wined3d_check_device_format(device->ddraw->wined3d, 0, WINED3D_DEVICE_TYPE_HAL, - mode.format_id, 0, WINED3D_RTYPE_TEXTURE, FormatList[i]) == D3D_OK) + mode.format_id, 0, WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK) { DDSURFACEDESC sdesc; @@ -2755,6 +2755,12 @@ TRACE("iface %p, state %#x, value %#x.\n", iface, state, value); + if (state >= D3DSTATE_OVERRIDE_BIAS) + { + WARN("Unhandled state %#x.\n", state); + return DDERR_INVALIDPARAMS; + } + wined3d_mutex_lock(); switch (state) @@ -5625,7 +5631,7 @@ return DDERR_INVALIDPARAMS; wined3d_mutex_lock(); - wined3d_surface_preload(surface->wined3d_surface); + wined3d_texture_preload(surface->wined3d_texture); wined3d_mutex_unlock(); return D3D_OK; @@ -5944,10 +5950,10 @@ return !dest_level && levelFound; } -static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *dest, +static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect) { - struct ddraw_surface *src_level, *dest_level; + struct ddraw_surface *dst_level, *src_level; IDirectDrawSurface7 *temp; DDSURFACEDESC2 ddsd; POINT point; @@ -5959,7 +5965,7 @@ /* Copy palette, if possible. */ IDirectDrawSurface7_GetPalette(&src->IDirectDrawSurface7_iface, &pal_src); - IDirectDrawSurface7_GetPalette(&dest->IDirectDrawSurface7_iface, &pal); + IDirectDrawSurface7_GetPalette(&dst->IDirectDrawSurface7_iface, &pal); if (pal_src != NULL && pal != NULL) { @@ -5979,36 +5985,37 @@ if (SUCCEEDED(hr)) { - IDirectDrawSurface7_SetColorKey(&dest->IDirectDrawSurface7_iface, ckeyflag, &ddckey); + IDirectDrawSurface7_SetColorKey(&dst->IDirectDrawSurface7_iface, ckeyflag, &ddckey); } } src_level = src; - dest_level = dest; + dst_level = dst; point = *DestPoint; src_rect = *SrcRect; - for (;src_level && dest_level;) + for (;src_level && dst_level;) { - if (src_level->surface_desc.dwWidth == dest_level->surface_desc.dwWidth && - src_level->surface_desc.dwHeight == dest_level->surface_desc.dwHeight) + if (src_level->surface_desc.dwWidth == dst_level->surface_desc.dwWidth + && src_level->surface_desc.dwHeight == dst_level->surface_desc.dwHeight) { UINT src_w = src_rect.right - src_rect.left; UINT src_h = src_rect.bottom - src_rect.top; RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h}; - if (FAILED(hr = wined3d_surface_blt(dest_level->wined3d_surface, &dst_rect, - src_level->wined3d_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) + if (FAILED(hr = wined3d_texture_blt(dst_level->wined3d_texture, dst_level->sub_resource_idx, &dst_rect, + src_level->wined3d_texture, src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) ERR("Blit failed, hr %#x.\n", hr); ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; ddsd.ddsCaps.dwCaps2 = DDSCAPS2_MIPMAPSUBLEVEL; - IDirectDrawSurface7_GetAttachedSurface(&dest_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp); + IDirectDrawSurface7_GetAttachedSurface(&dst_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp); - if (dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface); + if (dst_level != dst) + IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface); - dest_level = unsafe_impl_from_IDirectDrawSurface7(temp); + dst_level = unsafe_impl_from_IDirectDrawSurface7(temp); } ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; @@ -6028,8 +6035,10 @@ src_rect.bottom = (src_rect.bottom + 1) / 2; } - if (src_level && src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface); - if (dest_level && dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface); + if (src_level && src_level != src) + IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface); + if (dst_level && dst_level != dst) + IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface); } /***************************************************************************** diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/surface.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/surface.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/surface.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/surface.c 2016-02-08 19:32:34.000000000 +0000 @@ -46,22 +46,19 @@ int x, y, w, h; HRESULT hr; BOOL ret; + RECT r; if (!rect) { - x = 0; - y = 0; - w = surface->surface_desc.dwWidth; - h = surface->surface_desc.dwHeight; - } - else - { - x = rect->left; - y = rect->top; - w = rect->right - rect->left; - h = rect->bottom - rect->top; + SetRect(&r, 0, 0, surface->surface_desc.dwWidth, surface->surface_desc.dwHeight); + rect = &r; } + x = rect->left; + y = rect->top; + w = rect->right - rect->left; + h = rect->bottom - rect->top; + if (w <= 0 || h <= 0) return DD_OK; @@ -72,11 +69,11 @@ if (read) return DD_OK; - return wined3d_surface_blt(surface->ddraw->wined3d_frontbuffer, rect, - surface->wined3d_surface, rect, 0, NULL, WINED3D_TEXF_POINT); + return wined3d_texture_blt(surface->ddraw->wined3d_frontbuffer, 0, rect, + surface->wined3d_texture, surface->sub_resource_idx, rect, 0, NULL, WINED3D_TEXF_POINT); } - if (FAILED(hr = wined3d_surface_getdc(surface->wined3d_surface, &surface_dc))) + if (FAILED(hr = wined3d_texture_get_dc(surface->wined3d_texture, surface->sub_resource_idx, &surface_dc))) { ERR("Failed to get surface DC, hr %#x.\n", hr); return hr; @@ -86,7 +83,7 @@ if (!(screen_dc = GetDC(NULL))) { - wined3d_surface_releasedc(surface->wined3d_surface, surface_dc); + wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, surface_dc); ERR("Failed to get screen DC.\n"); return E_FAIL; } @@ -99,7 +96,7 @@ surface_dc, x, y, SRCCOPY); ReleaseDC(NULL, screen_dc); - wined3d_surface_releasedc(surface->wined3d_surface, surface_dc); + wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, surface_dc); if (!ret) { @@ -326,10 +323,7 @@ wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); - if (surface->wined3d_surface) - wined3d_surface_incref(surface->wined3d_surface); - if (surface->wined3d_texture) - wined3d_texture_incref(surface->wined3d_texture); + wined3d_texture_incref(surface->wined3d_texture); wined3d_mutex_unlock(); } } @@ -532,10 +526,7 @@ if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); - if (surface->wined3d_texture) - wined3d_texture_decref(surface->wined3d_texture); - if (surface->wined3d_surface) - wined3d_surface_decref(surface->wined3d_surface); + wined3d_texture_decref(surface->wined3d_texture); } ULONG ddraw_surface_release_iface(struct ddraw_surface *This) @@ -950,17 +941,17 @@ * For more details, see IWineD3DSurface::LockRect * *****************************************************************************/ -static HRESULT surface_lock(struct ddraw_surface *This, - RECT *Rect, DDSURFACEDESC2 *DDSD, DWORD Flags, HANDLE h) +static HRESULT surface_lock(struct ddraw_surface *surface, + RECT *rect, DDSURFACEDESC2 *surface_desc, DWORD flags, HANDLE h) { struct wined3d_box box; struct wined3d_map_desc map_desc; HRESULT hr = DD_OK; - TRACE("This %p, rect %s, surface_desc %p, flags %#x, h %p.\n", - This, wine_dbgstr_rect(Rect), DDSD, Flags, h); + TRACE("surface %p, rect %s, surface_desc %p, flags %#x, h %p.\n", + surface, wine_dbgstr_rect(rect), surface_desc, flags, h); - /* This->surface_desc.dwWidth and dwHeight are changeable, thus lock */ + /* surface->surface_desc.dwWidth and dwHeight are changeable, thus lock */ wined3d_mutex_lock(); /* Should I check for the handle to be NULL? @@ -970,33 +961,31 @@ */ /* Windows zeroes this if the rect is invalid */ - DDSD->lpSurface = 0; + surface_desc->lpSurface = NULL; - if (Rect) + if (rect) { - if ((Rect->left < 0) - || (Rect->top < 0) - || (Rect->left > Rect->right) - || (Rect->top > Rect->bottom) - || (Rect->right > This->surface_desc.dwWidth) - || (Rect->bottom > This->surface_desc.dwHeight)) + if ((rect->left < 0) || (rect->top < 0) + || (rect->left > rect->right) || (rect->right > surface->surface_desc.dwWidth) + || (rect->top > rect->bottom) || (rect->bottom > surface->surface_desc.dwHeight)) { WARN("Trying to lock an invalid rectangle, returning DDERR_INVALIDPARAMS\n"); wined3d_mutex_unlock(); return DDERR_INVALIDPARAMS; } - box.left = Rect->left; - box.top = Rect->top; - box.right = Rect->right; - box.bottom = Rect->bottom; + box.left = rect->left; + box.top = rect->top; + box.right = rect->right; + box.bottom = rect->bottom; box.front = 0; box.back = 1; } - if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - hr = ddraw_surface_update_frontbuffer(This, Rect, TRUE); + if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(surface, rect, TRUE); if (SUCCEEDED(hr)) - hr = wined3d_surface_map(This->wined3d_surface, &map_desc, Rect ? &box : NULL, Flags); + hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), + surface->sub_resource_idx, &map_desc, rect ? &box : NULL, flags); if (FAILED(hr)) { wined3d_mutex_unlock(); @@ -1013,22 +1002,23 @@ } } - if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { - if (Flags & DDLOCK_READONLY) - memset(&This->ddraw->primary_lock, 0, sizeof(This->ddraw->primary_lock)); - else if (Rect) - This->ddraw->primary_lock = *Rect; + if (flags & DDLOCK_READONLY) + memset(&surface->ddraw->primary_lock, 0, sizeof(surface->ddraw->primary_lock)); + else if (rect) + surface->ddraw->primary_lock = *rect; else - SetRect(&This->ddraw->primary_lock, 0, 0, This->surface_desc.dwWidth, This->surface_desc.dwHeight); + SetRect(&surface->ddraw->primary_lock, 0, 0, surface->surface_desc.dwWidth, surface->surface_desc.dwHeight); } /* Windows does not set DDSD_LPSURFACE on locked surfaces. */ - DD_STRUCT_COPY_BYSIZE(DDSD,&(This->surface_desc)); - DDSD->lpSurface = map_desc.data; + DD_STRUCT_COPY_BYSIZE(surface_desc, &surface->surface_desc); + surface_desc->lpSurface = map_desc.data; TRACE("locked surface returning description :\n"); - if (TRACE_ON(ddraw)) DDRAW_dump_surface_desc(DDSD); + if (TRACE_ON(ddraw)) + DDRAW_dump_surface_desc(surface_desc); wined3d_mutex_unlock(); @@ -1169,7 +1159,7 @@ TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); wined3d_mutex_lock(); - hr = wined3d_surface_unmap(surface->wined3d_surface); + hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); if (SUCCEEDED(hr) && surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(surface, &surface->ddraw->primary_lock, FALSE); wined3d_mutex_unlock(); @@ -1248,6 +1238,8 @@ tmp_rtv = ddraw_surface_get_rendertarget_view(dst_impl); tmp = dst_impl->wined3d_surface; + if (dst_impl->sub_resource_idx) + ERR("Invalid sub-resource index %u on surface %p.\n", dst_impl->sub_resource_idx, dst_impl); texture = dst_impl->wined3d_texture; rtv = wined3d_device_get_rendertarget_view(dst_impl->ddraw->wined3d_device, 0); ddraw_texture = wined3d_texture_get_parent(dst_impl->wined3d_texture); @@ -1276,10 +1268,12 @@ wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); dst_impl->wined3d_rtv = src_rtv; - wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); + wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); dst_impl->wined3d_surface = src_impl->wined3d_surface; prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); + if (src_impl->sub_resource_idx) + ERR("Invalid sub-resource index %u on surface %p.\n", src_impl->sub_resource_idx, src_impl); dst_impl->wined3d_texture = src_impl->wined3d_texture; ddraw_texture = prev_ddraw_texture; } @@ -1306,11 +1300,13 @@ wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); dst_impl->wined3d_rtv = src_rtv; - wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); + wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); dst_impl->wined3d_surface = src_impl->wined3d_surface; prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); ddraw_texture = prev_ddraw_texture; + if (src_impl->sub_resource_idx) + ERR("Invalid sub-resource index %u on surface %p.\n", src_impl->sub_resource_idx, src_impl); dst_impl->wined3d_texture = src_impl->wined3d_texture; dst_impl = src_impl; } @@ -1322,7 +1318,7 @@ wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, tmp_rtv, FALSE); wined3d_rendertarget_view_set_parent(tmp_rtv, src_impl); src_impl->wined3d_rtv = tmp_rtv; - wined3d_resource_set_parent(wined3d_surface_get_resource(tmp), src_impl); + wined3d_resource_set_parent(wined3d_texture_get_sub_resource(texture, 0), src_impl); src_impl->wined3d_surface = tmp; wined3d_resource_set_parent(wined3d_texture_get_resource(texture), ddraw_texture); src_impl->wined3d_texture = texture; @@ -1398,7 +1394,8 @@ struct ddraw_surface *src_surface, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { - struct wined3d_surface *wined3d_src_surface = src_surface ? src_surface->wined3d_surface : NULL; + struct wined3d_texture *wined3d_src_texture; + unsigned int src_sub_resource_idx; RECT src_rect, dst_rect; float scale_x, scale_y; const RECT *clip_rect; @@ -1407,19 +1404,6 @@ HRESULT hr = DD_OK; UINT i; - if (!dst_surface->clipper) - { - if (src_surface && src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - hr = ddraw_surface_update_frontbuffer(src_surface, src_rect_in, TRUE); - if (SUCCEEDED(hr)) - hr = wined3d_surface_blt(dst_surface->wined3d_surface, dst_rect_in, - wined3d_src_surface, src_rect_in, flags, fx, filter); - if (SUCCEEDED(hr) && (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) - hr = ddraw_surface_update_frontbuffer(dst_surface, dst_rect_in, FALSE); - - return hr; - } - if (!dst_rect_in) { dst_rect.left = 0; @@ -1451,10 +1435,28 @@ if (IsRectEmpty(&src_rect)) return DDERR_INVALIDRECT; + + wined3d_src_texture = src_surface->wined3d_texture; + src_sub_resource_idx = src_surface->sub_resource_idx; } else { SetRect(&src_rect, 0, 0, 0, 0); + wined3d_src_texture = NULL; + src_sub_resource_idx = 0; + } + + if (!dst_surface->clipper) + { + if (src_surface && src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(src_surface, &src_rect, TRUE); + if (SUCCEEDED(hr)) + hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx, &dst_rect, + wined3d_src_texture, src_sub_resource_idx, &src_rect, flags, fx, filter); + if (SUCCEEDED(hr) && (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) + hr = ddraw_surface_update_frontbuffer(dst_surface, &dst_rect, FALSE); + + return hr; } scale_x = (float)(src_rect.right - src_rect.left) / (float)(dst_rect.right - dst_rect.left); @@ -1500,8 +1502,8 @@ } } - if (FAILED(hr = wined3d_surface_blt(dst_surface->wined3d_surface, &clip_rect[i], - wined3d_src_surface, &src_rect_clipped, flags, fx, filter))) + if (FAILED(hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx, + &clip_rect[i], wined3d_src_texture, src_sub_resource_idx, &src_rect_clipped, flags, fx, filter))) break; if (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) @@ -2120,7 +2122,7 @@ if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(surface, NULL, TRUE); if (SUCCEEDED(hr)) - hr = wined3d_surface_getdc(surface->wined3d_surface, hdc); + hr = wined3d_texture_get_dc(surface->wined3d_texture, surface->sub_resource_idx, hdc); if (SUCCEEDED(hr) && format_is_paletteindexed(&surface->surface_desc.u4.ddpfPixelFormat)) { @@ -2208,7 +2210,7 @@ TRACE("iface %p, dc %p.\n", iface, hdc); wined3d_mutex_lock(); - hr = wined3d_surface_releasedc(surface->wined3d_surface, hdc); + hr = wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, hdc); if (SUCCEEDED(hr) && (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) hr = ddraw_surface_update_frontbuffer(surface, NULL, FALSE); wined3d_mutex_unlock(); @@ -4030,13 +4032,6 @@ return DDERR_INVALIDOBJECT; } - if (!surface->wined3d_texture) - { - ERR("The ddraw surface has no wined3d texture.\n"); - wined3d_mutex_unlock(); - return DDERR_INVALIDOBJECT; - } - hr = wined3d_texture_set_lod(surface->wined3d_texture, MaxLOD); wined3d_mutex_unlock(); @@ -4096,44 +4091,38 @@ * For more details, see IWineD3DSurface::BltFast * *****************************************************************************/ -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD dstx, DWORD dsty, - IDirectDrawSurface7 *Source, RECT *rsrc, DWORD trans) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, + DWORD dst_x, DWORD dst_y, IDirectDrawSurface7 *src_surface, RECT *src_rect, DWORD trans) { - struct ddraw_surface *This = impl_from_IDirectDrawSurface7(iface); - struct ddraw_surface *src = unsafe_impl_from_IDirectDrawSurface7(Source); + struct ddraw_surface *dst_impl = impl_from_IDirectDrawSurface7(iface); + struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface7(src_surface); DWORD src_w, src_h, dst_w, dst_h; HRESULT hr = DD_OK; + RECT dst_rect, s; DWORD flags = 0; - RECT dst_rect; TRACE("iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.\n", - iface, dstx, dsty, Source, wine_dbgstr_rect(rsrc), trans); + iface, dst_x, dst_y, src_surface, wine_dbgstr_rect(src_rect), trans); - dst_w = This->surface_desc.dwWidth; - dst_h = This->surface_desc.dwHeight; + dst_w = dst_impl->surface_desc.dwWidth; + dst_h = dst_impl->surface_desc.dwHeight; - /* Source must be != NULL, This is not checked by windows. Windows happily throws a 0xc0000005 - * in that case - */ - if(rsrc) - { - src_w = rsrc->right - rsrc->left; - src_h = rsrc->bottom - rsrc->top; - } - else + if (!src_rect) { - src_w = src->surface_desc.dwWidth; - src_h = src->surface_desc.dwHeight; + SetRect(&s, 0, 0, src_impl->surface_desc.dwWidth, src_impl->surface_desc.dwHeight); + src_rect = &s; } - if (src_w > dst_w || dstx > dst_w - src_w - || src_h > dst_h || dsty > dst_h - src_h) + src_w = src_rect->right - src_rect->left; + src_h = src_rect->bottom - src_rect->top; + if (src_w > dst_w || dst_x > dst_w - src_w + || src_h > dst_h || dst_y > dst_h - src_h) { WARN("Destination area out of bounds, returning DDERR_INVALIDRECT.\n"); return DDERR_INVALIDRECT; } - SetRect(&dst_rect, dstx, dsty, dstx + src_w, dsty + src_h); + SetRect(&dst_rect, dst_x, dst_y, dst_x + src_w, dst_y + src_h); if (trans & DDBLTFAST_SRCCOLORKEY) flags |= WINEDDBLT_KEYSRC; if (trans & DDBLTFAST_DESTCOLORKEY) @@ -4144,20 +4133,20 @@ flags |= WINEDDBLT_DONOTWAIT; wined3d_mutex_lock(); - if (This->clipper) + if (dst_impl->clipper) { wined3d_mutex_unlock(); WARN("Destination surface has a clipper set, returning DDERR_BLTFASTCANTCLIP.\n"); return DDERR_BLTFASTCANTCLIP; } - if (src->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - hr = ddraw_surface_update_frontbuffer(src, rsrc, TRUE); + if (src_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(src_impl, src_rect, TRUE); if (SUCCEEDED(hr)) - hr = wined3d_surface_blt(This->wined3d_surface, &dst_rect, - src->wined3d_surface, rsrc, flags, NULL, WINED3D_TEXF_POINT); - if (SUCCEEDED(hr) && (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) - hr = ddraw_surface_update_frontbuffer(This, &dst_rect, FALSE); + hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect, + src_impl->wined3d_texture, src_impl->sub_resource_idx, src_rect, flags, NULL, WINED3D_TEXF_POINT); + if (SUCCEEDED(hr) && (dst_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) + hr = ddraw_surface_update_frontbuffer(dst_impl, &dst_rect, FALSE); wined3d_mutex_unlock(); switch(hr) @@ -4706,7 +4695,7 @@ } } - if (surface->wined3d_texture) + if (surface->is_complex_root) hr = wined3d_texture_set_color_key(surface->wined3d_texture, flags, color_key ? (struct wined3d_color_key *)&fixed_color_key : NULL); @@ -5072,6 +5061,7 @@ { struct ddraw_surface *dst_surface = impl_from_IDirect3DTexture2(iface); struct ddraw_surface *src_surface = unsafe_impl_from_IDirect3DTexture2(src_texture); + struct wined3d_resource *dst_resource, *src_resource; HRESULT hr; TRACE("iface %p, src_texture %p.\n", iface, src_texture); @@ -5084,6 +5074,9 @@ wined3d_mutex_lock(); + dst_resource = wined3d_texture_get_resource(dst_surface->wined3d_texture); + src_resource = wined3d_texture_get_resource(src_surface->wined3d_texture); + if (((src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) != (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)) || (src_surface->surface_desc.u2.dwMipMapCount != dst_surface->surface_desc.u2.dwMipMapCount)) @@ -5141,22 +5134,19 @@ DDCKEY_SRCBLT, &src_desc->ddckCKSrcBlt); } - /* Copy the main memory texture into the surface that corresponds - * to the OpenGL texture object. */ - - hr = wined3d_surface_map(src_surface->wined3d_surface, &src_map_desc, NULL, 0); - if (FAILED(hr)) + if (FAILED(hr = wined3d_resource_map(src_resource, + src_surface->sub_resource_idx, &src_map_desc, NULL, 0))) { ERR("Failed to lock source surface, hr %#x.\n", hr); wined3d_mutex_unlock(); return D3DERR_TEXTURE_LOAD_FAILED; } - hr = wined3d_surface_map(dst_surface->wined3d_surface, &dst_map_desc, NULL, 0); - if (FAILED(hr)) + if (FAILED(hr = wined3d_resource_map(dst_resource, + dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0))) { ERR("Failed to lock destination surface, hr %#x.\n", hr); - wined3d_surface_unmap(src_surface->wined3d_surface); + wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx); wined3d_mutex_unlock(); return D3DERR_TEXTURE_LOAD_FAILED; } @@ -5166,8 +5156,8 @@ else memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight); - wined3d_surface_unmap(src_surface->wined3d_surface); - wined3d_surface_unmap(dst_surface->wined3d_surface); + wined3d_resource_unmap(dst_resource, dst_surface->sub_resource_idx); + wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx); } if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) @@ -5653,15 +5643,16 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) { + struct wined3d_resource_desc wined3d_desc, wined3d_mip_desc; struct ddraw_surface *root, *mip, **attach; - struct wined3d_resource_desc wined3d_desc; struct wined3d_texture *wined3d_texture; struct wined3d_resource *resource; struct wined3d_display_mode mode; DDSURFACEDESC2 *desc, *mip_desc; struct ddraw_texture *texture; - UINT layers, levels, i, j; + unsigned int layers = 1; unsigned int pitch = 0; + UINT levels, i, j; HRESULT hr; TRACE("ddraw %p, surface_desc %p, surface %p, outer_unknown %p, version %u.\n", @@ -5733,9 +5724,10 @@ return DDERR_INVALIDCAPS; } - if ((desc->ddsCaps.dwCaps & DDSCAPS_MIPMAP) && !(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) + if ((desc->ddsCaps.dwCaps & (DDSCAPS_ALLOCONLOAD | DDSCAPS_MIPMAP)) + && !(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) { - WARN("DDSCAPS_MIPMAP requested without DDSCAPS_TEXTURE.\n"); + WARN("Caps %#x require DDSCAPS_TEXTURE.\n", desc->ddsCaps.dwCaps); HeapFree(GetProcessHeap(), 0, texture); return DDERR_INVALIDCAPS; } @@ -5792,6 +5784,7 @@ ddrawformat_from_wined3dformat(&desc->u4.ddpfPixelFormat, mode.format_id); } + wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; wined3d_desc.format = wined3dformat_from_ddrawformat(&desc->u4.ddpfPixelFormat); if (wined3d_desc.format == WINED3DFMT_UNKNOWN) { @@ -5907,9 +5900,12 @@ DWORD usage = 0; if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) - rtype = WINED3D_RTYPE_CUBE_TEXTURE; + { + usage |= WINED3DUSAGE_LEGACY_CUBEMAP; + rtype = WINED3D_RTYPE_TEXTURE_2D; + } else if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE) - rtype = WINED3D_RTYPE_TEXTURE; + rtype = WINED3D_RTYPE_TEXTURE_2D; else rtype = WINED3D_RTYPE_SURFACE; @@ -5968,10 +5964,6 @@ } } - /* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE - * field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */ - if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface) - desc->dwFlags &= ~DDSD_LPSURFACE; if (desc->dwFlags & DDSD_LPSURFACE) { if (wined3d_desc.pool != WINED3D_POOL_SYSTEM_MEM) @@ -5988,6 +5980,13 @@ return DDERR_INVALIDPARAMS; } + if (!desc->lpSurface) + { + WARN("NULL surface memory pointer specified.\n"); + HeapFree(GetProcessHeap(), 0, texture); + return DDERR_INVALIDPARAMS; + } + if (format_is_compressed(&desc->u4.ddpfPixelFormat)) { if (version != 4 && (desc->dwFlags & DDSD_PITCH)) @@ -6056,23 +6055,18 @@ if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) { - wined3d_desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; + wined3d_desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP; layers = 6; } - else - { - wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE; - layers = 1; - } /* Some applications assume surfaces will always be mapped at the same * address. Some of those also assume that this address is valid even when * the surface isn't mapped, and that updates done this way will be * visible on the screen. The game Nox is such an application, * Commandos: Behind Enemy Lines is another. We set - * WINED3D_SURFACE_PIN_SYSMEM because of this. */ + * WINED3D_TEXTURE_CREATE_PIN_SYSMEM because of this. */ if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &wined3d_desc, levels, - WINED3D_SURFACE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) + WINED3D_TEXTURE_CREATE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) { WARN("Failed to create wined3d texture, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, texture); @@ -6081,7 +6075,7 @@ resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); root = wined3d_resource_get_parent(resource); - root->wined3d_texture = wined3d_texture; + wined3d_texture_decref(wined3d_texture); root->is_complex_root = TRUE; texture->root = root; @@ -6109,9 +6103,17 @@ mip_desc = &mip->surface_desc; if (j) + { + wined3d_resource_get_desc(resource, &wined3d_mip_desc); + mip_desc->dwWidth = wined3d_mip_desc.width; + mip_desc->dwHeight = wined3d_mip_desc.height; + mip_desc->ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL; + } else + { mip_desc->ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL; + } if (mip_desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) { @@ -6184,7 +6186,8 @@ desc->u5.dwBackBufferCount = 0; if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &wined3d_desc, 1, - WINED3D_SURFACE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) + WINED3D_TEXTURE_CREATE_PIN_SYSMEM, NULL, texture, + &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) { HeapFree(GetProcessHeap(), 0, texture); hr = hr_ddraw_from_wined3d(hr); @@ -6193,7 +6196,7 @@ resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); last = wined3d_resource_get_parent(resource); - last->wined3d_texture = wined3d_texture; + wined3d_texture_decref(wined3d_texture); texture->root = last; if (desc->dwFlags & DDSD_CKDESTOVERLAY) @@ -6232,11 +6235,12 @@ return hr; } -void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture, +void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) { + struct ddraw_texture *texture = wined3d_texture_get_parent(wined3d_texture); DDSURFACEDESC2 *desc = &surface->surface_desc; - struct wined3d_resource_desc wined3d_desc; unsigned int version = texture->version; surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl; @@ -6268,9 +6272,6 @@ } *desc = texture->surface_desc; - wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc); - desc->dwWidth = wined3d_desc.width; - desc->dwHeight = wined3d_desc.height; surface->first_attached = surface; if (format_is_compressed(&desc->u4.ddpfPixelFormat)) @@ -6291,8 +6292,9 @@ } desc->lpSurface = NULL; - wined3d_surface_incref(wined3d_surface); surface->wined3d_surface = wined3d_surface; + wined3d_texture_incref(surface->wined3d_texture = wined3d_texture); + surface->sub_resource_idx = sub_resource_idx; *parent_ops = &ddraw_surface_wined3d_parent_ops; wined3d_private_store_init(&surface->private_store); @@ -6326,8 +6328,8 @@ if (surface->wined3d_rtv) return surface->wined3d_rtv; - if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface, - surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv))) + if (FAILED(hr = wined3d_rendertarget_view_create_from_sub_resource(surface->wined3d_texture, + surface->sub_resource_idx, surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv))) { ERR("Failed to create rendertarget view, hr %#x.\n", hr); return NULL; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw1.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw1.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw1.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw1.c 2016-02-08 19:32:34.000000000 +0000 @@ -22,6 +22,7 @@ #include "wine/test.h" #include "d3d.h" +static BOOL is_ddraw64 = sizeof(DWORD) != sizeof(DWORD *); static DEVMODEW registry_mode; struct create_window_thread_param @@ -4886,7 +4887,7 @@ static const struct { - DWORD placement; + DWORD caps; DWORD flags_in; DWORD pitch_in; HRESULT hr; @@ -4896,26 +4897,58 @@ } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, - 0, 0, 0 }, + /* 0 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + /* 5 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + /* 10 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + /* 15 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; @@ -4933,11 +4966,10 @@ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; - surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; + surface_desc.ddsCaps.dwCaps = test_data[i].caps; surface_desc.dwWidth = 63; surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; - surface_desc.lpSurface = mem; surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; @@ -4945,8 +4977,16 @@ U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == test_data[i].hr || (test_data[i].placement == DDSCAPS_VIDEOMEMORY && hr == DDERR_NODIRECTDRAWHW), - "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + if (test_data[i].flags_in & DDSD_LPSURFACE) + { + HRESULT expected_hr = SUCCEEDED(test_data[i].hr) ? DDERR_INVALIDPARAMS : test_data[i].hr; + ok(hr == expected_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, expected_hr); + surface_desc.lpSurface = mem; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + } + if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) + continue; + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; @@ -4957,14 +4997,17 @@ ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) - todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out64); - else - ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + if (!(test_data[i].caps & DDSCAPS_TEXTURE)) + { + if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface); IDirectDrawSurface_Release(surface); @@ -8010,6 +8053,153 @@ DestroyWindow(window); } +static void test_lockrect_invalid(void) +{ + unsigned int i, r; + IDirectDraw *ddraw; + IDirectDrawSurface *surface; + HWND window; + HRESULT hr; + DDSURFACEDESC surface_desc; + DDCAPS hal_caps; + DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; + static RECT valid[] = + { + {60, 60, 68, 68}, + {60, 60, 60, 68}, + {60, 60, 68, 60}, + {120, 60, 128, 68}, + {60, 120, 68, 128}, + }; + static RECT invalid[] = + { + {68, 60, 60, 68}, /* left > right */ + {60, 68, 68, 60}, /* top > bottom */ + {-8, 60, 0, 68}, /* left < surface */ + {60, -8, 68, 0}, /* top < surface */ + {-16, 60, -8, 68}, /* right < surface */ + {60, -16, 68, -8}, /* bottom < surface */ + {60, 60, 136, 68}, /* right > surface */ + {60, 60, 68, 136}, /* bottom > surface */ + {136, 60, 144, 68}, /* left > surface */ + {60, 136, 68, 144}, /* top > surface */ + }; + static const struct + { + DWORD caps; + const char *name; + HRESULT hr; + } + resources[] = + { + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, "sysmem texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, "vidmem texture", DDERR_INVALIDPARAMS}, + }; + + 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 = IDirectDraw_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 = IDirectDraw_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) + { + skip("Required surface types not supported, skipping test.\n"); + goto done; + } + + for (r = 0; r < sizeof(resources) / sizeof(*resources); ++r) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = resources[r].caps; + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; + U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xff0000; + U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x00ff00; + U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000ff; + + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + + for (i = 0; i < sizeof(valid) / sizeof(*valid); ++i) + { + RECT *rect = &valid[i]; + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock failed (%#x) for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + + hr = IDirectDrawSurface_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + + for (i = 0; i < sizeof(invalid) / sizeof(*invalid); ++i) + { + RECT *rect = &invalid[i]; + + memset(&surface_desc, 1, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + if (SUCCEEDED(hr)) + { + hr = IDirectDrawSurface_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + else + ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); + } + + hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + hr = IDirectDrawSurface_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + + /* Locking a different rectangle returns DD_OK, but it seems to break the surface. + * Afterwards unlocking the surface fails(NULL rectangle or both locked rectangles) */ + + hr = IDirectDrawSurface_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + IDirectDrawSurface_Release(surface); + } + +done: + IDirectDraw_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw1) { IDirectDraw *ddraw; @@ -8082,4 +8272,5 @@ test_colorkey_precision(); test_range_colorkey(); test_shademode(); + test_lockrect_invalid(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw2.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw2.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw2.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw2.c 2016-02-08 19:32:34.000000000 +0000 @@ -24,6 +24,7 @@ #include "wine/test.h" #include "d3d.h" +static BOOL is_ddraw64 = sizeof(DWORD) != sizeof(DWORD *); static DEVMODEW registry_mode; struct create_window_thread_param @@ -5928,7 +5929,7 @@ static const struct { - DWORD placement; + DWORD caps; DWORD flags_in; DWORD pitch_in; HRESULT hr; @@ -5938,26 +5939,58 @@ } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, - 0, 0, 0 }, + /* 0 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + /* 5 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + /* 10 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + /* 15 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; @@ -5975,11 +6008,10 @@ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; - surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; + surface_desc.ddsCaps.dwCaps = test_data[i].caps; surface_desc.dwWidth = 63; surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; - surface_desc.lpSurface = mem; surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; @@ -5987,8 +6019,16 @@ U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == test_data[i].hr || (test_data[i].placement == DDSCAPS_VIDEOMEMORY && hr == DDERR_NODIRECTDRAWHW), - "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + if (test_data[i].flags_in & DDSD_LPSURFACE) + { + HRESULT expected_hr = SUCCEEDED(test_data[i].hr) ? DDERR_INVALIDPARAMS : test_data[i].hr; + ok(hr == expected_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, expected_hr); + surface_desc.lpSurface = mem; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + } + if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) + continue; + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; @@ -5999,14 +6039,18 @@ ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) - todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out64); - else - ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + /* The pitch for textures seems to be implementation specific. */ + if (!(test_data[i].caps & DDSCAPS_TEXTURE)) + { + if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface); IDirectDrawSurface_Release(surface); @@ -9112,6 +9156,157 @@ DestroyWindow(window); } +static void test_lockrect_invalid(void) +{ + unsigned int i, r; + IDirectDraw2 *ddraw; + IDirectDrawSurface *surface1; + IDirectDrawSurface2 *surface; + HWND window; + HRESULT hr; + DDSURFACEDESC surface_desc; + DDCAPS hal_caps; + DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; + static RECT valid[] = + { + {60, 60, 68, 68}, + {60, 60, 60, 68}, + {60, 60, 68, 60}, + {120, 60, 128, 68}, + {60, 120, 68, 128}, + }; + static RECT invalid[] = + { + {68, 60, 60, 68}, /* left > right */ + {60, 68, 68, 60}, /* top > bottom */ + {-8, 60, 0, 68}, /* left < surface */ + {60, -8, 68, 0}, /* top < surface */ + {-16, 60, -8, 68}, /* right < surface */ + {60, -16, 68, -8}, /* bottom < surface */ + {60, 60, 136, 68}, /* right > surface */ + {60, 60, 68, 136}, /* bottom > surface */ + {136, 60, 144, 68}, /* left > surface */ + {60, 136, 68, 144}, /* top > surface */ + }; + static const struct + { + DWORD caps; + const char *name; + HRESULT hr; + } + resources[] = + { + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, "sysmem texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, "vidmem texture", DDERR_INVALIDPARAMS}, + }; + + 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 = IDirectDraw2_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 = IDirectDraw2_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) + { + skip("Required surface types not supported, skipping test.\n"); + goto done; + } + + for (r = 0; r < sizeof(resources) / sizeof(*resources); ++r) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = resources[r].caps; + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; + U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xff0000; + U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x00ff00; + U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000ff; + + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name); + hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); + ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface2 interface, hr %#x.\n", hr); + IDirectDrawSurface_Release(surface1); + + hr = IDirectDrawSurface2_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + + for (i = 0; i < sizeof(valid) / sizeof(*valid); ++i) + { + RECT *rect = &valid[i]; + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface2_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock failed (%#x) for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + + hr = IDirectDrawSurface2_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + + for (i = 0; i < sizeof(invalid) / sizeof(*invalid); ++i) + { + RECT *rect = &invalid[i]; + + memset(&surface_desc, 1, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface2_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + if (SUCCEEDED(hr)) + { + hr = IDirectDrawSurface2_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + else + ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); + } + + hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface2_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface2_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + hr = IDirectDrawSurface2_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + + /* Locking a different rectangle returns DD_OK, but it seems to break the surface. + * Afterwards unlocking the surface fails(NULL rectangle or both locked rectangles) */ + + hr = IDirectDrawSurface2_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + IDirectDrawSurface2_Release(surface); + } + +done: + IDirectDraw2_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw2) { IDirectDraw2 *ddraw; @@ -9191,4 +9386,5 @@ test_colorkey_precision(); test_range_colorkey(); test_shademode(); + test_lockrect_invalid(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw4.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw4.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw4.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw4.c 2016-02-08 19:32:34.000000000 +0000 @@ -24,6 +24,7 @@ #include #include "d3d.h" +static BOOL is_ddraw64 = sizeof(DWORD) != sizeof(DWORD *); static DEVMODEW registry_mode; struct vec2 @@ -7449,7 +7450,7 @@ static const struct { - DWORD placement; + DWORD caps; DWORD flags_in; DWORD pitch_in; HRESULT hr; @@ -7459,38 +7460,77 @@ } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, - DDSD_PITCH, 0x0fc, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, - DDSD_PITCH, 0x100, 0x100}, + /* 0 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + /* 5 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + /* 10 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + /* 15 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + /* 20 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; @@ -7508,11 +7548,10 @@ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; - surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; + surface_desc.ddsCaps.dwCaps = test_data[i].caps; surface_desc.dwWidth = 63; surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; - surface_desc.lpSurface = mem; U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; @@ -7520,8 +7559,16 @@ U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == test_data[i].hr || (test_data[i].placement == DDSCAPS_VIDEOMEMORY && hr == DDERR_NODIRECTDRAWHW), - "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + if (test_data[i].flags_in & DDSD_LPSURFACE) + { + HRESULT expected_hr = SUCCEEDED(test_data[i].hr) ? DDERR_INVALIDPARAMS : test_data[i].hr; + ok(hr == expected_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, expected_hr); + surface_desc.lpSurface = mem; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + } + if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) + continue; + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; @@ -7532,14 +7579,18 @@ ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) - todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out64); - else - ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + /* The pitch for textures seems to be implementation specific. */ + if (!(test_data[i].caps & DDSCAPS_TEXTURE)) + { + if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface); IDirectDrawSurface4_Release(surface); @@ -10281,6 +10332,156 @@ DestroyWindow(window); } +static void test_lockrect_invalid(void) +{ + unsigned int i, r; + IDirectDraw4 *ddraw; + IDirectDrawSurface4 *surface; + HWND window; + HRESULT hr; + DDSURFACEDESC2 surface_desc; + DDCAPS hal_caps; + DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; + static RECT valid[] = + { + {60, 60, 68, 68}, + {60, 60, 60, 68}, + {60, 60, 68, 60}, + {120, 60, 128, 68}, + {60, 120, 68, 128}, + }; + static RECT invalid[] = + { + {68, 60, 60, 68}, /* left > right */ + {60, 68, 68, 60}, /* top > bottom */ + {-8, 60, 0, 68}, /* left < surface */ + {60, -8, 68, 0}, /* top < surface */ + {-16, 60, -8, 68}, /* right < surface */ + {60, -16, 68, -8}, /* bottom < surface */ + {60, 60, 136, 68}, /* right > surface */ + {60, 60, 68, 136}, /* bottom > surface */ + {136, 60, 144, 68}, /* left > surface */ + {60, 136, 68, 144}, /* top > surface */ + }; + static const struct + { + DWORD caps, caps2; + const char *name; + HRESULT hr; + } + resources[] = + { + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", DDERR_INVALIDPARAMS}, + }; + + 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 = IDirectDraw4_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 = IDirectDraw4_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 (r = 0; r < sizeof(resources) / sizeof(*resources); ++r) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = resources[r].caps; + surface_desc.ddsCaps.dwCaps2 = resources[r].caps2; + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0xff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x00ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000ff; + + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface4_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + + for (i = 0; i < sizeof(valid) / sizeof(*valid); ++i) + { + RECT *rect = &valid[i]; + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface4_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock failed (%#x) for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + + hr = IDirectDrawSurface4_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + + for (i = 0; i < sizeof(invalid) / sizeof(*invalid); ++i) + { + RECT *rect = &invalid[i]; + + memset(&surface_desc, 1, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + + hr = IDirectDrawSurface4_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + if (SUCCEEDED(hr)) + { + hr = IDirectDrawSurface4_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + else + ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); + } + + hr = IDirectDrawSurface4_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface4_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface4_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface4_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + hr = IDirectDrawSurface4_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + + /* Locking a different rectangle returns DD_OK, but it seems to break the surface. + * Afterwards unlocking the surface fails(NULL rectangle or both locked rectangles) */ + + hr = IDirectDrawSurface4_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + IDirectDrawSurface4_Release(surface); + } + +done: + IDirectDraw4_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw4) { IDirectDraw4 *ddraw; @@ -10367,4 +10568,5 @@ test_colorkey_precision(); test_range_colorkey(); test_shademode(); + test_lockrect_invalid(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw7.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw7.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/ddraw7.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/ddraw7.c 2016-02-08 19:32:34.000000000 +0000 @@ -7298,7 +7298,7 @@ static const struct { - DWORD placement; + DWORD caps; DWORD flags_in; DWORD pitch_in; HRESULT hr; @@ -7308,38 +7308,77 @@ } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, - DDSD_PITCH, 0x100, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, - DDSD_PITCH, 0x100, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, - DDSD_PITCH, 0x0fc, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, - 0, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, - DDSD_PITCH, 0x100, 0x100}, + /* 0 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + /* 5 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + /* 10 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + /* 15 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, + DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + /* 20 */ + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, + DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; @@ -7357,11 +7396,10 @@ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; - surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; + surface_desc.ddsCaps.dwCaps = test_data[i].caps; surface_desc.dwWidth = 63; surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; - surface_desc.lpSurface = mem; U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; @@ -7369,8 +7407,19 @@ U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == test_data[i].hr || (test_data[i].placement == DDSCAPS_VIDEOMEMORY && hr == DDERR_NODIRECTDRAWHW), - "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + if (test_data[i].flags_in & DDSD_LPSURFACE) + { + HRESULT expected_hr = SUCCEEDED(test_data[i].hr) ? DDERR_INVALIDPARAMS : test_data[i].hr; + ok(hr == expected_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, expected_hr); + surface_desc.lpSurface = mem; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + } + if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) + continue; + if (is_ddraw64 && (test_data[i].caps & DDSCAPS_TEXTURE) && SUCCEEDED(test_data[i].hr)) + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr); + else + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; @@ -7381,14 +7430,18 @@ ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) - todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out64); - else - ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + /* The pitch for textures seems to be implementation specific. */ + if (!(test_data[i].caps & DDSCAPS_TEXTURE)) + { + if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); + } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface); IDirectDrawSurface7_Release(surface); @@ -10544,6 +10597,170 @@ DestroyWindow(window); } +static void test_lockrect_invalid(void) +{ + unsigned int i, r; + IDirectDraw7 *ddraw; + IDirectDrawSurface7 *surface; + HWND window; + HRESULT hr; + DDSURFACEDESC2 surface_desc; + DDSURFACEDESC2 locked_desc; + DDCAPS hal_caps; + DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; + static RECT valid[] = + { + {60, 60, 68, 68}, + {60, 60, 60, 68}, + {60, 60, 68, 60}, + {120, 60, 128, 68}, + {60, 120, 68, 128}, + }; + static RECT invalid[] = + { + {68, 60, 60, 68}, /* left > right */ + {60, 68, 68, 60}, /* top > bottom */ + {-8, 60, 0, 68}, /* left < surface */ + {60, -8, 68, 0}, /* top < surface */ + {-16, 60, -8, 68}, /* right < surface */ + {60, -16, 68, -8}, /* bottom < surface */ + {60, 60, 136, 68}, /* right > surface */ + {60, 60, 68, 136}, /* bottom > surface */ + {136, 60, 144, 68}, /* left > surface */ + {60, 136, 68, 144}, /* top > surface */ + }; + static const struct + { + DWORD caps, caps2; + const char *name; + HRESULT hr; + } + resources[] = + { + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", DD_OK}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", DD_OK}, + }; + + 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 (r = 0; r < sizeof(resources) / sizeof(*resources); ++r) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = resources[r].caps; + surface_desc.ddsCaps.dwCaps2 = resources[r].caps2; + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0xff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x00ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000ff; + + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + if (is_ddraw64 && (resources[r].caps & DDSCAPS_TEXTURE)) + { + todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + if (SUCCEEDED(hr)) + IDirectDrawSurface7_Release(surface); + continue; + } + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name); + + /* Crashes in ddraw7 + hr = IDirectDrawSurface7_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + */ + + for (i = 0; i < sizeof(valid) / sizeof(*valid); ++i) + { + RECT *rect = &valid[i]; + + memset(&locked_desc, 0, sizeof(locked_desc)); + locked_desc.dwSize = sizeof(locked_desc); + + hr = IDirectDrawSurface7_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock failed (%#x) for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + + hr = IDirectDrawSurface7_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + + for (i = 0; i < sizeof(invalid) / sizeof(*invalid); ++i) + { + RECT *rect = &invalid[i]; + + memset(&locked_desc, 1, sizeof(locked_desc)); + locked_desc.dwSize = sizeof(locked_desc); + + hr = IDirectDrawSurface7_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL); + if (SUCCEEDED(resources[r].hr)) + todo_wine ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + else + ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n", + hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name); + if (SUCCEEDED(hr)) + { + hr = IDirectDrawSurface7_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + } + else + ok(!locked_desc.lpSurface, "Got unexpected lpSurface %p.\n", locked_desc.lpSurface); + } + + hr = IDirectDrawSurface7_Lock(surface, NULL, &locked_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface7_Lock(surface, NULL, &locked_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#x, type %s.\n", + hr, resources[r].name); + hr = IDirectDrawSurface7_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + hr = IDirectDrawSurface7_Lock(surface, &valid[0], &locked_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + hr = IDirectDrawSurface7_Lock(surface, &valid[0], &locked_desc, DDLOCK_WAIT, NULL); + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = [%d, %d]->[%d, %d]) failed (%#x).\n", + valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); + + /* Locking a different rectangle returns DD_OK, but it seems to break the surface. + * Afterwards unlocking the surface fails(NULL rectangle or both locked rectangles) */ + + hr = IDirectDrawSurface7_Unlock(surface, NULL); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + + IDirectDrawSurface7_Release(surface); + } + +done: + IDirectDraw7_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); @@ -10641,4 +10858,5 @@ test_colorkey_precision(); test_range_colorkey(); test_shademode(); + test_lockrect_invalid(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/dsurface.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/dsurface.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ddraw/tests/dsurface.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ddraw/tests/dsurface.c 2016-02-08 19:32:34.000000000 +0000 @@ -1208,126 +1208,6 @@ if (dd7) IDirectDraw7_Release(dd7); } -static void test_lockrect_invalid(void) -{ - unsigned int i, j; - - RECT valid[] = { - {60, 60, 68, 68}, - {60, 60, 60, 68}, - {60, 60, 68, 60}, - {120, 60, 128, 68}, - {60, 120, 68, 128}, - }; - - RECT invalid[] = { - {68, 60, 60, 68}, /* left > right */ - {60, 68, 68, 60}, /* top > bottom */ - {-8, 60, 0, 68}, /* left < surface */ - {60, -8, 68, 0}, /* top < surface */ - {-16, 60, -8, 68}, /* right < surface */ - {60, -16, 68, -8}, /* bottom < surface */ - {60, 60, 136, 68}, /* right > surface */ - {60, 60, 68, 136}, /* bottom > surface */ - {136, 60, 144, 68}, /* left > surface */ - {60, 136, 68, 144}, /* top > surface */ - }; - - const DWORD dds_caps[] = { - DDSCAPS_OFFSCREENPLAIN - }; - - for (j = 0; j < (sizeof(dds_caps) / sizeof(*dds_caps)); ++j) - { - IDirectDrawSurface *surface = 0; - DDSURFACEDESC surface_desc = {0}; - DDSURFACEDESC locked_desc = {0}; - HRESULT hr; - - surface_desc.dwSize = sizeof(surface_desc); - surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); - surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; - surface_desc.ddsCaps.dwCaps = dds_caps[j]; - surface_desc.dwWidth = 128; - surface_desc.dwHeight = 128; - surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; - U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; - U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xFF0000; - U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x00FF00; - U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000FF; - - hr = IDirectDraw_CreateSurface(lpDD, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "CreateSurface failed (0x%08x)\n", hr); - if (FAILED(hr)) - { - skip("failed to create surface\n"); - continue; - } - - hr = IDirectDrawSurface_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Lock returned 0x%08x for NULL DDSURFACEDESC," - " expected DDERR_INVALIDPARAMS (0x%08x)\n", hr, DDERR_INVALIDPARAMS); - - for (i = 0; i < (sizeof(valid) / sizeof(*valid)); ++i) - { - RECT *rect = &valid[i]; - - memset(&locked_desc, 0, sizeof(locked_desc)); - locked_desc.dwSize = sizeof(locked_desc); - - hr = IDirectDrawSurface_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Lock failed (0x%08x) for rect [%d, %d]->[%d, %d]\n", - hr, rect->left, rect->top, rect->right, rect->bottom); - - hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed (0x%08x)\n", hr); - } - - for (i = 0; i < (sizeof(invalid) / sizeof(*invalid)); ++i) - { - RECT *rect = &invalid[i]; - - memset(&locked_desc, 1, sizeof(locked_desc)); - locked_desc.dwSize = sizeof(locked_desc); - - hr = IDirectDrawSurface_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Lock returned 0x%08x for rect [%d, %d]->[%d, %d]" - ", expected DDERR_INVALIDPARAMS (0x%08x)\n", hr, rect->left, rect->top, - rect->right, rect->bottom, DDERR_INVALIDPARAMS); - ok(!locked_desc.lpSurface, "IDirectDrawSurface_Lock did not set lpSurface in the surface desc to zero.\n"); - } - - hr = IDirectDrawSurface_Lock(surface, NULL, &locked_desc, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "IDirectDrawSurface_Lock(rect = NULL) failed (0x%08x)\n", hr); - hr = IDirectDrawSurface_Lock(surface, NULL, &locked_desc, DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed (0x%08x)\n", hr); - } - hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed (0x%08x)\n", hr); - - memset(&locked_desc, 0, sizeof(locked_desc)); - locked_desc.dwSize = sizeof(locked_desc); - hr = IDirectDrawSurface_Lock(surface, &valid[0], &locked_desc, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "IDirectDrawSurface_Lock(rect = [%d, %d]->[%d, %d]) failed (0x%08x)\n", - valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); - hr = IDirectDrawSurface_Lock(surface, &valid[0], &locked_desc, DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = [%d, %d]->[%d, %d]) failed (0x%08x)\n", - valid[0].left, valid[0].top, valid[0].right, valid[0].bottom, hr); - - /* Locking a different rectangle returns DD_OK, but it seems to break the surface. - * Afterwards unlocking the surface fails(NULL rectangle, and both locked rectangles - */ - - hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DD_OK, "Unlock returned (0x%08x)\n", hr); - - IDirectDrawSurface_Release(surface); - } -} - static void CompressedTest(void) { HRESULT hr; @@ -3788,7 +3668,6 @@ GetDDInterface_7(); EnumTest(); CubeMapTest(); - test_lockrect_invalid(); CompressedTest(); SizeTest(); BltParamTest(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/analyzer.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/analyzer.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/analyzer.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/analyzer.c 2016-02-08 19:32:34.000000000 +0000 @@ -177,6 +177,11 @@ }; #undef _OT +const char *debugstr_sa_script(UINT16 script) +{ + return script < Script_LastId ? debugstr_an((char*)&dwritescripts_properties[script].props.isoScriptCode, 4): "not defined"; +} + struct dwrite_numbersubstitution { IDWriteNumberSubstitution IDWriteNumberSubstitution_iface; LONG ref; @@ -326,6 +331,12 @@ } } +BOOL lb_is_newline_char(WCHAR ch) +{ + short c = get_table_entry(wine_linebreak_table, ch); + return c == b_LF || c == b_NL || c == b_CR || c == b_BK; +} + static HRESULT analyze_linebreaks(const WCHAR *text, UINT32 count, DWRITE_LINE_BREAKPOINT *breakpoints) { struct linebreaking_state state; @@ -347,8 +358,8 @@ breakpoints[i].breakConditionBefore = DWRITE_BREAK_CONDITION_CAN_BREAK; breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_CAN_BREAK; - breakpoints[i].isWhitespace = break_class[i] == b_BK || break_class[i] == b_ZW || break_class[i] == b_SP || isspaceW(text[i]); - breakpoints[i].isSoftHyphen = FALSE; + breakpoints[i].isWhitespace = !!isspaceW(text[i]); + breakpoints[i].isSoftHyphen = text[i] == 0x00ad /* Unicode Soft Hyphen */; breakpoints[i].padding = 0; /* LB1 - resolve some classes. TODO: use external algorithms for these classes. */ @@ -522,15 +533,19 @@ case b_BB: set_break_condition(i, BreakConditionAfter, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, &state); break; - /* LB21a */ + /* LB21a, LB21b */ case b_HL: - if (i < count-2) + /* LB21a */ + if (i < count-1) switch (break_class[i+1]) { case b_HY: case b_BA: set_break_condition(i+1, BreakConditionAfter, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, &state); } + /* LB21b */ + if (i > 0 && break_class[i-1] == b_SY) + set_break_condition(i, BreakConditionBefore, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, &state); break; /* LB22 */ case b_IN: @@ -540,6 +555,7 @@ { case b_AL: case b_HL: + case b_EX: case b_ID: case b_IN: case b_NU: diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/dwrite_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/dwrite_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/dwrite_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/dwrite_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -99,6 +99,8 @@ m->dx, m->dy); } +const char *debugstr_sa_script(UINT16) DECLSPEC_HIDDEN; + static inline unsigned short get_table_entry(const unsigned short *table, WCHAR ch) { return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)]; @@ -139,6 +141,7 @@ extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE_FONT_FACE_TYPE,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT create_colorglyphenum(FLOAT,FLOAT,const DWRITE_GLYPH_RUN*,const DWRITE_GLYPH_RUN_DESCRIPTION*,DWRITE_MEASURING_MODE, const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN; +extern BOOL lb_is_newline_char(WCHAR) DECLSPEC_HIDDEN; /* Opentype font table functions */ struct dwrite_font_props { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/font.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/font.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/font.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/font.c 2016-02-08 19:32:34.000000000 +0000 @@ -1927,11 +1927,11 @@ family_data->fonts[family_data->font_count] = font_data; family_data->font_count++; if (font_data->style == DWRITE_FONT_STYLE_NORMAL) - family_data->has_normal_face = TRUE; + family_data->has_normal_face = 1; else if (font_data->style == DWRITE_FONT_STYLE_OBLIQUE) - family_data->has_oblique_face = TRUE; + family_data->has_oblique_face = 1; else - family_data->has_italic_face = TRUE; + family_data->has_italic_face = 1; return S_OK; } @@ -2733,8 +2733,8 @@ data->face_index = face_index; data->face_type = face_type; data->simulations = DWRITE_FONT_SIMULATIONS_NONE; - data->bold_sim_tested = FALSE; - data->oblique_sim_tested = FALSE; + data->bold_sim_tested = 0; + data->oblique_sim_tested = 0; IDWriteFontFile_AddRef(file); IDWriteFactory2_AddRef(factory); @@ -2811,9 +2811,9 @@ data->ref = 1; data->font_count = 0; data->font_alloc = 2; - data->has_normal_face = FALSE; - data->has_oblique_face = FALSE; - data->has_italic_face = FALSE; + data->has_normal_face = 0; + data->has_oblique_face = 0; + data->has_italic_face = 0; data->fonts = heap_alloc(sizeof(*data->fonts)*data->font_alloc); if (!data->fonts) { @@ -2839,7 +2839,7 @@ if (family->fonts[i]->bold_sim_tested) continue; - family->fonts[i]->bold_sim_tested = TRUE; + family->fonts[i]->bold_sim_tested = 1; for (j = i; j < family->font_count; j++) { if (family->fonts[j]->bold_sim_tested) continue; @@ -2850,7 +2850,7 @@ weight = family->fonts[j]->weight; heaviest = j; } - family->fonts[j]->bold_sim_tested = TRUE; + family->fonts[j]->bold_sim_tested = 1; } } @@ -2892,7 +2892,7 @@ strcatW(facenameW, boldW); if (init_font_data_from_font(family->fonts[heaviest], DWRITE_FONT_SIMULATIONS_BOLD, facenameW, &boldface) == S_OK) { - boldface->bold_sim_tested = TRUE; + boldface->bold_sim_tested = 1; fontfamily_add_font(family, boldface); } } @@ -2911,7 +2911,7 @@ if (family->fonts[i]->oblique_sim_tested) continue; - family->fonts[i]->oblique_sim_tested = TRUE; + family->fonts[i]->oblique_sim_tested = 1; if (family->fonts[i]->style == DWRITE_FONT_STYLE_NORMAL) regular = i; else if (family->fonts[i]->style == DWRITE_FONT_STYLE_OBLIQUE) @@ -2925,7 +2925,7 @@ if ((family->fonts[i]->weight == family->fonts[j]->weight) && (family->fonts[i]->stretch == family->fonts[j]->stretch)) { - family->fonts[j]->oblique_sim_tested = TRUE; + family->fonts[j]->oblique_sim_tested = 1; if (regular == ~0 && family->fonts[j]->style == DWRITE_FONT_STYLE_NORMAL) regular = j; @@ -2956,7 +2956,7 @@ strcatW(facenameW, obliqueW); if (init_font_data_from_font(family->fonts[regular], DWRITE_FONT_SIMULATIONS_OBLIQUE, facenameW, &obliqueface) == S_OK) { - obliqueface->oblique_sim_tested = TRUE; + obliqueface->oblique_sim_tested = 1; fontfamily_add_font(family, obliqueface); } } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/freetype.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/freetype.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/freetype.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/freetype.c 2016-02-08 19:32:34.000000000 +0000 @@ -32,7 +32,6 @@ #endif /* HAVE_FT2BUILD_H */ #include "windef.h" -#include "dwrite_2.h" #include "wine/library.h" #include "wine/debug.h" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/layout.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/layout.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/layout.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/layout.c 2016-02-08 19:32:34.000000000 +0000 @@ -196,15 +196,15 @@ struct layout_effective_inline { struct list entry; - IDWriteInlineObject *object; - IUnknown *effect; - FLOAT origin_x; - FLOAT origin_y; - FLOAT align_dx; - FLOAT width; - BOOL is_sideways; - BOOL is_rtl; - UINT32 line; + const struct layout_run *run; /* nominal run this one is based on */ + IUnknown *effect; /* original reference is kept only at range level */ + FLOAT origin_x; /* left X position */ + FLOAT origin_y; /* left top corner Y position */ + FLOAT align_dx; /* adjustment from text alignment */ + FLOAT width; /* object width as it's reported it */ + BOOL is_sideways; /* vertical flow direction flag passed to Draw */ + BOOL is_rtl; /* bidi flag passed to Draw */ + UINT32 line; /* 0-based line index in line metrics array */ }; struct layout_underline { @@ -234,8 +234,8 @@ struct dwrite_textlayout { IDWriteTextLayout2 IDWriteTextLayout2_iface; IDWriteTextFormat1 IDWriteTextFormat1_iface; - IDWriteTextAnalysisSink IDWriteTextAnalysisSink_iface; - IDWriteTextAnalysisSource IDWriteTextAnalysisSource_iface; + IDWriteTextAnalysisSink1 IDWriteTextAnalysisSink1_iface; + IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface; LONG ref; WCHAR *str; @@ -323,14 +323,14 @@ return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextFormat1_iface); } -static inline struct dwrite_textlayout *impl_from_IDWriteTextAnalysisSink(IDWriteTextAnalysisSink *iface) +static inline struct dwrite_textlayout *impl_from_IDWriteTextAnalysisSink1(IDWriteTextAnalysisSink1 *iface) { - return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextAnalysisSink_iface); + return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextAnalysisSink1_iface); } -static inline struct dwrite_textlayout *impl_from_IDWriteTextAnalysisSource(IDWriteTextAnalysisSource *iface) +static inline struct dwrite_textlayout *impl_from_IDWriteTextAnalysisSource1(IDWriteTextAnalysisSource1 *iface) { - return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextAnalysisSource_iface); + return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextAnalysisSource1_iface); } static inline struct dwrite_textformat *impl_from_IDWriteTextFormat1(IDWriteTextFormat1 *iface) @@ -350,10 +350,9 @@ return CONTAINING_RECORD(iface, struct dwrite_typography, IDWriteTypography_iface); } -static inline const char *debugstr_run(const struct regular_layout_run *run) +static inline const char *debugstr_rundescr(const DWRITE_GLYPH_RUN_DESCRIPTION *descr) { - return wine_dbg_sprintf("[%u,%u)", run->descr.textPosition, run->descr.textPosition + - run->descr.stringLength); + return wine_dbg_sprintf("[%u,%u)", descr->textPosition, descr->textPosition + descr->stringLength); } static inline BOOL is_layout_gdi_compatible(struct dwrite_textlayout *layout) @@ -401,6 +400,31 @@ return S_OK; } +static inline HRESULT format_set_flowdirection(struct dwrite_textformat_data *format, + DWRITE_FLOW_DIRECTION direction, BOOL *changed) +{ + if ((UINT32)direction > DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT) + return E_INVALIDARG; + if (changed) *changed = format->flow != direction; + format->flow = direction; + return S_OK; +} + +static inline HRESULT format_set_linespacing(struct dwrite_textformat_data *format, + DWRITE_LINE_SPACING_METHOD method, FLOAT spacing, FLOAT baseline, BOOL *changed) +{ + if (spacing < 0.0f || (UINT32)method > DWRITE_LINE_SPACING_METHOD_UNIFORM) + return E_INVALIDARG; + + if (changed) *changed = format->spacingmethod != method || + format->spacing != spacing || format->baseline != baseline; + + format->spacingmethod = method; + format->spacing = spacing; + format->baseline = baseline; + return S_OK; +} + static HRESULT get_fontfallback_from_format(const struct dwrite_textformat_data *format, IDWriteFontFallback **fallback) { *fallback = format->fallback; @@ -569,8 +593,8 @@ layout->actual_breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_MAY_NOT_BREAK; } - layout->actual_breakpoints[i].isWhitespace = FALSE; - layout->actual_breakpoints[i].isSoftHyphen = FALSE; + layout->actual_breakpoints[i].isWhitespace = 0; + layout->actual_breakpoints[i].isSoftHyphen = 0; } return S_OK; @@ -601,28 +625,26 @@ } metrics->length = length; - position = stop_position; + position = run->descr.textPosition + stop_position; if (stop_glyph == run->glyphcount) - breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionAfter; + breakcondition = get_effective_breakpoint(layout, position).breakConditionAfter; else { - breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionBefore; - if (stop_position) position = stop_position - 1; + breakcondition = get_effective_breakpoint(layout, position).breakConditionBefore; + if (stop_position) position -= 1; } metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK || breakcondition == DWRITE_BREAK_CONDITION_MUST_BREAK; if (metrics->length == 1) { - WORD type = 0; - - GetStringTypeW(CT_CTYPE1, &layout->str[position], 1, &type); - metrics->isWhitespace = !!(type & C1_SPACE); - metrics->isNewline = FALSE /* FIXME */; - metrics->isSoftHyphen = layout->str[position] == 0x00ad /* Unicode Soft Hyphen */; + DWRITE_LINE_BREAKPOINT bp = get_effective_breakpoint(layout, position); + metrics->isWhitespace = bp.isWhitespace; + metrics->isNewline = metrics->canWrapLineAfter && lb_is_newline_char(layout->str[position]); + metrics->isSoftHyphen = bp.isSoftHyphen; } else { - metrics->isWhitespace = FALSE; - metrics->isNewline = FALSE; - metrics->isSoftHyphen = FALSE; + metrics->isWhitespace = 0; + metrics->isNewline = 0; + metrics->isSoftHyphen = 0; } metrics->isRightToLeft = run->run.bidiLevel & 1; metrics->padding = 0; @@ -672,6 +694,57 @@ #define SCALE_FONT_METRIC(metric, emSize, metrics) ((FLOAT)(metric) * (emSize) / (FLOAT)(metrics)->designUnitsPerEm) +static HRESULT create_fontface_by_pos(struct dwrite_textlayout *layout, struct layout_range *range, IDWriteFontFace **fontface) +{ + static DWRITE_GLYPH_RUN_DESCRIPTION descr = { 0 }; + IDWriteFontFamily *family; + BOOL exists = FALSE; + IDWriteFont *font; + UINT32 index; + HRESULT hr; + + *fontface = NULL; + + hr = IDWriteFontCollection_FindFamilyName(range->collection, range->fontfamily, &index, &exists); + if (FAILED(hr) || !exists) { + WARN("%s: family %s not found in collection %p\n", debugstr_rundescr(&descr), debugstr_w(range->fontfamily), range->collection); + return hr; + } + + hr = IDWriteFontCollection_GetFontFamily(range->collection, index, &family); + if (FAILED(hr)) + return hr; + + hr = IDWriteFontFamily_GetFirstMatchingFont(family, range->weight, range->stretch, range->style, &font); + IDWriteFontFamily_Release(family); + if (FAILED(hr)) { + WARN("%s: failed to get a matching font\n", debugstr_rundescr(&descr)); + return hr; + } + + hr = IDWriteFont_CreateFontFace(font, fontface); + IDWriteFont_Release(font); + return hr; +} + +static void layout_get_font_metrics(struct dwrite_textlayout *layout, IDWriteFontFace *fontface, FLOAT emsize, + DWRITE_FONT_METRICS *fontmetrics) +{ + if (is_layout_gdi_compatible(layout)) { + HRESULT hr = IDWriteFontFace_GetGdiCompatibleMetrics(fontface, emsize, layout->ppdip, &layout->transform, fontmetrics); + if (FAILED(hr)) + WARN("failed to get compat metrics, 0x%08x\n", hr); + } + else + IDWriteFontFace_GetMetrics(fontface, fontmetrics); +} + +static void layout_get_font_height(FLOAT emsize, DWRITE_FONT_METRICS *fontmetrics, FLOAT *baseline, FLOAT *height) +{ + *baseline = SCALE_FONT_METRIC(fontmetrics->ascent + fontmetrics->lineGap, emsize, fontmetrics); + *height = SCALE_FONT_METRIC(fontmetrics->ascent + fontmetrics->descent + fontmetrics->lineGap, emsize, fontmetrics); +} + static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) { IDWriteTextAnalyzer *analyzer; @@ -721,14 +794,14 @@ } /* initial splitting by script */ - hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &layout->IDWriteTextAnalysisSource_iface, - range->h.range.startPosition, get_clipped_range_length(layout, range), &layout->IDWriteTextAnalysisSink_iface); + hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, (IDWriteTextAnalysisSource*)&layout->IDWriteTextAnalysisSource1_iface, + range->h.range.startPosition, get_clipped_range_length(layout, range), (IDWriteTextAnalysisSink*)&layout->IDWriteTextAnalysisSink1_iface); if (FAILED(hr)) break; /* this splits it further */ - hr = IDWriteTextAnalyzer_AnalyzeBidi(analyzer, &layout->IDWriteTextAnalysisSource_iface, - range->h.range.startPosition, get_clipped_range_length(layout, range), &layout->IDWriteTextAnalysisSink_iface); + hr = IDWriteTextAnalyzer_AnalyzeBidi(analyzer, (IDWriteTextAnalysisSource*)&layout->IDWriteTextAnalysisSource1_iface, + range->h.range.startPosition, get_clipped_range_length(layout, range), (IDWriteTextAnalysisSink*)&layout->IDWriteTextAnalysisSink1_iface); if (FAILED(hr)) break; } @@ -739,10 +812,7 @@ DWRITE_SHAPING_TEXT_PROPERTIES *text_props = NULL; struct regular_layout_run *run = &r->u.regular; DWRITE_FONT_METRICS fontmetrics = { 0 }; - IDWriteFontFamily *family; - UINT32 index, max_count; - IDWriteFont *font; - BOOL exists = TRUE; + UINT32 max_count; /* we need to do very little in case of inline objects */ if (r->kind == LAYOUT_RUN_INLINE) { @@ -752,11 +822,11 @@ metrics->width = 0.0f; metrics->length = r->u.object.length; - metrics->canWrapLineAfter = FALSE; - metrics->isWhitespace = FALSE; - metrics->isNewline = FALSE; - metrics->isSoftHyphen = FALSE; - metrics->isRightToLeft = FALSE; + metrics->canWrapLineAfter = 0; + metrics->isWhitespace = 0; + metrics->isNewline = 0; + metrics->isSoftHyphen = 0; + metrics->isRightToLeft = 0; metrics->padding = 0; c->run = r; c->position = 0; /* there's always one cluster per inline object, so 0 is valid value */ @@ -778,26 +848,7 @@ } range = get_layout_range_by_pos(layout, run->descr.textPosition); - - hr = IDWriteFontCollection_FindFamilyName(range->collection, range->fontfamily, &index, &exists); - if (FAILED(hr) || !exists) { - WARN("%s: family %s not found in collection %p\n", debugstr_run(run), debugstr_w(range->fontfamily), range->collection); - continue; - } - - hr = IDWriteFontCollection_GetFontFamily(range->collection, index, &family); - if (FAILED(hr)) - continue; - - hr = IDWriteFontFamily_GetFirstMatchingFont(family, range->weight, range->stretch, range->style, &font); - IDWriteFontFamily_Release(family); - if (FAILED(hr)) { - WARN("%s: failed to get a matching font\n", debugstr_run(run)); - continue; - } - - hr = IDWriteFont_CreateFontFace(font, &run->run.fontFace); - IDWriteFont_Release(font); + hr = create_fontface_by_pos(layout, range, &run->run.fontFace); if (FAILED(hr)) continue; @@ -840,7 +891,7 @@ if (FAILED(hr)) { heap_free(text_props); heap_free(glyph_props); - WARN("%s: shaping failed 0x%08x\n", debugstr_run(run), hr); + WARN("%s: shaping failed 0x%08x\n", debugstr_rundescr(&run->descr), hr); continue; } @@ -868,7 +919,7 @@ heap_free(text_props); heap_free(glyph_props); if (FAILED(hr)) - WARN("%s: failed to get glyph placement info, 0x%08x\n", debugstr_run(run), hr); + WARN("%s: failed to get glyph placement info, 0x%08x\n", debugstr_rundescr(&run->descr), hr); run->run.glyphAdvances = run->advances; run->run.glyphOffsets = run->offsets; @@ -882,23 +933,10 @@ run->run.glyphCount = run->glyphcount; /* baseline derived from font metrics */ - if (is_layout_gdi_compatible(layout)) { - hr = IDWriteFontFace_GetGdiCompatibleMetrics(run->run.fontFace, - run->run.fontEmSize, - layout->ppdip, - &layout->transform, - &fontmetrics); - if (FAILED(hr)) - WARN("failed to get compat metrics, 0x%08x\n", hr); - } - else - IDWriteFontFace_GetMetrics(run->run.fontFace, &fontmetrics); - - r->baseline = SCALE_FONT_METRIC(fontmetrics.ascent, run->run.fontEmSize, &fontmetrics); - r->height = SCALE_FONT_METRIC(fontmetrics.ascent + fontmetrics.descent, run->run.fontEmSize, &fontmetrics); + layout_get_font_metrics(layout, run->run.fontFace, run->run.fontEmSize, &fontmetrics); + layout_get_font_height(run->run.fontEmSize, &fontmetrics, &r->baseline, &r->height); layout_set_cluster_metrics(layout, r, &cluster); - continue; memerr: @@ -918,7 +956,7 @@ if (hr == S_OK) { layout->cluster_count = cluster; if (cluster) - layout->clustermetrics[cluster-1].canWrapLineAfter = TRUE; + layout->clustermetrics[cluster-1].canWrapLineAfter = 1; } IDWriteTextAnalyzer_Release(analyzer); @@ -945,8 +983,8 @@ if (FAILED(hr)) return hr; - hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &layout->IDWriteTextAnalysisSource_iface, - 0, layout->len, &layout->IDWriteTextAnalysisSink_iface); + hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, (IDWriteTextAnalysisSource*)&layout->IDWriteTextAnalysisSource1_iface, + 0, layout->len, (IDWriteTextAnalysisSink*)&layout->IDWriteTextAnalysisSink1_iface); IDWriteTextAnalyzer_Release(analyzer); } if (layout->actual_breakpoints) { @@ -1076,7 +1114,7 @@ if (!inlineobject) return E_OUTOFMEMORY; - inlineobject->object = r->u.object.object; + inlineobject->run = r; inlineobject->width = get_cluster_range_width(layout, first_cluster, first_cluster + cluster_count); inlineobject->origin_x = is_rtl ? origin_x - inlineobject->width : origin_x; inlineobject->origin_y = 0.0f; /* set after line is built */ @@ -1458,7 +1496,7 @@ } while (inrun && inrun->line == line) { - inrun->origin_y = origin_y; + inrun->origin_y = origin_y - inrun->run->baseline; inrun = layout_get_next_inline_run(layout, inrun); } } @@ -1485,7 +1523,6 @@ static HRESULT layout_add_underline(struct dwrite_textlayout *layout, struct layout_effective_run *first, struct layout_effective_run *last) { - struct layout_underline_splitting_params params, prev_params; struct layout_effective_run *cur; DWRITE_FONT_METRICS metrics; FLOAT thickness, offset; @@ -1517,8 +1554,8 @@ } cur = first; - prev_params = params; do { + struct layout_underline_splitting_params params, prev_params; struct layout_effective_run *next, *w; struct layout_underline *u; @@ -1560,6 +1597,31 @@ return S_OK; } +/* Adds zero width line, metrics are derived from font at specified text position. */ +static HRESULT layout_set_dummy_line_metrics(struct dwrite_textlayout *layout, UINT32 pos, UINT32 *line) +{ + DWRITE_FONT_METRICS fontmetrics; + DWRITE_LINE_METRICS metrics; + struct layout_range *range; + IDWriteFontFace *fontface; + HRESULT hr; + + range = get_layout_range_by_pos(layout, pos); + hr = create_fontface_by_pos(layout, range, &fontface); + if (FAILED(hr)) + return hr; + + layout_get_font_metrics(layout, fontface, range->fontsize, &fontmetrics); + layout_get_font_height(range->fontsize, &fontmetrics, &metrics.baseline, &metrics.height); + IDWriteFontFace_Release(fontface); + + metrics.length = 0; + metrics.trailingWhitespaceLength = 0; + metrics.newlineLength = 0; + metrics.isTrimmed = FALSE; + return layout_set_line_metrics(layout, &metrics, line); +} + static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout) { BOOL is_rtl = layout->format.readingdir == DWRITE_READING_DIRECTION_RIGHT_TO_LEFT; @@ -1606,7 +1668,8 @@ } overflow = layout->clustermetrics[i].canWrapLineAfter && - (width + layout->clustermetrics[i].width > layout->metrics.layoutWidth); + (width + layout->clustermetrics[i].width > layout->metrics.layoutWidth) && + (layout->format.wrapping != DWRITE_WORD_WRAPPING_NO_WRAP); /* check if we got new */ if (overflow || layout->clustermetrics[i].isNewline || /* always wrap on new line */ @@ -1641,19 +1704,22 @@ trailingspacewidth = 0.0f; while (strlength) { DWRITE_CLUSTER_METRICS *cluster = &layout->clustermetrics[index]; + struct layout_cluster *lc = &layout->clusters[index]; + WCHAR ch; - if (!cluster->isNewline && !cluster->isWhitespace) + /* This also filters out clusters added from inline objects, those are never + treated as a white space. */ + if (!cluster->isWhitespace) break; - if (cluster->isNewline) { - metrics.trailingWhitespaceLength += cluster->length; + /* Every isNewline cluster is also isWhitespace, but not every + newline character cluster has isNewline set, so go back to original string. */ + ch = lc->run->u.regular.descr.string[lc->position]; + if (cluster->length == 1 && lb_is_newline_char(ch)) metrics.newlineLength += cluster->length; - } - if (cluster->isWhitespace) { - metrics.trailingWhitespaceLength += cluster->length; - trailingspacewidth += cluster->width; - } + metrics.trailingWhitespaceLength += cluster->length; + trailingspacewidth += cluster->width; strlength -= cluster->length; index--; @@ -1704,7 +1770,18 @@ textpos += layout->clustermetrics[i].length; } - layout->metrics.left = is_rtl ? layout->metrics.layoutWidth - layout->metrics.width : 0; + /* Add dummy line if: + - there's no text, metrics come from first range in this case; + - last ended with a mandatory break, metrics come from last text position. + */ + if (layout->len == 0) + hr = layout_set_dummy_line_metrics(layout, 0, &line); + else if (layout->clustermetrics[layout->cluster_count-1].isNewline) + hr = layout_set_dummy_line_metrics(layout, layout->len-1, &line); + if (FAILED(hr)) + return hr; + + layout->metrics.left = is_rtl ? layout->metrics.layoutWidth - layout->metrics.width : 0.0f; layout->metrics.top = 0.0f; layout->metrics.maxBidiReorderingDepth = 1; /* FIXME */ layout->metrics.height = 0.0f; @@ -1735,7 +1812,7 @@ /* Same for inline runs */ while (inrun && inrun->line == line) { - inrun->origin_y = origin_y; + inrun->origin_y = origin_y - inrun->run->baseline; inrun = layout_get_next_inline_run(layout, inrun); } @@ -2311,6 +2388,7 @@ list_add_after(&outer->entry, &cur->entry); list_add_after(&cur->entry, &right->entry); + layout->recompute = RECOMPUTE_EVERYTHING; return S_OK; } @@ -3140,7 +3218,7 @@ context, inlineobject->origin_x + inlineobject->align_dx + origin_x, SNAP_COORD(inlineobject->origin_y + origin_y), - inlineobject->object, + inlineobject->run->u.object.object, inlineobject->is_sideways, inlineobject->is_rtl, inlineobject->effect); @@ -3151,7 +3229,7 @@ IDWriteTextRenderer_DrawUnderline(renderer, context, /* horizontal underline always grows from left to right, width is always added to origin regardless of run direction */ - (is_run_rtl(u->run) ? u->run->origin_x - u->run->width : u->run->origin_x) + run->align_dx + origin_x, + (is_run_rtl(u->run) ? u->run->origin_x - u->run->width : u->run->origin_x) + u->run->align_dx + origin_x, SNAP_COORD(u->run->origin_y + origin_y), &u->u, u->run->effect); @@ -3161,7 +3239,7 @@ LIST_FOR_EACH_ENTRY(s, &This->strikethrough, struct layout_strikethrough, entry) { IDWriteTextRenderer_DrawStrikethrough(renderer, context, - s->run->origin_x + run->align_dx + origin_x, + s->run->origin_x + s->run->align_dx + origin_x, SNAP_COORD(s->run->origin_y + origin_y), &s->s, s->run->effect); @@ -3231,23 +3309,12 @@ return max_count >= This->cluster_count ? S_OK : E_NOT_SUFFICIENT_BUFFER; } -/* Only to be used with DetermineMinWidth() to find the longest cluster sequence that we don't want to try - too hard to break. */ -static inline BOOL is_terminal_cluster(struct dwrite_textlayout *layout, UINT32 index) -{ - if (layout->clustermetrics[index].isWhitespace || layout->clustermetrics[index].isNewline || - (index == layout->cluster_count - 1)) - return TRUE; - /* check next one */ - return (index < layout->cluster_count - 1) && layout->clustermetrics[index+1].isWhitespace; -} - static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout2 *iface, FLOAT* min_width) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); + UINT32 start; FLOAT width; HRESULT hr; - UINT32 i; TRACE("(%p)->(%p)\n", This, min_width); @@ -3262,20 +3329,30 @@ if (FAILED(hr)) return hr; - for (i = 0; i < This->cluster_count;) { - if (is_terminal_cluster(This, i)) { - width = This->clustermetrics[i].width; - i++; - } - else { - width = 0.0f; - while (!is_terminal_cluster(This, i)) { - width += This->clustermetrics[i].width; - i++; - } - /* count last one too */ - width += This->clustermetrics[i].width; - } + /* Find widest word without emergency breaking between clusters, trailing whitespaces + preceding breaking point do not contribute to word width. */ + for (start = 0; start < This->cluster_count;) { + UINT32 end = start, j, next; + + /* Last cluster always could be wrapped after. */ + while (!This->clustermetrics[end].canWrapLineAfter) + end++; + /* make is so current cluster range that we can wrap after is [start,end) */ + end++; + + next = end; + + /* Ignore trailing whitespace clusters, in case of single space range will + be reduced to empty range, or [start,start+1). */ + while (end > start && This->clustermetrics[end-1].isWhitespace) + end--; + + /* check if cluster range exceeds last minimal width */ + width = 0.0f; + for (j = start; j < end; j++) + width += This->clustermetrics[j].width; + + start = next; if (width > This->minwidth) This->minwidth = width; @@ -3633,8 +3710,19 @@ static HRESULT WINAPI dwritetextformat1_layout_SetFlowDirection(IDWriteTextFormat1 *iface, DWRITE_FLOW_DIRECTION direction) { struct dwrite_textlayout *This = impl_layout_form_IDWriteTextFormat1(iface); - FIXME("(%p)->(%d): stub\n", This, direction); - return E_NOTIMPL; + BOOL changed; + HRESULT hr; + + TRACE("(%p)->(%d)\n", This, direction); + + hr = format_set_flowdirection(&This->format, direction, &changed); + if (FAILED(hr)) + return hr; + + if (changed) + This->recompute = RECOMPUTE_EVERYTHING; + + return S_OK; } static HRESULT WINAPI dwritetextformat1_layout_SetIncrementalTabStop(IDWriteTextFormat1 *iface, FLOAT tabstop) @@ -3652,12 +3740,23 @@ return E_NOTIMPL; } -static HRESULT WINAPI dwritetextformat1_layout_SetLineSpacing(IDWriteTextFormat1 *iface, DWRITE_LINE_SPACING_METHOD spacing, - FLOAT line_spacing, FLOAT baseline) +static HRESULT WINAPI dwritetextformat1_layout_SetLineSpacing(IDWriteTextFormat1 *iface, DWRITE_LINE_SPACING_METHOD method, + FLOAT spacing, FLOAT baseline) { struct dwrite_textlayout *This = impl_layout_form_IDWriteTextFormat1(iface); - FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline); - return E_NOTIMPL; + BOOL changed; + HRESULT hr; + + TRACE("(%p)->(%d %f %f)\n", This, method, spacing, baseline); + + hr = format_set_linespacing(&This->format, method, spacing, baseline, &changed); + if (FAILED(hr)) + return hr; + + if (changed) + This->recompute = RECOMPUTE_EVERYTHING; + + return S_OK; } static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat1_layout_GetTextAlignment(IDWriteTextFormat1 *iface) @@ -3903,12 +4002,15 @@ dwritetextformat1_layout_GetFontFallback }; -static HRESULT WINAPI dwritetextlayout_sink_QueryInterface(IDWriteTextAnalysisSink *iface, +static HRESULT WINAPI dwritetextlayout_sink_QueryInterface(IDWriteTextAnalysisSink1 *iface, REFIID riid, void **obj) { - if (IsEqualIID(riid, &IID_IDWriteTextAnalysisSink) || IsEqualIID(riid, &IID_IUnknown)) { + if (IsEqualIID(riid, &IID_IDWriteTextAnalysisSink1) || + IsEqualIID(riid, &IID_IDWriteTextAnalysisSink) || + IsEqualIID(riid, &IID_IUnknown)) + { *obj = iface; - IDWriteTextAnalysisSink_AddRef(iface); + IDWriteTextAnalysisSink1_AddRef(iface); return S_OK; } @@ -3916,23 +4018,25 @@ return E_NOINTERFACE; } -static ULONG WINAPI dwritetextlayout_sink_AddRef(IDWriteTextAnalysisSink *iface) +static ULONG WINAPI dwritetextlayout_sink_AddRef(IDWriteTextAnalysisSink1 *iface) { - return 2; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); + return IDWriteTextLayout2_AddRef(&layout->IDWriteTextLayout2_iface); } -static ULONG WINAPI dwritetextlayout_sink_Release(IDWriteTextAnalysisSink *iface) +static ULONG WINAPI dwritetextlayout_sink_Release(IDWriteTextAnalysisSink1 *iface) { - return 1; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); + return IDWriteTextLayout2_Release(&layout->IDWriteTextLayout2_iface); } -static HRESULT WINAPI dwritetextlayout_sink_SetScriptAnalysis(IDWriteTextAnalysisSink *iface, +static HRESULT WINAPI dwritetextlayout_sink_SetScriptAnalysis(IDWriteTextAnalysisSink1 *iface, UINT32 position, UINT32 length, DWRITE_SCRIPT_ANALYSIS const* sa) { - struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); struct layout_run *run; - TRACE("%u %u script=%d\n", position, length, sa->script); + TRACE("[%u,%u) script=%u:%s\n", position, position + length, sa->script, debugstr_sa_script(sa->script)); run = alloc_layout_run(LAYOUT_RUN_REGULAR); if (!run) @@ -3946,10 +4050,10 @@ return S_OK; } -static HRESULT WINAPI dwritetextlayout_sink_SetLineBreakpoints(IDWriteTextAnalysisSink *iface, +static HRESULT WINAPI dwritetextlayout_sink_SetLineBreakpoints(IDWriteTextAnalysisSink1 *iface, UINT32 position, UINT32 length, DWRITE_LINE_BREAKPOINT const* breakpoints) { - struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); if (position + length > layout->len) return E_FAIL; @@ -3958,13 +4062,13 @@ return S_OK; } -static HRESULT WINAPI dwritetextlayout_sink_SetBidiLevel(IDWriteTextAnalysisSink *iface, UINT32 position, +static HRESULT WINAPI dwritetextlayout_sink_SetBidiLevel(IDWriteTextAnalysisSink1 *iface, UINT32 position, UINT32 length, UINT8 explicitLevel, UINT8 resolvedLevel) { - struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); struct layout_run *cur_run; - TRACE("%u %u %u %u\n", position, length, explicitLevel, resolvedLevel); + TRACE("[%u,%u) %u %u\n", position, position + length, explicitLevel, resolvedLevel); LIST_FOR_EACH_ENTRY(cur_run, &layout->runs, struct layout_run, entry) { struct regular_layout_run *cur = &cur_run->u.regular; @@ -4014,30 +4118,39 @@ return S_OK; } -static HRESULT WINAPI dwritetextlayout_sink_SetNumberSubstitution(IDWriteTextAnalysisSink *iface, +static HRESULT WINAPI dwritetextlayout_sink_SetNumberSubstitution(IDWriteTextAnalysisSink1 *iface, UINT32 position, UINT32 length, IDWriteNumberSubstitution* substitution) { return E_NOTIMPL; } -static const IDWriteTextAnalysisSinkVtbl dwritetextlayoutsinkvtbl = { +static HRESULT WINAPI dwritetextlayout_sink_SetGlyphOrientation(IDWriteTextAnalysisSink1 *iface, + UINT32 position, UINT32 length, DWRITE_GLYPH_ORIENTATION_ANGLE angle, UINT8 adjusted_bidi_level, + BOOL is_sideways, BOOL is_rtl) +{ + return E_NOTIMPL; +} + +static const IDWriteTextAnalysisSink1Vtbl dwritetextlayoutsinkvtbl = { dwritetextlayout_sink_QueryInterface, dwritetextlayout_sink_AddRef, dwritetextlayout_sink_Release, dwritetextlayout_sink_SetScriptAnalysis, dwritetextlayout_sink_SetLineBreakpoints, dwritetextlayout_sink_SetBidiLevel, - dwritetextlayout_sink_SetNumberSubstitution + dwritetextlayout_sink_SetNumberSubstitution, + dwritetextlayout_sink_SetGlyphOrientation }; -static HRESULT WINAPI dwritetextlayout_source_QueryInterface(IDWriteTextAnalysisSource *iface, +static HRESULT WINAPI dwritetextlayout_source_QueryInterface(IDWriteTextAnalysisSource1 *iface, REFIID riid, void **obj) { - if (IsEqualIID(riid, &IID_IDWriteTextAnalysisSource) || + if (IsEqualIID(riid, &IID_IDWriteTextAnalysisSource1) || + IsEqualIID(riid, &IID_IDWriteTextAnalysisSource) || IsEqualIID(riid, &IID_IUnknown)) { *obj = iface; - IDWriteTextAnalysisSource_AddRef(iface); + IDWriteTextAnalysisSource1_AddRef(iface); return S_OK; } @@ -4045,20 +4158,22 @@ return E_NOINTERFACE; } -static ULONG WINAPI dwritetextlayout_source_AddRef(IDWriteTextAnalysisSource *iface) +static ULONG WINAPI dwritetextlayout_source_AddRef(IDWriteTextAnalysisSource1 *iface) { - return 2; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); + return IDWriteTextLayout2_AddRef(&layout->IDWriteTextLayout2_iface); } -static ULONG WINAPI dwritetextlayout_source_Release(IDWriteTextAnalysisSource *iface) +static ULONG WINAPI dwritetextlayout_source_Release(IDWriteTextAnalysisSource1 *iface) { - return 1; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); + return IDWriteTextLayout2_Release(&layout->IDWriteTextLayout2_iface); } -static HRESULT WINAPI dwritetextlayout_source_GetTextAtPosition(IDWriteTextAnalysisSource *iface, +static HRESULT WINAPI dwritetextlayout_source_GetTextAtPosition(IDWriteTextAnalysisSource1 *iface, UINT32 position, WCHAR const** text, UINT32* text_len) { - struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); TRACE("(%p)->(%u %p %p)\n", layout, position, text, text_len); @@ -4074,34 +4189,74 @@ return S_OK; } -static HRESULT WINAPI dwritetextlayout_source_GetTextBeforePosition(IDWriteTextAnalysisSource *iface, +static HRESULT WINAPI dwritetextlayout_source_GetTextBeforePosition(IDWriteTextAnalysisSource1 *iface, UINT32 position, WCHAR const** text, UINT32* text_len) { - FIXME("%u %p %p: stub\n", position, text, text_len); - return E_NOTIMPL; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); + + TRACE("(%p)->(%u %p %p)\n", layout, position, text, text_len); + + if (position > 0 && position < layout->len) { + *text = layout->str; + *text_len = position; + } + else { + *text = NULL; + *text_len = 0; + } + + return S_OK; } -static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_source_GetParagraphReadingDirection(IDWriteTextAnalysisSource *iface) +static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_source_GetParagraphReadingDirection(IDWriteTextAnalysisSource1 *iface) { - struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); return IDWriteTextLayout2_GetReadingDirection(&layout->IDWriteTextLayout2_iface); } -static HRESULT WINAPI dwritetextlayout_source_GetLocaleName(IDWriteTextAnalysisSource *iface, +static HRESULT WINAPI dwritetextlayout_source_GetLocaleName(IDWriteTextAnalysisSource1 *iface, UINT32 position, UINT32* text_len, WCHAR const** locale) { - FIXME("%u %p %p: stub\n", position, text_len, locale); - return E_NOTIMPL; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); + struct layout_range *range = get_layout_range_by_pos(layout, position); + + if (position < layout->len) { + struct layout_range *next; + + *locale = range->locale; + *text_len = range->h.range.length - position; + + next = LIST_ENTRY(list_next(&layout->ranges, &range->h.entry), struct layout_range, h.entry); + while (next && next->h.range.startPosition < layout->len && !strcmpW(range->locale, next->locale)) { + *text_len += next->h.range.length; + next = LIST_ENTRY(list_next(&layout->ranges, &next->h.entry), struct layout_range, h.entry); + } + + *text_len = min(*text_len, layout->len - position); + } + else { + *locale = NULL; + *text_len = 0; + } + + return S_OK; } -static HRESULT WINAPI dwritetextlayout_source_GetNumberSubstitution(IDWriteTextAnalysisSource *iface, +static HRESULT WINAPI dwritetextlayout_source_GetNumberSubstitution(IDWriteTextAnalysisSource1 *iface, UINT32 position, UINT32* text_len, IDWriteNumberSubstitution **substitution) { FIXME("%u %p %p: stub\n", position, text_len, substitution); return E_NOTIMPL; } -static const IDWriteTextAnalysisSourceVtbl dwritetextlayoutsourcevtbl = { +static HRESULT WINAPI dwritetextlayout_source_GetVerticalGlyphOrientation(IDWriteTextAnalysisSource1 *iface, + UINT32 position, UINT32 *length, DWRITE_VERTICAL_GLYPH_ORIENTATION *orientation, UINT8 *bidi_level) +{ + FIXME("%u %p %p %p: stub\n", position, length, orientation, bidi_level); + return E_NOTIMPL; +} + +static const IDWriteTextAnalysisSource1Vtbl dwritetextlayoutsourcevtbl = { dwritetextlayout_source_QueryInterface, dwritetextlayout_source_AddRef, dwritetextlayout_source_Release, @@ -4109,7 +4264,8 @@ dwritetextlayout_source_GetTextBeforePosition, dwritetextlayout_source_GetParagraphReadingDirection, dwritetextlayout_source_GetLocaleName, - dwritetextlayout_source_GetNumberSubstitution + dwritetextlayout_source_GetNumberSubstitution, + dwritetextlayout_source_GetVerticalGlyphOrientation }; static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, IDWriteTextFormat *format) @@ -4205,8 +4361,8 @@ layout->IDWriteTextLayout2_iface.lpVtbl = &dwritetextlayoutvtbl; layout->IDWriteTextFormat1_iface.lpVtbl = &dwritetextformat1_layout_vtbl; - layout->IDWriteTextAnalysisSink_iface.lpVtbl = &dwritetextlayoutsinkvtbl; - layout->IDWriteTextAnalysisSource_iface.lpVtbl = &dwritetextlayoutsourcevtbl; + layout->IDWriteTextAnalysisSink1_iface.lpVtbl = &dwritetextlayoutsinkvtbl; + layout->IDWriteTextAnalysisSource1_iface.lpVtbl = &dwritetextlayoutsourcevtbl; layout->ref = 1; layout->len = len; layout->recompute = RECOMPUTE_EVERYTHING; @@ -4285,6 +4441,9 @@ *ret = NULL; + if (!format || !str) + return E_INVALIDARG; + layout = heap_alloc(sizeof(struct dwrite_textlayout)); if (!layout) return E_OUTOFMEMORY; @@ -4303,6 +4462,9 @@ *ret = NULL; + if (!format || !str) + return E_INVALIDARG; + layout = heap_alloc(sizeof(struct dwrite_textlayout)); if (!layout) return E_OUTOFMEMORY; @@ -4364,11 +4526,14 @@ { struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); DWRITE_TEXT_RANGE range = { 0, ~0u }; + HRESULT hr; TRACE("(%p)->(%p %p %.2f %.2f %d %d %p)\n", This, context, renderer, originX, originY, is_sideways, is_rtl, effect); IDWriteTextLayout_SetDrawingEffect(This->layout, effect, range); - return IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY); + hr = IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY); + IDWriteTextLayout_SetDrawingEffect(This->layout, NULL, range); + return hr; } static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *ret) @@ -4557,14 +4722,8 @@ static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat1 *iface, DWRITE_FLOW_DIRECTION direction) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); - TRACE("(%p)->(%d)\n", This, direction); - - if ((UINT32)direction > DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT) - return E_INVALIDARG; - - This->format.flow = direction; - return S_OK; + return format_set_flowdirection(&This->format, direction, NULL); } static HRESULT WINAPI dwritetextformat_SetIncrementalTabStop(IDWriteTextFormat1 *iface, FLOAT tabstop) @@ -4593,16 +4752,8 @@ FLOAT spacing, FLOAT baseline) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); - TRACE("(%p)->(%d %f %f)\n", This, method, spacing, baseline); - - if (spacing < 0.0f || (UINT32)method > DWRITE_LINE_SPACING_METHOD_UNIFORM) - return E_INVALIDARG; - - This->format.spacingmethod = method; - This->format.spacing = spacing; - This->format.baseline = baseline; - return S_OK; + return format_set_linespacing(&This->format, method, spacing, baseline, NULL); } static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat_GetTextAlignment(IDWriteTextFormat1 *iface) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/main.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/main.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/main.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/main.c 2016-02-08 19:32:34.000000000 +0000 @@ -779,6 +779,8 @@ TRACE("(%p)->(%p %u %p %p)\n", This, reference_key, key_size, loader, font_file); + *font_file = NULL; + if (!loader || !factory_get_file_loader(This, loader)) return E_INVALIDARG; @@ -1045,9 +1047,9 @@ UINT32 len, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout) { struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + TRACE("(%p)->(%s:%u %p %f %f %p)\n", This, debugstr_wn(string, len), len, format, max_width, max_height, layout); - if (!format) return E_INVALIDARG; return create_textlayout(string, len, format, max_width, max_height, layout); } @@ -1060,7 +1062,6 @@ TRACE("(%p)->(%s:%u %p %f %f %f %p %d %p)\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_gdicompat_textlayout(string, len, format, layout_width, layout_height, pixels_per_dip, transform, use_gdi_natural, layout); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/opentype.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/opentype.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/opentype.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/opentype.c 2016-02-08 19:32:34.000000000 +0000 @@ -715,50 +715,137 @@ (type == DWRITE_FONT_FACE_TYPE_RAW_CFF); } -HRESULT opentype_analyze_font(IDWriteFontFileStream *stream, UINT32* font_count, DWRITE_FONT_FILE_TYPE *file_type, DWRITE_FONT_FACE_TYPE *face_type, BOOL *supported) +typedef HRESULT (*dwrite_fontfile_analyzer)(IDWriteFontFileStream *stream, UINT32 *font_count, DWRITE_FONT_FILE_TYPE *file_type, + DWRITE_FONT_FACE_TYPE *face_type); + +static HRESULT opentype_ttc_analyzer(IDWriteFontFileStream *stream, UINT32 *font_count, DWRITE_FONT_FILE_TYPE *file_type, + DWRITE_FONT_FACE_TYPE *face_type) { - /* TODO: Do font validation */ - DWRITE_FONT_FACE_TYPE face; - const void *font_data; - const char* tag; + static const DWORD ttctag = MS_TTCF_TAG; + const TTC_Header_V1 *header; void *context; HRESULT hr; - hr = IDWriteFontFileStream_ReadFileFragment(stream, &font_data, 0, sizeof(TTC_Header_V1), &context); + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&header, 0, sizeof(header), &context); if (FAILED(hr)) return hr; - tag = font_data; - *file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN; - face = DWRITE_FONT_FACE_TYPE_UNKNOWN; - *font_count = 0; - - if (DWRITE_MAKE_OPENTYPE_TAG(tag[0], tag[1], tag[2], tag[3]) == MS_TTCF_TAG) - { - const TTC_Header_V1 *header = font_data; + if (!memcmp(header->TTCTag, &ttctag, sizeof(ttctag))) { *font_count = GET_BE_DWORD(header->numFonts); *file_type = DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION; - face = DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION; + *face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION; } - else if (GET_BE_DWORD(*(DWORD*)font_data) == 0x10000) - { + + IDWriteFontFileStream_ReleaseFileFragment(stream, context); + + return *file_type != DWRITE_FONT_FILE_TYPE_UNKNOWN ? S_OK : S_FALSE; +} + +static HRESULT opentype_ttf_analyzer(IDWriteFontFileStream *stream, UINT32 *font_count, DWRITE_FONT_FILE_TYPE *file_type, + DWRITE_FONT_FACE_TYPE *face_type) +{ + const DWORD *header; + void *context; + HRESULT hr; + + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&header, 0, sizeof(*header), &context); + if (FAILED(hr)) + return hr; + + if (GET_BE_DWORD(*header) == 0x10000) { *font_count = 1; *file_type = DWRITE_FONT_FILE_TYPE_TRUETYPE; - face = DWRITE_FONT_FACE_TYPE_TRUETYPE; + *face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE; } - else if (DWRITE_MAKE_OPENTYPE_TAG(tag[0], tag[1], tag[2], tag[3]) == MS_OTTO_TAG) - { + + IDWriteFontFileStream_ReleaseFileFragment(stream, context); + + return *file_type != DWRITE_FONT_FILE_TYPE_UNKNOWN ? S_OK : S_FALSE; +} + +static HRESULT opentype_otf_analyzer(IDWriteFontFileStream *stream, UINT32 *font_count, DWRITE_FONT_FILE_TYPE *file_type, + DWRITE_FONT_FACE_TYPE *face_type) +{ + const DWORD *header; + void *context; + HRESULT hr; + + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&header, 0, sizeof(*header), &context); + if (FAILED(hr)) + return hr; + + if (GET_BE_DWORD(*header) == MS_OTTO_TAG) { *font_count = 1; *file_type = DWRITE_FONT_FILE_TYPE_CFF; - face = DWRITE_FONT_FACE_TYPE_CFF; + *face_type = DWRITE_FONT_FACE_TYPE_CFF; } - if (face_type) - *face_type = face; + IDWriteFontFileStream_ReleaseFileFragment(stream, context); + + return *file_type != DWRITE_FONT_FILE_TYPE_UNKNOWN ? S_OK : S_FALSE; +} - *supported = is_face_type_supported(face); +static HRESULT opentype_type1_analyzer(IDWriteFontFileStream *stream, UINT32 *font_count, DWRITE_FONT_FILE_TYPE *file_type, + DWRITE_FONT_FACE_TYPE *face_type) +{ + struct type1_header { + WORD tag; + char data[14]; + }; + const struct type1_header *header; + void *context; + HRESULT hr; + + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&header, 0, sizeof(*header), &context); + if (FAILED(hr)) + return hr; + + /* tag is followed by plain text section */ + if (header->tag == 0x8001 && + (!memcmp(header->data, "%!PS-AdobeFont", 14) || + !memcmp(header->data, "%!FontType", 10))) { + *font_count = 1; + *file_type = DWRITE_FONT_FILE_TYPE_TYPE1_PFB; + *face_type = DWRITE_FONT_FACE_TYPE_TYPE1; + } IDWriteFontFileStream_ReleaseFileFragment(stream, context); + + return *file_type != DWRITE_FONT_FILE_TYPE_UNKNOWN ? S_OK : S_FALSE; +} + +HRESULT opentype_analyze_font(IDWriteFontFileStream *stream, UINT32* font_count, DWRITE_FONT_FILE_TYPE *file_type, DWRITE_FONT_FACE_TYPE *face_type, BOOL *supported) +{ + static dwrite_fontfile_analyzer fontfile_analyzers[] = { + opentype_ttf_analyzer, + opentype_otf_analyzer, + opentype_ttc_analyzer, + opentype_type1_analyzer, + NULL + }; + dwrite_fontfile_analyzer *analyzer = fontfile_analyzers; + DWRITE_FONT_FACE_TYPE face; + HRESULT hr; + + if (!face_type) + face_type = &face; + + *file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN; + *face_type = DWRITE_FONT_FACE_TYPE_UNKNOWN; + *font_count = 0; + + while (*analyzer) { + hr = (*analyzer)(stream, font_count, file_type, face_type); + if (FAILED(hr)) + return hr; + + if (hr == S_OK) + break; + + analyzer++; + } + + *supported = is_face_type_supported(*face_type); return S_OK; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c 2016-02-08 19:32:34.000000000 +0000 @@ -27,7 +27,6 @@ #include "initguid.h" #include "windows.h" -#include "dwrite.h" #include "dwrite_2.h" #include "wine/test.h" @@ -966,21 +965,44 @@ }; static struct linebreaks_test linebreaks_tests[] = { - { {'A','-','B',' ','C',0x58a,'D',0x2010,'E',0x2012,'F',0x2013,'\t',0}, + { {'A','-','B',' ','C',0x58a,'D',0x2010,'E',0x2012,'F',0x2013,'\t',0xc,0xb,0x2028,0x2029,0x200b,0}, { - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, TRUE, FALSE }, - { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE }, - { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, TRUE, FALSE } + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MUST_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_MUST_BREAK, DWRITE_BREAK_CONDITION_MUST_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_MUST_BREAK, DWRITE_BREAK_CONDITION_MUST_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_MUST_BREAK, DWRITE_BREAK_CONDITION_MUST_BREAK, 1, 0 }, + { DWRITE_BREAK_CONDITION_MUST_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + } + }, + /* Soft hyphen, visible word dividers */ + { {'A',0xad,'B',0x5be,'C',0xf0b,'D',0x1361,'E',0x17d8,'F',0x17da,'G',0}, + { + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 1 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, + { DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, 0, 0 }, } }, { { 0 } } @@ -988,6 +1010,7 @@ static void compare_breakpoints(const struct linebreaks_test *test, DWRITE_LINE_BREAKPOINT *actual) { + static const char *conditions[] = {"N","CB","NB","B"}; const WCHAR *text = test->text; int cmp = memcmp(test->bp, actual, sizeof(*actual)*BREAKPOINT_COUNT); ok(!cmp, "%s: got wrong breakpoint data\n", wine_dbgstr_w(test->text)); @@ -995,16 +1018,19 @@ int i = 0; while (*text) { ok(!memcmp(&test->bp[i], &actual[i], sizeof(*actual)), - "%s: got (%d, %d, %d, %d), expected (%d, %d, %d, %d)\n", + "%s: got [%s, %s] (%s, %s), expected [%s, %s] (%s, %s)\n", wine_dbgstr_wn(&test->text[i], 1), - g_actual_bp[i].breakConditionBefore, - g_actual_bp[i].breakConditionAfter, - g_actual_bp[i].isWhitespace, - g_actual_bp[i].isSoftHyphen, - test->bp[i].breakConditionBefore, - test->bp[i].breakConditionAfter, - test->bp[i].isWhitespace, - test->bp[i].isSoftHyphen); + conditions[g_actual_bp[i].breakConditionBefore], + conditions[g_actual_bp[i].breakConditionAfter], + g_actual_bp[i].isWhitespace ? "WS" : "0", + g_actual_bp[i].isSoftHyphen ? "SHY" : "0", + conditions[test->bp[i].breakConditionBefore], + conditions[test->bp[i].breakConditionAfter], + test->bp[i].isWhitespace ? "WS" : "0", + test->bp[i].isSoftHyphen ? "SHY" : "0"); + if (g_actual_bp[i].isSoftHyphen) + ok(!g_actual_bp[i].isWhitespace, "%s: soft hyphen marked as a whitespace\n", + wine_dbgstr_wn(&test->text[i], 1)); text++; i++; } @@ -1016,6 +1042,7 @@ static const WCHAR emptyW[] = {0}; const struct linebreaks_test *ptr = linebreaks_tests; IDWriteTextAnalyzer *analyzer; + UINT32 i = 0; HRESULT hr; hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); @@ -1027,13 +1054,24 @@ while (*ptr->text) { + UINT32 len; + g_source = ptr->text; + len = lstrlenW(g_source); + + if (len > BREAKPOINT_COUNT) { + ok(0, "test %u: increase BREAKPOINT_COUNT to at least %u\n", i, len); + i++; + ptr++; + continue; + } memset(g_actual_bp, 0, sizeof(g_actual_bp)); - hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource, 0, lstrlenW(g_source), &analysissink); + hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource, 0, len, &analysissink); ok(hr == S_OK, "got 0x%08x\n", hr); compare_breakpoints(ptr, g_actual_bp); + i++; ptr++; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/font.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/font.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/font.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/font.c 2016-02-08 19:32:34.000000000 +0000 @@ -666,8 +666,10 @@ /* null out parameter crashes this call */ hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, NULL); + font = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, &font); EXPECT_HR(hr, E_INVALIDARG); + ok(font == NULL, "got %p\n", font); memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -1356,15 +1358,22 @@ todo_wine ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == E_INVALIDARG) /* older versions */, "got 0x%08x\n", hr); + fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TYPE1, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(fontface == NULL, "got %p\n", fontface); + fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_VECTOR, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(fontface == NULL, "got %p\n", fontface); + fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_BITMAP, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(fontface == NULL, "got %p\n", fontface); + fontface = NULL; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_UNKNOWN, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); todo_wine ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "got 0x%08x\n", hr); @@ -1867,8 +1876,10 @@ hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface); ok(hr == S_OK, "got 0x%08x\n", hr); + font_collection = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontCollection(factory, &collection3, "Billy", 6, &font_collection); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(font_collection == NULL, "got %p\n", font_collection); hr = IDWriteFactory_CreateCustomFontCollection(factory, &collection, "Billy", 6, &font_collection); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1878,8 +1889,10 @@ ok(hr == S_OK, "got 0x%08x\n", hr); IDWriteFontCollection_Release(font_collection); + font_collection = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontCollection(factory, (IDWriteFontCollectionLoader*)0xdeadbeef, "Billy", 6, &font_collection); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(font_collection == NULL, "got %p\n", font_collection); font = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); ok(font != NULL, "Failed to find font resource\n"); @@ -2058,11 +2071,15 @@ ok(hr == S_OK, "got 0x%08x\n", hr); IDWriteFontFile_Release(file); + file = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader3, &file); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(file == NULL, "got %p\n", file); + file = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, NULL, &file); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(file == NULL, "got %p\n", file); file = NULL; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader, &file); @@ -2101,8 +2118,10 @@ ok(count == 1, "got %i\n", count); /* invalid index */ + face = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 1, DWRITE_FONT_SIMULATIONS_NONE, &face); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(face == NULL, "got %p\n", face); hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -2540,8 +2559,10 @@ hr = IDWriteFactory_GetGdiInterop(factory, &interop); ok(hr == S_OK, "got 0x%08x\n", hr); + fontface = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, NULL, &fontface); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(fontface == NULL, "got %p\n", fontface); memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/layout.c wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/layout.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/dwrite/tests/layout.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/dwrite/tests/layout.c 2016-02-08 19:32:34.000000000 +0000 @@ -25,7 +25,6 @@ #include #include "windows.h" -#include "dwrite.h" #include "dwrite_2.h" #include "wine/test.h" @@ -728,25 +727,44 @@ factory = create_factory(); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 0.0, 0.0, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 1.0, 0.0, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 0.0, 1.0, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 1000.0, 1000.0, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); ok(hr == S_OK, "got 0x%08x\n", hr); + layout = (void*)0xdeadbeef; + hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, &layout); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 0, format, 0.0f, 0.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + EXPECT_REF(format, 1); hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, format, 1000.0, 1000.0, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -823,20 +841,30 @@ factory = create_factory(); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1.0, 0.0, 0.0, NULL, FALSE, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1.0, 0.0, 1.0, NULL, FALSE, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1000.0, 1000.0, 1.0, NULL, FALSE, &layout); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); /* create with text format */ hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, @@ -844,6 +872,11 @@ ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(format, 1); + layout = (void*)0xdeadbeef; + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(layout == NULL, "got %p\n", layout); + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(format, 1); @@ -1084,7 +1117,6 @@ metrics.supportsSideways = TRUE; hr = IDWriteInlineObject_GetMetrics(sign, &metrics); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(metrics.width > 0.0, "got %.2f\n", metrics.width); ok(metrics.height == 0.0, "got %.2f\n", metrics.height); ok(metrics.baseline == 0.0, "got %.2f\n", metrics.baseline); @@ -1378,7 +1410,7 @@ }; static const struct drawcall_entry draw_seq3[] = { - { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN, {0x202a,0x202c,0} }, { DRAW_GLYPHRUN, {'a','b',0} }, { DRAW_LAST_KIND } }; @@ -1661,14 +1693,19 @@ static void test_GetClusterMetrics(void) { + static const WCHAR str_white_spaceW[] = { + /* BK - FORM FEED, LINE TABULATION, LINE SEP, PARA SEP */ 0xc, 0xb, 0x2028, 0x2029, + /* ZW - ZERO WIDTH SPACE */ 0x200b, + /* SP - SPACE */ 0x20 + }; static const WCHAR str5W[] = {'a','\r','b','\n','c','\n','\r','d','\r','\n','e',0xb,'f',0xc, - 'g',0x0085,'h',0x2028,'i',0x2029,0}; + 'g',0x0085,'h',0x2028,'i',0x2029,0xad,0xa,0}; static const WCHAR str3W[] = {0x2066,')',')',0x661,'(',0x627,')',0}; static const WCHAR str2W[] = {0x202a,0x202c,'a',0}; static const WCHAR strW[] = {'a','b','c','d',0}; static const WCHAR str4W[] = {'a',' ',0}; DWRITE_INLINE_OBJECT_METRICS inline_metrics; - DWRITE_CLUSTER_METRICS metrics[20]; + DWRITE_CLUSTER_METRICS metrics[22]; IDWriteTextLayout1 *layout1; IDWriteInlineObject *trimm; IDWriteTextFormat *format; @@ -1786,7 +1823,6 @@ hr = IDWriteInlineObject_GetMetrics(trimm, &inline_metrics); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(inline_metrics.width > 0.0 && inline_metrics.width == metrics[0].width, "got %.2f, expected %.2f\n", inline_metrics.width, metrics[0].width); @@ -1904,6 +1940,7 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); + ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter); ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace); ok(metrics[1].canWrapLineAfter == 1, "got %d\n", metrics[1].canWrapLineAfter); IDWriteTextLayout_Release(layout); @@ -1952,16 +1989,15 @@ IDWriteTextLayout_Release(layout); /* isNewline tests */ - hr = IDWriteFactory_CreateTextLayout(factory, str5W, 20, format, 100.0, 200.0, &layout); + hr = IDWriteFactory_CreateTextLayout(factory, str5W, lstrlenW(str5W), format, 100.0f, 200.0f, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); count = 0; memset(metrics, 0, sizeof(metrics)); - hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 20, &count); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, sizeof(metrics)/sizeof(metrics[0]), &count); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(count == 20, "got %u\n", count); + ok(count == 22, "got %u\n", count); -todo_wine { ok(metrics[1].isNewline == 1, "got %d\n", metrics[1].isNewline); ok(metrics[3].isNewline == 1, "got %d\n", metrics[3].isNewline); ok(metrics[5].isNewline == 1, "got %d\n", metrics[5].isNewline); @@ -1972,7 +2008,8 @@ ok(metrics[15].isNewline == 1, "got %d\n", metrics[15].isNewline); ok(metrics[17].isNewline == 1, "got %d\n", metrics[17].isNewline); ok(metrics[19].isNewline == 1, "got %d\n", metrics[19].isNewline); -} + ok(metrics[21].isNewline == 1, "got %d\n", metrics[21].isNewline); + ok(metrics[0].isNewline == 0, "got %d\n", metrics[0].isNewline); ok(metrics[2].isNewline == 0, "got %d\n", metrics[2].isNewline); ok(metrics[4].isNewline == 0, "got %d\n", metrics[4].isNewline); @@ -1983,12 +2020,43 @@ ok(metrics[14].isNewline == 0, "got %d\n", metrics[14].isNewline); ok(metrics[16].isNewline == 0, "got %d\n", metrics[16].isNewline); ok(metrics[18].isNewline == 0, "got %d\n", metrics[18].isNewline); + ok(metrics[20].isNewline == 0, "got %d\n", metrics[20].isNewline); - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { ok(metrics[i].length == 1, "%d: got %d\n", i, metrics[i].length); + ok(metrics[i].isSoftHyphen == (i == count - 2), "%d: got %d\n", i, metrics[i].isSoftHyphen); + if (metrics[i].isSoftHyphen) + ok(!metrics[i].isWhitespace, "%u: got %d\n", i, metrics[i].isWhitespace); + if (metrics[i].isNewline) { + if (i == 17 || i == 19) + todo_wine ok(metrics[i].width == 0.0f, "%u: got width %f\n", i, metrics[i].width); + else + ok(metrics[i].width == 0.0f, "%u: got width %f\n", i, metrics[i].width); + ok(metrics[i].isWhitespace == 1, "%u: got %d\n", i, metrics[i].isWhitespace); + ok(metrics[i].canWrapLineAfter == 1, "%u: got %d\n", i, metrics[i].canWrapLineAfter); + } + } IDWriteTextLayout_Release(layout); + /* Test whitespace resolution from linebreaking classes BK, ZW, and SP */ + hr = IDWriteFactory_CreateTextLayout(factory, str_white_spaceW, sizeof(str_white_spaceW)/sizeof(WCHAR), format, + 100.0f, 200.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 20, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 6, "got %u\n", count); + + ok(metrics[0].isWhitespace == 1, "got %d\n", metrics[0].isWhitespace); + ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace); + ok(metrics[2].isWhitespace == 1, "got %d\n", metrics[2].isWhitespace); + ok(metrics[3].isWhitespace == 1, "got %d\n", metrics[3].isWhitespace); + ok(metrics[4].isWhitespace == 0, "got %d\n", metrics[4].isWhitespace); + ok(metrics[5].isWhitespace == 1, "got %d\n", metrics[5].isWhitespace); + IDWriteInlineObject_Release(trimm); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -2319,10 +2387,21 @@ static void test_DetermineMinWidth(void) { + struct minwidth_test { + const WCHAR text[10]; /* text to create a layout for */ + const WCHAR mintext[10]; /* text that represents sequence of minimal width */ + } minwidth_tests[] = { + { {' ','a','b',' ',0}, {'a','b',0} }, + { {'a','\n',' ',' ',0}, {'a',0} }, + { {'a','\n',' ',' ','b',0}, {'b',0} }, + { {'a','b','c','\n',' ',' ','b',0}, {'a','b','c',0} }, + }; static const WCHAR strW[] = {'a','b','c','d',0}; + DWRITE_CLUSTER_METRICS metrics[10]; IDWriteTextFormat *format; IDWriteTextLayout *layout; IDWriteFactory *factory; + UINT32 count, i, j; FLOAT minwidth; HRESULT hr; @@ -2337,13 +2416,44 @@ hr = IDWriteTextLayout_DetermineMinWidth(layout, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); - minwidth = 0.0; - hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth); + /* empty string */ + hr = IDWriteFactory_CreateTextLayout(factory, strW, 0, format, 100.0f, 100.0f, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(minwidth > 0.0, "got %.2f\n", minwidth); + minwidth = 1.0f; + hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(minwidth == 0.0f, "got %f\n", minwidth); IDWriteTextLayout_Release(layout); + + for (i = 0; i < sizeof(minwidth_tests)/sizeof(minwidth_tests[0]); i++) { + FLOAT width = 0.0f; + + /* measure expected width */ + hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].mintext, lstrlenW(minwidth_tests[i].mintext), format, 1000.0f, 1000.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, sizeof(metrics)/sizeof(metrics[0]), &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + + for (j = 0; j < count; j++) + width += metrics[j].width; + + IDWriteTextLayout_Release(layout); + + hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].text, lstrlenW(minwidth_tests[i].text), format, 1000.0f, 1000.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + minwidth = 0.0f; + hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(minwidth == width, "test %u: expected width %f, got %f\n", i, width, minwidth); + + IDWriteTextLayout_Release(layout); + } + IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); } @@ -3097,18 +3207,41 @@ return fontface; } +static BOOL get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT32 size) +{ + UINT32 index; + BOOL exists = FALSE; + HRESULT hr; + + hr = IDWriteLocalizedStrings_FindLocaleName(strings, enusW, &index, &exists); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (exists) { + hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size); + ok(hr == S_OK, "got 0x%08x\n", hr); + } + else + *buff = 0; + + return exists; +} + static void test_GetLineMetrics(void) { static const WCHAR str3W[] = {'a','\r','b','\n','c','\n','\r','d','\r','\n',0}; static const WCHAR strW[] = {'a','b','c','d',' ',0}; static const WCHAR str2W[] = {'a','b','\r','c','d',0}; + static const WCHAR str4W[] = {'a','\r',0}; + IDWriteFontCollection *syscollection; DWRITE_FONT_METRICS fontmetrics; DWRITE_LINE_METRICS metrics[6]; + UINT32 count, i, familycount; IDWriteTextFormat *format; IDWriteTextLayout *layout; IDWriteFontFace *fontface; IDWriteFactory *factory; - UINT32 count; + DWRITE_TEXT_RANGE range; + WCHAR nameW[256]; HRESULT hr; factory = create_factory(); @@ -3134,31 +3267,130 @@ ok(metrics[0].newlineLength == 0, "got %u\n", metrics[0].newlineLength); ok(metrics[0].isTrimmed == FALSE, "got %d\n", metrics[0].isTrimmed); - /* Tahoma doesn't provide BASE table, so baseline is calculated from font metrics */ + IDWriteTextLayout_Release(layout); + + /* Test line height and baseline calculation */ + hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + familycount = IDWriteFontCollection_GetFontFamilyCount(syscollection); + + for (i = 0; i < familycount; i++) { + static const WCHAR mvboliW[] = {'M','V',' ','B','o','l','i',0}; + IDWriteLocalizedStrings *names; + IDWriteFontFamily *family; + IDWriteFont *font; + BOOL exists; + + format = NULL; + layout = NULL; + + hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, + DWRITE_FONT_STYLE_NORMAL, &font); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontFamily_GetFamilyNames(family, &names); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (!(exists = get_enus_string(names, nameW, sizeof(nameW)/sizeof(nameW[0])))) { + IDWriteLocalFontFileLoader *localloader; + IDWriteFontFileLoader *loader; + IDWriteFontFile *file; + const void *key; + UINT32 keysize; + UINT32 count; + + count = 1; + hr = IDWriteFontFace_GetFiles(fontface, &count, &file); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontFile_GetLoader(file, &loader); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFontFileLoader_Release(loader); + + hr = IDWriteFontFile_GetReferenceKey(file, &key, &keysize); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, keysize, nameW, sizeof(nameW)/sizeof(*nameW)); + ok(hr == S_OK, "got 0x%08x\n", hr); + + skip("Failed to get English family name, font file %s\n", wine_dbgstr_w(nameW)); + + IDWriteLocalFontFileLoader_Release(localloader); + IDWriteFontFile_Release(file); + } + + IDWriteLocalizedStrings_Release(names); + IDWriteFont_Release(font); + + if (!exists) + goto cleanup; + + /* This will effectively skip on Vista/2008 only, newer systems work just fine with this font. */ + if (!lstrcmpW(nameW, mvboliW)) { + skip("Skipping line metrics test for %s, gives inconsistent results\n", wine_dbgstr_w(nameW)); + goto cleanup; + } + + IDWriteFontFace_GetMetrics(fontface, &fontmetrics); + hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 5, format, 30000.0f, 100.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(metrics, 0, sizeof(metrics)); + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 2, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + + ok(metrics[0].baseline == fontmetrics.ascent + fontmetrics.lineGap, "%s: got %.2f, expected %d, " + "linegap %d\n", wine_dbgstr_w(nameW), metrics[0].baseline, fontmetrics.ascent + fontmetrics.lineGap, + fontmetrics.lineGap); + ok(metrics[0].height == fontmetrics.ascent + fontmetrics.descent + fontmetrics.lineGap, + "%s: got %.2f, expected %d, linegap %d\n", wine_dbgstr_w(nameW), metrics[0].height, + fontmetrics.ascent + fontmetrics.descent + fontmetrics.lineGap, fontmetrics.lineGap); + + cleanup: + if (layout) + IDWriteTextLayout_Release(layout); + if (format) + IDWriteTextFormat_Release(format); + IDWriteFontFace_Release(fontface); + IDWriteFontFamily_Release(family); + } + IDWriteFontCollection_Release(syscollection); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 2048.0f, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + fontface = get_fontface_from_format(format); ok(fontface != NULL, "got %p\n", fontface); - IDWriteFontFace_GetMetrics(fontface, &fontmetrics); - - ok(metrics[0].baseline == fontmetrics.ascent, "got %.2f, expected %d\n", metrics[0].baseline, - fontmetrics.ascent); - ok(metrics[0].height == fontmetrics.ascent + fontmetrics.descent, "got %.2f, expected %d\n", - metrics[0].height, fontmetrics.ascent + fontmetrics.descent); - IDWriteTextLayout_Release(layout); /* force 2 lines */ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 10000.0, 1000.0, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); memset(metrics, 0, sizeof(metrics)); - count = 2; - hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 2, &count); + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, sizeof(metrics)/sizeof(*metrics), &count); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine { ok(count == 2, "got %u\n", count); /* baseline is relative to a line, and is not accumulated */ ok(metrics[0].baseline == metrics[1].baseline, "got %.2f, %.2f\n", metrics[0].baseline, metrics[1].baseline); -} + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); @@ -3171,29 +3403,122 @@ ok(hr == S_OK, "got 0x%08x\n", hr); memset(metrics, 0xcc, sizeof(metrics)); - hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 6, &count); + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, sizeof(metrics)/sizeof(*metrics), &count); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(count == 6, "got %u\n", count); -todo_wine { ok(metrics[0].length == 2, "got %u\n", metrics[0].length); ok(metrics[1].length == 2, "got %u\n", metrics[1].length); ok(metrics[2].length == 2, "got %u\n", metrics[2].length); ok(metrics[3].length == 1, "got %u\n", metrics[3].length); ok(metrics[4].length == 3, "got %u\n", metrics[4].length); ok(metrics[5].length == 0, "got %u\n", metrics[5].length); -} -todo_wine { ok(metrics[0].newlineLength == 1, "got %u\n", metrics[0].newlineLength); ok(metrics[1].newlineLength == 1, "got %u\n", metrics[1].newlineLength); ok(metrics[2].newlineLength == 1, "got %u\n", metrics[2].newlineLength); ok(metrics[3].newlineLength == 1, "got %u\n", metrics[3].newlineLength); ok(metrics[4].newlineLength == 2, "got %u\n", metrics[4].newlineLength); ok(metrics[5].newlineLength == 0, "got %u\n", metrics[5].newlineLength); -} + + ok(metrics[0].trailingWhitespaceLength == 1, "got %u\n", metrics[0].newlineLength); + ok(metrics[1].trailingWhitespaceLength == 1, "got %u\n", metrics[1].newlineLength); + ok(metrics[2].trailingWhitespaceLength == 1, "got %u\n", metrics[2].newlineLength); + ok(metrics[3].trailingWhitespaceLength == 1, "got %u\n", metrics[3].newlineLength); + ok(metrics[4].trailingWhitespaceLength == 2, "got %u\n", metrics[4].newlineLength); + ok(metrics[5].trailingWhitespaceLength == 0, "got %u\n", metrics[5].newlineLength); + + IDWriteTextLayout_Release(layout); + + /* empty text layout */ + hr = IDWriteFactory_CreateTextLayout(factory, strW, 0, format, 100.0f, 300.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + ok(metrics[0].length == 0, "got %u\n", metrics[0].length); + ok(metrics[0].trailingWhitespaceLength == 0, "got %u\n", metrics[0].trailingWhitespaceLength); + ok(metrics[0].newlineLength == 0, "got %u\n", metrics[0].newlineLength); + ok(metrics[0].height > 0.0f, "got %f\n", metrics[0].height); + ok(metrics[0].baseline > 0.0f, "got %f\n", metrics[0].baseline); + ok(!metrics[0].isTrimmed, "got %d\n", metrics[0].isTrimmed); + + /* change font size at first position, see if metrics changed */ + range.startPosition = 0; + range.length = 1; + hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + ok(metrics[1].height > metrics[0].height, "got %f\n", metrics[1].height); + ok(metrics[1].baseline > metrics[0].baseline, "got %f\n", metrics[1].baseline); + + /* revert font size back to format value, set different size for position 1 */ + hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + range.startPosition = 1; + range.length = 1; + hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(metrics + 1, 0, sizeof(*metrics)); + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + ok(metrics[1].height == metrics[0].height, "got %f\n", metrics[1].height); + ok(metrics[1].baseline == metrics[0].baseline, "got %f\n", metrics[1].baseline); + IDWriteTextLayout_Release(layout); + + /* text is "a\r" */ + hr = IDWriteFactory_CreateTextLayout(factory, str4W, 2, format, 100.0f, 300.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, sizeof(metrics)/sizeof(*metrics), &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 2, "got %u\n", count); + ok(metrics[0].length == 2, "got %u\n", metrics[0].length); + ok(metrics[0].newlineLength == 1, "got %u\n", metrics[0].newlineLength); + ok(metrics[0].height > 0.0f, "got %f\n", metrics[0].height); + ok(metrics[0].baseline > 0.0f, "got %f\n", metrics[0].baseline); + ok(metrics[1].length == 0, "got %u\n", metrics[1].length); + ok(metrics[1].newlineLength == 0, "got %u\n", metrics[1].newlineLength); + ok(metrics[1].height > 0.0f, "got %f\n", metrics[1].height); + ok(metrics[1].baseline > 0.0f, "got %f\n", metrics[1].baseline); + + range.startPosition = 1; + range.length = 1; + hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 2, "got %u\n", count); + ok(metrics[3].height > metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height); + ok(metrics[3].baseline > metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline); + + /* revert to original format */ + hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 2, "got %u\n", count); + ok(metrics[3].height == metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height); + ok(metrics[3].baseline == metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline); + + IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(format); IDWriteFontFace_Release(fontface); IDWriteFactory_Release(factory); @@ -3201,16 +3526,21 @@ static void test_SetTextAlignment(void) { - static const WCHAR str2W[] = {'a','a','a','a','a',0}; static const WCHAR strW[] = {'a',0}; - DWRITE_CLUSTER_METRICS clusters[1]; + + static const WCHAR stringsW[][10] = { + {'a',0}, + {0} + }; + + DWRITE_CLUSTER_METRICS clusters[10]; DWRITE_TEXT_METRICS metrics; IDWriteTextFormat1 *format1; IDWriteTextFormat *format; IDWriteTextLayout *layout; IDWriteFactory *factory; DWRITE_TEXT_ALIGNMENT v; - UINT32 count; + UINT32 count, i; HRESULT hr; factory = create_factory(); @@ -3259,80 +3589,101 @@ else win_skip("IDWriteTextFormat1 is not supported\n"); - count = 0; - hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(count == 1, "got %u\n", count); + for (i = 0; i < sizeof(stringsW)/sizeof(stringsW[0]); i++) { + FLOAT text_width; - /* maxwidth is 500, leading alignment */ - hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_LEADING); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING); + ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); - ok(metrics.left == 0.0, "got %.2f\n", metrics.left); - ok(metrics.width == clusters[0].width, "got %.2f\n", metrics.width); - ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth); - ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); - /* maxwidth is 500, trailing alignment */ - hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + count = 0; + hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, sizeof(clusters)/sizeof(*clusters), &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (lstrlenW(stringsW[i])) + ok(count > 0, "got %u\n", count); + else + ok(count == 0, "got %u\n", count); - hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + text_width = 0.0f; + while (count) + text_width += clusters[--count].width; - ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); - ok(metrics.width == clusters[0].width, "got %.2f\n", metrics.width); - ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth); - ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); - IDWriteTextLayout_Release(layout); + /* maxwidth is 500, leading alignment */ + hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_LEADING); + ok(hr == S_OK, "got 0x%08x\n", hr); - /* initially created with trailing alignment */ - hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == 0.0f, "got %.2f\n", metrics.left); + ok(metrics.width == text_width, "got %.2f\n", metrics.width); + ok(metrics.layoutWidth == 500.0f, "got %.2f\n", metrics.layoutWidth); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); - hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + /* maxwidth is 500, trailing alignment */ + hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); + ok(hr == S_OK, "got 0x%08x\n", hr); - ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); - ok(metrics.width == clusters[0].width, "got %.2f\n", metrics.width); - ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth); - ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); - IDWriteTextLayout_Release(layout); + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); - /* max width less than total run width, trailing alignment */ - hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); + ok(metrics.width == text_width, "got %.2f\n", metrics.width); + ok(metrics.layoutWidth == 500.0f, "got %.2f\n", metrics.layoutWidth); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + IDWriteTextLayout_Release(layout); - hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 2*clusters[0].width, 100.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); -todo_wine - ok(metrics.width == 5*clusters[0].width, "got %.2f\n", metrics.width); - ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); - IDWriteTextLayout_Release(layout); + /* initially created with trailing alignment */ + hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_TRAILING); + ok(hr == S_OK, "got 0x%08x\n", hr); - /* maxwidth is 500, centered */ - hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 500.0, 100.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(metrics.left == (metrics.layoutWidth - metrics.width) / 2.0, "got %.2f\n", metrics.left); - ok(metrics.width == 5*clusters[0].width, "got %.2f\n", metrics.width); - ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); + ok(metrics.width == text_width, "got %.2f\n", metrics.width); + ok(metrics.layoutWidth == 500.0f, "got %.2f\n", metrics.layoutWidth); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + IDWriteTextLayout_Release(layout); - IDWriteTextLayout_Release(layout); + if (lstrlenW(stringsW[i]) > 0) { + /* max width less than total run width, trailing alignment */ + hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, clusters[0].width, 100.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); + ok(metrics.width == text_width, "got %.2f\n", metrics.width); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + IDWriteTextLayout_Release(layout); + } + + /* maxwidth is 500, centered */ + hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(metrics.left == (metrics.layoutWidth - metrics.width) / 2.0f, "got %.2f\n", metrics.left); + ok(metrics.width == text_width, "got %.2f\n", metrics.width); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + + IDWriteTextLayout_Release(layout); + } IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -3705,11 +4056,13 @@ static void test_SetWordWrapping(void) { - static const WCHAR strW[] = {'a',0}; + static const WCHAR strW[] = {'a',' ','s','o','m','e',' ','t','e','x','t',' ','a','n','d', + ' ','a',' ','b','i','t',' ','m','o','r','e','\n','b'}; IDWriteTextFormat *format; IDWriteTextLayout *layout; IDWriteFactory *factory; DWRITE_WORD_WRAPPING v; + UINT32 count; HRESULT hr; factory = create_factory(); @@ -3721,7 +4074,7 @@ v = IDWriteTextFormat_GetWordWrapping(format); ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v); - hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); + hr = IDWriteFactory_CreateTextLayout(factory, strW, sizeof(strW)/sizeof(WCHAR), format, 10.0f, 100.0f, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); v = IDWriteTextLayout_GetWordWrapping(layout); @@ -3736,6 +4089,23 @@ v = IDWriteTextFormat_GetWordWrapping(format); ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v); + /* disable wrapping, text has explicit newline */ + hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(count == 2, "got %u\n", count); + + hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(count > 2, "got %u\n", count); + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/gdiplus_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/gdiplus_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/gdiplus_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/gdiplus_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -197,6 +197,7 @@ REAL offset; /* dash offset */ GpBrush *brush; GpPenAlignment align; + GpMatrix transform; }; struct GpGraphics{ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/pen.c wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/pen.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/pen.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/pen.c 2016-02-08 19:32:34.000000000 +0000 @@ -171,6 +171,7 @@ gp_pen->offset = 0.0; gp_pen->customstart = NULL; gp_pen->customend = NULL; + GdipSetMatrixElements(&gp_pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { FIXME("UnitWorld, UnitPixel only supported units\n"); @@ -448,17 +449,14 @@ GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix) { - static int calls; - TRACE("(%p,%p)\n", pen, matrix); if(!pen || !matrix) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + *matrix = pen->transform; - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/tests/pen.c wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/tests/pen.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/gdiplus/tests/pen.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/gdiplus/tests/pen.c 2016-02-08 19:32:34.000000000 +0000 @@ -366,6 +366,69 @@ GdipDeletePen(pen); } +static void test_transform(void) +{ + GpStatus status; + GpPen *pen; + GpMatrix *matrix, *matrix2; + REAL values[6]; + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + + status = GdipGetPenTransform(pen, matrix); + expect(Ok, status); + + status = GdipGetMatrixElements(matrix, values); + expect(Ok, status); + + expectf(1.0, values[0]); + expectf(0.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]); + + GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2); + status = GdipSetPenTransform(pen, matrix2); + todo_wine expect(Ok, status); + GdipDeleteMatrix(matrix2); + + status = GdipGetPenTransform(pen, matrix); + expect(Ok, status); + status = GdipGetMatrixElements(matrix, values); + expect(Ok, status); +todo_wine { + expectf(3.0, values[0]); + expectf(-2.0, values[1]); + expectf(5.0, values[2]); + expectf(2.0, values[3]); + expectf(6.0, values[4]); + expectf(3.0, values[5]); +} + status = GdipResetPenTransform(pen); + todo_wine expect(Ok, status); + + status = GdipGetPenTransform(pen, matrix); + expect(Ok, status); + status = GdipGetMatrixElements(matrix, values); + expect(Ok, status); + + expectf(1.0, values[0]); + expectf(0.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]); + + GdipDeletePen(pen); + + GdipDeleteMatrix(matrix); +} + START_TEST(pen) { struct GdiplusStartupInput gdiplusStartupInput; @@ -387,6 +450,7 @@ test_customcap(); test_penfilltype(); test_compoundarray(); + test_transform(); GdiplusShutdown(gdiplusToken); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/imm32/imm.c wine-staging-1.9.3~ubuntu12.04.1/dlls/imm32/imm.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/imm32/imm.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/imm32/imm.c 2016-02-08 19:32:34.000000000 +0000 @@ -439,6 +439,16 @@ PostMessageW(target, msg, wParam, lParam); } +/* for sending messages as the IME */ +static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam) +{ + HWND target = GetFocus(); + if (!target) + SendMessageW(data->IMC.hWnd,msg,wParam,lParam); + else + SendMessageW(target, msg, wParam, lParam); +} + static LRESULT ImmInternalSendIMENotify(InputContextData *data, WPARAM notify, LPARAM lParam) { HWND target; @@ -2887,7 +2897,7 @@ lpTransMsg = ImmLockIMCC(data->IMC.hMsgBuf); for (i = 0; i < data->IMC.dwNumMsgBuf; i++) - ImmInternalPostIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam); + ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam); ImmUnlockIMCC(data->IMC.hMsgBuf); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/imm32/tests/imm32.c wine-staging-1.9.3~ubuntu12.04.1/dlls/imm32/tests/imm32.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/imm32/tests/imm32.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/imm32/tests/imm32.c 2016-02-08 19:32:34.000000000 +0000 @@ -44,7 +44,7 @@ HWND hwnd; HHOOK get_msg_hook; HHOOK call_wnd_proc_hook; - imm_msgs msgs[32]; + imm_msgs msgs[64]; unsigned int i_msg; } msg_spy; @@ -59,6 +59,12 @@ } u; } TEST_INPUT; +typedef struct _tagTRANSMSG { + UINT message; + WPARAM wParam; + LPARAM lParam; +} TRANSMSG, *LPTRANSMSG; + static UINT (WINAPI *pSendInput) (UINT, INPUT*, size_t); static LRESULT CALLBACK get_msg_filter(int nCode, WPARAM wParam, LPARAM lParam) @@ -1015,6 +1021,9 @@ HIMC imc; UINT idx = 0; + LPINPUTCONTEXT lpIMC; + LPTRANSMSG lpTransMsg; + HWND hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, GetModuleHandleA(NULL), NULL); @@ -1032,6 +1041,64 @@ if (msg) ok(!msg->post, "Message should not be posted\n"); } while (msg); msg_spy_flush_msgs(); + + lpIMC = ImmLockIMC(imc); + lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG)); + lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf); + lpTransMsg += lpIMC->dwNumMsgBuf; + lpTransMsg->message = WM_IME_STARTCOMPOSITION; + lpTransMsg->wParam = 0; + lpTransMsg->lParam = 0; + ImmUnlockIMCC(lpIMC->hMsgBuf); + lpIMC->dwNumMsgBuf++; + ImmUnlockIMC(imc); + ImmGenerateMessage(imc); + idx = 0; + do + { + msg = msg_spy_find_next_msg(WM_IME_STARTCOMPOSITION, &idx); + if (msg) ok(!msg->post, "Message should not be posted\n"); + } while (msg); + msg_spy_flush_msgs(); + + lpIMC = ImmLockIMC(imc); + lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG)); + lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf); + lpTransMsg += lpIMC->dwNumMsgBuf; + lpTransMsg->message = WM_IME_COMPOSITION; + lpTransMsg->wParam = 0; + lpTransMsg->lParam = 0; + ImmUnlockIMCC(lpIMC->hMsgBuf); + lpIMC->dwNumMsgBuf++; + ImmUnlockIMC(imc); + ImmGenerateMessage(imc); + idx = 0; + do + { + msg = msg_spy_find_next_msg(WM_IME_COMPOSITION, &idx); + if (msg) ok(!msg->post, "Message should not be posted\n"); + } while (msg); + msg_spy_flush_msgs(); + + lpIMC = ImmLockIMC(imc); + lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG)); + lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf); + lpTransMsg += lpIMC->dwNumMsgBuf; + lpTransMsg->message = WM_IME_ENDCOMPOSITION; + lpTransMsg->wParam = 0; + lpTransMsg->lParam = 0; + ImmUnlockIMCC(lpIMC->hMsgBuf); + lpIMC->dwNumMsgBuf++; + ImmUnlockIMC(imc); + ImmGenerateMessage(imc); + idx = 0; + do + { + msg = msg_spy_find_next_msg(WM_IME_ENDCOMPOSITION, &idx); + if (msg) ok(!msg->post, "Message should not be posted\n"); + } while (msg); + msg_spy_flush_msgs(); + ImmSetOpenStatus(imc, FALSE); ImmReleaseContext(hwnd, imc); DestroyWindow(hwnd); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/array.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/array.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/array.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/array.c 2016-02-08 19:32:34.000000000 +0000 @@ -20,6 +20,7 @@ #include "wine/port.h" #include +#include #include "jscript.h" @@ -64,6 +65,12 @@ return is_vclass(jsthis, JSCLASS_ARRAY) ? array_from_vdisp(jsthis) : NULL; } +unsigned array_get_length(jsdisp_t *array) +{ + assert(is_class(array, JSCLASS_ARRAY)); + return array_from_jsdisp(array)->length; +} + static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret) { ArrayInstance *array; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/bool.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/bool.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/bool.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/bool.c 2016-02-08 19:32:34.000000000 +0000 @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "jscript.h" #include "wine/debug.h" @@ -37,6 +39,12 @@ return is_vclass(jsthis, JSCLASS_BOOLEAN) ? (BoolInstance*)jsthis->u.jsdisp : NULL; } +BOOL bool_obj_value(jsdisp_t *obj) +{ + assert(is_class(obj, JSCLASS_BOOLEAN)); + return ((BoolInstance*)obj)->val; +} + /* ECMA-262 3rd Edition 15.6.4.2 */ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/global.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/global.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/global.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/global.c 2016-02-08 19:32:34.000000000 +0000 @@ -67,6 +67,7 @@ {'S','c','r','i','p','t','E','n','g','i','n','e','B','u','i','l','d','V','e','r','s','i','o','n',0}; static const WCHAR CollectGarbageW[] = {'C','o','l','l','e','c','t','G','a','r','b','a','g','e',0}; static const WCHAR MathW[] = {'M','a','t','h',0}; +static const WCHAR JSONW[] = {'J','S','O','N',0}; static const WCHAR encodeURIW[] = {'e','n','c','o','d','e','U','R','I',0}; static const WCHAR decodeURIW[] = {'d','e','c','o','d','e','U','R','I',0}; static const WCHAR encodeURIComponentW[] = {'e','n','c','o','d','e','U','R','I','C','o','m','p','o','n','e','n','t',0}; @@ -264,8 +265,7 @@ if(FAILED(hres)) return hres; - if(!isinf(n) && !isnan(n)) - ret = TRUE; + ret = is_finite(n); } if(r) @@ -1108,6 +1108,19 @@ if(FAILED(hres)) return hres; + if(ctx->version >= 2) { + jsdisp_t *json; + + hres = create_json(ctx, &json); + if(FAILED(hres)) + return hres; + + hres = jsdisp_propput_dontenum(ctx->global, JSONW, jsval_obj(json)); + jsdisp_release(json); + if(FAILED(hres)) + return hres; + } + hres = create_activex_constr(ctx, &constr); if(FAILED(hres)) return hres; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/jscript.h wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/jscript.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/jscript.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/jscript.h 2016-02-08 19:32:34.000000000 +0000 @@ -117,7 +117,8 @@ JSCLASS_REGEXP, JSCLASS_STRING, JSCLASS_ARGUMENTS, - JSCLASS_VBARRAY + JSCLASS_VBARRAY, + JSCLASS_JSON } jsclass_t; jsdisp_t *iface_to_jsdisp(IUnknown*) DECLSPEC_HIDDEN; @@ -317,6 +318,7 @@ HRESULT create_bool(script_ctx_t*,BOOL,jsdisp_t**) DECLSPEC_HIDDEN; HRESULT create_number(script_ctx_t*,double,jsdisp_t**) DECLSPEC_HIDDEN; HRESULT create_vbarray(script_ctx_t*,SAFEARRAY*,jsdisp_t**) DECLSPEC_HIDDEN; +HRESULT create_json(script_ctx_t*,jsdisp_t**) DECLSPEC_HIDDEN; typedef enum { NO_HINT, @@ -339,6 +341,7 @@ HRESULT decode_source(WCHAR*) DECLSPEC_HIDDEN; HRESULT double_to_string(double,jsstr_t**) DECLSPEC_HIDDEN; +BOOL is_finite(double) DECLSPEC_HIDDEN; typedef struct named_item_t { IDispatch *disp; @@ -458,6 +461,9 @@ HRESULT parse_regexp_flags(const WCHAR*,DWORD,DWORD*) DECLSPEC_HIDDEN; HRESULT regexp_string_match(script_ctx_t*,jsdisp_t*,jsstr_t*,jsval_t*) DECLSPEC_HIDDEN; +BOOL bool_obj_value(jsdisp_t*) DECLSPEC_HIDDEN; +unsigned array_get_length(jsdisp_t*) DECLSPEC_HIDDEN; + static inline BOOL is_class(jsdisp_t *jsdisp, jsclass_t class) { return jsdisp->builtin_info->class == class; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/json.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/json.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/json.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/json.c 2016-02-08 19:32:34.000000000 +0000 @@ -0,0 +1,853 @@ +/* + * Copyright 2016 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "jscript.h" +#include "parser.h" + +#include "wine/debug.h" +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(jscript); + +static const WCHAR parseW[] = {'p','a','r','s','e',0}; +static const WCHAR stringifyW[] = {'s','t','r','i','n','g','i','f','y',0}; + +static const WCHAR nullW[] = {'n','u','l','l',0}; +static const WCHAR trueW[] = {'t','r','u','e',0}; +static const WCHAR falseW[] = {'f','a','l','s','e',0}; + +static const WCHAR toJSONW[] = {'t','o','J','S','O','N',0}; + +typedef struct { + const WCHAR *ptr; + const WCHAR *end; + script_ctx_t *ctx; +} json_parse_ctx_t; + +static BOOL is_json_space(WCHAR c) +{ + return c == ' ' || c == '\t' || c == '\n' || c == '\r'; +} + +static WCHAR skip_spaces(json_parse_ctx_t *ctx) +{ + while(is_json_space(*ctx->ptr)) + ctx->ptr++; + return *ctx->ptr; +} + +static BOOL is_keyword(json_parse_ctx_t *ctx, const WCHAR *keyword) +{ + unsigned i; + for(i=0; keyword[i]; i++) { + if(!ctx->ptr[i] || keyword[i] != ctx->ptr[i]) + return FALSE; + } + if(is_identifier_char(ctx->ptr[i])) + return FALSE; + ctx->ptr += i; + return TRUE; +} + +/* ECMA-262 5.1 Edition 15.12.1.1 */ +static HRESULT parse_json_string(json_parse_ctx_t *ctx, WCHAR **r) +{ + const WCHAR *ptr = ++ctx->ptr; + size_t len; + WCHAR *buf; + + while(*ctx->ptr && *ctx->ptr != '"') { + if(*ctx->ptr++ == '\\') + ctx->ptr++; + } + if(!*ctx->ptr) { + FIXME("unterminated string\n"); + return E_FAIL; + } + + len = ctx->ptr-ptr; + buf = heap_alloc((len+1)*sizeof(WCHAR)); + if(!buf) + return E_OUTOFMEMORY; + if(len) + memcpy(buf, ptr, len*sizeof(WCHAR)); + buf[len] = 0; + + if(!unescape(buf)) { + FIXME("unescape failed\n"); + heap_free(buf); + return E_FAIL; + } + + ctx->ptr++; + *r = buf; + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.1.2 */ +static HRESULT parse_json_value(json_parse_ctx_t *ctx, jsval_t *r) +{ + HRESULT hres; + + switch(skip_spaces(ctx)) { + + /* JSONNullLiteral */ + case 'n': + if(!is_keyword(ctx, nullW)) + break; + *r = jsval_null(); + return S_OK; + + /* JSONBooleanLiteral */ + case 't': + if(!is_keyword(ctx, trueW)) + break; + *r = jsval_bool(TRUE); + return S_OK; + case 'f': + if(!is_keyword(ctx, falseW)) + break; + *r = jsval_bool(FALSE); + return S_OK; + + /* JSONObject */ + case '{': { + WCHAR *prop_name; + jsdisp_t *obj; + jsval_t val; + + hres = create_object(ctx->ctx, NULL, &obj); + if(FAILED(hres)) + return hres; + + ctx->ptr++; + if(skip_spaces(ctx) == '}') { + ctx->ptr++; + *r = jsval_obj(obj); + return S_OK; + } + + while(1) { + if(*ctx->ptr != '"') + break; + hres = parse_json_string(ctx, &prop_name); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) != ':') { + FIXME("missing ':'\n"); + heap_free(prop_name); + break; + } + + ctx->ptr++; + hres = parse_json_value(ctx, &val); + if(SUCCEEDED(hres)) { + hres = jsdisp_propput_name(obj, prop_name, val); + jsval_release(val); + } + heap_free(prop_name); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) == '}') { + ctx->ptr++; + *r = jsval_obj(obj); + return S_OK; + } + + if(*ctx->ptr++ != ',') { + FIXME("expected ','\n"); + break; + } + skip_spaces(ctx); + } + + jsdisp_release(obj); + break; + } + + /* JSONString */ + case '"': { + WCHAR *string; + jsstr_t *str; + + hres = parse_json_string(ctx, &string); + if(FAILED(hres)) + return hres; + + /* FIXME: avoid reallocation */ + str = jsstr_alloc(string); + heap_free(string); + if(!str) + return E_OUTOFMEMORY; + + *r = jsval_string(str); + return S_OK; + } + + /* JSONArray */ + case '[': { + jsdisp_t *array; + unsigned i = 0; + jsval_t val; + + hres = create_array(ctx->ctx, 0, &array); + if(FAILED(hres)) + return hres; + + ctx->ptr++; + if(skip_spaces(ctx) == ']') { + ctx->ptr++; + *r = jsval_obj(array); + return S_OK; + } + + while(1) { + hres = parse_json_value(ctx, &val); + if(FAILED(hres)) + break; + + hres = jsdisp_propput_idx(array, i, val); + jsval_release(val); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) == ']') { + ctx->ptr++; + *r = jsval_obj(array); + return S_OK; + } + + if(*ctx->ptr != ',') { + FIXME("expected ','\n"); + break; + } + + ctx->ptr++; + i++; + } + + jsdisp_release(array); + break; + } + + /* JSONNumber */ + default: { + int sign = 1; + double n; + + if(*ctx->ptr == '-') { + sign = -1; + ctx->ptr++; + skip_spaces(ctx); + } + + if(!isdigitW(*ctx->ptr)) + break; + + if(*ctx->ptr == '0') { + ctx->ptr++; + n = 0; + if(is_identifier_char(*ctx->ptr)) + break; + }else { + hres = parse_decimal(&ctx->ptr, ctx->end, &n); + if(FAILED(hres)) + return hres; + } + + *r = jsval_number(sign*n); + return S_OK; + } + } + + FIXME("Syntax error at %s\n", debugstr_w(ctx->ptr)); + return E_FAIL; +} + +/* ECMA-262 5.1 Edition 15.12.2 */ +static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + json_parse_ctx_t parse_ctx; + const WCHAR *buf; + jsstr_t *str; + jsval_t ret; + HRESULT hres; + + if(argc != 1) { + FIXME("Unsupported args\n"); + return E_INVALIDARG; + } + + hres = to_flat_string(ctx, argv[0], &str, &buf); + if(FAILED(hres)) + return hres; + + TRACE("%s\n", debugstr_w(buf)); + + parse_ctx.ptr = buf; + parse_ctx.end = buf + jsstr_length(str); + parse_ctx.ctx = ctx; + hres = parse_json_value(&parse_ctx, &ret); + jsstr_release(str); + if(FAILED(hres)) + return hres; + + if(skip_spaces(&parse_ctx)) { + FIXME("syntax error\n"); + jsval_release(ret); + return E_FAIL; + } + + if(r) + *r = ret; + else + jsval_release(ret); + return S_OK; +} + +typedef struct { + script_ctx_t *ctx; + + WCHAR *buf; + size_t buf_size; + size_t buf_len; + + jsdisp_t **stack; + size_t stack_top; + size_t stack_size; + + WCHAR gap[11]; /* according to the spec, it's no longer than 10 chars */ +} stringify_ctx_t; + +static BOOL stringify_push_obj(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + if(!ctx->stack_size) { + ctx->stack = heap_alloc(4*sizeof(*ctx->stack)); + if(!ctx->stack) + return FALSE; + ctx->stack_size = 4; + }else if(ctx->stack_top == ctx->stack_size) { + jsdisp_t **new_stack; + + new_stack = heap_realloc(ctx->stack, ctx->stack_size*2*sizeof(*ctx->stack)); + if(!new_stack) + return FALSE; + ctx->stack = new_stack; + ctx->stack_size *= 2; + } + + ctx->stack[ctx->stack_top++] = obj; + return TRUE; +} + +static void stringify_pop_obj(stringify_ctx_t *ctx) +{ + ctx->stack_top--; +} + +static BOOL is_on_stack(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + size_t i = ctx->stack_top; + while(i--) { + if(ctx->stack[i] == obj) + return TRUE; + } + return FALSE; +} + +static BOOL append_string_len(stringify_ctx_t *ctx, const WCHAR *str, size_t len) +{ + if(!ctx->buf_size) { + ctx->buf = heap_alloc(len*2*sizeof(WCHAR)); + if(!ctx->buf) + return FALSE; + ctx->buf_size = len*2; + }else if(ctx->buf_len + len > ctx->buf_size) { + WCHAR *new_buf; + size_t new_size; + + new_size = ctx->buf_size * 2 + len; + new_buf = heap_realloc(ctx->buf, new_size*sizeof(WCHAR)); + if(!new_buf) + return FALSE; + ctx->buf = new_buf; + ctx->buf_size = new_size; + } + + if(len) + memcpy(ctx->buf + ctx->buf_len, str, len*sizeof(WCHAR)); + ctx->buf_len += len; + return TRUE; +} + +static inline BOOL append_string(stringify_ctx_t *ctx, const WCHAR *str) +{ + return append_string_len(ctx, str, strlenW(str)); +} + +static inline BOOL append_char(stringify_ctx_t *ctx, WCHAR c) +{ + return append_string_len(ctx, &c, 1); +} + +static inline BOOL append_simple_quote(stringify_ctx_t *ctx, WCHAR c) +{ + WCHAR str[] = {'\\',c}; + return append_string_len(ctx, str, 2); +} + +static HRESULT maybe_to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *r) +{ + jsdisp_t *obj; + HRESULT hres; + + if(!is_object_instance(val) || !get_object(val) || !(obj = iface_to_jsdisp((IUnknown*)get_object(val)))) + return jsval_copy(val, r); + + if(is_class(obj, JSCLASS_NUMBER)) { + double n; + hres = to_number(ctx, val, &n); + jsdisp_release(obj); + if(SUCCEEDED(hres)) + *r = jsval_number(n); + return hres; + } + + if(is_class(obj, JSCLASS_STRING)) { + jsstr_t *str; + hres = to_string(ctx, val, &str); + jsdisp_release(obj); + if(SUCCEEDED(hres)) + *r = jsval_string(str); + return hres; + } + + if(is_class(obj, JSCLASS_BOOLEAN)) { + *r = jsval_bool(bool_obj_value(obj)); + jsdisp_release(obj); + return S_OK; + } + + *r = jsval_obj(obj); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation Quote) */ +static HRESULT json_quote(stringify_ctx_t *ctx, const WCHAR *ptr, size_t len) +{ + if(!ptr || !append_char(ctx, '"')) + return E_OUTOFMEMORY; + + while(len--) { + switch(*ptr) { + case '"': + case '\\': + if(!append_simple_quote(ctx, *ptr)) + return E_OUTOFMEMORY; + break; + case '\b': + if(!append_simple_quote(ctx, 'b')) + return E_OUTOFMEMORY; + break; + case '\f': + if(!append_simple_quote(ctx, 'f')) + return E_OUTOFMEMORY; + break; + case '\n': + if(!append_simple_quote(ctx, 'n')) + return E_OUTOFMEMORY; + break; + case '\r': + if(!append_simple_quote(ctx, 'r')) + return E_OUTOFMEMORY; + break; + case '\t': + if(!append_simple_quote(ctx, 't')) + return E_OUTOFMEMORY; + break; + default: + if(*ptr < ' ') { + const WCHAR formatW[] = {'\\','u','%','0','4','x',0}; + WCHAR buf[7]; + sprintfW(buf, formatW, *ptr); + if(!append_string(ctx, buf)) + return E_OUTOFMEMORY; + }else { + if(!append_char(ctx, *ptr)) + return E_OUTOFMEMORY; + } + } + ptr++; + } + + return append_char(ctx, '"') ? S_OK : E_OUTOFMEMORY; +} + +static inline BOOL is_callable(jsdisp_t *obj) +{ + return is_class(obj, JSCLASS_FUNCTION); +} + +static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val); + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation JA) */ +static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + unsigned length, i, j; + jsval_t val; + HRESULT hres; + + if(is_on_stack(ctx, obj)) { + FIXME("Found a cycle\n"); + return E_FAIL; + } + + if(!stringify_push_obj(ctx, obj)) + return E_OUTOFMEMORY; + + if(!append_char(ctx, '[')) + return E_OUTOFMEMORY; + + length = array_get_length(obj); + + for(i=0; i < length; i++) { + if(i && !append_char(ctx, ',')) + return E_OUTOFMEMORY; + + if(*ctx->gap) { + if(!append_char(ctx, '\n')) + return E_OUTOFMEMORY; + + for(j=0; j < ctx->stack_top; j++) { + if(!append_string(ctx, ctx->gap)) + return E_OUTOFMEMORY; + } + } + + hres = jsdisp_get_idx(obj, i, &val); + if(FAILED(hres)) + return hres; + + hres = stringify(ctx, val); + if(FAILED(hres)) + return hres; + + if(hres == S_FALSE && !append_string(ctx, nullW)) + return E_OUTOFMEMORY; + } + + if((length && *ctx->gap && !append_char(ctx, '\n')) || !append_char(ctx, ']')) + return E_OUTOFMEMORY; + + stringify_pop_obj(ctx); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation JO) */ +static HRESULT stringify_object(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + DISPID dispid = DISPID_STARTENUM; + jsval_t val = jsval_undefined(); + unsigned prop_cnt = 0, i; + size_t stepback; + BSTR prop_name; + HRESULT hres; + + if(is_on_stack(ctx, obj)) { + FIXME("Found a cycle\n"); + return E_FAIL; + } + + if(!stringify_push_obj(ctx, obj)) + return E_OUTOFMEMORY; + + if(!append_char(ctx, '{')) + return E_OUTOFMEMORY; + + while((hres = IDispatchEx_GetNextDispID(&obj->IDispatchEx_iface, fdexEnumDefault, dispid, &dispid)) == S_OK) { + jsval_release(val); + hres = jsdisp_propget(obj, dispid, &val); + if(FAILED(hres)) + return hres; + + if(is_undefined(val)) + continue; + + stepback = ctx->buf_len; + + if(prop_cnt && !append_char(ctx, ',')) { + hres = E_OUTOFMEMORY; + break; + } + + if(*ctx->gap) { + if(!append_char(ctx, '\n')) { + hres = E_OUTOFMEMORY; + break; + } + + for(i=0; i < ctx->stack_top; i++) { + if(!append_string(ctx, ctx->gap)) { + hres = E_OUTOFMEMORY; + break; + } + } + } + + hres = IDispatchEx_GetMemberName(&obj->IDispatchEx_iface, dispid, &prop_name); + if(FAILED(hres)) + break; + + hres = json_quote(ctx, prop_name, SysStringLen(prop_name)); + SysFreeString(prop_name); + if(FAILED(hres)) + break; + + if(!append_char(ctx, ':') || (*ctx->gap && !append_char(ctx, ' '))) { + hres = E_OUTOFMEMORY; + break; + } + + hres = stringify(ctx, val); + if(FAILED(hres)) + break; + + if(hres == S_FALSE) { + ctx->buf_len = stepback; + continue; + } + + prop_cnt++; + } + jsval_release(val); + if(FAILED(hres)) + return hres; + + if(prop_cnt && *ctx->gap) { + if(!append_char(ctx, '\n')) + return E_OUTOFMEMORY; + + for(i=1; i < ctx->stack_top; i++) { + if(!append_string(ctx, ctx->gap)) { + hres = E_OUTOFMEMORY; + break; + } + } + } + + if(!append_char(ctx, '}')) + return E_OUTOFMEMORY; + + stringify_pop_obj(ctx); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation Str) */ +static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val) +{ + jsval_t value; + HRESULT hres; + + if(is_object_instance(val) && get_object(val)) { + jsdisp_t *obj; + DISPID id; + + obj = iface_to_jsdisp((IUnknown*)get_object(val)); + if(!obj) + return S_FALSE; + + hres = jsdisp_get_id(obj, toJSONW, 0, &id); + jsdisp_release(obj); + if(hres == S_OK) + FIXME("Use toJSON.\n"); + } + + /* FIXME: Support replacer replacer. */ + + hres = maybe_to_primitive(ctx->ctx, val, &value); + if(FAILED(hres)) + return hres; + + switch(jsval_type(value)) { + case JSV_NULL: + if(!append_string(ctx, nullW)) + hres = E_OUTOFMEMORY; + break; + case JSV_BOOL: + if(!append_string(ctx, get_bool(value) ? trueW : falseW)) + hres = E_OUTOFMEMORY; + break; + case JSV_STRING: { + jsstr_t *str = get_string(value); + const WCHAR *ptr = jsstr_flatten(str); + if(ptr) + hres = json_quote(ctx, ptr, jsstr_length(str)); + else + hres = E_OUTOFMEMORY; + break; + } + case JSV_NUMBER: { + double n = get_number(value); + if(is_finite(n)) { + const WCHAR *ptr; + jsstr_t *str; + + /* FIXME: Optimize. There is no need for jsstr_t here. */ + hres = double_to_string(n, &str); + if(FAILED(hres)) + break; + + ptr = jsstr_flatten(str); + assert(ptr != NULL); + hres = ptr && !append_string_len(ctx, ptr, jsstr_length(str)) ? E_OUTOFMEMORY : S_OK; + jsstr_release(str); + }else { + if(!append_string(ctx, nullW)) + hres = E_OUTOFMEMORY; + } + break; + } + case JSV_OBJECT: { + jsdisp_t *obj; + + obj = iface_to_jsdisp((IUnknown*)get_object(value)); + if(!obj) { + hres = S_FALSE; + break; + } + + if(!is_callable(obj)) + hres = is_class(obj, JSCLASS_ARRAY) ? stringify_array(ctx, obj) : stringify_object(ctx, obj); + else + hres = S_FALSE; + + jsdisp_release(obj); + break; + } + case JSV_UNDEFINED: + hres = S_FALSE; + break; + case JSV_VARIANT: + FIXME("VARIANT\n"); + hres = E_NOTIMPL; + break; + } + + jsval_release(value); + return hres; +} + +/* ECMA-262 5.1 Edition 15.12.3 */ +static HRESULT JSON_stringify(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + stringify_ctx_t stringify_ctx = {ctx, NULL,0,0, NULL,0,0, {0}}; + HRESULT hres; + + TRACE("\n"); + + if(argc >= 2 && is_object_instance(argv[1])) { + FIXME("Replacer %s not yet supported\n", debugstr_jsval(argv[1])); + return E_NOTIMPL; + } + + if(argc >= 3) { + jsval_t space_val; + + hres = maybe_to_primitive(ctx, argv[2], &space_val); + if(FAILED(hres)) + return hres; + + if(is_number(space_val)) { + double n = get_number(space_val); + if(n >= 1) { + int i, len; + if(n > 10) + n = 10; + len = floor(n); + for(i=0; i < len; i++) + stringify_ctx.gap[i] = ' '; + stringify_ctx.gap[len] = 0; + } + }else if(is_string(space_val)) { + jsstr_t *space_str = get_string(space_val); + size_t len = jsstr_length(space_str); + if(len > 10) + len = 10; + jsstr_extract(space_str, 0, len, stringify_ctx.gap); + } + + jsval_release(space_val); + } + + hres = stringify(&stringify_ctx, argv[0]); + if(SUCCEEDED(hres) && r) { + assert(!stringify_ctx.stack_top); + + if(hres == S_OK) { + jsstr_t *ret = jsstr_alloc_len(stringify_ctx.buf, stringify_ctx.buf_len); + if(ret) + *r = jsval_string(ret); + else + hres = E_OUTOFMEMORY; + }else { + *r = jsval_undefined(); + } + } + + heap_free(stringify_ctx.buf); + heap_free(stringify_ctx.stack); + return hres; +} + +static const builtin_prop_t JSON_props[] = { + {parseW, JSON_parse, PROPF_METHOD|2}, + {stringifyW, JSON_stringify, PROPF_METHOD|3} +}; + +static const builtin_info_t JSON_info = { + JSCLASS_JSON, + {NULL, NULL, 0}, + sizeof(JSON_props)/sizeof(*JSON_props), + JSON_props, + NULL, + NULL +}; + +HRESULT create_json(script_ctx_t *ctx, jsdisp_t **ret) +{ + jsdisp_t *json; + HRESULT hres; + + json = heap_alloc_zero(sizeof(*json)); + if(!json) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(json, ctx, &JSON_info, ctx->object_constr); + if(FAILED(hres)) { + heap_free(json); + return hres; + } + + *ret = json; + return S_OK; +} diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/jsutils.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/jsutils.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/jsutils.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/jsutils.c 2016-02-08 19:32:34.000000000 +0000 @@ -53,6 +53,11 @@ return NULL; } +BOOL is_finite(double n) +{ + return !isnan(n) && !isinf(n); +} + #define MIN_BLOCK_SIZE 128 #define ARENA_FREE_FILLER 0xaa @@ -641,7 +646,7 @@ if(FAILED(hres)) return hres; - *ret = isnan(n) || isinf(n) ? 0 : n; + *ret = is_finite(n) ? n : 0; return S_OK; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/lex.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/lex.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/lex.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/lex.c 2016-02-08 19:32:34.000000000 +0000 @@ -109,7 +109,7 @@ } /* ECMA-262 3rd Edition 7.6 */ -static BOOL is_identifier_char(WCHAR c) +BOOL is_identifier_char(WCHAR c) { return isalnumW(c) || c == '$' || c == '_' || c == '\\'; } @@ -249,7 +249,7 @@ return ctx->ptr != ctx->end; } -static BOOL unescape(WCHAR *str) +BOOL unescape(WCHAR *str) { WCHAR *pd, *p, c; int i; @@ -406,14 +406,14 @@ return ret; } -static BOOL parse_double_literal(parser_ctx_t *ctx, LONG int_part, double *ret) +HRESULT parse_decimal(const WCHAR **iter, const WCHAR *end, double *ret) { - LONGLONG d, hlp; + const WCHAR *ptr = *iter; + LONGLONG d = 0, hlp; int exp = 0; - d = int_part; - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - hlp = d*10 + *(ctx->ptr++) - '0'; + while(ptr < end && isdigitW(*ptr)) { + hlp = d*10 + *(ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) { exp++; break; @@ -421,51 +421,48 @@ else d = hlp; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ptr < end && isdigitW(*ptr)) { exp++; - ctx->ptr++; + ptr++; } - if(*ctx->ptr == '.') { - ctx->ptr++; + if(*ptr == '.') { + ptr++; - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - hlp = d*10 + *(ctx->ptr++) - '0'; + while(ptr < end && isdigitW(*ptr)) { + hlp = d*10 + *(ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) break; d = hlp; exp--; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) - ctx->ptr++; + while(ptr < end && isdigitW(*ptr)) + ptr++; } - if(ctx->ptr < ctx->end && (*ctx->ptr == 'e' || *ctx->ptr == 'E')) { + if(ptr < end && (*ptr == 'e' || *ptr == 'E')) { int sign = 1, e = 0; - ctx->ptr++; - if(ctx->ptr < ctx->end) { - if(*ctx->ptr == '+') { - ctx->ptr++; - }else if(*ctx->ptr == '-') { + if(++ptr < end) { + if(*ptr == '+') { + ptr++; + }else if(*ptr == '-') { sign = -1; - ctx->ptr++; - }else if(!isdigitW(*ctx->ptr)) { + ptr++; + }else if(!isdigitW(*ptr)) { WARN("Expected exponent part\n"); - lex_error(ctx, E_FAIL); - return FALSE; + return E_FAIL; } } - if(ctx->ptr == ctx->end) { + if(ptr == end) { WARN("unexpected end of file\n"); - lex_error(ctx, E_FAIL); - return FALSE; + return E_FAIL; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - if(e > INT_MAX/10 || (e = e*10 + *ctx->ptr++ - '0')<0) + while(ptr < end && isdigitW(*ptr)) { + if(e > INT_MAX/10 || (e = e*10 + *ptr++ - '0')<0) e = INT_MAX; } e *= sign; @@ -475,22 +472,25 @@ else exp += e; } - if(is_identifier_char(*ctx->ptr)) { + if(is_identifier_char(*ptr)) { WARN("wrong char after zero\n"); - lex_error(ctx, JS_E_MISSING_SEMICOLON); - return FALSE; + return JS_E_MISSING_SEMICOLON; } *ret = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); - return TRUE; + *iter = ptr; + return S_OK; } static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret) { - LONG l, d; + HRESULT hres; + + if(*ctx->ptr == '0') { + LONG d, l = 0; + + ctx->ptr++; - l = *ctx->ptr++ - '0'; - if(!l) { if(*ctx->ptr == 'x' || *ctx->ptr == 'X') { if(++ctx->ptr == ctx->end) { ERR("unexpected end of file\n"); @@ -546,7 +546,13 @@ } } - return parse_double_literal(ctx, l, ret); + hres = parse_decimal(&ctx->ptr, ctx->end, ret); + if(FAILED(hres)) { + lex_error(ctx, hres); + return FALSE; + } + + return TRUE; } static int next_token(parser_ctx_t *ctx, void *lval) @@ -599,8 +605,12 @@ case '.': if(++ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { double n; - if(!parse_double_literal(ctx, 0, &n)) + HRESULT hres; + hres = parse_decimal(&ctx->ptr, ctx->end, &n); + if(FAILED(hres)) { + lex_error(ctx, hres); return -1; + } *(literal_t**)lval = new_double_literal(ctx, n); return tNumericLiteral; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/Makefile.in wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/Makefile.in --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/Makefile.in 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/Makefile.in 2016-02-08 19:32:34.000000000 +0000 @@ -15,6 +15,7 @@ global.c \ jscript.c \ jscript_main.c \ + json.c \ jsregexp.c \ jsstr.c \ jsutils.c \ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/number.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/number.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/number.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/number.c 2016-02-08 19:32:34.000000000 +0000 @@ -16,9 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include @@ -257,7 +254,7 @@ val = number->value; - if(radix==10 || isnan(val) || isinf(val)) { + if(radix==10 || !is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -383,7 +380,7 @@ } val = number->value; - if(isinf(val) || isnan(val)) { + if(!is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -424,7 +421,7 @@ } val = number->value; - if(isinf(val) || isnan(val)) { + if(!is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -465,7 +462,7 @@ } val = number->value; - if(isinf(val) || isnan(val) || !prec) { + if(!is_finite(val) || !prec) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/object.c wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/object.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/object.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/object.c 2016-02-08 19:32:34.000000000 +0000 @@ -54,7 +54,7 @@ static const WCHAR stringW[] = {'S','t','r','i','n','g',0}; /* Keep in sync with jsclass_t enum */ static const WCHAR *names[] = {NULL, arrayW, booleanW, dateW, errorW, - functionW, NULL, mathW, numberW, objectW, regexpW, stringW, objectW, objectW}; + functionW, NULL, mathW, numberW, objectW, regexpW, stringW, objectW, objectW, objectW}; TRACE("\n"); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/parser.h wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/parser.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/parser.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/parser.h 2016-02-08 19:32:34.000000000 +0000 @@ -62,6 +62,10 @@ return heap_pool_alloc(&ctx->script->tmp_heap, size); } +BOOL is_identifier_char(WCHAR) DECLSPEC_HIDDEN; +BOOL unescape(WCHAR*) DECLSPEC_HIDDEN; +HRESULT parse_decimal(const WCHAR**,const WCHAR*,double*) DECLSPEC_HIDDEN; + typedef enum { LT_DOUBLE, LT_STRING, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/tests/api.js wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/tests/api.js --- wine-staging-1.9.2~ubuntu12.04.1/dlls/jscript/tests/api.js 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/jscript/tests/api.js 2016-02-08 19:32:34.000000000 +0000 @@ -1766,6 +1766,89 @@ tmp = Math.tan(-Infinity); ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); +(function() { + if(invokeVersion < 2) + return; + + var stringify_tests = [ + [[true], "true"], + [[false], "false"], + [[null], "null"], + [[1], "1"], + [["test"], "\"test\""], + [["test\"\\\b\f\n\r\t\u0002 !"], "\"test\\\"\\\\\\b\\f\\n\\r\\t\\u0002 !\""], + [[NaN], "null"], + [[Infinity], "null"], + [[-Infinity], "null"], + [[{prop1: true, prop2: "string"}], "{\"prop1\":true,\"prop2\":\"string\"}"], + [[{prop1: true, prop2: testObj, prop3: undefined}], "{\"prop1\":true}"], + [[{prop1: true, prop2: {prop: "string"}},undefined," "], + "{\n \"prop1\": true,\n \"prop2\": {\n \"prop\": \"string\"\n }\n}"], + [[{ },undefined," "], "{}"], + [[[,2,undefined,3,{ },]],"[null,2,null,3,{},null]"], + [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n \"prop\": 0\n },\n null\n]"] + ]; + + var i, s, v; + + for(i=0; i < stringify_tests.length; i++) { + s = JSON.stringify.apply(null, stringify_tests[i][0]); + ok(s === stringify_tests[i][1], + "["+i+"] stringify(" + stringify_tests[i][0] + ") returned " + s + " expected " + stringify_tests[i][1]); + } + + s = JSON.stringify(testObj); + ok(s === undefined || s === "undefined" /* broken on some old versions */, + "stringify(testObj) returned " + s + " expected undfined"); + + s = JSON.stringify(undefined); + ok(s === undefined || s === "undefined" /* broken on some old versions */, + "stringify(undefined) returned " + s + " expected undfined"); + + var parse_tests = [ + ["true", true], + [" \nnull ", null], + ["{}", {}], + ["\"\\r\\n test\\u1111\"", "\r\n test\u1111"], + ["{\"x\" :\n true}", {x:true}], + ["{\"x y\": {}, \"z\": {\"x\":null}}", {"x y":{}, z:{x:null}}], + ["[]", []], + ["[false,{},{\"x\": []}]", [false,{},{x:[]}]], + ["0", 0], + ["- 1", -1], + ["1e2147483648", Infinity] + ]; + + function json_cmp(x, y) { + if(x === y) + return true; + + if(!(x instanceof Object) || !(y instanceof Object)) + return false; + + for(var prop in x) { + if(!x.hasOwnProperty(prop)) + continue; + if(!x.hasOwnProperty(prop)) + return false; + if(!json_cmp(x[prop], y[prop])) + return false; + } + + for(var prop in y) { + if(!x.hasOwnProperty(prop) && y.hasOwnProperty(prop)) + return false; + } + + return true; + } + + for(i=0; i < parse_tests.length; i++) { + v = JSON.parse(parse_tests[i][0]); + ok(json_cmp(v, parse_tests[i][1]), "parse[" + i + "] returned " + v + ", expected " + parse_tests[i][1]); + } +})(); + var func = function (a) { var a = 1; if(a) return; @@ -2717,6 +2800,14 @@ ["lbound", 0], ["toArray", 0], ["ubound", 0] +]); + +if(invokeVersion < 2) + ok(typeof(JSON) === "undefined", "JSON is not undefined"); +else + testFunctions(JSON, [ + ["parse", 2], + ["stringify", 3] ]); ok(ActiveXObject.length == 1, "ActiveXObject.length = " + ActiveXObject.length); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/console.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/console.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/console.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/console.c 2016-02-08 19:32:34.000000000 +0000 @@ -3267,20 +3267,21 @@ memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO)); - if (maxwindow) - { - FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; - } - SERVER_START_REQ(get_console_output_info) { req->handle = console_handle_unmap(hConsole); if ((ret = !wine_server_call_err(req))) { - fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1; - fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1; + if (maxwindow) + { + fontinfo->dwFontSize.X = min(reply->width, reply->max_width); + fontinfo->dwFontSize.Y = min(reply->height, reply->max_height); + } + else + { + fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1; + fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1; + } } } SERVER_END_REQ; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/editline.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/editline.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/editline.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/editline.c 2016-02-08 19:32:34.000000000 +0000 @@ -916,6 +916,7 @@ void (*func)(struct WCEL_Context* ctx); DWORD mode, input_mode, ks; int use_emacs; + CONSOLE_SCREEN_BUFFER_INFO csbi; memset(&ctx, 0, sizeof(ctx)); ctx.hConIn = hConsoleIn; @@ -994,6 +995,10 @@ if (ctx.insertkey) ctx.insert = !ctx.insert; + GetConsoleScreenBufferInfo(ctx.hConOut, &csbi); + if (ctx.csbi.wAttributes != csbi.wAttributes) + ctx.csbi.wAttributes = csbi.wAttributes; + if (func) (func)(&ctx); else if (!(ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED)) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/kernel32.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/kernel32.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/kernel32.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/kernel32.spec 2016-02-08 19:32:34.000000000 +0000 @@ -860,7 +860,7 @@ @ stdcall GetTimeFormatEx(wstr long ptr wstr ptr long) @ stdcall GetTimeFormatW(long long ptr wstr ptr long) @ stdcall GetTimeZoneInformation(ptr) -# @ stub GetTimeZoneInformationForYear +@ stdcall GetTimeZoneInformationForYear(long ptr ptr) @ stdcall GetThreadUILanguage() # @ stub GetUILanguageInfo # @ stub -arch=x86_64 GetUmsCompletionListEvent diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/locale.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/locale.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/locale.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/locale.c 2016-02-08 19:32:34.000000000 +0000 @@ -2152,7 +2152,7 @@ const union cptable *table; int ret; - if (!src || !srclen || (!dst && dstlen)) + if (!src || !srclen || (!dst && dstlen) || dstlen < 0) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; @@ -2368,7 +2368,7 @@ const union cptable *table; int ret, used_tmp; - if (!src || !srclen || (!dst && dstlen)) + if (!src || !srclen || (!dst && dstlen) || dstlen < 0) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/process.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/process.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/process.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/process.c 2016-02-08 19:32:34.000000000 +0000 @@ -3850,6 +3850,11 @@ status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), buffer, *len, len ); + if (status == STATUS_INFO_LENGTH_MISMATCH) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } if (status != STATUS_SUCCESS) { SetLastError( RtlNtStatusToDosError( status ) ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/codepage.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/codepage.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/codepage.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/codepage.c 2016-02-08 19:32:34.000000000 +0000 @@ -28,6 +28,7 @@ #include "winbase.h" #include "winnls.h" +static const char foobarA[] = "foobar"; static const WCHAR foobarW[] = {'f','o','o','b','a','r',0}; static void test_destination_buffer(void) @@ -144,48 +145,57 @@ static void test_negative_dest_length(void) { int len, i; - static char buf[LONGBUFLEN]; + static WCHAR bufW[LONGBUFLEN]; + static char bufA[LONGBUFLEN]; static WCHAR originalW[LONGBUFLEN]; static char originalA[LONGBUFLEN]; DWORD theError; /* Test return on -1 dest length */ SetLastError( 0xdeadbeef ); - memset(buf,'x',sizeof(buf)); - len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1, NULL, NULL); - todo_wine { - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError()); - } + memset(bufA,'x',sizeof(bufA)); + len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1, NULL, NULL); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, + "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError()); + + SetLastError( 0xdeadbeef ); + memset(bufW,'x',sizeof(bufW)); + len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1, bufW, -1); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, + "MultiByteToWideChar(destlen -1): len=%d error=%x\n", len, GetLastError()); /* Test return on -1000 dest length */ SetLastError( 0xdeadbeef ); - memset(buf,'x',sizeof(buf)); - len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1000, NULL, NULL); - todo_wine { - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError()); - } + memset(bufA,'x',sizeof(bufA)); + len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1000, NULL, NULL); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, + "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError()); + + SetLastError( 0xdeadbeef ); + memset(bufW,'x',sizeof(bufW)); + len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1000, bufW, -1); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, + "MultiByteToWideChar(destlen -1000): len=%d error=%x\n", len, GetLastError()); /* Test return on INT_MAX dest length */ SetLastError( 0xdeadbeef ); - memset(buf,'x',sizeof(buf)); - len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, INT_MAX, NULL, NULL); - ok(len == 7 && !lstrcmpA(buf, "foobar") && GetLastError() == 0xdeadbeef, + memset(bufA,'x',sizeof(bufA)); + len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, INT_MAX, NULL, NULL); + ok(len == 7 && !lstrcmpA(bufA, "foobar") && GetLastError() == 0xdeadbeef, "WideCharToMultiByte(destlen INT_MAX): len=%d error=%x\n", len, GetLastError()); /* Test return on INT_MAX dest length and very long input */ SetLastError( 0xdeadbeef ); - memset(buf,'x',sizeof(buf)); + memset(bufA,'x',sizeof(bufA)); for (i=0; i < LONGBUFLEN - 1; i++) { originalW[i] = 'Q'; originalA[i] = 'Q'; } originalW[LONGBUFLEN-1] = 0; originalA[LONGBUFLEN-1] = 0; - len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, buf, INT_MAX, NULL, NULL); + len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, bufA, INT_MAX, NULL, NULL); theError = GetLastError(); - ok(len == LONGBUFLEN && !lstrcmpA(buf, originalA) && theError == 0xdeadbeef, + ok(len == LONGBUFLEN && !lstrcmpA(bufA, originalA) && theError == 0xdeadbeef, "WideCharToMultiByte(srclen %d, destlen INT_MAX): len %d error=%x\n", LONGBUFLEN, len, theError); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/console.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/console.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/console.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/console.c 2016-02-08 19:32:34.000000000 +0000 @@ -2606,6 +2606,14 @@ memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(NULL, TRUE, &cfi); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); + ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), FALSE, &cfi); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); @@ -2614,6 +2622,14 @@ memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), TRUE, &cfi); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); + ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); ok(ret, "got %d, expected non-zero\n", ret); ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); @@ -2625,6 +2641,16 @@ "got %d, expected %d\n", cfi.dwFontSize.X, width); ok(cfi.dwFontSize.Y == height || cfi.dwFontSize.Y == c.Y /* Vista and higher */, "got %d, expected %d\n", cfi.dwFontSize.Y, height); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, TRUE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(cfi.dwFontSize.X == csbi.dwMaximumWindowSize.X, + "got %d, expected %d\n", cfi.dwFontSize.X, csbi.dwMaximumWindowSize.X); + ok(cfi.dwFontSize.Y == csbi.dwMaximumWindowSize.Y, + "got %d, expected %d\n", cfi.dwFontSize.Y, csbi.dwMaximumWindowSize.Y); } static void test_GetConsoleFontSize(HANDLE std_output) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/process.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/process.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/process.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/process.c 2016-02-08 19:32:34.000000000 +0000 @@ -3125,25 +3125,20 @@ len = 0; ret = pGetLogicalProcessorInformationEx(RelationProcessorCore, NULL, &len); -todo_wine { ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); ok(len > 0, "got %u\n", len); -} + len = 0; ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len); -todo_wine { ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); ok(len > 0, "got %u\n", len); -} -if (len) { info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pGetLogicalProcessorInformationEx(RelationAll, info, &len); ok(ret, "got %d, error %d\n", ret, GetLastError()); ok(info->Size > 0, "got %u\n", info->Size); HeapFree(GetProcessHeap(), 0, info); } -} START_TEST(process) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/time.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/time.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/tests/time.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/tests/time.c 2016-02-08 19:32:34.000000000 +0000 @@ -31,6 +31,7 @@ static int (WINAPI *pGetCalendarInfoW)(LCID,CALID,CALTYPE,LPWSTR,int,LPDWORD); static DWORD (WINAPI *pGetDynamicTimeZoneInformation)(DYNAMIC_TIME_ZONE_INFORMATION*); static void (WINAPI *pGetSystemTimePreciseAsFileTime)(LPFILETIME); +static BOOL (WINAPI *pGetTimeZoneInformationForYear)(USHORT, PDYNAMIC_TIME_ZONE_INFORMATION, LPTIME_ZONE_INFORMATION); #define SECSPERMIN 60 #define SECSPERDAY 86400 @@ -869,6 +870,123 @@ HeapFree(GetProcessHeap(), 0, sppi); } +static WORD day_of_month(const SYSTEMTIME* systemtime, WORD year) +{ + SYSTEMTIME first_of_month = {0}; + FILETIME filetime; + WORD result; + + if (systemtime->wYear != 0) + return systemtime->wDay; + + first_of_month.wYear = year; + first_of_month.wMonth = systemtime->wMonth; + first_of_month.wDay = 1; + + /* round-trip conversion sets day of week field */ + SystemTimeToFileTime(&first_of_month, &filetime); + FileTimeToSystemTime(&filetime, &first_of_month); + + result = 1 + ((systemtime->wDayOfWeek - first_of_month.wDayOfWeek + 7) % 7) + + (7 * (systemtime->wDay - 1)); + + if (systemtime->wDay == 5) + { + /* make sure this isn't in the next month */ + SYSTEMTIME result_date; + + result_date = first_of_month; + result_date.wDay = result; + + SystemTimeToFileTime(&result_date, &filetime); + FileTimeToSystemTime(&filetime, &result_date); + + if (result_date.wDay != result) + result = 1 + ((systemtime->wDayOfWeek - first_of_month.wDayOfWeek + 7) % 7) + + (7 * (4 - 1)); + } + + return result; +} + +static void test_GetTimeZoneInformationForYear(void) +{ + BOOL ret; + SYSTEMTIME systemtime; + TIME_ZONE_INFORMATION local_tzinfo, tzinfo; + DYNAMIC_TIME_ZONE_INFORMATION dyn_tzinfo; + static const WCHAR std_tzname[] = {'G','r','e','e','n','l','a','n','d',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e',0}; + static const WCHAR dlt_tzname[] = {'G','r','e','e','n','l','a','n','d',' ','D','a','y','l','i','g','h','t',' ','T','i','m','e',0}; + WORD std_day, dlt_day; + + if (!pGetTimeZoneInformationForYear || !pGetDynamicTimeZoneInformation) + { + win_skip("GetTimeZoneInformationForYear not available\n"); + return; + } + + GetLocalTime(&systemtime); + + GetTimeZoneInformation(&local_tzinfo); + + ret = pGetTimeZoneInformationForYear(systemtime.wYear, NULL, &tzinfo); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u\n", GetLastError()); + ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %d, got %d\n", local_tzinfo.Bias, tzinfo.Bias); + ok(!lstrcmpW(tzinfo.StandardName, local_tzinfo.StandardName), + "Expected StandardName %s, got %s\n", wine_dbgstr_w(local_tzinfo.StandardName), wine_dbgstr_w(tzinfo.StandardName)); + ok(!memcmp(&tzinfo.StandardDate, &local_tzinfo.StandardDate, sizeof(SYSTEMTIME)), "StandardDate does not match\n"); + ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %d, got %d\n", local_tzinfo.StandardBias, tzinfo.StandardBias); + ok(!lstrcmpW(tzinfo.DaylightName, local_tzinfo.DaylightName), + "Expected DaylightName %s, got %s\n", wine_dbgstr_w(local_tzinfo.DaylightName), wine_dbgstr_w(tzinfo.DaylightName)); + ok(!memcmp(&tzinfo.DaylightDate, &local_tzinfo.DaylightDate, sizeof(SYSTEMTIME)), "DaylightDate does not match\n"); + ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %d, got %d\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias); + + pGetDynamicTimeZoneInformation(&dyn_tzinfo); + + ret = pGetTimeZoneInformationForYear(systemtime.wYear, &dyn_tzinfo, &tzinfo); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u\n", GetLastError()); + ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %d, got %d\n", local_tzinfo.Bias, tzinfo.Bias); + ok(!lstrcmpW(tzinfo.StandardName, local_tzinfo.StandardName), + "Expected StandardName %s, got %s\n", wine_dbgstr_w(local_tzinfo.StandardName), wine_dbgstr_w(tzinfo.StandardName)); + ok(!memcmp(&tzinfo.StandardDate, &local_tzinfo.StandardDate, sizeof(SYSTEMTIME)), "StandardDate does not match\n"); + ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %d, got %d\n", local_tzinfo.StandardBias, tzinfo.StandardBias); + ok(!lstrcmpW(tzinfo.DaylightName, local_tzinfo.DaylightName), + "Expected DaylightName %s, got %s\n", wine_dbgstr_w(local_tzinfo.DaylightName), wine_dbgstr_w(tzinfo.DaylightName)); + ok(!memcmp(&tzinfo.DaylightDate, &local_tzinfo.DaylightDate, sizeof(SYSTEMTIME)), "DaylightDate does not match\n"); + ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %d, got %d\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias); + + memset(&dyn_tzinfo, 0xaa, sizeof(dyn_tzinfo)); + lstrcpyW(dyn_tzinfo.TimeZoneKeyName, std_tzname); + dyn_tzinfo.DynamicDaylightTimeDisabled = FALSE; + + ret = pGetTimeZoneInformationForYear(2015, &dyn_tzinfo, &tzinfo); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u\n", GetLastError()); + ok(tzinfo.Bias == 180, "Expected Bias 180, got %d\n", tzinfo.Bias); + ok(!lstrcmpW(tzinfo.StandardName, std_tzname) || broken(!tzinfo.StandardName[0]) /* vista,7 */, + "Expected StandardName %s, got %s\n", + wine_dbgstr_w(std_tzname), wine_dbgstr_w(tzinfo.StandardName)); + ok(tzinfo.StandardDate.wMonth == 10, "Expected standard month 10, got %d\n", tzinfo.StandardDate.wMonth); + std_day = day_of_month(&tzinfo.StandardDate, 2015); + ok(std_day == 24, "Expected standard day 24, got %d\n", std_day); + ok(tzinfo.StandardBias == 0, "Expected StandardBias 0, got %d\n", tzinfo.StandardBias); + ok(!lstrcmpW(tzinfo.DaylightName, dlt_tzname) || broken(!tzinfo.DaylightName[0]) /* vista,7 */, + "Expected DaylightName %s, got %s\n", + wine_dbgstr_w(dlt_tzname), wine_dbgstr_w(tzinfo.DaylightName)); + ok(tzinfo.DaylightDate.wMonth == 3, "Expected daylight month 3, got %d\n", tzinfo.DaylightDate.wMonth); + dlt_day = day_of_month(&tzinfo.DaylightDate, 2015); + ok(dlt_day == 28, "Expected daylight day 28, got %d\n", dlt_day); + ok(tzinfo.DaylightBias == -60, "Expected DaylightBias -60, got %d\n", tzinfo.DaylightBias); + + memset(&dyn_tzinfo, 0xaa, sizeof(dyn_tzinfo)); + lstrcpyW(dyn_tzinfo.TimeZoneKeyName, dlt_tzname); + + SetLastError(0xdeadbeef); + ret = pGetTimeZoneInformationForYear(2015, &dyn_tzinfo, &tzinfo); + ok((ret == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND) || + broken(ret == TRUE) /* vista,7 */, + "GetTimeZoneInformationForYear err %u\n", GetLastError()); +} + START_TEST(time) { HMODULE hKernel = GetModuleHandleA("kernel32"); @@ -879,6 +997,7 @@ pGetCalendarInfoW = (void *)GetProcAddress(hKernel, "GetCalendarInfoW"); pGetDynamicTimeZoneInformation = (void *)GetProcAddress(hKernel, "GetDynamicTimeZoneInformation"); pGetSystemTimePreciseAsFileTime = (void *)GetProcAddress(hKernel, "GetSystemTimePreciseAsFileTime"); + pGetTimeZoneInformationForYear = (void *)GetProcAddress(hKernel, "GetTimeZoneInformationForYear"); test_conversions(); test_invalid_arg(); @@ -891,4 +1010,5 @@ test_GetCalendarInfo(); test_GetDynamicTimeZoneInformation(); test_GetSystemTimePreciseAsFileTime(); + test_GetTimeZoneInformationForYear(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/time.c wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/time.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/kernel32/time.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/kernel32/time.c 2016-02-08 19:32:34.000000000 +0000 @@ -282,6 +282,179 @@ return TRUE; } +/*********************************************************************** + * TIME_GetSpecificTimeZoneKey + * + * Opens the registry key for the time zone with the given name. + * + * PARAMS + * key_name [in] The time zone name. + * result [out] The open registry key handle. + * + * RETURNS + * TRUE if successful. + */ +static BOOL TIME_GetSpecificTimeZoneKey( const WCHAR *key_name, HANDLE *result ) +{ + static const WCHAR Time_ZonesW[] = { '\\','R','E','G','I','S','T','R','Y','\\', + 'M','a','c','h','i','n','e','\\', + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s',' ','N','T','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'T','i','m','e',' ','Z','o','n','e','s',0 }; + HANDLE time_zones_key; + OBJECT_ATTRIBUTES attr; + UNICODE_STRING nameW; + NTSTATUS status; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &nameW; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + RtlInitUnicodeString( &nameW, Time_ZonesW ); + status = NtOpenKey( &time_zones_key, KEY_READ, &attr ); + if (status) + { + WARN("Unable to open the time zones key\n"); + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + + attr.RootDirectory = time_zones_key; + RtlInitUnicodeString( &nameW, key_name ); + status = NtOpenKey( result, KEY_READ, &attr ); + + NtClose( time_zones_key ); + + if (status) + { + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + + return TRUE; +} + +static BOOL reg_query_value(HKEY hkey, LPCWSTR name, DWORD type, void *data, DWORD count) +{ + UNICODE_STRING nameW; + char buf[256]; + KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buf; + NTSTATUS status; + + if (count > sizeof(buf) - sizeof(KEY_VALUE_PARTIAL_INFORMATION)) + return FALSE; + + RtlInitUnicodeString(&nameW, name); + + if ((status = NtQueryValueKey(hkey, &nameW, KeyValuePartialInformation, + buf, sizeof(buf), &count))) + { + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + + if (info->Type != type) + { + SetLastError( ERROR_DATATYPE_MISMATCH ); + return FALSE; + } + + memcpy(data, info->Data, info->DataLength); + return TRUE; +} + +/*********************************************************************** + * TIME_GetSpecificTimeZoneInfo + * + * Returns time zone information for the given time zone and year. + * + * PARAMS + * key_name [in] The time zone name. + * year [in] The year, if Dynamic DST is used. + * dynamic [in] Whether to use Dynamic DST. + * result [out] The time zone information. + * + * RETURNS + * TRUE if successful. + */ +static BOOL TIME_GetSpecificTimeZoneInfo( const WCHAR *key_name, WORD year, + BOOL dynamic, DYNAMIC_TIME_ZONE_INFORMATION *tzinfo ) +{ + static const WCHAR Dynamic_DstW[] = { 'D','y','n','a','m','i','c',' ','D','S','T',0 }; + static const WCHAR fmtW[] = { '%','d',0 }; + static const WCHAR stdW[] = { 'S','t','d',0 }; + static const WCHAR dltW[] = { 'D','l','t',0 }; + static const WCHAR tziW[] = { 'T','Z','I',0 }; + HANDLE time_zone_key, dynamic_dst_key; + OBJECT_ATTRIBUTES attr; + UNICODE_STRING nameW; + WCHAR yearW[16]; + BOOL got_reg_data = FALSE; + struct tz_reg_data + { + LONG bias; + LONG std_bias; + LONG dlt_bias; + SYSTEMTIME std_date; + SYSTEMTIME dlt_date; + } tz_data; + + if (!TIME_GetSpecificTimeZoneKey( key_name, &time_zone_key )) + return FALSE; + + if (!reg_query_value( time_zone_key, stdW, REG_SZ, tzinfo->StandardName, sizeof(tzinfo->StandardName)) || + !reg_query_value( time_zone_key, dltW, REG_SZ, tzinfo->DaylightName, sizeof(tzinfo->DaylightName))) + { + NtClose( time_zone_key ); + return FALSE; + } + + lstrcpyW(tzinfo->TimeZoneKeyName, key_name); + + if (dynamic) + { + attr.Length = sizeof(attr); + attr.RootDirectory = time_zone_key; + attr.ObjectName = &nameW; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + RtlInitUnicodeString( &nameW, Dynamic_DstW ); + if (!NtOpenKey( &dynamic_dst_key, KEY_READ, &attr )) + { + sprintfW( yearW, fmtW, year ); + got_reg_data = reg_query_value( dynamic_dst_key, yearW, REG_BINARY, &tz_data, sizeof(tz_data) ); + + NtClose( dynamic_dst_key ); + } + } + + if (!got_reg_data) + { + if (!reg_query_value( time_zone_key, tziW, REG_BINARY, &tz_data, sizeof(tz_data) )) + { + NtClose( time_zone_key ); + return FALSE; + } + } + + tzinfo->Bias = tz_data.bias; + tzinfo->StandardBias = tz_data.std_bias; + tzinfo->DaylightBias = tz_data.dlt_bias; + tzinfo->StandardDate = tz_data.std_date; + tzinfo->DaylightDate = tz_data.dlt_date; + + tzinfo->DynamicDaylightTimeDisabled = !dynamic; + + NtClose( time_zone_key ); + + return TRUE; +} + /*********************************************************************** * SetLocalTime (KERNEL32.@) @@ -418,6 +591,30 @@ } /*********************************************************************** + * GetTimeZoneInformationForYear (KERNEL32.@) + */ +BOOL WINAPI GetTimeZoneInformationForYear( USHORT wYear, + PDYNAMIC_TIME_ZONE_INFORMATION pdtzi, LPTIME_ZONE_INFORMATION ptzi ) +{ + DYNAMIC_TIME_ZONE_INFORMATION local_dtzi, result; + + if (!pdtzi) + { + if (GetDynamicTimeZoneInformation(&local_dtzi) == TIME_ZONE_ID_INVALID) + return FALSE; + pdtzi = &local_dtzi; + } + + if (!TIME_GetSpecificTimeZoneInfo(pdtzi->TimeZoneKeyName, wYear, + !pdtzi->DynamicDaylightTimeDisabled, &result)) + return FALSE; + + memcpy(ptzi, &result, sizeof(*ptzi)); + + return TRUE; +} + +/*********************************************************************** * SetTimeZoneInformation (KERNEL32.@) * * Change the settings of the current local time zone. diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mpr/tests/mpr.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mpr/tests/mpr.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mpr/tests/mpr.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mpr/tests/mpr.c 2016-02-08 19:32:34.000000000 +0000 @@ -164,6 +164,7 @@ static DWORD (WINAPI *pWNetGetCachedPassword)( LPSTR, WORD, LPSTR, LPWORD, BYTE ); static UINT (WINAPI *pWNetEnumCachedPasswords)( LPSTR, WORD, BYTE, ENUMPASSWORDPROC, DWORD); static UINT (WINAPI *pWNetRemoveCachedPassword)( LPSTR, WORD, BYTE ); +static DWORD (WINAPI *pWNetUseConnectionA)( HWND, LPNETRESOURCEA, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD, LPDWORD ); #define MPR_GET_PROC(func) \ p ## func = (void*)GetProcAddress(hmpr, #func) @@ -176,6 +177,7 @@ MPR_GET_PROC(WNetGetCachedPassword); MPR_GET_PROC(WNetEnumCachedPasswords); MPR_GET_PROC(WNetRemoveCachedPassword); + MPR_GET_PROC(WNetUseConnectionA); } static const char* m_resource = "wine-test-resource"; @@ -257,9 +259,62 @@ } } +static void test_WNetUseConnection(void) +{ + DWORD ret; + DWORD bufSize; + DWORD outRes; + LPNETRESOURCEA netRes; + CHAR outBuf[4]; + + if (pWNetUseConnectionA) + { + netRes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NETRESOURCEA) + sizeof("\\\\127.0.0.1\\c$") + sizeof("J:")); + netRes->dwType = RESOURCETYPE_DISK; + netRes->dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; + netRes->dwUsage = RESOURCEUSAGE_CONNECTABLE; + netRes->lpLocalName = (LPSTR)((LPBYTE)netRes + sizeof(NETRESOURCEA)); + netRes->lpRemoteName = (LPSTR)((LPBYTE)netRes + sizeof(NETRESOURCEA) + sizeof("J:")); + strcpy(netRes->lpLocalName, "J:"); + strcpy(netRes->lpRemoteName, "\\\\127.0.0.1\\c$"); + bufSize = 0; + ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, NULL, &bufSize, &outRes); + todo_wine + ok(ret == WN_SUCCESS, "Unexpected return: %u\n", ret); + ok(bufSize == 0, "Unexpected buffer size: %u\n", bufSize); + if (ret == WN_SUCCESS) + WNetCancelConnectionA("J:", TRUE); + bufSize = 0; + ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes); + todo_wine + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return: %u\n", ret); + ok(bufSize == 0, "Unexpected buffer size: %u\n", bufSize); + if (ret == WN_SUCCESS) + WNetCancelConnectionA("J:", TRUE); + bufSize = 1; + todo_wine { + ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes); + ok(ret == ERROR_MORE_DATA, "Unexpected return: %u\n", ret); + ok(bufSize == 3, "Unexpected buffer size: %u\n", bufSize); + if (ret == WN_SUCCESS) + WNetCancelConnectionA("J:", TRUE); + bufSize = 4; + ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes); + ok(ret == WN_SUCCESS, "Unexpected return: %u\n", ret); + } + ok(bufSize == 4, "Unexpected buffer size: %u\n", bufSize); + if (ret == WN_SUCCESS) + WNetCancelConnectionA("J:", TRUE); + HeapFree(GetProcessHeap(), 0, netRes); + } else { + win_skip("WNetUseConnection() is not supported.\n"); + } +} + START_TEST(mpr) { test_WNetGetUniversalName(); test_WNetGetRemoteName(); test_WNetCachePassword(); + test_WNetUseConnection(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mpr/wnet.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mpr/wnet.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mpr/wnet.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mpr/wnet.c 2016-02-08 19:32:34.000000000 +0000 @@ -133,11 +133,17 @@ DWORD type, size = sizeof(providerPath); if (RegQueryValueExW(hKey, szProviderPath, NULL, &type, - (LPBYTE)providerPath, &size) == ERROR_SUCCESS && type == REG_SZ) + (LPBYTE)providerPath, &size) == ERROR_SUCCESS && (type == REG_SZ || type == REG_EXPAND_SZ)) { static const WCHAR szProviderName[] = { 'N','a','m','e',0 }; PWSTR name = NULL; - + + if (type == REG_EXPAND_SZ) + { + WCHAR path[MAX_PATH]; + if (ExpandEnvironmentStringsW(providerPath, path, MAX_PATH)) lstrcpyW( providerPath, path ); + } + size = 0; RegQueryValueExW(hKey, szProviderName, NULL, NULL, NULL, &size); if (size) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mscoree/assembly.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mscoree/assembly.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mscoree/assembly.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mscoree/assembly.c 2016-02-08 19:32:34.000000000 +0000 @@ -314,3 +314,17 @@ return S_OK; } + +HRESULT assembly_get_native_entrypoint(ASSEMBLY *assembly, NativeEntryPointFunc *func) +{ + if (assembly->corhdr->Flags & COMIMAGE_FLAGS_NATIVE_ENTRYPOINT) + { + *func = assembly_rva_to_va(assembly, assembly->corhdr->EntryPointRVA); + return S_OK; + } + else + { + *func = NULL; + return S_FALSE; + } +} diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mscoree/corruntimehost.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mscoree/corruntimehost.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mscoree/corruntimehost.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mscoree/corruntimehost.c 2016-02-08 19:32:34.000000000 +0000 @@ -919,7 +919,75 @@ #include "poppack.h" -#else /* !defined(__i386__) */ +#elif __x86_64__ /* !__i386__ */ + +# define CAN_FIXUP_VTABLE 1 + +#include "pshpack1.h" + +struct vtable_fixup_thunk +{ + /* push %rbp; + mov %rsp, %rbp + sub $0x80, %rsp ; 0x8*4 + 0x10*4 + 0x20 + */ + BYTE i1[11]; + /* + mov %rcx, 0x60(%rsp); mov %rdx, 0x68(%rsp); mov %r8, 0x70(%rsp); mov %r9, 0x78(%rsp); + movaps %xmm0,0x20(%rsp); ...; movaps %xmm3,0x50(%esp) + */ + BYTE i2[40]; + /* mov function,%rax */ + BYTE i3[2]; + void (CDECL *function)(struct dll_fixup *); + /* mov fixup,%rcx */ + BYTE i4[2]; + struct dll_fixup *fixup; + /* call *%rax */ + BYTE i5[2]; + /* + mov 0x60(%rsp),%rcx; mov 0x68(%rsp),%rdx; mov 0x70(%rsp),%r8; mov 0x78(%rsp),%r9; + movaps 0x20(%rsp),xmm0; ...; movaps 0x50(%esp),xmm3 + */ + BYTE i6[40]; + /* mov %rbp, %rsp + pop %rbp + */ + BYTE i7[4]; + /* mov vtable_entry, %rax */ + BYTE i8[2]; + void *vtable_entry; + /* mov [%rax],%rax + jmp %rax */ + BYTE i9[5]; +}; + +static const struct vtable_fixup_thunk thunk_template = { + {0x55,0x48,0x89,0xE5, 0x48,0x81,0xEC,0x80,0x00,0x00,0x00}, + {0x48,0x89,0x4C,0x24,0x60, 0x48,0x89,0x54,0x24,0x68, + 0x4C,0x89,0x44,0x24,0x70, 0x4C,0x89,0x4C,0x24,0x78, + 0x0F,0x29,0x44,0x24,0x20, 0x0F,0x29,0x4C,0x24,0x30, + 0x0F,0x29,0x54,0x24,0x40, 0x0F,0x29,0x5C,0x24,0x50, + }, + {0x48,0xB8}, + NULL, + {0x48,0xB9}, + NULL, + {0xFF,0xD0}, + {0x48,0x8B,0x4C,0x24,0x60, 0x48,0x8B,0x54,0x24,0x68, + 0x4C,0x8B,0x44,0x24,0x70, 0x4C,0x8B,0x4C,0x24,0x78, + 0x0F,0x28,0x44,0x24,0x20, 0x0F,0x28,0x4C,0x24,0x30, + 0x0F,0x28,0x54,0x24,0x40, 0x0F,0x28,0x5C,0x24,0x50, + }, + {0x48,0x89,0xEC, 0x5D}, + {0x48,0xB8}, + NULL, + {0x48,0x8B,0x00,0xFF,0xE0} +}; + +#include "poppack.h" + +#else /* !__i386__ && !__x86_64__ */ # define CAN_FIXUP_VTABLE 0 @@ -982,15 +1050,19 @@ /* Mono needs an image that belongs to an assembly. */ image = mono_assembly_get_image(assembly); +#if __x86_64__ + if (fixup->fixup->type & COR_VTABLE_64BIT) +#else if (fixup->fixup->type & COR_VTABLE_32BIT) +#endif { - DWORD *vtable = fixup->vtable; - DWORD *tokens = fixup->tokens; + void **vtable = fixup->vtable; + ULONG_PTR *tokens = fixup->tokens; for (i=0; ifixup->count; i++) { - TRACE("%x\n", tokens[i]); - vtable[i] = PtrToUint(mono_marshal_get_vtfixup_ftnptr( - image, tokens[i], fixup->fixup->type)); + TRACE("%#lx\n", tokens[i]); + vtable[i] = mono_marshal_get_vtfixup_ftnptr( + image, tokens[i], fixup->fixup->type); } } @@ -1029,16 +1101,18 @@ fixup->vtable = (BYTE*)hmodule + vtable_fixup->rva; fixup->done = FALSE; + TRACE("vtable_fixup->type=0x%x\n",vtable_fixup->type); +#if __x86_64__ + if (vtable_fixup->type & COR_VTABLE_64BIT) +#else if (vtable_fixup->type & COR_VTABLE_32BIT) +#endif { - DWORD *vtable = fixup->vtable; - DWORD *tokens; + void **vtable = fixup->vtable; + ULONG_PTR *tokens; int i; struct vtable_fixup_thunk *thunks = fixup->thunk_code; - if (sizeof(void*) > 4) - ERR("32-bit fixup in 64-bit mode; broken image?\n"); - tokens = fixup->tokens = HeapAlloc(GetProcessHeap(), 0, sizeof(*tokens) * vtable_fixup->count); memcpy(tokens, vtable, sizeof(*tokens) * vtable_fixup->count); for (i=0; icount; i++) @@ -1047,7 +1121,7 @@ thunks[i].fixup = fixup; thunks[i].function = ReallyFixupVTable; thunks[i].vtable_entry = &vtable[i]; - vtable[i] = PtrToUint(&thunks[i]); + vtable[i] = &thunks[i]; } } else @@ -1061,23 +1135,28 @@ list_add_tail(&dll_fixups, &fixup->entry); } +static void FixupVTable_Assembly(HMODULE hmodule, ASSEMBLY *assembly) +{ + VTableFixup *vtable_fixups; + ULONG vtable_fixup_count, i; + + assembly_get_vtable_fixups(assembly, &vtable_fixups, &vtable_fixup_count); + if (CAN_FIXUP_VTABLE) + for (i=0; i + +#include "windef.h" +#include "winbase.h" + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msdrm/Makefile.in wine-staging-1.9.3~ubuntu12.04.1/dlls/msdrm/Makefile.in --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msdrm/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msdrm/Makefile.in 2016-02-08 19:32:34.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = msdrm.dll + +C_SRCS = \ + main.c diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msdrm/msdrm.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/msdrm/msdrm.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msdrm/msdrm.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msdrm/msdrm.spec 2016-02-08 19:32:34.000000000 +0000 @@ -0,0 +1,89 @@ +@ stub DRMAcquireAdvisories +@ stub DRMAcquireIssuanceLicenseTemplate +@ stub DRMAcquireLicense +@ stub DRMActivate +@ stub DRMAddLicense +@ stub DRMAddRightWithUser +@ stub DRMAttest +@ stub DRMCheckSecurity +@ stub DRMClearAllRights +@ stub DRMCloseEnvironmentHandle +@ stub DRMCloseHandle +@ stub DRMClosePubHandle +@ stub DRMCloseQueryHandle +@ stub DRMCloseSession +@ stub DRMConstructCertificateChain +@ stub DRMCreateBoundLicense +@ stub DRMCreateClientSession +@ stub DRMCreateEnablingBitsDecryptor +@ stub DRMCreateEnablingBitsEncryptor +@ stub DRMCreateEnablingPrincipal +@ stub DRMCreateIssuanceLicense +@ stub DRMCreateLicenseStorageSession +@ stub DRMCreateRight +@ stub DRMCreateUser +@ stub DRMDecode +@ stub DRMDeconstructCertificateChain +@ stub DRMDecrypt +@ stub DRMDeleteLicense +@ stub DRMDuplicateEnvironmentHandle +@ stub DRMDuplicateHandle +@ stub DRMDuplicatePubHandle +@ stub DRMDuplicateSession +@ stub DRMEncode +@ stub DRMEncrypt +@ stub DRMEnumerateLicense +@ stub DRMGetApplicationSpecificData +@ stub DRMGetBoundLicenseAttribute +@ stub DRMGetBoundLicenseAttributeCount +@ stub DRMGetBoundLicenseObject +@ stub DRMGetBoundLicenseObjectCount +@ stub DRMGetCertificateChainCount +@ stub DRMGetClientVersion +@ stub DRMGetEnvironmentInfo +@ stub DRMGetInfo +@ stub DRMGetIntervalTime +@ stub DRMGetIssuanceLicenseInfo +@ stub DRMGetIssuanceLicenseTemplate +@ stub DRMGetMetaData +@ stub DRMGetNameAndDescription +@ stub DRMGetOwnerLicense +@ stub DRMGetProcAddress +@ stub DRMGetRevocationPoint +@ stub DRMGetRightExtendedInfo +@ stub DRMGetRightInfo +@ stub DRMGetSecurityProvider +@ stub DRMGetServiceLocation +@ stub DRMGetSignedIssuanceLicense +@ stub DRMGetSignedIssuanceLicenseEx +@ stub DRMGetTime +@ stub DRMGetUnboundLicenseAttribute +@ stub DRMGetUnboundLicenseAttributeCount +@ stub DRMGetUnboundLicenseObject +@ stub DRMGetUnboundLicenseObjectCount +@ stub DRMGetUsagePolicy +@ stub DRMGetUserInfo +@ stub DRMGetUserRights +@ stub DRMGetUsers +@ stub DRMInitEnvironment +@ stub DRMIsActivated +@ stub DRMIsWindowProtected +@ stub DRMLoadLibrary +@ stub DRMParseUnboundLicense +@ stub DRMRegisterContent +@ stub DRMRegisterProtectedWindow +@ stub DRMRegisterRevocationList +@ stub DRMRepair +@ stub DRMSetApplicationSpecificData +@ stub DRMSetGlobalOptions +@ stub DRMSetIntervalTime +@ stub DRMSetMetaData +@ stub DRMSetNameAndDescription +@ stub DRMSetRevocationPoint +@ stub DRMSetUsagePolicy +@ stub DRMVerify +@ stub DllCanUnloadNow +@ stub DllGetClassObject +@ stub DllRegisterServer +@ stub DllUnregisterServer +@ stub __AddMachineCertToLicenseStore diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/mshtml_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/mshtml_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/mshtml_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/mshtml_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -41,6 +41,8 @@ #define NS_ERROR_GENERATE_FAILURE(module,code) \ ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) +#define NS_ERROR_GENERATE_SUCCESS(module,code) \ + ((nsresult) (((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) #define NS_OK ((nsresult)0x00000000L) #define NS_ERROR_FAILURE ((nsresult)0x80004005L) @@ -57,6 +59,7 @@ #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2) #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18) +#define NS_SUCCESS_DEFAULT_ACTION NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_NETWORK, 66) #define NS_FAILED(res) ((res) & 0x80000000) #define NS_SUCCEEDED(res) (!NS_FAILED(res)) @@ -846,7 +849,7 @@ BOOL load_gecko(void) DECLSPEC_HIDDEN; void close_gecko(void) DECLSPEC_HIDDEN; void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*) DECLSPEC_HIDDEN; -void init_nsio(nsIComponentManager*,nsIComponentRegistrar*) DECLSPEC_HIDDEN; +void init_nsio(nsIComponentManager*) DECLSPEC_HIDDEN; void release_nsio(void) DECLSPEC_HIDDEN; BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN; void set_viewer_zoom(NSContainer*,float) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/mutation.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/mutation.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/mutation.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/mutation.c 2016-02-08 19:32:34.000000000 +0000 @@ -526,12 +526,17 @@ } static void NSAPI nsDocumentObserver_AttributeWillChange(nsIDocumentObserver *iface, nsIDocument *aDocument, - nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType) + void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) { } static void NSAPI nsDocumentObserver_AttributeChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, - nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType) + void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aOldValue) +{ +} + +static void NSAPI nsDocumentObserver_NativeAnonymousChildListChange(nsIDocumentObserver *iface, nsIDocument *aDocument, + nsIContent *aContent, cpp_bool aIsRemove) { } @@ -722,6 +727,7 @@ nsDocumentObserver_CharacterDataChanged, nsDocumentObserver_AttributeWillChange, nsDocumentObserver_AttributeChanged, + nsDocumentObserver_NativeAnonymousChildListChange, nsDocumentObserver_AttributeSetToCurrentValue, nsDocumentObserver_ContentAppended, nsDocumentObserver_ContentInserted, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsembed.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsembed.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsembed.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsembed.c 2016-02-08 19:32:34.000000000 +0000 @@ -458,9 +458,9 @@ if(TRACE_ON(gecko)) debug_level = 5; else if(WARN_ON(gecko)) - debug_level = 3; - else if(ERR_ON(gecko)) debug_level = 2; + else if(ERR_ON(gecko)) + debug_level = 1; sprintfW(buf, debug_formatW, debug_level); SetEnvironmentVariableW(nspr_log_modulesW, buf); @@ -721,12 +721,7 @@ if(NS_FAILED(nsres)) ERR("Could not get nsIComponentManager: %08x\n", nsres); - nsres = NS_GetComponentRegistrar(®istrar); - if(NS_SUCCEEDED(nsres)) - init_nsio(pCompMgr, registrar); - else - ERR("NS_GetComponentRegistrar failed: %08x\n", nsres); - + init_nsio(pCompMgr); init_mutation(pCompMgr); set_preferences(); @@ -735,9 +730,12 @@ if(NS_FAILED(nsres)) ERR("Could not get category manager service: %08x\n", nsres); - if(registrar) { + nsres = NS_GetComponentRegistrar(®istrar); + if(NS_SUCCEEDED(nsres)) { register_nsservice(registrar, pServMgr); nsIComponentRegistrar_Release(registrar); + }else { + ERR("NS_GetComponentRegistrar failed: %08x\n", nsres); } init_node_cc(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsiface.idl wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsiface.idl --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsiface.idl 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsiface.idl 2016-02-08 19:32:34.000000000 +0000 @@ -25,7 +25,7 @@ #pragma makedep header -cpp_quote("#define GECKO_VERSION \"2.40\"") +cpp_quote("#define GECKO_VERSION \"2.44\"") cpp_quote("#define GECKO_VERSION_STRING \"Wine Gecko \" GECKO_VERSION") import "wtypes.idl"; @@ -191,7 +191,6 @@ typedef nsISupports nsIPrivacyTransitionObserver; typedef nsISupports nsIDOMHTMLPropertiesCollection; typedef nsISupports mozIDOMApplication; -typedef nsISupports nsILoadGroupConnectionInfo; typedef nsISupports nsIDOMCrypto; typedef nsISupports nsIDOMPkcs11; typedef nsISupports nsIDocShellTreeOwner; @@ -398,7 +397,7 @@ [ object, - uuid(395fe045-7d18-4adb-a3fd-af98c8a1af11), + uuid(92073a54-6d78-4f30-913a-b871813208c6), local ] interface nsIURI : nsISupports @@ -427,6 +426,7 @@ nsresult Clone(nsIURI **_retval); nsresult Resolve(const nsACString *relativePath, nsACString *_retval); nsresult GetAsciiSpec(nsACString *aAsciiSpec); + nsresult GetAsciiHostPort(nsACString *aAsciiHostPort); nsresult GetAsciiHost(nsACString *aAsciiHost); nsresult GetOriginCharset(nsACString *aOriginCharset); nsresult GetRef(nsACString *aRef); @@ -439,7 +439,7 @@ [ object, - uuid(1419aa16-f134-4154-9886-00c7c5147a13), + uuid(86adcd89-0b70-47a2-b0fe-5bb2c5f37e31), local ] interface nsIURL : nsIURI @@ -462,7 +462,7 @@ [ object, - uuid(7750029c-1b0a-414e-8359-a77f24a2a0a6), + uuid(e91ac988-27c2-448b-b1a1-3822e1ef1987), local ] interface nsIFileURL : nsIURL @@ -535,7 +535,7 @@ [ object, - uuid(afb57ac2-bce5-4ee3-bb34-385089a9ba5c), + uuid(f0c87725-7a35-463c-9ceb-2c07f23406cc), local ] interface nsILoadGroup : nsIRequest @@ -550,14 +550,14 @@ nsresult GetActiveCount(uint32_t *aActiveCount); nsresult GetNotificationCallbacks(nsIInterfaceRequestor **aNotificationCallbacks); nsresult SetNotificationCallbacks(nsIInterfaceRequestor *aNotificationCallbacks); - nsresult GetConnectionInfo(nsILoadGroupConnectionInfo **aConnectionInfo); + nsresult GetSchedulingContextID(nsID *aSchedulingContextID); nsresult GetDefaultLoadFlags(nsLoadFlags *aDefaultLoadFlags); nsresult SetDefaultLoadFlags(nsLoadFlags aDefaultLoadFlags); } [ object, - uuid(1bc48693-c45d-45f4-8ab1-46e323037fe1), + uuid(2c389865-23db-4aa7-9fe5-60cc7b00697e), local ] interface nsIChannel : nsIRequest @@ -571,6 +571,7 @@ const UINT LOAD_CLASSIFY_URI = 1 << 22; const UINT LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE = 1 << 23; const UINT LOAD_EXPLICIT_CREDENTIALS = 1 << 24; + const UINT LOAD_BYPASS_SERVICE_WORKER = 1 << 25; nsresult GetOriginalURI(nsIURI **aOriginalURI); nsresult SetOriginalURI(nsIURI *aOriginalURI); @@ -587,7 +588,9 @@ nsresult GetContentLength(int64_t *aContentLength); nsresult SetContentLength(int64_t aContentLength); nsresult Open(nsIInputStream **_retval); + nsresult Open2(nsIInputStream **_retval); nsresult AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext); + nsresult AsyncOpen2(nsIStreamListener *aListener); nsresult GetContentDisposition(uint32_t *aContentDisposition); nsresult SetContentDisposition(uint32_t aContentDisposition); nsresult GetContentDispositionFilename(nsAString *aContentDispositionFilename); @@ -609,7 +612,7 @@ [ object, - uuid(86ad7e1f-3a64-4e0f-a104-395ebecd7d5c), + uuid(e90acf2d-eaf2-41d8-97b2-c8d99f6437a1), local ] interface nsIHttpChannel : nsIChannel @@ -622,7 +625,9 @@ nsresult SetReferrerWithPolicy(nsIURI *referrer, uint32_t referrerPolicy); nsresult GetRequestHeader(const nsACString *aHeader, nsACString *_retval); nsresult SetRequestHeader(const nsACString *aHeader, const nsACString *aValue, bool aMerge); + nsresult SetEmptyRequestHeader(const nsACString *aHeader); nsresult VisitRequestHeaders(nsIHttpHeaderVisitor *aVisitor); + nsresult VisitNonDefaultRequestHeaders(nsIHttpHeaderVisitor *aVisitor); nsresult GetAllowPipelining(bool *aAllowPipelining); nsresult SetAllowPipelining(bool aAllowPipelining); nsresult GetAllowSTS(bool *aAllowSTS); @@ -632,6 +637,8 @@ nsresult GetResponseStatus(uint32_t *aResponseStatus); nsresult GetResponseStatusText(nsACString *aResponseStatusText); nsresult GetRequestSucceeded(bool *aRequestSucceeded); + nsresult GetIsMainDocumentChannel(bool *aIsMainDocumentChannel); + nsresult SetIsMainDocumentChannel(bool aIsMainDocumentChannel); nsresult GetResponseHeader(const nsACString *header, nsACString *_retval); nsresult SetResponseHeader(const nsACString *header, const nsACString *value, bool merge); nsresult VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor); @@ -639,11 +646,13 @@ nsresult IsNoCacheResponse(bool *_retval); nsresult IsPrivateResponse(bool *_retval); nsresult RedirectTo(nsIURI *aNewURI); + nsresult GetSchedulingContextID(nsID *aSchedulingContextID); + nsresult SetSchedulingContextID(const nsID aSchedulingContextID); } [ object, - uuid(26833ec7-4555-4f23-9281-3a12d4b76db1), + uuid(9eabaac6-cc7c-4ca1-9430-65f2daaa578f), local ] interface nsIHttpChannelInternal : nsISupports @@ -672,21 +681,26 @@ nsresult SetAllowSpdy(bool aAllowSpdy); nsresult GetResponseTimeoutEnabled(bool *aResponseTimeoutEnabled); nsresult SetResponseTimeoutEnabled(bool aResponseTimeoutEnabled); + nsresult GetInitialRwin(uint32_t *aInitialRwin) ; + nsresult SetInitialRwin(uint32_t aInitialRwin); nsresult GetApiRedirectToURI(nsIURI **aApiRedirectToURI); nsresult GetAllowAltSvc(bool *aAllowAltSvc); nsresult SetAllowAltSvc(bool aAllowAltSvc); - nsresult AddRedirect(nsIPrincipal *aPrincipal); nsresult GetLastModifiedTime(PRTime *aLastModifiedTime); - nsresult ForceNoIntercept(); + nsresult ForceIntercepted(uint64_t aInterceptionID); + nsresult GetResponseSynthesized(bool *aResponseSynthesized); nsresult GetCorsIncludeCredentials(bool *aCorsIncludeCredentials); nsresult SetCorsIncludeCredentials(bool aCorsIncludeCredentials); nsresult GetCorsMode(uint32_t *aCorsMode); nsresult SetCorsMode(uint32_t aCorsMode); + nsresult GetRedirectMode(uint32_t *aRedirectMode); + nsresult SetRedirectMode(uint32_t aRedirectMode); nsresult GetTopWindowURI(nsIURI **aTopWindowURI); nsresult GetNetworkInterfaceId(nsACString *aNetworkInterfaceId); nsresult SetNetworkInterfaceId(const nsACString *aNetworkInterfaceId); - nsresult ContinueBeginConnect(); nsresult GetProxyURI(nsIURI **aProxyURI); + nsresult SetCorsPreflightParameters(const void /*nsTArray*/ *unsafeHeaders, + bool withCredentials, nsIPrincipal *preflightPrincipal); } [ @@ -1392,57 +1406,32 @@ [ object, - uuid(8146f3fc-9fc1-47c5-85ef-95d686e4ca6d), + uuid(ab30b7cc-f7f9-4b9b-befb-7dbf6cf86d46), local ] interface nsIDOMWindow : nsISupports { - nsresult GetWindow(nsIDOMWindow **aWindow); - nsresult GetSelf(nsIDOMWindow **aSelf); nsresult GetDocument(nsIDOMDocument **aDocument); nsresult GetName(nsAString *aName); nsresult SetName(const nsAString *aName); nsresult GetLocation(nsIDOMLocation **aLocation); - nsresult GetHistory(nsISupports **aHistory); - nsresult GetLocationbar(nsISupports **aLocationbar); - nsresult GetMenubar(nsISupports **aMenubar); - nsresult GetPersonalbar(nsISupports **aPersonalbar); - nsresult GetScrollbars(nsISupports **aScrollbars); - nsresult GetStatusbar(nsISupports **aStatusbar); - nsresult GetToolbar(nsISupports **aToolbar); - nsresult GetStatus(nsAString *aStatus); - nsresult SetStatus(const nsAString *aStatus); nsresult Close(); nsresult Stop(); nsresult Focus(); nsresult Blur(); nsresult GetLength(uint32_t *aLength); - nsresult GetScriptableTop(nsIDOMWindow **aTop); nsresult GetRealTop(nsIDOMWindow **aTop); - nsresult GetScriptableParent(nsIDOMWindow **aParent); nsresult GetRealParent(nsIDOMWindow **aParent); - nsresult GetScriptableOpener(JSContext* cx, int /* JS::MutableHandleValue */ aOpener); - nsresult SetScriptableOpener(JSContext* cx, int /* JS::HandleValue */ aOpener); nsresult GetOpener(nsIDOMWindow **aOpenerWindow); nsresult SetOpener(nsIDOMWindow *aOpenerWindow); - nsresult GetScriptableFrameElement(nsIDOMElement **aFrameElement); nsresult GetRealFrameElement(nsIDOMElement **aFrameElement); nsresult GetNavigator(nsIDOMNavigator **aNavigator); - nsresult GetApplicationCache(nsIDOMOfflineResourceList **aApplicationCache); - nsresult Alert(const nsAString *text); - nsresult Confirm(const nsAString *text, bool *_retval); - nsresult Prompt(const nsAString *aMessage, const nsAString *aInitial, nsAString *_retval); nsresult Print(); - nsresult ShowModalDialog(const nsAString *aURI, nsIVariant *aArgs, const nsAString *aOptions, uint8_t _argc, nsIVariant **_retval); - nsresult PostMessageMoz(const long /*jsval*/ *message, const nsAString *targetOrigin, const /*JS::Value*/ void *transfer, JSContext *cx); - nsresult Atob(const nsAString *aAsciiString, nsAString *_retval); - nsresult Btoa(const nsAString *aBase64Data, nsAString *_retval); nsresult GetSessionStorage(nsISupports **aSessionStorage); nsresult GetLocalStorage(nsISupports **aLocalStorage); nsresult GetIndexedDB(nsISupports **aIndexedDB); nsresult GetSelection(nsISelection **_retval); nsresult MatchMedia(const nsAString *media_query_list, nsISupports **_retval); - nsresult GetScreen(nsIDOMScreen **aScreen); nsresult GetInnerWidth(int32_t *aInnerWidth); nsresult SetInnerWidth(int32_t aInnerWidth); nsresult GetInnerHeight(int32_t *aInnerHeight); @@ -1464,18 +1453,11 @@ nsresult SetOuterHeight(int32_t aOuterHeight); nsresult GetComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval); nsresult GetDefaultComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval); - nsresult GetWindowRoot(nsIDOMEventTarget **aWindowRoot); nsresult GetFrames(nsIDOMWindowCollection **aFrames); nsresult GetTextZoom(float *aTextZoom); nsresult SetTextZoom(float aTextZoom); nsresult ScrollByLines(int32_t numLines); nsresult ScrollByPages(int32_t numPages); - nsresult SizeToContent(); - nsresult GetContent(nsIDOMWindow **aContent); - nsresult GetPrompter(nsIPrompt **aPrompter); - nsresult GetClosed(bool *aClosed); - nsresult GetCrypto(nsIDOMCrypto **aCrypto); - nsresult GetControllers(nsIControllers **aControllers); nsresult GetMozInnerScreenX(float *aMozInnerScreenX); nsresult GetMozInnerScreenY(float *aMozInnerScreenY); nsresult GetDevicePixelRatio(float *aDevicePixelRatio); @@ -1486,25 +1468,9 @@ nsresult Back(); nsresult Forward(); nsresult Home(); - nsresult MoveTo(int32_t xPos, int32_t yPos); - nsresult MoveBy(int32_t xDif, int32_t yDif); - nsresult ResizeTo(int32_t width, int32_t height); - nsresult ResizeBy(int32_t widthDif, int32_t heightDif); nsresult Open(const nsAString *url, const nsAString *name, const nsAString *options, nsIDOMWindow **_retval); - nsresult OpenDialog(const nsAString *url, const nsAString *name, const nsAString *options, nsISupports *aExtraArgument, - nsIDOMWindow **_retval); - nsresult UpdateCommands(const nsAString *action, nsISelection *sel, int16_t reason); nsresult Find(const nsAString *str, bool caseSensitive, bool backwards, bool wrapAround, bool wholeWord, bool searchInFrames, bool showDialog, bool *_retval); - nsresult GetMozPaintCount(uint64_t *aMozPaintCount); - nsresult MozRequestAnimationFrame(nsIFrameRequestCallback *aCallback, int32_t *_retval); - nsresult RequestAnimationFrame(void /*const JS::Value*/ *aCallback, JSContext* cx, int32_t *_retval); - nsresult MozCancelAnimationFrame(int32_t aHandle); - nsresult MozCancelRequestAnimationFrame(int32_t aHandle); - nsresult CancelAnimationFrame(int32_t aHandle); - nsresult GetMozAnimationStartTime(int64_t *aMozAnimationStartTime); - nsresult GetConsole(JSContext *cx, jsval *aConsole); - nsresult SetConsole(JSContext *cx, const jsval *aConsole); } [ @@ -2348,7 +2314,7 @@ [ object, - uuid(0e92d522-53a5-4af6-9a24-4eccdcbf4f91), + uuid(3ade79d4-8cb9-4952-b18d-4f9b63ca0d31), local ] interface nsIWebNavigation : nsISupports @@ -2370,6 +2336,7 @@ const UINT LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10000; const UINT LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20000; const UINT LOAD_FLAGS_DISALLOW_INHERIT_OWNER = 0x40000; + const UINT LOAD_FLAGS_ERROR_LOAD_CHANGES_RV = 0x80000; nsresult GetCanGoBack(bool *aCanGoBack); nsresult GetCanGoForward(bool *aCanGoForward); @@ -2407,7 +2374,7 @@ [ object, - uuid(1bcfc611-8941-4c39-9e06-7116e564a1ce), + uuid(04dd3a01-a74e-44aa-8d49-2c30478fd7b8), local ] interface nsIPrintSettings : nsISupports @@ -2417,6 +2384,7 @@ nsresult SetPrintOptions(int32_t aType, bool aTurnOnOff); nsresult GetPrintOptions(int32_t aType, bool *_retval); nsresult GetPrintOptionsBits(int32_t *_retval); + nsresult SetPrintOptionsBits(int32_t bits); nsresult GetEffectivePageSize(double *aWidth, double *aHeight); nsresult Clone(nsIPrintSettings **_retval); nsresult Assign(nsIPrintSettings *aPS); @@ -2500,22 +2468,12 @@ nsresult SetPaperHeight(double aPaperHeight); nsresult GetPaperSizeUnit(int16_t *aPaperSizeUnit); nsresult SetPaperSizeUnit(int16_t aPaperSizeUnit); - nsresult GetPlexName(PRUnichar **aPlexName); - nsresult SetPlexName(const PRUnichar *aPlexName); - nsresult GetColorspace(PRUnichar **aColorspace); - nsresult SetColorspace(const PRUnichar *aColorspace); - nsresult GetResolutionName(PRUnichar **aResolutionName); - nsresult SetResolutionName(const PRUnichar aResolutionName); - nsresult GetDownloadFonts(bool *aDownloadFonts); - nsresult SetDownloadFonts(bool aDownloadFonts); nsresult GetPrintReversed(bool *aPrintReversed); nsresult SetPrintReversed(bool aPrintReversed); nsresult GetPrintInColor(bool *aPrintInColor); nsresult SetPrintInColor(bool aPrintInColor); nsresult GetOrientation(int32_t *aOrientation); nsresult SetOrientation(int32_t aOrientation); - nsresult GetPrintCommand(PRUnichar **aPrintCommand); - nsresult SetPrintCommand(const PRUnichar *aPrintCommand); nsresult GetNumCopies(int32_t *aNumCopies); nsresult SetNumCopies(int32_t aNumCopies); nsresult GetPrinterName(PRUnichar **aPrinterName); @@ -2599,7 +2557,7 @@ [ object, - uuid(dfb5a307-7ecf-41dd-aee2-f1d623459c44), + uuid(2fa6884a-ae65-412a-9d4c-ce6e34544ba1), local ] interface nsIFile : nsISupports @@ -2625,6 +2583,7 @@ nsresult MoveTo(nsIFile *newParentDir, const nsAString *newName); nsresult MoveToNative(nsIFile *newParentDir, const nsAString *newName); nsresult RenameTo(nsIFile *newParentDir, const nsAString *newName); + nsresult RenameToNative(nsIFile *newParentDir, const nsACString *newName); nsresult Remove(bool recursive); nsresult GetPermissions(uint32_t *aPermissions); nsresult SetPermissions(uint32_t pPermissions); @@ -2673,6 +2632,8 @@ nsresult Launch(); nsresult GetRelativeDescriptor(nsIFile *fromFile, nsACString *_retval); nsresult SetRelativeDescriptor(nsIFile *fromFile, const nsACString *relativeDesc); + nsresult GetRelativePath(nsIFile *fromFile, nsACString *_retval); + nsresult SetRelativePath(nsIFile *fromFile, const nsACString *relativeDesc); } [ @@ -2745,7 +2706,7 @@ [ object, - uuid(a7aad716-e72c-435d-82f1-7582dffae661), + uuid(a87210e6-7c8c-41f7-864d-df809015193e), local ] interface nsIProtocolHandler : nsISupports @@ -2770,6 +2731,7 @@ const unsigned long URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM = (1<<16); const unsigned long URI_SYNC_LOAD_IS_OK = (1<<17); const unsigned long URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT = (1<<18); + const unsigned long URI_FETCHABLE_BY_ANYONE = (1 << 19); nsresult GetScheme(nsACString *aScheme); nsresult GetDefaultPort(int32_t *aDefaultPort); @@ -2793,6 +2755,20 @@ [ object, + uuid(d13c21ca-7329-45a5-8912-9d2e2fef1231), + local +] +interface nsIIOServiceHook : nsISupports +{ + nsresult NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel **_retval); + nsresult GetProtocolHandler(nsIProtocolHandler *aHandler, nsIProtocolHandler **_retval); + nsresult NewURI(const nsACString *aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval); + nsresult ProtocolHasFlags(nsIURI *aURI, uint32_t aFlag, bool *_retval); + nsresult URIChainHasFlags(nsIURI *aURI, uint32_t aFlags, bool *_retval); +} + +[ + object, uuid(4286de5a-b2ea-446f-8f70-e2a461f42694), local ] @@ -2821,28 +2797,7 @@ nsresult GetAppOfflineState(uint32_t appId, int32_t *_retval); nsresult AllowPort(int32_t aPort, const char *aScheme, bool *_retval); nsresult ExtractScheme(const nsACString *urlString, nsACString *_retval); - nsresult NewLoadInfo(nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, - nsIDOMNode *aLoadingNode, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsILoadInfo **_retval); -} - -[ - object, - uuid(ca68c485-9db3-4c12-82a6-4fab7948e2d5), - local, -] -interface nsINetUtil : nsISupports -{ - nsresult ParseContentType(const nsACString *aTypeHeader, nsACString *aCharset, - bool *aHadCharset, nsACString *_retval); - nsresult ProtocolHasFlags(nsIURI *aURI, uint32_t aFlag, bool *_retval); - nsresult URIChainHasFlags(nsIURI *aURI, uint32_t aFlags, bool *_retval); - nsresult ToImmutableURI(nsIURI *aURI, nsIURI **_retval); - nsresult NewSimpleNestedURI(nsIURI *aURI, nsIURI **_retval); - nsresult EscapeString(const nsACString *aString, uint32_t aEscapeType, nsACString *_retval); - nsresult EscapeURL(const nsACString *aStr, uint32_t aFlags, nsACString *_retval); - nsresult UnescapeString(const nsACString *aStr, uint32_t aFlags, nsACString *_retval); - nsresult ExtractCharsetFromContentType(const nsACString *aTypeHeader, nsACString *aCharset, - int32_t *aCharsetStart, int32_t *aCharsetEnd, bool *_retval); + nsresult SetHook(nsIIOServiceHook *aHook); } [ @@ -2909,7 +2864,7 @@ [ object, - uuid(02d54f52-a1f5-4ad2-b560-36f14012935e), + uuid(63857daf-c084-4ea6-a8b9-6812e3176991), local ] interface nsIDOMEvent : nsISupports @@ -2939,11 +2894,12 @@ bool Deserialize(const /*IPC::Message*/ void *aMsg, void **aIter); void SetOwner(void /*mozilla::dom::EventTarget*/ *aOwner); void /*nsDOMEvent*/ *InternalDOMEvent(); + nsresult StopCrossProcessForwarding(); } [ object, - uuid(1a75c351-d115-4d51-94df-731dd1723a1f), + uuid(a30a95ac-3b95-4251-88dc-8efa89ba9f9c), local ] interface nsIDOMWindowUtils : nsISupports @@ -2955,7 +2911,6 @@ nsresult GetDocumentMetadata(const nsAString *aName, nsAString *_retval); nsresult Redraw(uint32_t aCount, uint32_t *_retval); nsresult UpdateLayerTree(); - nsresult SetCSSViewport(float aWidthPx, float aHeightPx); nsresult GetViewportInfo(uint32_t aDisplayWidth, uint32_t aDisplayHeight, double *aDefaultZoom, bool *aAllowZoom, double *aMinZoom, double *aMaxZoom, uint32_t *aWidth, uint32_t *aHeight, bool *aAutoSize); nsresult SetDisplayPortForElement(float aXPx, float aYPx, float aWidthPx, float aHeightPx, @@ -3037,8 +2992,9 @@ nsresult SendContentCommandEvent(const nsAString *aType, nsITransferable *aTransferable); nsresult SendQueryContentEvent(uint32_t aType, uint32_t aOffset, uint32_t aLength, int32_t aX, int32_t aY, uint32_t aAdditionalFlags, nsIQueryContentEventResult **_retval); - nsresult RemoteFrameFullscreenChanged(nsIDOMElement *aFrameElement, const nsAString *aNewOrigin); + nsresult RemoteFrameFullscreenChanged(nsIDOMElement *aFrameElement); nsresult RemoteFrameFullscreenReverted(); + nsresult HandleFullscreenRequests(bool *_retval); nsresult ExitFullscreen(); nsresult SendSelectionSetEvent(uint32_t aOffset, uint32_t aLength, uint32_t aAdditionalFlags, bool *_retval); nsresult SelectAtPoint(float aX, float aY, uint32_t aSelectBehavior, bool *_retval); @@ -3054,7 +3010,7 @@ nsresult ResumeTimeouts(); nsresult GetLayerManagerType(nsAString *aLayerManagerType); nsresult GetLayerManagerRemote(bool *aLayerManagerRemote); - nsresult GetSupportsHardwareH264Decoding(bool *aSupportsHardwareH264Decoding); + nsresult GetSupportsHardwareH264Decoding(nsAString *aSupportsHardwareH264Decoding); nsresult StartFrameTimeRecording(uint32_t *startIndex); nsresult StopFrameTimeRecording(uint32_t startIndex, uint32_t *frameCount, float **frameIntervals); nsresult BeginTabSwitch(); @@ -3066,10 +3022,13 @@ nsresult AdvanceTimeAndRefresh(int64_t aMilliseconds); nsresult RestoreNormalRefresh(); nsresult GetIsTestControllingRefreshes(bool *aIsTestControllingRefreshes); + nsresult GetAsyncPanZoomEnabled(bool *aAsyncPanZoomEnabled); nsresult SetAsyncScrollOffset(nsIDOMNode *aNode, int32_t aX, int32_t aY); + nsresult SetAsyncZoom(nsIDOMNode *aRootElement, float aValue); + nsresult FlushApzRepaints(bool *_retval); nsresult ComputeAnimationDistance(nsIDOMElement *element, const nsAString *property, const nsAString *value1, const nsAString *value2, double *_retval); - nsresult WrapDOMFile(nsIFile *aFile, nsIDOMFile **_retval); + nsresult WrapDOMFile(nsIFile *aFile, nsISupports **_retval); nsresult GetFocusedInputType(char **aFocusedInputType); nsresult FindElementWithViewId(long /*nsViewID*/ aId, nsIDOMElement **_retval); nsresult GetViewId(nsIDOMElement *aElement, long /*nsViewID*/ *_retval); @@ -3081,6 +3040,7 @@ nsresult GetFilePath(void /*JS::HandleValue*/ *aFile, JSContext *cx, nsAString *_retval); nsresult GetFileReferences(const nsAString *aDatabaseName, int64_t aId, void /*JS::HandleValue*/ *aOptions, int32_t *aRefCnt, int32_t *aDBRefCnt, int32_t *aSliceRefCnt, JSContext* cx, bool *_retval); + nsresult FlushPendingFileDeletions(); nsresult IsIncrementalGCEnabled(JSContext *cx, bool *_retval); nsresult StartPCCountProfiling(JSContext *cx); nsresult StopPCCountProfiling(JSContext *cx); @@ -3091,7 +3051,6 @@ nsresult GetPaintingSuppressed(bool *aPaintingSuppressed); nsresult GetPlugins(JSContext *cx, /*JS::Value*/ void *aPlugins); nsresult SetScrollPositionClampingScrollPortSize(float aWidth, float aHeight); - nsresult SetContentDocumentFixedPositionMargins(float aTop, float aRight, float aBottom, float aLeft); nsresult DisableDialogs(); nsresult EnableDialogs(); nsresult AreDialogsEnabled(bool *_retval); @@ -3106,9 +3065,8 @@ nsresult IsNodeDisabledForEvents(nsIDOMNode *aNode, bool *_retval); nsresult GetPaintFlashing(bool *aPaintFlashing); nsresult SetPaintFlashing(bool aPaintFlashing); - nsresult RunInStableState(nsIRunnable *runnable); - nsresult RunBeforeNextEvent(nsIRunnable *runnable); - nsresult GetOMTAStyle(nsIDOMElement *aElement, const nsAString *aProperty, nsAString *_retval); + nsresult GetOMTAStyle(nsIDOMElement *aElement, const nsAString *aProperty, + const nsAString *aPseudoElement, nsAString *_retval); nsresult RequestCompositorProperty(const nsAString *aProperty, float *_retval); nsresult SetHandlingUserInput(bool aHandlingInput, void /*nsIJSRAIIHelper*/ **_retval); nsresult GetContentAPZTestData(JSContext *cx, int /*JS::MutableHandleValue*/ _retval); @@ -3125,6 +3083,12 @@ nsresult SetChromeMargin(int32_t aTop, int32_t aRight, int32_t aBottom, int32_t aLeft); nsresult GetServiceWorkersTestingEnabled(bool *aServiceWorkersTestingEnabled); nsresult SetServiceWorkersTestingEnabled(bool aServiceWorkersTestingEnabled); + nsresult GetFrameUniformityTestData(JSContext* cx, int /*JS::MutableHandleValue*/ *_retval); + nsresult EnterChaosMode(); + nsresult LeaveChaosMode(); + nsresult HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType, bool *_retval); + nsresult ForceUseCounterFlush(nsIDOMNode *aNode); + nsresult SetNextPaintSyncId(int32_t aSyncId); } cpp_quote("#define CONTEXT_NONE 0x00") @@ -3416,7 +3380,7 @@ [ object, - uuid(70f7e9ea-a9bf-48cc-ad9d-8acaeed29b68), + uuid(8e1bab9d-8815-4d2c-a24d-7aba5239dc22), local ] interface nsIContent : nsISupports @@ -3426,7 +3390,7 @@ [ object, - uuid(0b78eabe-8b94-4ea1-9331-5d48e83ada95), + uuid(5f51e18c-9e0e-4dc0-9f08-7a326552ea11), local ] interface nsIDocument : nsISupports @@ -3739,7 +3703,7 @@ [ object, - uuid(c63e9d64-490d-48bf-8013-b5d8ee4dbc25), + uuid(e7570e5a-f1d6-452d-b4f8-b35fdc63aa03), local ] interface nsIDocShellLoadInfo : nsISupports @@ -3749,6 +3713,10 @@ nsresult GetReferrer(nsIURI **aReferrer); nsresult SetReferrer(nsIURI *aReferrer); + nsresult GetOriginalURI(nsIURI **aOriginalURI); + nsresult SetOriginalURI(nsIURI *aOriginalURI); + nsresult GetLoadReplace(bool *aLoadReplace); + nsresult SetLoadReplace(bool aLoadReplace); nsresult GetOwner(nsISupports **aOwner); nsresult SetOwner(nsISupports *aOwner); nsresult GetInheritOwner(bool *aInheritOwner); @@ -3780,7 +3748,7 @@ [ object, - uuid(696b32a1-3cf1-4909-b501-474b25fc7954), + uuid(44aca825-0080-49f1-8407-df62183e5ec1), local ] interface nsIDocShell : nsIDocShellTreeItem @@ -3788,11 +3756,12 @@ nsresult LoadURI(nsIURI *uri, nsIDocShellLoadInfo *loadInfo, uint32_t aLoadFlags, bool firstParty); nsresult LoadStream(nsIInputStream *aStream, nsIURI *aURI, const nsACString *aContentType, const nsACString *aContentCharset, nsIDocShellLoadInfo *aLoadInfo); - nsresult InternalLoad(nsIURI *aURI, nsIURI *aReferrer, uint32_t aReferrerPolicy, nsISupports *aOwner, - uint32_t aFlags, const PRUnichar *aWindowTarget, const char *aTypeHint, nsACString *aFileName, - nsIInputStream *aPostDataStream, nsIInputStream *aHeadersStream, uint32_t aLoadFlags, - nsISHEntry *aSHEntry, bool firstParty, const nsAString *aSrcdoc, nsIDocShell *aSourceDocShell, - nsIURI *aBaseURI, nsIDocShell **aDocShell, nsIRequest **aRequest); + nsresult InternalLoad(nsIURI *aURI, nsIURI *aOriginalURI, bool aLoadReplace, nsIURI *aReferrer, + uint32_t aReferrerPolicy, nsISupports *aOwner, uint32_t aFlags, const PRUnichar *aWindowTarget, + const char *aTypeHint, nsACString *aFileName, nsIInputStream *aPostDataStream, + nsIInputStream *aHeadersStream, uint32_t aLoadFlags, nsISHEntry *aSHEntry, bool firstParty, + const nsAString *aSrcdoc, nsIDocShell *aSourceDocShell, nsIURI *aBaseURI, nsIDocShell **aDocShell, + nsIRequest **aRequest); nsresult AddState(jsval *aData, const nsAString *aTitle, const nsAString *aURL, bool aReplace, JSContext *cx); nsresult CreateLoadInfo(nsIDocShellLoadInfo **loadInfo); nsresult PrepareForNewContentModel(); @@ -3837,7 +3806,7 @@ nsresult SetMarginWidth(int32_t aMarginWidth); nsresult GetMarginHeight(int32_t *aMarginHeight); nsresult SetMarginHeight(int32_t aMarginHeight); - nsresult TabToTreeOwner(bool forward, bool *tookFocus); + nsresult TabToTreeOwner(bool forward, bool forDocumentNavigation, bool *_retval); nsresult GetBusyFlags(uint32_t *aBusyFlags); nsresult GetLoadType(uint32_t *aLoadType); nsresult SetLoadType(uint32_t aLoadType); @@ -3857,7 +3826,7 @@ nsresult GetRestoringDocument(bool *aRestoringDocument); nsresult GetUseErrorPages(bool *aUseErrorPages); nsresult SetUseErrorPages(bool aUseErrorPages); - nsresult DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL, nsIChannel *aFailedChannel); + nsresult DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL, nsIChannel *aFailedChannel, bool *_retval); nsresult GetFailedChannel(nsIChannel **aFailedChannel); nsresult GetPreviousTransIndex(int32_t *aPreviousTransIndex); nsresult GetLoadedTransIndex(int32_t *aLoadedTransIndex); @@ -3916,6 +3885,7 @@ nsresult GetAppId(uint32_t *aAppId); nsresult GetAppManifestURL(nsAString *aAppManifestURL); nsresult GetSameTypeParentIgnoreBrowserAndAppBoundaries(nsIDocShell **_retval); + nsresult GetSameTypeRootTreeItemIgnoreBrowserAndAppBoundaries(nsIDocShell **_retval); nsresult GetAsyncPanZoomEnabled(bool *aAsyncPanZoomEnabled); nsresult GetSandboxFlags(uint32_t *aSandboxFlags); nsresult SetSandboxFlags(uint32_t aSandboxFlags); @@ -3928,6 +3898,8 @@ bool PluginsAllowedInCurrentDoc(); nsresult GetFullscreenAllowed(bool *aFullscreenAllowed); nsresult SetFullscreenAllowed(bool allowed); + uint32_t OrientationLock(); + void SetOrientationLock(uint32_t orientationLock); nsresult GetAffectPrivateSessionLifetime(bool *aAffectPrivateSessionLifetime); nsresult SetAffectPrivateSessionLifetime(bool aAffectPrivateSessionLifetime); nsresult GetMayEnableCharacterEncodingMenu(bool *aMayEnableCharacterEncodingMenu); @@ -3953,7 +3925,6 @@ nsresult SetDeviceSizeIsPageSize(bool aDeviceSizeIsPageSize); void /* thiscall */ SetOpener(void /*nsITabParent*/ *aOpener); void /* thiscall nsITabParent */ *GetOpener(); - void /*mozilla::dom::URLSearchParams */ *GetURLSearchParams(); void /* thiscall */ NotifyJSRunToCompletionStart(const char *aReason, const char16_t *functionName, const char16_t *fileName, uint32_t lineNumber); void /* thiscall */ NotifyJSRunToCompletionStop(); @@ -3966,19 +3937,22 @@ [ object, - uuid(16fe5e3e-eadc-4312-9d44-b6bedd6b5474), + uuid(6d674c17-0fbc-4633-8f46-734e87ebf0c7), local ] interface nsIMutationObserver : nsISupports { + typedef struct {} nsAttrValue; + void CharacterDataWillChange(nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo); void CharacterDataChanged(nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo); - void AttributeWillChange(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, - nsIAtom *aAttribute, int32_t aModType); - void AttributeChanged(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, - nsIAtom *aAttribute, int32_t aModType); + void AttributeWillChange(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, int32_t aNameSpaceID, + nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aNewValue); + void AttributeChanged(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, int32_t aNameSpaceID, + nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aOldValue); + void NativeAnonymousChildListChange(nsIDocument *aDocument, nsIContent *aContent, bool aIsRemove); void AttributeSetToCurrentValue(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, int32_t aNameSpaceID, nsIAtom *aAttribute); void ContentAppended(nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aFirstNewContent, @@ -4083,10 +4057,21 @@ [ object, + uuid(5fe83b24-38b9-4901-a4a1-d1bd57d3fe18), + local +] +interface nsIAudioChannelAgentCallback : nsISupports +{ + nsresult WindowVolumeChanged(float aVolume, bool aMuted); + nsresult WindowAudioCaptureChanged(); +} + +[ + object, uuid(8f672000-bab9-4c60-aaaf-2673c4e2a4c6), local ] -interface nsIPluginInstance : nsISupports +interface nsIPluginInstance : nsIAudioChannelAgentCallback { nsresult GetDOMElement(nsIDOMElement **aDOMElement); } @@ -4139,7 +4124,7 @@ [ object, - uuid(ba602ca6-dc7a-457e-a57a-ee5b343fd863), + uuid(b7ae2310-576e-11e5-a837-0800200c9a66), local ] interface nsIScriptSecurityManager : nsISupports { @@ -4149,7 +4134,7 @@ nsresult CheckLoadURIFromScript(JSContext *cx, nsIURI *uri); nsresult CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, uint32_t flags); nsresult CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString *uri, uint32_t flags); - nsresult ScriptAllowed(JSObject *aGlobal); + bool ScriptAllowed(JSObject *aGlobal); nsresult GetSystemPrincipal(nsIPrincipal **_retval); nsresult GetSimpleCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval); nsresult GetAppCodebasePrincipal(nsIURI *uri, uint32_t appId, bool inMozBrowser, nsIPrincipal **_retval); @@ -4157,6 +4142,10 @@ nsresult GetDocShellCodebasePrincipal(nsIURI *uri, nsIDocShell *docShell, nsIPrincipal **_retval); nsresult GetNoAppCodebasePrincipal(nsIURI *uri, nsIPrincipal **_retval); nsresult GetCodebasePrincipal(nsIURI *uri, nsIPrincipal **_retval); + nsresult CreateCodebasePrincipal(nsIURI *uri, int /*JS::HandleValue*/ originAttributes, JSContext* cx, nsIPrincipal **_retval); + nsresult CreateCodebasePrincipalFromOrigin(const nsACString *origin, nsIPrincipal **_retval); + nsresult CreateNullPrincipal(int /*JS::HandleValue*/ originAttributes, JSContext *cx, nsIPrincipal **_retval); + nsresult CreateExpandedPrincipal(nsIPrincipal **aPrincipalArray, uint32_t aLength, nsIPrincipal **_retval); nsresult CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, bool reportError); nsresult GetChannelResultPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval); nsresult GetChannelURIPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsio.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsio.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/nsio.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/nsio.c 2016-02-08 19:32:34.000000000 +0000 @@ -48,7 +48,6 @@ {0x5088272e, 0x900b, 0x11da, {0xc6,0x87, 0x00,0x0f,0xea,0x57,0xf2,0x1a}}; static nsIIOService *nsio = NULL; -static nsINetUtil *net_util; static const char *request_method_strings[] = {"GET", "PUT", "POST"}; @@ -897,6 +896,15 @@ return NS_ERROR_NOT_IMPLEMENTED; } +static nsresult NSAPI nsChannel_Open2(nsIHttpChannel *iface, nsIInputStream **_retval) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + + FIXME("(%p)->(%p)\n", This, _retval); + + return NS_ERROR_NOT_IMPLEMENTED; +} + static HTMLOuterWindow *get_window_from_load_group(nsChannel *This) { HTMLOuterWindow *window; @@ -1163,6 +1171,13 @@ return nsres; } +static nsresult NSAPI nsChannel_AsyncOpen2(nsIHttpChannel *iface, nsIStreamListener *aListener) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + FIXME("(%p)->(%p)\n", This, aListener); + return nsIHttpChannel_AsyncOpen(&This->nsIHttpChannel_iface, aListener, NULL); +} + static nsresult NSAPI nsChannel_GetContentDisposition(nsIHttpChannel *iface, UINT32 *aContentDisposition) { nsChannel *This = impl_from_nsIHttpChannel(iface); @@ -1318,6 +1333,13 @@ return set_channel_http_header(&This->request_headers, aHeader, aValue); } +static nsresult NSAPI nsChannel_SetEmptyRequestHeader(nsIHttpChannel *iface, const nsACString *aHeader) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + FIXME("(%p)->(%s)\n", This, debugstr_nsacstr(aHeader)); + return NS_ERROR_NOT_IMPLEMENTED; +} + static nsresult NSAPI nsChannel_VisitRequestHeaders(nsIHttpChannel *iface, nsIHttpHeaderVisitor *aVisitor) { @@ -1328,6 +1350,13 @@ return NS_ERROR_NOT_IMPLEMENTED; } +static nsresult NSAPI nsChannel_VisitNonDefaultRequestHeaders(nsIHttpChannel *iface, nsIHttpHeaderVisitor *aVisitor) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + FIXME("(%p)->(%p)\n", This, aVisitor); + return NS_ERROR_NOT_IMPLEMENTED; +} + static nsresult NSAPI nsChannel_GetAllowPipelining(nsIHttpChannel *iface, cpp_bool *aAllowPipelining) { nsChannel *This = impl_from_nsIHttpChannel(iface); @@ -1419,6 +1448,20 @@ return NS_OK; } +static nsresult NSAPI nsChannel_GetIsMainDocumentChannel(nsIHttpChannel *iface, cpp_bool *aIsMainDocumentChannel) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + FIXME("(%p)->(%p)\n", This, aIsMainDocumentChannel); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsChannel_SetIsMainDocumentChannel(nsIHttpChannel *iface, cpp_bool aIsMainDocumentChannel) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + FIXME("(%p)->(%x)\n", This, aIsMainDocumentChannel); + return NS_ERROR_NOT_IMPLEMENTED; +} + static nsresult NSAPI nsChannel_GetResponseHeader(nsIHttpChannel *iface, const nsACString *header, nsACString *_retval) { @@ -1491,6 +1534,24 @@ return NS_ERROR_NOT_IMPLEMENTED; } +static nsresult NSAPI nsHttpChannel_GetSchedulingContextID(nsIHttpChannel *iface, nsIID *aSchedulingContextID) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + + FIXME("(%p)->(%p)\n", This, aSchedulingContextID); + + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsHttpChannel_SetSchedulingContextID(nsIHttpChannel *iface, const nsIID aSchedulingContextID) +{ + nsChannel *This = impl_from_nsIHttpChannel(iface); + + FIXME("(%p)->(%s)\n", This, debugstr_guid(&aSchedulingContextID)); + + return NS_ERROR_NOT_IMPLEMENTED; +} + static const nsIHttpChannelVtbl nsChannelVtbl = { nsChannel_QueryInterface, nsChannel_AddRef, @@ -1520,7 +1581,9 @@ nsChannel_GetContentLength, nsChannel_SetContentLength, nsChannel_Open, + nsChannel_Open2, nsChannel_AsyncOpen, + nsChannel_AsyncOpen2, nsChannel_GetContentDisposition, nsChannel_SetContentDisposition, nsChannel_GetContentDispositionFilename, @@ -1536,7 +1599,9 @@ nsChannel_SetReferrerWithPolicy, nsChannel_GetRequestHeader, nsChannel_SetRequestHeader, + nsChannel_SetEmptyRequestHeader, nsChannel_VisitRequestHeaders, + nsChannel_VisitNonDefaultRequestHeaders, nsChannel_GetAllowPipelining, nsChannel_SetAllowPipelining, nsChannel_GetAllowTLS, @@ -1546,13 +1611,17 @@ nsChannel_GetResponseStatus, nsChannel_GetResponseStatusText, nsChannel_GetRequestSucceeded, + nsChannel_GetIsMainDocumentChannel, + nsChannel_SetIsMainDocumentChannel, nsChannel_GetResponseHeader, nsChannel_SetResponseHeader, nsChannel_VisitResponseHeaders, nsChannel_IsNoStoreResponse, nsChannel_IsNoCacheResponse, nsChannel_IsPrivateResponse, - nsChannel_RedirectTo + nsChannel_RedirectTo, + nsHttpChannel_GetSchedulingContextID, + nsHttpChannel_SetSchedulingContextID }; static inline nsChannel *impl_from_nsIUploadChannel(nsIUploadChannel *iface) @@ -1872,6 +1941,22 @@ return NS_ERROR_NOT_IMPLEMENTED; } +static nsresult NSAPI nsHttpChannelInternal_GetInitialRwin(nsIHttpChannelInternal *iface, + UINT32 *aInitialRwin) +{ + nsChannel *This = impl_from_nsIHttpChannelInternal(iface); + FIXME("(%p)->(%p)\n", This, aInitialRwin); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsHttpChannelInternal_SetInitialRwin(nsIHttpChannelInternal *iface, + UINT32 aInitialRwin) +{ + nsChannel *This = impl_from_nsIHttpChannelInternal(iface); + FIXME("(%p)->(%x)\n", This, aInitialRwin); + return NS_ERROR_NOT_IMPLEMENTED; +} + static nsresult NSAPI nsHttpChannelInternal_GetApiRedirectToURI(nsIHttpChannelInternal *iface, nsIURI **aApiRedirectToURI) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); @@ -1893,24 +1978,24 @@ return NS_ERROR_NOT_IMPLEMENTED; } -static nsresult NSAPI nsHttpChannelInternal_AddRedirect(nsIHttpChannelInternal *iface, nsIPrincipal *aPrincipal) +static nsresult NSAPI nsHttpChannelInternal_GetLastModifiedTime(nsIHttpChannelInternal *iface, PRTime *aLastModifiedTime) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); - FIXME("(%p)->(%p)\n", This, aPrincipal); + FIXME("(%p)->(%p)\n", This, aLastModifiedTime); return NS_ERROR_NOT_IMPLEMENTED; } -static nsresult NSAPI nsHttpChannelInternal_GetLastModifiedTime(nsIHttpChannelInternal *iface, PRTime *aLastModifiedTime) +static nsresult NSAPI nsHttpChannelInternal_ForceIntercepted(nsIHttpChannelInternal *iface, UINT64 aInterceptionID) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); - FIXME("(%p)->(%p)\n", This, aLastModifiedTime); + FIXME("(%p)->(%s)\n", This, wine_dbgstr_longlong(aInterceptionID)); return NS_ERROR_NOT_IMPLEMENTED; } -static nsresult NSAPI nsHttpChannelInternal_ForceNoIntercept(nsIHttpChannelInternal *iface) +static nsresult NSAPI nsHttpChannelInternal_GetResponseSynthesized(nsIHttpChannelInternal *iface, cpp_bool *ResponseSynthesized) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); - FIXME("(%p)\n", This); + FIXME("(%p, %p)\n", This, ResponseSynthesized); return NS_ERROR_NOT_IMPLEMENTED; } @@ -1944,6 +2029,20 @@ return NS_OK; } +static nsresult NSAPI nsHttpChannelInternal_GetRedirectMode(nsIHttpChannelInternal *iface, UINT32 *aRedirectMode) +{ + nsChannel *This = impl_from_nsIHttpChannelInternal(iface); + FIXME("(%p)->(%p)\n", This, aRedirectMode); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsHttpChannelInternal_SetRedirectMode(nsIHttpChannelInternal *iface, UINT32 aRedirectMode) +{ + nsChannel *This = impl_from_nsIHttpChannelInternal(iface); + FIXME("(%p)->(%d)\n", This, aRedirectMode); + return NS_ERROR_NOT_IMPLEMENTED; +} + static nsresult NSAPI nsHttpChannelInternal_GetTopWindowURI(nsIHttpChannelInternal *iface, nsIURI **aTopWindowURI) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); @@ -1967,17 +2066,18 @@ return NS_ERROR_NOT_IMPLEMENTED; } -static nsresult NSAPI nsHttpChannelInternal_ContinueBeginConnect(nsIHttpChannelInternal *iface) +static nsresult NSAPI nsHttpChannelInternal_GetProxyURI(nsIHttpChannelInternal *iface, nsIURI **aProxyURI) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); - FIXME("(%p)\n", This); + FIXME("(%p)->(%p)\n", This, aProxyURI); return NS_ERROR_NOT_IMPLEMENTED; } -static nsresult NSAPI nsHttpChannelInternal_GetProxyURI(nsIHttpChannelInternal *iface, nsIURI **aProxyURI) +static nsresult NSAPI nsHttpChannelInternal_SetCorsPreflightParameters(nsIHttpChannelInternal *iface, + const void /*nsTArray*/ *unsafeHeaders, cpp_bool withCredentials, nsIPrincipal *preflightPrincipal) { nsChannel *This = impl_from_nsIHttpChannelInternal(iface); - FIXME("(%p)->(%p)\n", This, aProxyURI); + FIXME("(%p %p %x %p)\n", This, unsafeHeaders, withCredentials, preflightPrincipal); return NS_ERROR_NOT_IMPLEMENTED; } @@ -2009,21 +2109,25 @@ nsHttpChannelInternal_SetAllowSpdy, nsHttpChannelInternal_GetResponseTimeoutEnabled, nsHttpChannelInternal_SetResponseTimeoutEnabled, + nsHttpChannelInternal_GetInitialRwin, + nsHttpChannelInternal_SetInitialRwin, nsHttpChannelInternal_GetApiRedirectToURI, nsHttpChannelInternal_GetAllowAltSvc, nsHttpChannelInternal_SetAllowAltSvc, - nsHttpChannelInternal_AddRedirect, nsHttpChannelInternal_GetLastModifiedTime, - nsHttpChannelInternal_ForceNoIntercept, + nsHttpChannelInternal_ForceIntercepted, + nsHttpChannelInternal_GetResponseSynthesized, nsHttpChannelInternal_GetCorsIncludeCredentials, nsHttpChannelInternal_SetCorsIncludeCredentials, nsHttpChannelInternal_GetCorsMode, nsHttpChannelInternal_SetCorsMode, + nsHttpChannelInternal_GetRedirectMode, + nsHttpChannelInternal_SetRedirectMode, nsHttpChannelInternal_GetTopWindowURI, nsHttpChannelInternal_GetNetworkInterfaceId, nsHttpChannelInternal_SetNetworkInterfaceId, - nsHttpChannelInternal_ContinueBeginConnect, - nsHttpChannelInternal_GetProxyURI + nsHttpChannelInternal_GetProxyURI, + nsHttpChannelInternal_SetCorsPreflightParameters }; @@ -2711,6 +2815,15 @@ return nsIFileURL_GetSpec(&This->nsIFileURL_iface, aAsciiSpec); } +static nsresult NSAPI nsURI_GetAsciiHostPort(nsIFileURL *iface, nsACString *aAsciiHostPort) +{ + nsWineURI *This = impl_from_nsIFileURL(iface); + + WARN("(%p)->(%p) FIXME: Use Uri_PUNYCODE_IDN_HOST flag\n", This, aAsciiHostPort); + + return nsIFileURL_GetAsciiHostPort(&This->nsIFileURL_iface, aAsciiHostPort); +} + static nsresult NSAPI nsURI_GetAsciiHost(nsIFileURL *iface, nsACString *aAsciiHost) { nsWineURI *This = impl_from_nsIFileURL(iface); @@ -3123,6 +3236,7 @@ nsURI_Clone, nsURI_Resolve, nsURI_GetAsciiSpec, + nsURI_GetAsciiHostPort, nsURI_GetAsciiHost, nsURI_GetOriginCharset, nsURL_GetRef, @@ -3506,38 +3620,78 @@ nsProtocolHandler_AllowPort }; -static nsresult NSAPI nsIOService_QueryInterface(nsIIOService*,nsIIDRef,void**); +static nsresult NSAPI nsIOServiceHook_QueryInterface(nsIIOServiceHook *iface, nsIIDRef riid, + void **result) +{ + if(IsEqualGUID(&IID_nsISupports, riid)) { + TRACE("(IID_nsISupports %p)\n", result); + *result = iface; + }else if(IsEqualGUID(&IID_nsIIOServiceHook, riid)) { + TRACE("(IID_nsIIOServiceHook %p)\n", result); + *result = iface; + }else { + ERR("(%s %p)\n", debugstr_guid(riid), result); + *result = NULL; + return NS_NOINTERFACE; + } + + nsISupports_AddRef((nsISupports*)*result); + return NS_OK; +} -static nsrefcnt NSAPI nsIOService_AddRef(nsIIOService *iface) +static nsrefcnt NSAPI nsIOServiceHook_AddRef(nsIIOServiceHook *iface) { return 2; } -static nsrefcnt NSAPI nsIOService_Release(nsIIOService *iface) +static nsrefcnt NSAPI nsIOServiceHook_Release(nsIIOServiceHook *iface) { return 1; } -static nsresult NSAPI nsIOService_GetProtocolHandler(nsIIOService *iface, const char *aScheme, - nsIProtocolHandler **_retval) +static nsresult NSAPI nsIOServiceHook_NewChannel(nsIIOServiceHook *iface, nsIURI *aURI, + nsILoadInfo *aLoadInfo, nsIChannel **_retval) { - nsIExternalProtocolHandler *nsexthandler; - nsIProtocolHandler *nshandler; - nsProtocolHandler *ret; + nsWineURI *wine_uri; + nsChannel *ret; nsresult nsres; - TRACE("(%s %p)\n", debugstr_a(aScheme), _retval); + TRACE("(%p %p %p)\n", aURI, aLoadInfo, _retval); - nsres = nsIIOService_GetProtocolHandler(nsio, aScheme, &nshandler); + nsres = nsIURI_QueryInterface(aURI, &IID_nsWineURI, (void**)&wine_uri); if(NS_FAILED(nsres)) { - WARN("GetProtocolHandler failed: %08x\n", nsres); - return nsres; + TRACE("Could not get nsWineURI: %08x\n", nsres); + return NS_SUCCESS_DEFAULT_ACTION; } - nsres = nsIProtocolHandler_QueryInterface(nshandler, &IID_nsIExternalProtocolHandler, - (void**)&nsexthandler); + nsres = create_nschannel(wine_uri, &ret); + nsIFileURL_Release(&wine_uri->nsIFileURL_iface); + if(NS_FAILED(nsres)) + return nsres; + + nsIURI_AddRef(aURI); + ret->original_uri = aURI; + + if(aLoadInfo) + nsIHttpChannel_SetLoadInfo(&ret->nsIHttpChannel_iface, aLoadInfo); + + *_retval = (nsIChannel*)&ret->nsIHttpChannel_iface; + return NS_OK; +} + +static nsresult NSAPI nsIOServiceHook_GetProtocolHandler(nsIIOServiceHook *iface, nsIProtocolHandler *aHandler, + nsIProtocolHandler **_retval) +{ + nsIExternalProtocolHandler *nsexthandler; + nsProtocolHandler *ret; + nsresult nsres; + + TRACE("(%p %p)\n", aHandler, _retval); + + nsres = nsIProtocolHandler_QueryInterface(aHandler, &IID_nsIExternalProtocolHandler, (void**)&nsexthandler); if(NS_FAILED(nsres)) { - *_retval = nshandler; + nsIProtocolHandler_AddRef(aHandler); + *_retval = aHandler; return NS_OK; } @@ -3549,20 +3703,15 @@ ret->nsIProtocolHandler_iface.lpVtbl = &nsProtocolHandlerVtbl; ret->ref = 1; - ret->nshandler = nshandler; - *_retval = &ret->nsIProtocolHandler_iface; + nsIProtocolHandler_AddRef(aHandler); + ret->nshandler = aHandler; + + *_retval = &ret->nsIProtocolHandler_iface; TRACE("return %p\n", *_retval); return NS_OK; } -static nsresult NSAPI nsIOService_GetProtocolFlags(nsIIOService *iface, const char *aScheme, - UINT32 *_retval) -{ - TRACE("(%s %p)\n", debugstr_a(aScheme), _retval); - return nsIIOService_GetProtocolFlags(nsio, aScheme, _retval); -} - static BOOL is_gecko_special_uri(const char *spec) { static const char *special_schemes[] = {"chrome:", "data:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"}; @@ -3583,7 +3732,7 @@ return FALSE; } -static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *aSpec, +static nsresult NSAPI nsIOServiceHook_NewURI(nsIIOServiceHook *iface, const nsACString *aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) { nsWineURI *wine_uri, *base_wine_uri = NULL; @@ -3600,7 +3749,7 @@ nsACString_GetData(aSpec, &spec); if(is_gecko_special_uri(spec)) - return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); + return NS_SUCCESS_DEFAULT_ACTION; if(!strncmp(spec, "wine:", 5)) spec += 5; @@ -3643,7 +3792,7 @@ } if(FAILED(hres)) - return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); + return NS_SUCCESS_DEFAULT_ACTION; nsres = create_nsuri(urlmon_uri, window, NULL, NULL, &wine_uri); IUri_Release(urlmon_uri); @@ -3656,192 +3805,6 @@ return nsres; } -static nsresult NSAPI nsIOService_NewFileURI(nsIIOService *iface, nsIFile *aFile, - nsIURI **_retval) -{ - TRACE("(%p %p)\n", aFile, _retval); - return nsIIOService_NewFileURI(nsio, aFile, _retval); -} - -static nsresult new_channel_from_uri(nsIURI *uri, nsILoadInfo *load_info, nsIChannel **_retval) -{ - nsWineURI *wine_uri; - nsChannel *ret; - nsresult nsres; - - nsres = nsIURI_QueryInterface(uri, &IID_nsWineURI, (void**)&wine_uri); - if(NS_FAILED(nsres)) { - TRACE("Could not get nsWineURI: %08x\n", nsres); - return nsIIOService_NewChannelFromURI(nsio, uri, _retval); - } - - nsres = create_nschannel(wine_uri, &ret); - nsIFileURL_Release(&wine_uri->nsIFileURL_iface); - if(NS_FAILED(nsres)) - return nsres; - - nsIURI_AddRef(uri); - ret->original_uri = uri; - - if(load_info) - nsIHttpChannel_SetLoadInfo(&ret->nsIHttpChannel_iface, load_info); - - *_retval = (nsIChannel*)&ret->nsIHttpChannel_iface; - return NS_OK; -} - -static nsresult NSAPI nsIOService_NewChannelFromURI2(nsIIOService *iface, nsIURI *aURI, - nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, - UINT32 aSecurityFlags, UINT32 aContentPolicyType, nsIChannel **_retval) -{ - nsILoadInfo *load_info = NULL; - nsresult nsres; - - TRACE("(%p %p %p %p %x %d %p)\n", aURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, - aSecurityFlags, aContentPolicyType, _retval); - - if(aLoadingNode || aLoadingPrincipal) { - nsres = nsIIOService_NewLoadInfo(nsio, aLoadingPrincipal, aTriggeringPrincipal, aLoadingNode, - aSecurityFlags, aContentPolicyType, &load_info); - assert(nsres == NS_OK); - } - - nsres = new_channel_from_uri(aURI, load_info, _retval); - if(load_info) - nsISupports_Release(load_info); - return nsres; -} - -static nsresult NSAPI nsIOService_NewChannelFromURIWithLoadInfo(nsIIOService *iface, nsIURI *aURI, - nsILoadInfo *aLoadInfo, nsIChannel **_retval) -{ - TRACE("(%p %p %p)\n", aURI, aLoadInfo, _retval); - return new_channel_from_uri(aURI, aLoadInfo, _retval); -} - -static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI *aURI, - nsIChannel **_retval) -{ - TRACE("(%p %p)\n", aURI, _retval); - return new_channel_from_uri(aURI, NULL, _retval); -} - -static nsresult NSAPI nsIOService_NewChannel2(nsIIOService *iface, const nsACString *aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, - nsIPrincipal *aTriggeringPrincipal, UINT32 aSecurityFlags, UINT32 aContentPolicyType, nsIChannel **_retval) -{ - TRACE("(%s %s %p %p %p %p %x %d %p)\n", debugstr_nsacstr(aSpec), debugstr_a(aOriginCharset), aBaseURI, - aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); - return nsIIOService_NewChannel2(nsio, aSpec, aOriginCharset, aBaseURI, aLoadingNode, aLoadingPrincipal, - aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); -} - -static nsresult NSAPI nsIOService_NewChannel(nsIIOService *iface, const nsACString *aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval) -{ - TRACE("(%s %s %p %p)\n", debugstr_nsacstr(aSpec), debugstr_a(aOriginCharset), aBaseURI, _retval); - return nsIIOService_NewChannel(nsio, aSpec, aOriginCharset, aBaseURI, _retval); -} - -static nsresult NSAPI nsIOService_GetOffline(nsIIOService *iface, cpp_bool *aOffline) -{ - TRACE("(%p)\n", aOffline); - return nsIIOService_GetOffline(nsio, aOffline); -} - -static nsresult NSAPI nsIOService_SetOffline(nsIIOService *iface, cpp_bool aOffline) -{ - TRACE("(%x)\n", aOffline); - return nsIIOService_SetOffline(nsio, aOffline); -} - -static nsresult NSAPI nsIOService_GetConnectivity(nsIIOService *iface, cpp_bool *aConnectivity) -{ - TRACE("(%p)\n", aConnectivity); - return nsIIOService_GetConnectivity(nsio, aConnectivity); -} - -static nsresult NSAPI nsIOService_SetAppOffline(nsIIOService *iface, UINT32 appId, INT32 state) -{ - TRACE("(%d %x)\n", appId, state); - return nsIIOService_SetAppOffline(nsio, appId, state); -} - -static nsresult NSAPI nsIOService_IsAppOffline(nsIIOService *iface, UINT32 appId, cpp_bool *_retval) -{ - TRACE("(%u %p)\n", appId, _retval); - return nsIIOService_IsAppOffline(nsio, appId, _retval); -} - -static nsresult NSAPI nsIOService_GetAppOfflineState(nsIIOService *iface, UINT32 appId, INT32 *_retval) -{ - TRACE("(%d %p)\n", appId, _retval); - return nsIIOService_GetAppOfflineState(nsio, appId, _retval); -} - -static nsresult NSAPI nsIOService_AllowPort(nsIIOService *iface, LONG aPort, - const char *aScheme, cpp_bool *_retval) -{ - TRACE("(%d %s %p)\n", aPort, debugstr_a(aScheme), _retval); - return nsIIOService_AllowPort(nsio, aPort, debugstr_a(aScheme), _retval); -} - -static nsresult NSAPI nsIOService_ExtractScheme(nsIIOService *iface, const nsACString *urlString, - nsACString * _retval) -{ - TRACE("(%s %p)\n", debugstr_nsacstr(urlString), _retval); - return nsIIOService_ExtractScheme(nsio, urlString, _retval); -} - -static const nsIIOServiceVtbl nsIOServiceVtbl = { - nsIOService_QueryInterface, - nsIOService_AddRef, - nsIOService_Release, - nsIOService_GetProtocolHandler, - nsIOService_GetProtocolFlags, - nsIOService_NewURI, - nsIOService_NewFileURI, - nsIOService_NewChannelFromURI2, - nsIOService_NewChannelFromURIWithLoadInfo, - nsIOService_NewChannelFromURI, - nsIOService_NewChannel2, - nsIOService_NewChannel, - nsIOService_GetOffline, - nsIOService_SetOffline, - nsIOService_GetConnectivity, - nsIOService_SetAppOffline, - nsIOService_IsAppOffline, - nsIOService_GetAppOfflineState, - nsIOService_AllowPort, - nsIOService_ExtractScheme -}; - -static nsIIOService nsIOService = { &nsIOServiceVtbl }; - -static nsresult NSAPI nsNetUtil_QueryInterface(nsINetUtil *iface, nsIIDRef riid, - void **result) -{ - return nsIIOService_QueryInterface(&nsIOService, riid, result); -} - -static nsrefcnt NSAPI nsNetUtil_AddRef(nsINetUtil *iface) -{ - return 2; -} - -static nsrefcnt NSAPI nsNetUtil_Release(nsINetUtil *iface) -{ - return 1; -} - -static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader, - nsACString *aCharset, cpp_bool *aHadCharset, nsACString *aContentType) -{ - TRACE("(%s %p %p %p)\n", debugstr_nsacstr(aTypeHeader), aCharset, aHadCharset, aContentType); - - return nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType); -} - static const char *debugstr_protocol_flags(UINT32 flags) { switch(flags) { @@ -3866,169 +3829,43 @@ X(URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM); X(URI_SYNC_LOAD_IS_OK); X(URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT); + X(URI_FETCHABLE_BY_ANYONE); #undef X default: return wine_dbg_sprintf("%08x", flags); } } -static nsresult NSAPI nsNetUtil_ProtocolHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) +static nsresult NSAPI nsIOServiceHook_ProtocolHasFlags(nsIIOServiceHook *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) { TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); - - return nsINetUtil_ProtocolHasFlags(net_util, aURI, aFlags, _retval); + return NS_SUCCESS_DEFAULT_ACTION; } -static nsresult NSAPI nsNetUtil_URIChainHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) +static nsresult NSAPI nsIOServiceHook_URIChainHasFlags(nsIIOServiceHook *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) { TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); if(aFlags == URI_DOES_NOT_RETURN_DATA) { *_retval = FALSE; - return NS_OK; - } - - return nsINetUtil_URIChainHasFlags(net_util, aURI, aFlags, _retval); -} - -static nsresult NSAPI nsNetUtil_ToImmutableURI(nsINetUtil *iface, nsIURI *aURI, nsIURI **_retval) -{ - TRACE("(%p %p)\n", aURI, _retval); - - return nsINetUtil_ToImmutableURI(net_util, aURI, _retval); -} - -static nsresult NSAPI nsNetUtil_NewSimpleNestedURI(nsINetUtil *iface, nsIURI *aURI, nsIURI **_retval) -{ - TRACE("(%p %p)\n", aURI, _retval); - - return nsINetUtil_NewSimpleNestedURI(net_util, aURI, _retval); -} - -static nsresult NSAPI nsNetUtil_EscapeString(nsINetUtil *iface, const nsACString *aString, - UINT32 aEscapeType, nsACString *_retval) -{ - TRACE("(%s %x %p)\n", debugstr_nsacstr(aString), aEscapeType, _retval); - - return nsINetUtil_EscapeString(net_util, aString, aEscapeType, _retval); -} - -static nsresult NSAPI nsNetUtil_EscapeURL(nsINetUtil *iface, const nsACString *aStr, UINT32 aFlags, - nsACString *_retval) -{ - TRACE("(%s %08x %p)\n", debugstr_nsacstr(aStr), aFlags, _retval); - - return nsINetUtil_EscapeURL(net_util, aStr, aFlags, _retval); -} - -static nsresult NSAPI nsNetUtil_UnescapeString(nsINetUtil *iface, const nsACString *aStr, - UINT32 aFlags, nsACString *_retval) -{ - TRACE("(%s %08x %p)\n", debugstr_nsacstr(aStr), aFlags, _retval); - - return nsINetUtil_UnescapeString(net_util, aStr, aFlags, _retval); -} - -static nsresult NSAPI nsNetUtil_ExtractCharsetFromContentType(nsINetUtil *iface, const nsACString *aTypeHeader, - nsACString *aCharset, LONG *aCharsetStart, LONG *aCharsetEnd, cpp_bool *_retval) -{ - TRACE("(%s %p %p %p %p)\n", debugstr_nsacstr(aTypeHeader), aCharset, aCharsetStart, - aCharsetEnd, _retval); - - return nsINetUtil_ExtractCharsetFromContentType(net_util, aTypeHeader, aCharset, aCharsetStart, aCharsetEnd, _retval); -} - -static const nsINetUtilVtbl nsNetUtilVtbl = { - nsNetUtil_QueryInterface, - nsNetUtil_AddRef, - nsNetUtil_Release, - nsNetUtil_ParseContentType, - nsNetUtil_ProtocolHasFlags, - nsNetUtil_URIChainHasFlags, - nsNetUtil_ToImmutableURI, - nsNetUtil_NewSimpleNestedURI, - nsNetUtil_EscapeString, - nsNetUtil_EscapeURL, - nsNetUtil_UnescapeString, - nsNetUtil_ExtractCharsetFromContentType -}; - -static nsINetUtil nsNetUtil = { &nsNetUtilVtbl }; - -static nsresult NSAPI nsIOService_QueryInterface(nsIIOService *iface, nsIIDRef riid, - void **result) -{ - *result = NULL; - - if(IsEqualGUID(&IID_nsISupports, riid)) - *result = &nsIOService; - else if(IsEqualGUID(&IID_nsIIOService, riid)) - *result = &nsIOService; - else if(IsEqualGUID(&IID_nsINetUtil, riid)) - *result = &nsNetUtil; - - if(*result) { - nsISupports_AddRef((nsISupports*)*result); - return NS_OK; - } - - FIXME("(%s %p)\n", debugstr_guid(riid), result); - return NS_NOINTERFACE; -} - -static nsresult NSAPI nsIOServiceFactory_QueryInterface(nsIFactory *iface, nsIIDRef riid, - void **result) -{ - *result = NULL; - - if(IsEqualGUID(&IID_nsISupports, riid)) { - TRACE("(IID_nsISupports %p)\n", result); - *result = iface; - }else if(IsEqualGUID(&IID_nsIFactory, riid)) { - TRACE("(IID_nsIFactory %p)\n", result); - *result = iface; - } - - if(*result) { - nsIFactory_AddRef(iface); - return NS_OK; + return S_OK; } - WARN("(%s %p)\n", debugstr_guid(riid), result); - return NS_NOINTERFACE; -} - -static nsrefcnt NSAPI nsIOServiceFactory_AddRef(nsIFactory *iface) -{ - return 2; -} - -static nsrefcnt NSAPI nsIOServiceFactory_Release(nsIFactory *iface) -{ - return 1; -} - -static nsresult NSAPI nsIOServiceFactory_CreateInstance(nsIFactory *iface, - nsISupports *aOuter, const nsIID *iid, void **result) -{ - return nsIIOService_QueryInterface(&nsIOService, iid, result); + return NS_SUCCESS_DEFAULT_ACTION; } -static nsresult NSAPI nsIOServiceFactory_LockFactory(nsIFactory *iface, cpp_bool lock) -{ - WARN("(%x)\n", lock); - return NS_OK; -} - -static const nsIFactoryVtbl nsIOServiceFactoryVtbl = { - nsIOServiceFactory_QueryInterface, - nsIOServiceFactory_AddRef, - nsIOServiceFactory_Release, - nsIOServiceFactory_CreateInstance, - nsIOServiceFactory_LockFactory +static const nsIIOServiceHookVtbl nsIOServiceHookVtbl = { + nsIOServiceHook_QueryInterface, + nsIOServiceHook_AddRef, + nsIOServiceHook_Release, + nsIOServiceHook_NewChannel, + nsIOServiceHook_GetProtocolHandler, + nsIOServiceHook_NewURI, + nsIOServiceHook_ProtocolHasFlags, + nsIOServiceHook_URIChainHasFlags }; -static nsIFactory nsIOServiceFactory = { &nsIOServiceFactoryVtbl }; +static nsIIOServiceHook nsIOServiceHook = { &nsIOServiceHookVtbl }; static BOOL translate_url(HTMLDocumentObj *doc, nsWineURI *uri) { @@ -4086,7 +3923,7 @@ return NS_OK; } -void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *registrar) +void init_nsio(nsIComponentManager *component_manager) { nsIFactory *old_factory = NULL; nsresult nsres; @@ -4105,31 +3942,12 @@ return; } - nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util); - if(NS_FAILED(nsres)) { - WARN("Could not get nsINetUtil interface: %08x\n", nsres); - nsIIOService_Release(nsio); - return; - } - - nsres = nsIComponentRegistrar_UnregisterFactory(registrar, &NS_IOSERVICE_CID, old_factory); - nsIFactory_Release(old_factory); - if(NS_FAILED(nsres)) - ERR("UnregisterFactory failed: %08x\n", nsres); - - nsres = nsIComponentRegistrar_RegisterFactory(registrar, &NS_IOSERVICE_CID, - NS_IOSERVICE_CLASSNAME, NS_IOSERVICE_CONTRACTID, &nsIOServiceFactory); - if(NS_FAILED(nsres)) - ERR("RegisterFactory failed: %08x\n", nsres); + nsres = nsIIOService_SetHook(nsio, &nsIOServiceHook); + assert(nsres == NS_OK); } void release_nsio(void) { - if(net_util) { - nsINetUtil_Release(net_util); - net_util = NULL; - } - if(nsio) { nsIIOService_Release(nsio); nsio = NULL; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/script.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/script.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/script.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/script.c 2016-02-08 19:32:34.000000000 +0000 @@ -110,6 +110,26 @@ WARN("SetProperty(%x) failed: %08x\n", property, hres); } +static BOOL is_quirks_mode(HTMLDocumentNode *doc) +{ + const WCHAR *compat_mode; + nsAString nsstr; + nsresult nsres; + BOOL ret = FALSE; + + static const WCHAR BackCompatW[] = {'B','a','c','k','C','o','m','p','a','t',0}; + + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMHTMLDocument_GetCompatMode(doc->nsdoc, &nsstr); + if(NS_SUCCEEDED(nsres)) { + nsAString_GetData(&nsstr, &compat_mode); + if(!strcmpW(compat_mode, BackCompatW)) + ret = TRUE; + } + nsAString_Finish(&nsstr); + return ret; +} + static BOOL init_script_engine(ScriptHost *script_host) { IObjectSafety *safety; @@ -148,7 +168,7 @@ return FALSE; V_VT(&var) = VT_I4; - V_I4(&var) = 1; + V_I4(&var) = is_quirks_mode(script_host->window->doc) ? 1 : 2; set_script_prop(script_host, SCRIPTPROP_INVOKEVERSIONING, &var); V_VT(&var) = VT_BOOL; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/tests/dom.c wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/tests/dom.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/mshtml/tests/dom.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/mshtml/tests/dom.c 2016-02-08 19:32:34.000000000 +0000 @@ -1420,7 +1420,7 @@ hres = IHTMLElement_getAttribute(elem, bstr, 2, &val); ok(hres == S_OK, "getAttribute failed: %08x\n", hres); - ok(V_VT(&val) == VT_BSTR, "V_VT(val) = %u, expected VT_BSTR", V_VT(&val)); + ok(V_VT(&val) == VT_BSTR, "V_VT(val) = %u, expected VT_BSTR\n", V_VT(&val)); ok(!strcmp_wa(V_BSTR(&val), "null"), "V_BSTR(val) = %s, expected \"null\"\n", wine_dbgstr_w(V_BSTR(&val))); VariantClear(&val); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msi/dialog.c wine-staging-1.9.3~ubuntu12.04.1/dlls/msi/dialog.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msi/dialog.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msi/dialog.c 2016-02-08 19:32:34.000000000 +0000 @@ -704,11 +704,13 @@ { struct subscriber *sub; - TRACE("event %s control %s attribute %s\n", debugstr_w(event), debugstr_w(control), debugstr_w(attribute)); + TRACE("dialog %s event %s control %s attribute %s\n", debugstr_w(dialog->name), debugstr_w(event), + debugstr_w(control), debugstr_w(attribute)); LIST_FOR_EACH_ENTRY( sub, &dialog->package->subscriptions, struct subscriber, entry ) { - if (!strcmpiW( sub->event, event ) && + if (sub->dialog == dialog && + !strcmpiW( sub->event, event ) && !strcmpiW( sub->control, control ) && !strcmpiW( sub->attribute, attribute )) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/main.c wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/main.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/main.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/main.c 2016-02-08 19:32:34.000000000 +0000 @@ -67,7 +67,6 @@ if (tls) { - CloseHandle(tls->handle); MSVCRT_free(tls->efcvt_buffer); MSVCRT_free(tls->asctime_buffer); MSVCRT_free(tls->wasctime_buffer); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/tests/misc.c wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/tests/misc.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/tests/misc.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/tests/misc.c 2016-02-08 19:32:34.000000000 +0000 @@ -23,6 +23,7 @@ #include #include #include "msvcrt.h" +#include static inline float __port_infinity(void) { @@ -540,6 +541,66 @@ ok(errno == 0xdeadbeef, "errno = %d\n", errno); } +static void __cdecl test_thread_func(void *end_thread_type) +{ + if (end_thread_type == (void*)1) + _endthread(); + else if (end_thread_type == (void*)2) + ExitThread(0); + else if (end_thread_type == (void*)3) + _endthreadex(0); +} + +static unsigned __stdcall test_thread_func_ex(void *arg) +{ + _endthread(); + return 0; +} + +static void test_thread_handle_close(void) +{ + HANDLE hThread; + DWORD ret; + + /* _beginthread: handle is not closed on ExitThread and _endthreadex */ + hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)0); + ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno); + WaitForSingleObject(hThread, INFINITE); + ret = CloseHandle(hThread); + ok(!ret, "ret = %d\n", ret); + + hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)1); + ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno); + WaitForSingleObject(hThread, INFINITE); + ret = CloseHandle(hThread); + ok(!ret, "ret = %d\n", ret); + + hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)2); + ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno); + Sleep(150); + ret = WaitForSingleObject(hThread, INFINITE); + ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret); + ret = CloseHandle(hThread); + ok(ret, "ret = %d\n", ret); + + hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)3); + ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno); + Sleep(150); + ret = WaitForSingleObject(hThread, INFINITE); + ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret); + ret = CloseHandle(hThread); + ok(ret, "ret = %d\n", ret); + + /* _beginthreadex: handle is not closed on _endthread */ + hThread = (HANDLE)_beginthreadex(NULL,0, test_thread_func_ex, NULL, 0, NULL); + ok(hThread != NULL, "_beginthreadex failed (%d)\n", errno); + Sleep(150); + ret = WaitForSingleObject(hThread, INFINITE); + ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret); + ret = CloseHandle(hThread); + ok(ret, "ret = %d\n", ret); +} + START_TEST(misc) { int arg_c; @@ -568,4 +629,5 @@ test__invalid_parameter(); test_qsort_s(); test_math_functions(); + test_thread_handle_close(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/thread.c wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/thread.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/msvcrt/thread.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/msvcrt/thread.c 2016-02-08 19:32:34.000000000 +0000 @@ -55,6 +55,38 @@ return ptr; } +/********************************************************************* + * _endthread (MSVCRT.@) + */ +void CDECL _endthread(void) +{ + thread_data_t *tls; + + TRACE("(void)\n"); + + tls = TlsGetValue(msvcrt_tls_index); + if (tls && tls->handle != INVALID_HANDLE_VALUE) + { + CloseHandle(tls->handle); + tls->handle = INVALID_HANDLE_VALUE; + } else + WARN("tls=%p tls->handle=%p\n", tls, tls ? tls->handle : INVALID_HANDLE_VALUE); + + /* FIXME */ + ExitThread(0); +} + +/********************************************************************* + * _endthreadex (MSVCRT.@) + */ +void CDECL _endthreadex( + unsigned int retval) /* [in] Thread exit code */ +{ + TRACE("(%d)\n", retval); + + /* FIXME */ + ExitThread(retval); +} /********************************************************************* * _beginthread_trampoline @@ -69,6 +101,7 @@ MSVCRT_free(arg); local_trampoline.start_address(local_trampoline.arglist); + _endthread(); return 0; } @@ -132,29 +165,6 @@ } /********************************************************************* - * _endthread (MSVCRT.@) - */ -void CDECL _endthread(void) -{ - TRACE("(void)\n"); - - /* FIXME */ - ExitThread(0); -} - -/********************************************************************* - * _endthreadex (MSVCRT.@) - */ -void CDECL _endthreadex( - unsigned int retval) /* [in] Thread exit code */ -{ - TRACE("(%d)\n", retval); - - /* FIXME */ - ExitThread(retval); -} - -/********************************************************************* * _getptd (MSVCR80.@) */ thread_data_t* CDECL _getptd(void) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ndis.sys/main.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ndis.sys/main.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ndis.sys/main.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ndis.sys/main.c 2016-02-08 19:32:34.000000000 +0000 @@ -43,3 +43,8 @@ FIXME("(%p, %u, %u): stub\n", address, length, tag); return NDIS_STATUS_FAILURE; } + +void WINAPI NdisAllocateSpinLock(NDIS_SPIN_LOCK *lock) +{ + FIXME("(%p): stub\n", lock); +} diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ndis.sys/ndis.sys.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/ndis.sys/ndis.sys.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ndis.sys/ndis.sys.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ndis.sys/ndis.sys.spec 2016-02-08 19:32:34.000000000 +0000 @@ -16,7 +16,7 @@ @ stub NdisAllocatePacket @ stub NdisAllocatePacketPool @ stub NdisAllocatePacketPoolEx -@ stub NdisAllocateSpinLock +@ stdcall NdisAllocateSpinLock(ptr) @ stub NdisAnsiStringToUnicodeString @ stub NdisBufferLength @ stub NdisBufferVirtualAddress diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/file.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/file.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/file.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/file.c 2016-02-08 19:32:34.000000000 +0000 @@ -218,11 +218,12 @@ if (io->u.Status == STATUS_SUCCESS) { + static UNICODE_STRING empty_string; OBJECT_ATTRIBUTES unix_attr = *attr; data_size_t len; struct object_attributes *objattr; - unix_attr.ObjectName = NULL; /* we send the unix name instead */ + unix_attr.ObjectName = &empty_string; /* we send the unix name instead */ if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len ))) { RtlFreeAnsiString( &unix_name ); @@ -3512,6 +3513,8 @@ options, pipe_type, read_mode, completion_mode, max_inst, inbound_quota, outbound_quota, timeout); + if (!attr) return STATUS_INVALID_PARAMETER; + /* assume we only get relative timeout */ if (timeout->QuadPart > 0) FIXME("Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart)); @@ -3636,7 +3639,6 @@ if (!pHandle) return STATUS_ACCESS_VIOLATION; if (!attr) return STATUS_INVALID_PARAMETER; - if (!attr->ObjectName) return STATUS_OBJECT_PATH_SYNTAX_BAD; if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/nt.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/nt.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/nt.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/nt.c 2016-02-08 19:32:34.000000000 +0000 @@ -1243,77 +1243,255 @@ cached_sci.Architecture, cached_sci.Level, cached_sci.Revision, cached_sci.FeatureSet); } -#ifdef linux -static inline BOOL logical_proc_info_add_by_id(SYSTEM_LOGICAL_PROCESSOR_INFORMATION *data, - DWORD *len, DWORD max_len, LOGICAL_PROCESSOR_RELATIONSHIP rel, DWORD id, DWORD proc) +static BOOL grow_logical_proc_buf(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **pdata, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **pdataex, DWORD *max_len) { - DWORD i; + if (pdata) + { + SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; - for(i=0; i<*len; i++) + *max_len *= 2; + new_data = RtlReAllocateHeap(GetProcessHeap(), 0, *pdata, *max_len*sizeof(*new_data)); + if (!new_data) + return FALSE; + + *pdata = new_data; + } + else { - if(data[i].Relationship!=rel || data[i].u.Reserved[1]!=id) - continue; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *new_dataex; + + *max_len *= 2; + new_dataex = RtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, *pdataex, *max_len*sizeof(*new_dataex)); + if (!new_dataex) + return FALSE; - data[i].ProcessorMask |= (ULONG_PTR)1<Relationship == rel && dataex->u.Processor.Reserved[1] == id) + { + dataex->u.Processor.GroupMask[0].Mask |= mask; + return TRUE; + } + ofs += dataex->Size; + } + + /* TODO: For now, just one group. If more than 64 processors, then we + * need another group. */ + + while (ofs + log_proc_ex_size_plus(sizeof(PROCESSOR_RELATIONSHIP)) > *pmax_len) + { + if (!grow_logical_proc_buf(NULL, pdataex, pmax_len)) + return FALSE; + } + + dataex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*pdataex) + ofs); + + dataex->Relationship = rel; + dataex->Size = log_proc_ex_size_plus(sizeof(PROCESSOR_RELATIONSHIP)); + dataex->u.Processor.Flags = 0; /* TODO */ + dataex->u.Processor.EfficiencyClass = 0; + dataex->u.Processor.GroupCount = 1; + dataex->u.Processor.GroupMask[0].Mask = mask; + dataex->u.Processor.GroupMask[0].Group = 0; + /* mark for future lookup */ + dataex->u.Processor.Reserved[0] = 0; + dataex->u.Processor.Reserved[1] = id; + + *len += dataex->Size; + } - data[i].Relationship = rel; - data[i].ProcessorMask = (ULONG_PTR)1<Level && (*pdata)[i].u.Cache.Type==cache->Type) + return TRUE; + } - for(i=0; i<*len; i++) + while (*len == *pmax_len) + if (!grow_logical_proc_buf(pdata, NULL, pmax_len)) + return FALSE; + + (*pdata)[i].Relationship = RelationCache; + (*pdata)[i].ProcessorMask = mask; + (*pdata)[i].u.Cache = *cache; + *len = i+1; + } + else { - if(data[i].Relationship==RelationCache && data[i].ProcessorMask==mask - && data[i].u.Cache.Level==cache->Level && data[i].u.Cache.Type==cache->Type) - return TRUE; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *dataex = *pdataex; + DWORD ofs; + + for (ofs = 0; ofs < *len; ) + { + dataex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*pdataex) + ofs); + if (dataex->Relationship == RelationCache && dataex->u.Cache.GroupMask.Mask == mask && + dataex->u.Cache.Level == cache->Level && dataex->u.Cache.Type == cache->Type) + return TRUE; + ofs += dataex->Size; + } + + while (ofs + log_proc_ex_size_plus(sizeof(CACHE_RELATIONSHIP)) > *pmax_len) + { + if (!grow_logical_proc_buf(NULL, pdataex, pmax_len)) + return FALSE; + } + + dataex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*pdataex) + ofs); + + dataex->Relationship = RelationCache; + dataex->Size = log_proc_ex_size_plus(sizeof(CACHE_RELATIONSHIP)); + dataex->u.Cache.Level = cache->Level; + dataex->u.Cache.Associativity = cache->Associativity; + dataex->u.Cache.LineSize = cache->LineSize; + dataex->u.Cache.CacheSize = cache->Size; + dataex->u.Cache.Type = cache->Type; + dataex->u.Cache.GroupMask.Mask = mask; + dataex->u.Cache.GroupMask.Group = 0; + + *len += dataex->Size; } - if(*len == max_len) - return FALSE; + return TRUE; +} + +static inline BOOL logical_proc_info_add_numa_node(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **pdata, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **pdataex, DWORD *len, DWORD *pmax_len, ULONG_PTR mask, + DWORD node_id) +{ + if (pdata) + { + while (*len == *pmax_len) + if (!grow_logical_proc_buf(pdata, NULL, pmax_len)) + return FALSE; + + (*pdata)[*len].Relationship = RelationNumaNode; + (*pdata)[*len].ProcessorMask = mask; + (*pdata)[*len].u.NumaNode.NodeNumber = node_id; + (*len)++; + } + else + { + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *dataex; + + while (*len + log_proc_ex_size_plus(sizeof(NUMA_NODE_RELATIONSHIP)) > *pmax_len) + { + if (!grow_logical_proc_buf(NULL, pdataex, pmax_len)) + return FALSE; + } + + dataex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*pdataex) + *len); + + dataex->Relationship = RelationNumaNode; + dataex->Size = log_proc_ex_size_plus(sizeof(NUMA_NODE_RELATIONSHIP)); + dataex->u.NumaNode.NodeNumber = node_id; + dataex->u.NumaNode.GroupMask.Mask = mask; + dataex->u.NumaNode.GroupMask.Group = 0; + + *len += dataex->Size; + } - data[i].Relationship = RelationCache; - data[i].ProcessorMask = mask; - data[i].u.Cache = *cache; - *len = i+1; return TRUE; } -static inline BOOL logical_proc_info_add_numa_node(SYSTEM_LOGICAL_PROCESSOR_INFORMATION *data, - DWORD *len, DWORD max_len, ULONG_PTR mask, DWORD node_id) +static inline BOOL logical_proc_info_add_group(SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **pdataex, + DWORD *len, DWORD *pmax_len, DWORD num_cpus, ULONG_PTR mask) { - if(*len == max_len) - return FALSE; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *dataex; + + while (*len + log_proc_ex_size_plus(sizeof(GROUP_RELATIONSHIP)) > *pmax_len) + { + if (!grow_logical_proc_buf(NULL, pdataex, pmax_len)) + return FALSE; + } + + dataex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*pdataex) + *len); + + dataex->Relationship = RelationGroup; + dataex->Size = log_proc_ex_size_plus(sizeof(GROUP_RELATIONSHIP)); + dataex->u.Group.MaximumGroupCount = 1; + dataex->u.Group.ActiveGroupCount = 1; + dataex->u.Group.GroupInfo[0].MaximumProcessorCount = num_cpus; + dataex->u.Group.GroupInfo[0].ActiveProcessorCount = num_cpus; + dataex->u.Group.GroupInfo[0].ActiveProcessorMask = mask; + + *len += dataex->Size; - data[*len].Relationship = RelationNumaNode; - data[*len].ProcessorMask = mask; - data[*len].u.NumaNode.NodeNumber = node_id; - (*len)++; return TRUE; } -static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, DWORD *max_len) +#ifdef linux +/* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ +static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) { static const char core_info[] = "/sys/devices/system/cpu/cpu%u/%s"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap"; FILE *fcpu_list, *fnuma_list, *f; - DWORD len = 0, beg, end, i, j, r; + DWORD len = 0, beg, end, i, j, r, num_cpus = 0; char op, name[MAX_PATH]; + ULONG_PTR all_cpus_mask = 0; fcpu_list = fopen("/sys/devices/system/cpu/online", "r"); if(!fcpu_list) @@ -1334,52 +1512,32 @@ continue; } - sprintf(name, core_info, i, "core_id"); + sprintf(name, core_info, i, "physical_package_id"); f = fopen(name, "r"); if(f) { fscanf(f, "%u", &r); fclose(f); } - else r = i; - if(!logical_proc_info_add_by_id(*data, &len, *max_len, RelationProcessorCore, r, i)) + else r = 0; + if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorPackage, r, 1 << i)) { - SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; - - *max_len *= 2; - new_data = RtlReAllocateHeap(GetProcessHeap(), 0, *data, *max_len*sizeof(*new_data)); - if(!new_data) - { - fclose(fcpu_list); - return STATUS_NO_MEMORY; - } - - *data = new_data; - logical_proc_info_add_by_id(*data, &len, *max_len, RelationProcessorCore, r, i); + fclose(fcpu_list); + return STATUS_NO_MEMORY; } - sprintf(name, core_info, i, "physical_package_id"); + sprintf(name, core_info, i, "core_id"); f = fopen(name, "r"); if(f) { fscanf(f, "%u", &r); fclose(f); } - else r = 0; - if(!logical_proc_info_add_by_id(*data, &len, *max_len, RelationProcessorPackage, r, i)) + else r = i; + if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorCore, r, 1 << i)) { - SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; - - *max_len *= 2; - new_data = RtlReAllocateHeap(GetProcessHeap(), 0, *data, *max_len*sizeof(*new_data)); - if(!new_data) - { - fclose(fcpu_list); - return STATUS_NO_MEMORY; - } - - *data = new_data; - logical_proc_info_add_by_id(*data, &len, *max_len, RelationProcessorPackage, r, i); + fclose(fcpu_list); + return STATUS_NO_MEMORY; } for(j=0; j<4; j++) @@ -1440,47 +1598,39 @@ else cache.Type = CacheUnified; - if(!logical_proc_info_add_cache(*data, &len, *max_len, mask, &cache)) + if(!logical_proc_info_add_cache(data, dataex, &len, max_len, mask, &cache)) { - SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; - - *max_len *= 2; - new_data = RtlReAllocateHeap(GetProcessHeap(), 0, *data, *max_len*sizeof(*new_data)); - if(!new_data) - { - fclose(fcpu_list); - return STATUS_NO_MEMORY; - } - - *data = new_data; - logical_proc_info_add_cache(*data, &len, *max_len, mask, &cache); + fclose(fcpu_list); + return STATUS_NO_MEMORY; } } } } fclose(fcpu_list); + if(data){ + for(i=0; iRelationship == RelationProcessorCore){ + all_cpus_mask |= infoex->u.Processor.GroupMask[0].Mask; + ++num_cpus; + } + i += infoex->Size; + } + } + fnuma_list = fopen("/sys/devices/system/node/online", "r"); if(!fnuma_list) { - ULONG_PTR mask = 0; - - for(i=0; iPeb->NumberOfProcessors; + size = sizeof(pkgs_no); + if(sysctlbyname("hw.packages", &pkgs_no, &size, NULL, 0)) + pkgs_no = 1; + size = sizeof(cores_no); - if(sysctlbyname("machdep.cpu.core_count", &cores_no, &size, NULL, 0)) + if(sysctlbyname("hw.physicalcpu", &cores_no, &size, NULL, 0)) cores_no = lcpu_no; - lcpu_per_core = lcpu_no/cores_no; - for(i=0; i 0){ + mask = 0; + for(k = 0; k < cache_sharing[i]; ++k) + mask |= (ULONG_PTR)1 << (j * lcpu_per_core + k); + + if(!logical_proc_info_add_cache(data, dataex, &len, max_len, mask, &cache[i])) + return STATUS_NO_MEMORY; } - (*data)[len].Relationship = RelationCache; - (*data)[len].ProcessorMask = mask; - (*data)[len].u.Cache = cache[i]; - len++; + cache_ctrs[i] += lcpu_per_core; + + if(cache_ctrs[i] == cache_sharing[i]) + cache_ctrs[i] = 0; } } } - mask = 0; - for(i=0; i= len) + { + if (!SystemInformation) + ret = STATUS_ACCESS_VIOLATION; + else + memcpy( SystemInformation, buf, len); + } + else + ret = STATUS_INFO_LENGTH_MISMATCH; + + RtlFreeHeap(GetProcessHeap(), 0, buf); + + break; + } + default: + FIXME("(0x%08x,%p,%u,%p,%u,%p) stub\n", SystemInformationClass, Query, QueryLength, SystemInformation, + Length, ResultLength); + break; + } + + if (ResultLength) + *ResultLength = len; + + return ret; } /****************************************************************************** diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/ntdll_misc.h wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/ntdll_misc.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/ntdll_misc.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/ntdll_misc.h 2016-02-08 19:32:34.000000000 +0000 @@ -99,6 +99,7 @@ extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, data_size_t *ret_len ) DECLSPEC_HIDDEN; +extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; /* module handling */ extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/om.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/om.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/om.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/om.c 2016-02-08 19:32:34.000000000 +0000 @@ -429,34 +429,24 @@ * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ -NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes) +NTSTATUS WINAPI NtOpenDirectoryObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr) { NTSTATUS ret; - if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION; - if (!ObjectAttributes) return STATUS_INVALID_PARAMETER; - TRACE("(%p,0x%08x,%s)\n", DirectoryHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes)); - /* Have to test it here because server won't know difference between - * ObjectName == NULL and ObjectName == "" */ - if (!ObjectAttributes->ObjectName) - { - if (ObjectAttributes->RootDirectory) - return STATUS_OBJECT_NAME_INVALID; - else - return STATUS_OBJECT_PATH_SYNTAX_BAD; - } + if (!handle) return STATUS_ACCESS_VIOLATION; + if ((ret = validate_open_object_attributes( attr ))) return ret; + + TRACE("(%p,0x%08x,%s)\n", handle, access, debugstr_ObjectAttributes(attr)); SERVER_START_REQ(open_directory) { - req->access = DesiredAccess; - req->attributes = ObjectAttributes->Attributes; - req->rootdir = wine_server_obj_handle( ObjectAttributes->RootDirectory ); - if (ObjectAttributes->ObjectName) - wine_server_add_data(req, ObjectAttributes->ObjectName->Buffer, - ObjectAttributes->ObjectName->Length); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); - *DirectoryHandle = wine_server_ptr_handle( reply->handle ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; @@ -586,34 +576,25 @@ * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ -NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes) +NTSTATUS WINAPI NtOpenSymbolicLinkObject( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr) { NTSTATUS ret; - TRACE("(%p,0x%08x,%s)\n",LinkHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes)); - if (!LinkHandle) return STATUS_ACCESS_VIOLATION; - if (!ObjectAttributes) return STATUS_INVALID_PARAMETER; - /* Have to test it here because server won't know difference between - * ObjectName == NULL and ObjectName == "" */ - if (!ObjectAttributes->ObjectName) - { - if (ObjectAttributes->RootDirectory) - return STATUS_OBJECT_NAME_INVALID; - else - return STATUS_OBJECT_PATH_SYNTAX_BAD; - } + TRACE("(%p,0x%08x,%s)\n", handle, access, debugstr_ObjectAttributes(attr)); + + if (!handle) return STATUS_ACCESS_VIOLATION; + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ(open_symlink) { - req->access = DesiredAccess; - req->attributes = ObjectAttributes->Attributes; - req->rootdir = wine_server_obj_handle( ObjectAttributes->RootDirectory ); - if (ObjectAttributes->ObjectName) - wine_server_add_data(req, ObjectAttributes->ObjectName->Buffer, - ObjectAttributes->ObjectName->Length); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); - *LinkHandle = wine_server_ptr_handle( reply->handle ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; @@ -642,7 +623,7 @@ data_size_t len; struct object_attributes *objattr; - if (!SymbolicLinkHandle || !TargetName) return STATUS_ACCESS_VIOLATION; + if (!SymbolicLinkHandle || !attr || !TargetName) return STATUS_ACCESS_VIOLATION; if (!TargetName->Buffer) return STATUS_INVALID_PARAMETER; TRACE("(%p,0x%08x,%s -> %s)\n", SymbolicLinkHandle, DesiredAccess, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/process.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/process.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/process.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/process.c 2016-02-08 19:32:34.000000000 +0000 @@ -40,6 +40,10 @@ #include "ntdll_misc.h" #include "wine/server.h" +#ifdef HAVE_MACH_MACH_H +#include +#endif + WINE_DEFAULT_DEBUG_CHANNEL(ntdll); static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE; @@ -110,6 +114,32 @@ return ((ULONG_PTR)1 << num_cpus) - 1; } +#if defined(HAVE_MACH_MACH_H) + +static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) +{ +#if defined(MACH_TASK_BASIC_INFO) + struct mach_task_basic_info info; + mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT; + if(task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info, &infoCount) == KERN_SUCCESS) + { + pvmi->VirtualSize = info.resident_size + info.virtual_size; + pvmi->PagefileUsage = info.virtual_size; + pvmi->WorkingSetSize = info.resident_size; + pvmi->PeakWorkingSetSize = info.resident_size_max; + } +#endif +} + +#else + +static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) +{ + /* FIXME : real data */ +} + +#endif + /****************************************************************************** * NtQueryInformationProcess [NTDLL.@] * ZwQueryInformationProcess [NTDLL.@] @@ -240,8 +270,8 @@ ret = STATUS_INVALID_HANDLE; else { - /* FIXME : real data */ memset(&pvmi, 0 , sizeof(VM_COUNTERS)); + fill_VM_COUNTERS(&pvmi); len = ProcessInformationLength; if (len != FIELD_OFFSET(VM_COUNTERS,PrivatePageCount)) len = sizeof(VM_COUNTERS); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/reg.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/reg.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/reg.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/reg.c 2016-02-08 19:32:34.000000000 +0000 @@ -128,8 +128,9 @@ { NTSTATUS ret; - if (!retkey || !attr) return STATUS_ACCESS_VIOLATION; - if (attr->Length > sizeof(OBJECT_ATTRIBUTES)) return STATUS_INVALID_PARAMETER; + if (!retkey || !attr || !attr->ObjectName) return STATUS_ACCESS_VIOLATION; + if ((ret = validate_open_object_attributes( attr ))) return ret; + TRACE( "(%p,%s,%x,%p)\n", attr->RootDirectory, debugstr_us(attr->ObjectName), access, retkey ); if (options) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/sync.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/sync.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/sync.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/sync.c 2016-02-08 19:32:34.000000000 +0000 @@ -88,6 +88,8 @@ if (!attr) return STATUS_SUCCESS; + if (attr->Length != sizeof(*attr)) return STATUS_INVALID_PARAMETER; + if ((sd = attr->SecurityDescriptor)) { len += sizeof(struct security_descriptor); @@ -110,6 +112,7 @@ if (attr->ObjectName->Length & (sizeof(WCHAR) - 1)) return STATUS_OBJECT_NAME_INVALID; len += attr->ObjectName->Length; } + else if (attr->RootDirectory) return STATUS_OBJECT_NAME_INVALID; *ret = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); if (!*ret) return STATUS_NO_MEMORY; @@ -150,6 +153,19 @@ return STATUS_SUCCESS; } +NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) +{ + if (!attr || attr->Length != sizeof(*attr)) return STATUS_INVALID_PARAMETER; + + if (attr->ObjectName) + { + if (attr->ObjectName->Length & (sizeof(WCHAR) - 1)) return STATUS_OBJECT_NAME_INVALID; + } + else if (attr->RootDirectory) return STATUS_OBJECT_NAME_INVALID; + + return STATUS_SUCCESS; +} + /* * Semaphores */ @@ -190,23 +206,21 @@ /****************************************************************************** * NtOpenSemaphore (NTDLL.@) */ -NTSTATUS WINAPI NtOpenSemaphore( OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES *attr ) +NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0; NTSTATUS ret; - if (len >= MAX_PATH * sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_semaphore ) { - req->access = access; - req->attributes = (attr) ? attr->Attributes : 0; - req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); - if (len) wine_server_add_data( req, attr->ObjectName->Buffer, len ); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); - *SemaphoreHandle = wine_server_ptr_handle( reply->handle ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; @@ -299,24 +313,21 @@ * NtOpenEvent (NTDLL.@) * ZwOpenEvent (NTDLL.@) */ -NTSTATUS WINAPI NtOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN const OBJECT_ATTRIBUTES *attr ) +NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0; NTSTATUS ret; - if (len >= MAX_PATH * sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_event ) { - req->access = DesiredAccess; - req->attributes = (attr) ? attr->Attributes : 0; - req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); - if (len) wine_server_add_data( req, attr->ObjectName->Buffer, len ); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); - *EventHandle = wine_server_ptr_handle( reply->handle ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; @@ -467,23 +478,21 @@ * NtOpenMutant [NTDLL.@] * ZwOpenMutant [NTDLL.@] */ -NTSTATUS WINAPI NtOpenMutant(OUT HANDLE* MutantHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES* attr ) +NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { NTSTATUS status; - DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0; - if (len >= MAX_PATH * sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((status = validate_open_object_attributes( attr ))) return status; SERVER_START_REQ( open_mutex ) { req->access = access; - req->attributes = (attr) ? attr->Attributes : 0; - req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); - if (len) wine_server_add_data( req, attr->ObjectName->Buffer, len ); + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); status = wine_server_call( req ); - *MutantHandle = wine_server_ptr_handle( reply->handle ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return status; @@ -555,10 +564,24 @@ * NtOpenJobObject [NTDLL.@] * ZwOpenJobObject [NTDLL.@] */ -NTSTATUS WINAPI NtOpenJobObject( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - FIXME( "stub: %p %x %s\n", handle, access, attr ? debugstr_us(attr->ObjectName) : "" ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS ret; + + if ((ret = validate_open_object_attributes( attr ))) return ret; + + SERVER_START_REQ( open_job ) + { + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + ret = wine_server_call( req ); + *handle = wine_server_ptr_handle( reply->handle ); + } + SERVER_END_REQ; + return ret; } /****************************************************************************** @@ -773,21 +796,19 @@ * NtOpenTimer [NTDLL.@] * ZwOpenTimer [NTDLL.@] */ -NTSTATUS WINAPI NtOpenTimer(OUT PHANDLE handle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES* attr ) +NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - DWORD len = (attr && attr->ObjectName) ? attr->ObjectName->Length : 0; - NTSTATUS status; + NTSTATUS status; - if (len >= MAX_PATH * sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((status = validate_open_object_attributes( attr ))) return status; SERVER_START_REQ( open_timer ) { - req->access = access; - req->attributes = (attr) ? attr->Attributes : 0; - req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); - if (len) wine_server_add_data( req, attr->ObjectName->Buffer, len ); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); status = wine_server_call( req ); *handle = wine_server_ptr_handle( reply->handle ); } @@ -1087,17 +1108,17 @@ */ NTSTATUS WINAPI NtOpenKeyedEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0; NTSTATUS ret; - if (len >= MAX_PATH * sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_keyed_event ) { - req->access = access; - req->attributes = attr ? attr->Attributes : 0; - req->rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); - if (len) wine_server_add_data( req, attr->ObjectName->Buffer, len ); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); *handle = wine_server_ptr_handle( reply->handle ); } @@ -1272,24 +1293,22 @@ * ObjectAttributes [I] completion object name * */ -NTSTATUS WINAPI NtOpenIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes ) +NTSTATUS WINAPI NtOpenIoCompletion( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { NTSTATUS status; - TRACE("(%p, 0x%x, %p)\n", CompletionPort, DesiredAccess, ObjectAttributes); - - if (!CompletionPort || !ObjectAttributes || !ObjectAttributes->ObjectName) - return STATUS_INVALID_PARAMETER; + if (!handle) return STATUS_INVALID_PARAMETER; + if ((status = validate_open_object_attributes( attr ))) return status; SERVER_START_REQ( open_completion ) { - req->access = DesiredAccess; - req->rootdir = wine_server_obj_handle( ObjectAttributes->RootDirectory ); - wine_server_add_data( req, ObjectAttributes->ObjectName->Buffer, - ObjectAttributes->ObjectName->Length ); - if (!(status = wine_server_call( req ))) - *CompletionPort = wine_server_ptr_handle( reply->handle ); + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + status = wine_server_call( req ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return status; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/file.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/file.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/file.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/file.c 2016-02-08 19:32:34.000000000 +0000 @@ -1139,39 +1139,6 @@ if ( rc == STATUS_SUCCESS ) pNtClose(hslot); /* - * Test that the length field is checked properly - */ - attr.Length = 0; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); - - attr.Length = sizeof(OBJECT_ATTRIBUTES)+1; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); - - /* - * Test handling of a NULL unicode string in ObjectName - */ - InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL); - attr.ObjectName = NULL; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - ok( rc == STATUS_OBJECT_PATH_SYNTAX_BAD || - rc == STATUS_INVALID_PARAMETER, - "rc = %x not STATUS_OBJECT_PATH_SYNTAX_BAD or STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); - - /* * Test a valid call */ InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/info.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/info.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/info.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/info.c 2016-02-08 19:32:34.000000000 +0000 @@ -721,35 +721,90 @@ len = 0; relationship = RelationProcessorCore; status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len); -todo_wine { ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); ok(len > 0, "got %u\n", len); -} + len = 0; relationship = RelationAll; status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len); -todo_wine { ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); ok(len > 0, "got %u\n", len); -} + len2 = 0; ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len2); -todo_wine ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); ok(len == len2, "got %u, expected %u\n", len2, len); if (len && len == len2) { + int j, i; + infoex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); infoex2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex, len, &len); ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); - ok(infoex->Size > 0, "got %u\n", infoex->Size); ret = pGetLogicalProcessorInformationEx(RelationAll, infoex2, &len2); ok(ret, "got %d, error %d\n", ret, GetLastError()); ok(!memcmp(infoex, infoex2, len), "returned info data mismatch\n"); + for(i = 0; status == STATUS_SUCCESS && i < len; ){ + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *ex = (void*)(((char *)infoex) + i); + + ok(ex->Relationship >= RelationProcessorCore && ex->Relationship <= RelationGroup, + "Got invalid relationship value: 0x%x\n", ex->Relationship); + if (!ex->Size) + { + ok(0, "got infoex[%u].Size=0\n", i); + break; + } + + trace("infoex[%u].Size: %u\n", i, ex->Size); + switch(ex->Relationship){ + case RelationProcessorCore: + case RelationProcessorPackage: + trace("infoex[%u].Relationship: 0x%x (Core == 0x0 or Package == 0x3)\n", i, ex->Relationship); + trace("infoex[%u].Processor.Flags: 0x%x\n", i, ex->Processor.Flags); + trace("infoex[%u].Processor.EfficiencyClass: 0x%x\n", i, ex->Processor.EfficiencyClass); + trace("infoex[%u].Processor.GroupCount: 0x%x\n", i, ex->Processor.GroupCount); + for(j = 0; j < ex->Processor.GroupCount; ++j){ + trace("infoex[%u].Processor.GroupMask[%u].Mask: 0x%lx\n", i, j, ex->Processor.GroupMask[j].Mask); + trace("infoex[%u].Processor.GroupMask[%u].Group: 0x%x\n", i, j, ex->Processor.GroupMask[j].Group); + } + break; + case RelationNumaNode: + trace("infoex[%u].Relationship: 0x%x (NumaNode)\n", i, ex->Relationship); + trace("infoex[%u].NumaNode.NodeNumber: 0x%x\n", i, ex->NumaNode.NodeNumber); + trace("infoex[%u].NumaNode.GroupMask.Mask: 0x%lx\n", i, ex->NumaNode.GroupMask.Mask); + trace("infoex[%u].NumaNode.GroupMask.Group: 0x%x\n", i, ex->NumaNode.GroupMask.Group); + break; + case RelationCache: + trace("infoex[%u].Relationship: 0x%x (Cache)\n", i, ex->Relationship); + trace("infoex[%u].Cache.Level: 0x%x\n", i, ex->Cache.Level); + trace("infoex[%u].Cache.Associativity: 0x%x\n", i, ex->Cache.Associativity); + trace("infoex[%u].Cache.LineSize: 0x%x\n", i, ex->Cache.LineSize); + trace("infoex[%u].Cache.CacheSize: 0x%x\n", i, ex->Cache.CacheSize); + trace("infoex[%u].Cache.Type: 0x%x\n", i, ex->Cache.Type); + trace("infoex[%u].Cache.GroupMask.Mask: 0x%lx\n", i, ex->Cache.GroupMask.Mask); + trace("infoex[%u].Cache.GroupMask.Group: 0x%x\n", i, ex->Cache.GroupMask.Group); + break; + case RelationGroup: + trace("infoex[%u].Relationship: 0x%x (Group)\n", i, ex->Relationship); + trace("infoex[%u].Group.MaximumGroupCount: 0x%x\n", i, ex->Group.MaximumGroupCount); + trace("infoex[%u].Group.ActiveGroupCount: 0x%x\n", i, ex->Group.ActiveGroupCount); + for(j = 0; j < ex->Group.ActiveGroupCount; ++j){ + trace("infoex[%u].Group.GroupInfo[%u].MaximumProcessorCount: 0x%x\n", i, j, ex->Group.GroupInfo[j].MaximumProcessorCount); + trace("infoex[%u].Group.GroupInfo[%u].ActiveProcessorCount: 0x%x\n", i, j, ex->Group.GroupInfo[j].ActiveProcessorCount); + trace("infoex[%u].Group.GroupInfo[%u].ActiveProcessorMask: 0x%lx\n", i, j, ex->Group.GroupInfo[j].ActiveProcessorMask); + } + break; + default: + break; + } + + i += ex->Size; + } + HeapFree(GetProcessHeap(), 0, infoex); HeapFree(GetProcessHeap(), 0, infoex2); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/om.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/om.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/tests/om.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/tests/om.c 2016-02-08 19:32:34.000000000 +0000 @@ -34,17 +34,22 @@ static NTSTATUS (WINAPI *pNtPulseEvent) ( HANDLE, PULONG ); static NTSTATUS (WINAPI *pNtQueryEvent) ( HANDLE, EVENT_INFORMATION_CLASS, PVOID, ULONG, PULONG ); static NTSTATUS (WINAPI *pNtCreateJobObject)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES ); +static NTSTATUS (WINAPI *pNtOpenJobObject)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtCreateKey)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, ULONG, const UNICODE_STRING *, ULONG, PULONG ); +static NTSTATUS (WINAPI *pNtOpenKey)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtDeleteKey)( HANDLE ); static NTSTATUS (WINAPI *pNtCreateMailslotFile)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG, ULONG, PLARGE_INTEGER ); static NTSTATUS (WINAPI *pNtCreateMutant)( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, BOOLEAN ); static NTSTATUS (WINAPI *pNtOpenMutant) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtCreateSemaphore)( PHANDLE, ACCESS_MASK,const POBJECT_ATTRIBUTES,LONG,LONG ); +static NTSTATUS (WINAPI *pNtOpenSemaphore)( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtCreateTimer) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, TIMER_TYPE ); +static NTSTATUS (WINAPI *pNtOpenTimer)( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtCreateSection)( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, const PLARGE_INTEGER, ULONG, ULONG, HANDLE ); +static NTSTATUS (WINAPI *pNtOpenSection)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES ); static NTSTATUS (WINAPI *pNtOpenFile) ( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG ); static NTSTATUS (WINAPI *pNtClose) ( HANDLE ); static NTSTATUS (WINAPI *pNtCreateNamedPipeFile)( PHANDLE, ULONG, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, @@ -61,6 +66,7 @@ static NTSTATUS (WINAPI *pNtWaitForKeyedEvent)( HANDLE, const void *, BOOLEAN, const LARGE_INTEGER * ); static NTSTATUS (WINAPI *pNtReleaseKeyedEvent)( HANDLE, const void *, BOOLEAN, const LARGE_INTEGER * ); static NTSTATUS (WINAPI *pNtCreateIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, ULONG); +static NTSTATUS (WINAPI *pNtOpenIoCompletion)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES ); #define KEYEDEVENT_WAIT 0x0001 #define KEYEDEVENT_WAKE 0x0002 @@ -362,23 +368,101 @@ pNtClose(dir); } +static void test_all_kernel_objects( UINT line, OBJECT_ATTRIBUTES *attr, + NTSTATUS create_expect, NTSTATUS open_expect ) +{ + UNICODE_STRING target; + LARGE_INTEGER size; + NTSTATUS status, status2; + HANDLE ret, ret2; + + pRtlCreateUnicodeStringFromAsciiz( &target, "\\DosDevices" ); + size.QuadPart = 4096; + + status = pNtCreateMutant( &ret, GENERIC_ALL, attr, FALSE ); + ok( status == create_expect, "%u: NtCreateMutant failed %x\n", line, status ); + status2 = pNtOpenMutant( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenMutant failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateSemaphore( &ret, GENERIC_ALL, attr, 1, 2 ); + ok( status == create_expect, "%u: NtCreateSemaphore failed %x\n", line, status ); + status2 = pNtOpenSemaphore( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenSemaphore failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateEvent( &ret, GENERIC_ALL, attr, 1, 0 ); + ok( status == create_expect, "%u: NtCreateEvent failed %x\n", line, status ); + status2 = pNtOpenEvent( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenEvent failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, attr, 0 ); + ok( status == create_expect, "%u: NtCreateKeyedEvent failed %x\n", line, status ); + status2 = pNtOpenKeyedEvent( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenKeyedEvent failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateTimer( &ret, GENERIC_ALL, attr, NotificationTimer ); + ok( status == create_expect, "%u: NtCreateTimer failed %x\n", line, status ); + status2 = pNtOpenTimer( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenTimer failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateIoCompletion( &ret, GENERIC_ALL, attr, 0 ); + ok( status == create_expect, "%u: NtCreateCompletion failed %x\n", line, status ); + status2 = pNtOpenIoCompletion( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenCompletion failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateJobObject( &ret, GENERIC_ALL, attr ); + ok( status == create_expect, "%u: NtCreateJobObject failed %x\n", line, status ); + status2 = pNtOpenJobObject( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenJobObject failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, attr ); + ok( status == create_expect, "%u: NtCreateDirectoryObject failed %x\n", line, status ); + status2 = pNtOpenDirectoryObject( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenDirectoryObject failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, attr, &target ); + ok( status == create_expect, "%u: NtCreateSymbolicLinkObject failed %x\n", line, status ); + status2 = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, attr ); + ok( status2 == open_expect, "%u: NtOpenSymbolicLinkObject failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + status = pNtCreateSection( &ret, SECTION_MAP_WRITE, attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); + ok( status == create_expect, "%u: NtCreateSection failed %x\n", line, status ); + status2 = pNtOpenSection( &ret2, SECTION_MAP_WRITE, attr ); + ok( status2 == open_expect, "%u: NtOpenSection failed %x\n", line, status2 ); + if (!status) pNtClose( ret ); + if (!status2) pNtClose( ret2 ); + pRtlFreeUnicodeString( &target ); +} + static void test_name_limits(void) { static const WCHAR pipeW[] = {'\\','D','e','v','i','c','e','\\','N','a','m','e','d','P','i','p','e','\\'}; static const WCHAR mailslotW[] = {'\\','D','e','v','i','c','e','\\','M','a','i','l','S','l','o','t','\\'}; static const WCHAR registryW[] = {'\\','R','E','G','I','S','T','R','Y','\\','M','a','c','h','i','n','e','\\','S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t','\\'}; - OBJECT_ATTRIBUTES attr; + OBJECT_ATTRIBUTES attr, attr2, attr3; IO_STATUS_BLOCK iosb; LARGE_INTEGER size, timeout; UNICODE_STRING str, target; NTSTATUS status; - HANDLE ret; + HANDLE ret, ret2; DWORD i; InitializeObjectAttributes( &attr, &str, 0, 0, NULL ); + InitializeObjectAttributes( &attr2, &str, 0, (HANDLE)0xdeadbeef, NULL ); + InitializeObjectAttributes( &attr3, &str, 0, 0, NULL ); str.Buffer = HeapAlloc( GetProcessHeap(), 0, 65536 + sizeof(registryW)); str.MaximumLength = 65534; for (i = 0; i < 65536 / sizeof(WCHAR); i++) str.Buffer[i] = 'a'; + size.QuadPart = 4096; + pRtlCreateUnicodeStringFromAsciiz( &target, "\\DosDevices" ); if (!(attr.RootDirectory = get_base_dir())) { @@ -386,96 +470,210 @@ return; } - str.Length = 67; - status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateMutant failed %x\n", str.Length, status ); - status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr, 1, 2 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSemaphore failed %x\n", str.Length, status ); - status = pNtCreateEvent( &ret, GENERIC_ALL, &attr, 1, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateEvent failed %x\n", str.Length, status ); - status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateKeyedEvent failed %x\n", str.Length, status ); - status = pNtCreateTimer( &ret, GENERIC_ALL, &attr, NotificationTimer ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateTimer failed %x\n", str.Length, status ); - status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateCompletion failed %x\n", str.Length, status ); - status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateJobObject failed %x\n", str.Length, status ); - status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateDirectoryObject failed %x\n", str.Length, status ); - pRtlCreateUnicodeStringFromAsciiz( &target, "\\DosDevices" ); - status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr, &target ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSymbolicLinkObject failed %x\n", str.Length, status ); - size.QuadPart = 4096; - status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSection failed %x\n", str.Length, status ); - - str.Length = 65532; - status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE ); + str.Length = 0; + status = pNtCreateMutant( &ret, GENERIC_ALL, &attr2, FALSE ); ok( status == STATUS_SUCCESS, "%u: NtCreateMutant failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenMutant( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenMutant failed %x\n", str.Length, status ); + status = pNtOpenMutant( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenMutant failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr, 1, 2 ); + status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr2, 1, 2 ); ok( status == STATUS_SUCCESS, "%u: NtCreateSemaphore failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenSemaphore( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenSemaphore failed %x\n", str.Length, status ); + status = pNtOpenSemaphore( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenSemaphore failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateEvent( &ret, GENERIC_ALL, &attr, 1, 0 ); + status = pNtCreateEvent( &ret, GENERIC_ALL, &attr2, 1, 0 ); ok( status == STATUS_SUCCESS, "%u: NtCreateEvent failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenEvent( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenEvent failed %x\n", str.Length, status ); + status = pNtOpenEvent( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenEvent failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr, 0 ); + status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr2, 0 ); ok( status == STATUS_SUCCESS, "%u: NtCreateKeyedEvent failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenKeyedEvent( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenKeyedEvent failed %x\n", str.Length, status ); + status = pNtOpenKeyedEvent( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenKeyedEvent failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateTimer( &ret, GENERIC_ALL, &attr, NotificationTimer ); + status = pNtCreateTimer( &ret, GENERIC_ALL, &attr2, NotificationTimer ); ok( status == STATUS_SUCCESS, "%u: NtCreateTimer failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenTimer( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenTimer failed %x\n", str.Length, status ); + status = pNtOpenTimer( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenTimer failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr, 0 ); + status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr2, 0 ); ok( status == STATUS_SUCCESS, "%u: NtCreateCompletion failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenIoCompletion( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenCompletion failed %x\n", str.Length, status ); + status = pNtOpenIoCompletion( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenCompletion failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr ); + status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr2 ); ok( status == STATUS_SUCCESS, "%u: NtCreateJobObject failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenJobObject( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenJobObject failed %x\n", str.Length, status ); + status = pNtOpenJobObject( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenJobObject failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr ); + status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr2 ); ok( status == STATUS_SUCCESS, "%u: NtCreateDirectoryObject failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenDirectoryObject( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_SUCCESS || broken(status == STATUS_ACCESS_DENIED), /* winxp */ + "%u: NtOpenDirectoryObject failed %x\n", str.Length, status ); + if (!status) pNtClose( ret2 ); + status = pNtOpenDirectoryObject( &ret2, GENERIC_ALL, &attr3 ); + ok( status == STATUS_SUCCESS, "%u: NtOpenDirectoryObject failed %x\n", str.Length, status ); + pNtClose( ret2 ); pNtClose( ret ); - status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr, &target ); + status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr2, &target ); ok( status == STATUS_SUCCESS, "%u: NtCreateSymbolicLinkObject failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status ); + status = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, &attr3 ); + todo_wine + ok( status == STATUS_SUCCESS, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status ); + pNtClose( ret2 ); pNtClose( ret ); - size.QuadPart = 4096; - status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); + status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr2, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); ok( status == STATUS_SUCCESS, "%u: NtCreateSection failed %x\n", str.Length, status ); + attr3.RootDirectory = ret; + status = pNtOpenSection( &ret2, SECTION_MAP_WRITE, &attr ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenSection failed %x\n", str.Length, status ); + status = pNtOpenSection( &ret2, SECTION_MAP_WRITE, &attr3 ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, + "%u: NtOpenSection failed %x\n", str.Length, status ); pNtClose( ret ); + str.Length = 67; + test_all_kernel_objects( __LINE__, &attr2, STATUS_OBJECT_NAME_INVALID, STATUS_OBJECT_NAME_INVALID ); + + str.Length = 65532; + test_all_kernel_objects( __LINE__, &attr, STATUS_SUCCESS, STATUS_SUCCESS ); + str.Length = 65534; - status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateMutant failed %x\n", str.Length, status ); - status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr, 1, 2 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSemaphore failed %x\n", str.Length, status ); - status = pNtCreateEvent( &ret, GENERIC_ALL, &attr, 1, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateEvent failed %x\n", str.Length, status ); - status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateKeyedEvent failed %x\n", str.Length, status ); - status = pNtCreateTimer( &ret, GENERIC_ALL, &attr, NotificationTimer ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateTimer failed %x\n", str.Length, status ); - status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateCompletion failed %x\n", str.Length, status ); - status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateJobObject failed %x\n", str.Length, status ); - status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateDirectoryObject failed %x\n", str.Length, status ); - status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr, &target ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSymbolicLinkObject failed %x\n", str.Length, status ); - size.QuadPart = 4096; - status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); - ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSection failed %x\n", str.Length, status ); + test_all_kernel_objects( __LINE__, &attr, STATUS_OBJECT_NAME_INVALID, STATUS_OBJECT_NAME_INVALID ); + + str.Length = 128; + for (attr.Length = 0; attr.Length <= 2 * sizeof(attr); attr.Length++) + { + if (attr.Length == sizeof(attr)) + test_all_kernel_objects( __LINE__, &attr, STATUS_SUCCESS, STATUS_SUCCESS ); + else + test_all_kernel_objects( __LINE__, &attr, STATUS_INVALID_PARAMETER, STATUS_INVALID_PARAMETER ); + } + attr.Length = sizeof(attr); + + /* null attributes or ObjectName, with or without RootDirectory */ + attr3.RootDirectory = 0; + attr2.ObjectName = attr3.ObjectName = NULL; + test_all_kernel_objects( __LINE__, &attr2, STATUS_OBJECT_NAME_INVALID, STATUS_OBJECT_NAME_INVALID ); + test_all_kernel_objects( __LINE__, &attr3, STATUS_SUCCESS, STATUS_OBJECT_PATH_SYNTAX_BAD ); + + status = pNtCreateMutant( &ret, GENERIC_ALL, NULL, FALSE ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateMutant failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenMutant( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenMutant failed %x\n", status ); + status = pNtCreateSemaphore( &ret, GENERIC_ALL, NULL, 1, 2 ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateSemaphore failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenSemaphore( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSemaphore failed %x\n", status ); + status = pNtCreateEvent( &ret, GENERIC_ALL, NULL, 1, 0 ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateEvent failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenEvent( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenEvent failed %x\n", status ); + status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, NULL, 0 ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateKeyedEvent failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenKeyedEvent failed %x\n", status ); + status = pNtCreateTimer( &ret, GENERIC_ALL, NULL, NotificationTimer ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateTimer failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenTimer( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenTimer failed %x\n", status ); + status = pNtCreateIoCompletion( &ret, GENERIC_ALL, NULL, 0 ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateCompletion failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenIoCompletion( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenCompletion failed %x\n", status ); + status = pNtCreateJobObject( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateJobObject failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenJobObject( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenJobObject failed %x\n", status ); + status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateDirectoryObject failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenDirectoryObject failed %x\n", status ); + status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, NULL, &target ); + ok( status == STATUS_ACCESS_VIOLATION || broken( status == STATUS_SUCCESS), /* winxp */ + "NULL: NtCreateSymbolicLinkObject failed %x\n", status ); + if (!status) pNtClose( ret ); + status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSymbolicLinkObject failed %x\n", status ); + status = pNtCreateSection( &ret, SECTION_MAP_WRITE, NULL, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); + ok( status == STATUS_SUCCESS, "NULL: NtCreateSection failed %x\n", status ); + pNtClose( ret ); + status = pNtOpenSection( &ret, SECTION_MAP_WRITE, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSection failed %x\n", status ); + attr2.ObjectName = attr3.ObjectName = &str; /* named pipes */ memcpy( str.Buffer, pipeW, sizeof(pipeW) ); for (i = 0; i < 65536 / sizeof(WCHAR); i++) str.Buffer[i + sizeof(pipeW)/sizeof(WCHAR)] = 'a'; - str.Length = 67; + str.Length = 0; attr.RootDirectory = 0; attr.Attributes = OBJ_CASE_INSENSITIVE; timeout.QuadPart = -10000; status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr2, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + ok( status == STATUS_INVALID_HANDLE, "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + str.Length = 67; + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr2, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + str.Length = 128; + for (attr.Length = 0; attr.Length <= 2 * sizeof(attr); attr.Length++) + { + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + if (attr.Length == sizeof(attr)) + { + ok( status == STATUS_SUCCESS, "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + pNtClose( ret ); + } + else ok( status == STATUS_INVALID_PARAMETER, + "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + } + attr.Length = sizeof(attr); str.Length = 65532; status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); @@ -485,13 +683,43 @@ status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateNamedPipeFile failed %x\n", str.Length, status ); + attr3.RootDirectory = 0; + attr2.ObjectName = attr3.ObjectName = NULL; + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr2, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateNamedPipeFile failed %x\n", status ); + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, &attr3, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtCreateNamedPipeFile failed %x\n", status ); + status = pNtCreateNamedPipeFile( &ret, GENERIC_ALL, NULL, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_CREATE, FILE_PIPE_FULL_DUPLEX, 0, 0, 0, 1, 256, 256, &timeout ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtCreateNamedPipeFile failed %x\n", status ); + attr2.ObjectName = attr3.ObjectName = &str; /* mailslots */ memcpy( str.Buffer, mailslotW, sizeof(mailslotW) ); for (i = 0; i < 65536 / sizeof(WCHAR); i++) str.Buffer[i + sizeof(mailslotW)/sizeof(WCHAR)] = 'a'; - str.Length = 67; + str.Length = 0; status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr, &iosb, 0, 0, 0, NULL ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr2, &iosb, 0, 0, 0, NULL ); + ok( status == STATUS_INVALID_HANDLE, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + str.Length = 67; + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr2, &iosb, 0, 0, 0, NULL ); ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + str.Length = 128; + for (attr.Length = 0; attr.Length <= 2 * sizeof(attr); attr.Length++) + { + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr, &iosb, 0, 0, 0, NULL ); + if (attr.Length == sizeof(attr)) + { + ok( status == STATUS_SUCCESS, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + pNtClose( ret ); + } + else ok( status == STATUS_INVALID_PARAMETER, + "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + } + attr.Length = sizeof(attr); str.Length = 65532; status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr, &iosb, 0, 0, 0, NULL ); ok( status == STATUS_SUCCESS, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); @@ -499,10 +727,27 @@ str.Length = 65534; status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr, &iosb, 0, 0, 0, NULL ); ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateMailslotFile failed %x\n", str.Length, status ); + attr3.RootDirectory = 0; + attr2.ObjectName = attr3.ObjectName = NULL; + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr2, &iosb, 0, 0, 0, NULL ); + ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateMailslotFile failed %x\n", status ); + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, &attr3, &iosb, 0, 0, 0, NULL ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtCreateMailslotFile failed %x\n", status ); + status = pNtCreateMailslotFile( &ret, GENERIC_ALL, NULL, &iosb, 0, 0, 0, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "NULL: NtCreateMailslotFile failed %x\n", status ); + attr2.ObjectName = attr3.ObjectName = &str; /* registry keys */ memcpy( str.Buffer, registryW, sizeof(registryW) ); for (i = 0; i < 65536 / sizeof(WCHAR); i++) str.Buffer[i + sizeof(registryW)/sizeof(WCHAR)] = 'a'; + str.Length = 0; + status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); + todo_wine + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtCreateKey( &ret, GENERIC_ALL, &attr2, 0, NULL, 0, NULL ); + ok( status == STATUS_INVALID_HANDLE, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr2 ); + ok( status == STATUS_INVALID_HANDLE, "%u: NtOpenKey failed %x\n", str.Length, status ); str.Length = sizeof(registryW) + 250 * sizeof(WCHAR) + 1; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); ok( status == STATUS_OBJECT_NAME_INVALID || @@ -520,10 +765,41 @@ "%u: NtCreateKey failed %x\n", str.Length, status ); if (!status) { + status = pNtOpenKey( &ret2, KEY_READ, &attr ); + ok( status == STATUS_SUCCESS, "%u: NtOpenKey failed %x\n", str.Length, status ); + pNtClose( ret2 ); + attr3.RootDirectory = ret; + str.Length = 0; + status = pNtOpenKey( &ret2, KEY_READ, &attr3 ); + ok( status == STATUS_SUCCESS, "%u: NtOpenKey failed %x\n", str.Length, status ); + pNtClose( ret2 ); pNtDeleteKey( ret ); pNtClose( ret ); + + str.Length = sizeof(registryW) + 256 * sizeof(WCHAR); + for (attr.Length = 0; attr.Length <= 2 * sizeof(attr); attr.Length++) + { + if (attr.Length == sizeof(attr)) + { + status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); + ok( status == STATUS_SUCCESS, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret2, KEY_READ, &attr ); + ok( status == STATUS_SUCCESS, "%u: NtOpenKey failed %x\n", str.Length, status ); + pNtClose( ret2 ); + pNtDeleteKey( ret ); + pNtClose( ret ); + } + else + { + status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); + ok( status == STATUS_INVALID_PARAMETER, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret2, KEY_READ, &attr ); + ok( status == STATUS_INVALID_PARAMETER, "%u: NtOpenKey failed %x\n", str.Length, status ); + } + } + attr.Length = sizeof(attr); } - str.Length++; + str.Length = sizeof(registryW) + 256 * sizeof(WCHAR) + 1; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); ok( status == STATUS_OBJECT_NAME_INVALID || status == STATUS_INVALID_PARAMETER || @@ -534,12 +810,23 @@ pNtDeleteKey( ret ); pNtClose( ret ); } + status = pNtOpenKey( &ret, GENERIC_ALL, &attr ); + ok( status == STATUS_OBJECT_NAME_INVALID || + status == STATUS_INVALID_PARAMETER || + broken( status == STATUS_OBJECT_NAME_NOT_FOUND ), /* wow64 */ + "%u: NtOpenKey failed %x\n", str.Length, status ); str.Length++; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); ok( status == STATUS_INVALID_PARAMETER, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr ); + todo_wine + ok( status == STATUS_INVALID_PARAMETER, "%u: NtOpenKey failed %x\n", str.Length, status ); str.Length = 2000; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); ok( status == STATUS_INVALID_PARAMETER, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr ); + todo_wine + ok( status == STATUS_INVALID_PARAMETER, "%u: NtOpenKey failed %x\n", str.Length, status ); /* some Windows versions change the error past 2050 chars, others past 4066 chars, some don't */ str.Length = 5000; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); @@ -547,12 +834,43 @@ status == STATUS_BUFFER_TOO_SMALL || status == STATUS_INVALID_PARAMETER, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr ); + todo_wine + ok( status == STATUS_BUFFER_OVERFLOW || + status == STATUS_BUFFER_TOO_SMALL || + status == STATUS_INVALID_PARAMETER, + "%u: NtOpenKey failed %x\n", str.Length, status ); str.Length = 65534; status = pNtCreateKey( &ret, GENERIC_ALL, &attr, 0, NULL, 0, NULL ); ok( status == STATUS_OBJECT_NAME_INVALID || status == STATUS_BUFFER_OVERFLOW || status == STATUS_BUFFER_TOO_SMALL, "%u: NtCreateKey failed %x\n", str.Length, status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr ); + todo_wine + ok( status == STATUS_OBJECT_NAME_INVALID || + status == STATUS_BUFFER_OVERFLOW || + status == STATUS_BUFFER_TOO_SMALL, + "%u: NtOpenKey failed %x\n", str.Length, status ); + attr3.RootDirectory = 0; + attr2.ObjectName = attr3.ObjectName = NULL; + status = pNtCreateKey( &ret, GENERIC_ALL, &attr2, 0, NULL, 0, NULL ); + todo_wine + ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE, + "NULL: NtCreateKey failed %x\n", status ); + status = pNtCreateKey( &ret, GENERIC_ALL, &attr3, 0, NULL, 0, NULL ); + todo_wine + ok( status == STATUS_ACCESS_VIOLATION, "NULL: NtCreateKey failed %x\n", status ); + status = pNtCreateKey( &ret, GENERIC_ALL, NULL, 0, NULL, 0, NULL ); + ok( status == STATUS_ACCESS_VIOLATION, "NULL: NtCreateKey failed %x\n", status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr2 ); + ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE, + "NULL: NtOpenKey failed %x\n", status ); + status = pNtOpenKey( &ret, GENERIC_ALL, &attr3 ); + ok( status == STATUS_ACCESS_VIOLATION, "NULL: NtOpenKey failed %x\n", status ); + status = pNtOpenKey( &ret, GENERIC_ALL, NULL ); + ok( status == STATUS_ACCESS_VIOLATION, "NULL: NtOpenKey failed %x\n", status ); + attr2.ObjectName = attr3.ObjectName = &str; pRtlFreeUnicodeString( &str ); pRtlFreeUnicodeString( &target ); @@ -884,10 +1202,13 @@ char buffer[1024]; NTSTATUS status; ULONG len, expected_len; - UNICODE_STRING *str; + OBJECT_ATTRIBUTES attr; + UNICODE_STRING path, *str; char dir[MAX_PATH], tmp_path[MAX_PATH], file1[MAX_PATH + 16]; LARGE_INTEGER size; + InitializeObjectAttributes( &attr, &path, 0, 0, 0 ); + handle = CreateEventA( NULL, FALSE, FALSE, "test_event" ); len = 0; @@ -917,9 +1238,12 @@ str = (UNICODE_STRING *)buffer; ok( sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR) == len, "unexpected len %u\n", len ); ok( str->Length >= sizeof(name), "unexpected len %u\n", str->Length ); + ok( len > sizeof(UNICODE_STRING) + sizeof("\\test_event") * sizeof(WCHAR), + "name too short %s\n", wine_dbgstr_w(str->Buffer) ); /* there can be a \\Sessions prefix in the name */ ok( !memcmp( str->Buffer + (str->Length - sizeof(name)) / sizeof(WCHAR), name, sizeof(name) ), "wrong name %s\n", wine_dbgstr_w(str->Buffer) ); + trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); len -= sizeof(WCHAR); status = pNtQueryObject( handle, ObjectNameInformation, buffer, len, &len ); @@ -1053,6 +1377,67 @@ ok( str->Buffer && !memcmp( str->Buffer, type_section, sizeof(type_section) ), "wrong/bad type name %s (%p)\n", wine_dbgstr_w(str->Buffer), str->Buffer ); pNtClose( handle ); + + handle = CreateMailslotA( "\\\\.\\mailslot\\test_mailslot", 100, 1000, NULL ); + ok( handle != INVALID_HANDLE_VALUE, "CreateMailslot failed err %u\n", GetLastError() ); + len = 0; + status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len ); + ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status ); + str = (UNICODE_STRING *)buffer; + ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len ); + str = (UNICODE_STRING *)buffer; + expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR); + ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */ + "unexpected len %u\n", len ); + ok( len > sizeof(UNICODE_STRING) + sizeof("\\test_mailslot") * sizeof(WCHAR), + "name too short %s\n", wine_dbgstr_w(str->Buffer) ); + trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); + pNtClose( handle ); + + handle = CreateNamedPipeA( "\\\\.\\pipe\\test_pipe", PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE, + 1, 1000, 1000, 1000, NULL ); + ok( handle != INVALID_HANDLE_VALUE, "CreateNamedPipe failed err %u\n", GetLastError() ); + len = 0; + status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len ); + ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status ); + str = (UNICODE_STRING *)buffer; + todo_wine + ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len ); + str = (UNICODE_STRING *)buffer; + expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR); + todo_wine + ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */ + "unexpected len %u\n", len ); + todo_wine + ok( len > sizeof(UNICODE_STRING) + sizeof("\\test_pipe") * sizeof(WCHAR), + "name too short %s\n", wine_dbgstr_w(str->Buffer) ); + trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); + pNtClose( handle ); + + pRtlCreateUnicodeStringFromAsciiz( &path, "\\REGISTRY\\Machine\\Software\\Classes" ); + status = pNtCreateKey( &handle, KEY_ALL_ACCESS, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed status %x\n", status ); + pRtlFreeUnicodeString( &path ); + if (status == STATUS_SUCCESS) + { + len = 0; + status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len ); + ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status ); + str = (UNICODE_STRING *)buffer; + todo_wine + ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len ); + str = (UNICODE_STRING *)buffer; + expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR); + todo_wine + ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */ + "unexpected len %u\n", len ); + todo_wine + ok( len > sizeof(UNICODE_STRING) + sizeof("\\Classes") * sizeof(WCHAR), + "name too short %s\n", wine_dbgstr_w(str->Buffer) ); + trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); + pNtClose( handle ); + } } static void test_type_mismatch(void) @@ -1409,7 +1794,9 @@ pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pNtCreateEvent = (void *)GetProcAddress(hntdll, "NtCreateEvent"); pNtCreateJobObject = (void *)GetProcAddress(hntdll, "NtCreateJobObject"); + pNtOpenJobObject = (void *)GetProcAddress(hntdll, "NtOpenJobObject"); pNtCreateKey = (void *)GetProcAddress(hntdll, "NtCreateKey"); + pNtOpenKey = (void *)GetProcAddress(hntdll, "NtOpenKey"); pNtDeleteKey = (void *)GetProcAddress(hntdll, "NtDeleteKey"); pNtCreateMailslotFile = (void *)GetProcAddress(hntdll, "NtCreateMailslotFile"); pNtCreateMutant = (void *)GetProcAddress(hntdll, "NtCreateMutant"); @@ -1427,8 +1814,11 @@ pNtCreateSymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtCreateSymbolicLinkObject"); pNtQuerySymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtQuerySymbolicLinkObject"); pNtCreateSemaphore = (void *)GetProcAddress(hntdll, "NtCreateSemaphore"); + pNtOpenSemaphore = (void *)GetProcAddress(hntdll, "NtOpenSemaphore"); pNtCreateTimer = (void *)GetProcAddress(hntdll, "NtCreateTimer"); + pNtOpenTimer = (void *)GetProcAddress(hntdll, "NtOpenTimer"); pNtCreateSection = (void *)GetProcAddress(hntdll, "NtCreateSection"); + pNtOpenSection = (void *)GetProcAddress(hntdll, "NtOpenSection"); pNtQueryObject = (void *)GetProcAddress(hntdll, "NtQueryObject"); pNtReleaseSemaphore = (void *)GetProcAddress(hntdll, "NtReleaseSemaphore"); pNtCreateKeyedEvent = (void *)GetProcAddress(hntdll, "NtCreateKeyedEvent"); @@ -1436,6 +1826,7 @@ pNtWaitForKeyedEvent = (void *)GetProcAddress(hntdll, "NtWaitForKeyedEvent"); pNtReleaseKeyedEvent = (void *)GetProcAddress(hntdll, "NtReleaseKeyedEvent"); pNtCreateIoCompletion = (void *)GetProcAddress(hntdll, "NtCreateIoCompletion"); + pNtOpenIoCompletion = (void *)GetProcAddress(hntdll, "NtOpenIoCompletion"); test_case_sensitive(); test_namespace_pipe(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/virtual.c wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/virtual.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/ntdll/virtual.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/ntdll/virtual.c 2016-02-08 19:32:34.000000000 +0000 @@ -2498,17 +2498,18 @@ NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { NTSTATUS ret; - DWORD len = attr->ObjectName->Length; - if (len > MAX_PATH*sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_mapping ) { - req->access = access; + req->access = access; req->attributes = attr->Attributes; - req->rootdir = wine_server_obj_handle( attr->RootDirectory ); - wine_server_add_data( req, attr->ObjectName->Buffer, len ); - if (!(ret = wine_server_call( req ))) *handle = wine_server_ptr_handle( reply->handle ); + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + ret = wine_server_call( req ); + *handle = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/oleaut32/tests/typelib.c wine-staging-1.9.3~ubuntu12.04.1/dlls/oleaut32/tests/typelib.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/oleaut32/tests/typelib.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/oleaut32/tests/typelib.c 2016-02-08 19:32:34.000000000 +0000 @@ -1656,7 +1656,6 @@ static OLECHAR dualW[] = {'d','u','a','l',0}; static OLECHAR coclassW[] = {'c','o','c','l','a','s','s',0}; static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0x3213,0}; - static const WCHAR defaultQW[] = {'d','e','f','a','u','l','t','?',0}; static OLECHAR func1W[] = {'f','u','n','c','1',0}; static OLECHAR func2W[] = {'f','u','n','c','2',0}; static OLECHAR prop1W[] = {'P','r','o','p','1',0}; @@ -1668,6 +1667,7 @@ static OLECHAR *names1[] = {func1W, param1W, param2W}; static OLECHAR *names2[] = {func2W, param1W, param2W}; static OLECHAR *propname[] = {prop1W, param1W}; + static const GUID tlcustguid = {0xbf611abe,0x5b38,0x11df,{0x91,0x5c,0x08,0x02,0x79,0x79,0x94,0x69}}; static const GUID custguid = {0xbf611abe,0x5b38,0x11df,{0x91,0x5c,0x08,0x02,0x79,0x79,0x94,0x70}}; static const GUID bogusguid = {0xbf611abe,0x5b38,0x11df,{0x91,0x5c,0x08,0x02,0x79,0x79,0x94,0x71}}; static const GUID interfaceguid = {0x3b9ff02f,0x9675,0x4861,{0xb7,0x81,0xce,0xae,0xa4,0x78,0x2a,0xcc}}; @@ -1679,6 +1679,7 @@ ICreateTypeInfo *createti; ICreateTypeInfo2 *createti2; ITypeLib *tl, *stdole; + ITypeLib2 *tl2; ITypeInfo *interface1, *interface2, *dual, *unknown, *dispatch, *ti; ITypeInfo *tinfos[2]; ITypeInfo2 *ti2; @@ -1701,6 +1702,8 @@ TYPEKIND kind; DESCKIND desckind; BINDPTR bindptr; + char nameA[16]; + WCHAR nameW[16]; switch(sys){ case SYS_WIN32: @@ -1795,6 +1798,23 @@ SysFreeString(name); SysFreeString(helpfile); + V_VT(&cust_data) = VT_I4; + V_I4(&cust_data) = 1; + hres = ICreateTypeLib2_SetCustData(createtl, &tlcustguid, &cust_data); + ok(hres == S_OK, "got %08x\n", hres); + + hres = ITypeLib_QueryInterface(tl, &IID_ITypeLib2, (void**)&tl2); + ok(hres == S_OK, "no ITypeLib2 interface (%x)\n", hres); + + V_VT(&cust_data) = VT_EMPTY; + V_I4(&cust_data) = 0; + hres = ITypeLib2_GetCustData(tl2, &tlcustguid, &cust_data); + ok(hres == S_OK, "got %08x\n", hres); + ok(V_VT(&cust_data) == VT_I4, "V_VT(&cust_data) = %d\n", V_VT(&cust_data)); + ok(V_I4(&cust_data) == 1, "V_I4(&cust_data) = %d\n", V_I4(&cust_data)); + + ITypeLib2_Release(tl2); + /* invalid parameters */ hres = ICreateTypeLib2_CreateTypeInfo(createtl, NULL, TKIND_INTERFACE, &createti); ok(hres == E_INVALIDARG, "got %08x\n", hres); @@ -2197,6 +2217,9 @@ ok(hres == S_OK, "got %08x\n", hres); SysFreeString(V_BSTR(¶mdescex.varDefaultValue)); + WideCharToMultiByte(CP_ACP, 0, defaultW, -1, nameA, sizeof(nameA), NULL, NULL); + MultiByteToWideChar(CP_ACP, 0, nameA, -1, nameW, sizeof(nameW)/sizeof(nameW[0])); + hres = ITypeInfo2_GetFuncDesc(ti2, 3, &pfuncdesc); ok(hres == S_OK, "got %08x\n", hres); @@ -2222,7 +2245,7 @@ U(*edesc).paramdesc.pparamdescex->cBytes); ok(V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue) == VT_BSTR, "got: %d\n", V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue)); - ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), defaultQW), + ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), nameW), "got: %s\n", wine_dbgstr_w(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue))); @@ -2234,7 +2257,7 @@ U(*edesc).paramdesc.pparamdescex->cBytes); ok(V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue) == VT_BSTR, "got: %d\n", V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue)); - ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), defaultQW), + ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), nameW), "got: %s\n", wine_dbgstr_w(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue))); @@ -2856,6 +2879,16 @@ SysFreeString(name); SysFreeString(helpfile); + hres = ITypeLib_QueryInterface(tl, &IID_ITypeLib2, (void**)&tl2); + ok(hres == S_OK, "no ITypeLib2 interface (%x)\n", hres); + V_VT(&cust_data) = VT_EMPTY; + V_I4(&cust_data) = 0; + hres = ITypeLib2_GetCustData(tl2, &tlcustguid, &cust_data); + ok(hres == S_OK, "got %08x\n", hres); + ok(V_VT(&cust_data) == VT_I4, "V_VT(&cust_data) = %d\n", V_VT(&cust_data)); + ok(V_I4(&cust_data) == 1, "V_I4(&cust_data) = %d\n", V_I4(&cust_data)); + ITypeLib2_Release(tl2); + hres = ITypeLib_GetTypeInfo(tl, 0, &ti); ok(hres == S_OK, "got %08x\n", hres); @@ -3020,7 +3053,7 @@ U(*edesc).paramdesc.pparamdescex->cBytes); ok(V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue) == VT_BSTR, "got: %d\n", V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue)); - ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), defaultQW), + ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), nameW), "got: %s\n", wine_dbgstr_w(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue))); @@ -3032,7 +3065,7 @@ U(*edesc).paramdesc.pparamdescex->cBytes); ok(V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue) == VT_BSTR, "got: %d\n", V_VT(&U(*edesc).paramdesc.pparamdescex->varDefaultValue)); - ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), defaultQW), + ok(!lstrcmpW(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue), nameW), "got: %s\n", wine_dbgstr_w(V_BSTR(&U(*edesc).paramdesc.pparamdescex->varDefaultValue))); @@ -5626,6 +5659,11 @@ ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr); SysFreeString(path); + path = NULL; + hr = QueryPathOfRegTypeLib(&LIBID_TestTypelib, 0xffff, 0xffff, LOCALE_NEUTRAL, &path); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(path); + /* manifest version is 2.0, actual is 1.0 */ hr = LoadRegTypeLib(&LIBID_register_test, 1, 0, LOCALE_NEUTRAL, &tl); ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr); @@ -5671,6 +5709,20 @@ hr = LoadRegTypeLib(&LIBID_TestTypelib, 1, 7, LOCALE_NEUTRAL, &tl); ok(hr == TYPE_E_LIBNOTREGISTERED, "got 0x%08x\n", hr); + hr = LoadRegTypeLib(&LIBID_TestTypelib, 0xffff, 0xffff, LOCALE_NEUTRAL, &tl); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITypeLib_GetLibAttr(tl, &attr); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(attr->lcid == 0, "got %x\n", attr->lcid); + ok(attr->wMajorVerNum == 2, "got %d\n", attr->wMajorVerNum); + ok(attr->wMinorVerNum == 5, "got %d\n", attr->wMinorVerNum); + ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "got %x\n", attr->wLibFlags); + + ITypeLib_ReleaseTLibAttr(tl, attr); + ITypeLib_Release(tl); + DeleteFileA("test_actctx_tlb.tlb"); DeleteFileA("test_actctx_tlb2.tlb"); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/oleaut32/typelib.c wine-staging-1.9.3~ubuntu12.04.1/dlls/oleaut32/typelib.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/oleaut32/typelib.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/oleaut32/typelib.c 2016-02-08 19:32:34.000000000 +0000 @@ -323,7 +323,7 @@ WCHAR *nameW; DWORD len; - if (tlib->major_version != wMaj || tlib->minor_version < wMin) + if ((wMaj != 0xffff || wMin != 0xffff) && (tlib->major_version != wMaj || tlib->minor_version < wMin)) return TYPE_E_LIBNOTREGISTERED; nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset); @@ -536,7 +536,7 @@ res= LoadTypeLib(bstr, ppTLib); SysFreeString(bstr); - if (*ppTLib) + if ((wVerMajor!=0xffff || wVerMinor!=0xffff) && *ppTLib) { TLIBATTR *attr; @@ -9280,7 +9280,7 @@ { WMSFT_SegContents *cdguids_seg = &file->cdguids_seg; DWORD ret = cdguids_seg->len, offs; - MSFT_CDGuid *cdguid = cdguids_seg->data; + MSFT_CDGuid *cdguid; TLBCustData *cd; if(list_empty(custdata_list)) @@ -9289,8 +9289,10 @@ cdguids_seg->len += sizeof(MSFT_CDGuid) * list_count(custdata_list); if(!cdguids_seg->data){ cdguid = cdguids_seg->data = heap_alloc(cdguids_seg->len); - }else + }else { cdguids_seg->data = heap_realloc(cdguids_seg->data, cdguids_seg->len); + cdguid = (MSFT_CDGuid*)((char*)cdguids_seg->data + ret); + } offs = ret + sizeof(MSFT_CDGuid); LIST_FOR_EACH_ENTRY(cd, custdata_list, TLBCustData, entry){ @@ -9982,7 +9984,7 @@ else file.header.NameOffset = -1; - file.header.CustomDataOffset = -1; /* TODO SetCustData not impl yet */ + file.header.CustomDataOffset = WMSFT_compile_custdata(&This->custdata_list, &file); if(This->guid) file.header.posguid = This->guid->offset; @@ -10132,8 +10134,16 @@ REFGUID guid, VARIANT *varVal) { ITypeLibImpl *This = impl_from_ICreateTypeLib2(iface); - FIXME("%p %s %p - stub\n", This, debugstr_guid(guid), varVal); - return E_NOTIMPL; + TLBGuid *tlbguid; + + TRACE("%p %s %p\n", This, debugstr_guid(guid), varVal); + + if (!guid || !varVal) + return E_INVALIDARG; + + tlbguid = TLB_append_guid(&This->guid_list, guid, -1); + + return TLB_set_custdata(&This->custdata_list, tlbguid, varVal); } static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringContext(ICreateTypeLib2 *iface, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/olepro32/Makefile.in wine-staging-1.9.3~ubuntu12.04.1/dlls/olepro32/Makefile.in --- wine-staging-1.9.2~ubuntu12.04.1/dlls/olepro32/Makefile.in 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/olepro32/Makefile.in 2016-02-08 19:32:34.000000000 +0000 @@ -4,4 +4,6 @@ C_SRCS = olepro32stubs.c +IDL_SRCS = olepro.idl + RC_SRCS = version.rc diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/olepro32/olepro.idl wine-staging-1.9.3~ubuntu12.04.1/dlls/olepro32/olepro.idl --- wine-staging-1.9.2~ubuntu12.04.1/dlls/olepro32/olepro.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/olepro32/olepro.idl 2016-02-08 19:32:34.000000000 +0000 @@ -0,0 +1,270 @@ +/* + * Copyright (C) 2003 Robert Shearman + * 2005 Huw Davies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#pragma makedep regtypelib + +import "oaidl.idl"; + +#include + +[ + uuid(bef6e001-a874-101a-8bba-00aa00300cab), + version(2.0), + helpstring("Standard OLE Types") +] +library StdType +{ + importlib("stdole2.tlb"); + + typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB), public] + unsigned long OLE_COLOR; + + typedef [uuid(66504302-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_XPOS_PIXELS; + + typedef [uuid(66504303-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_YPOS_PIXELS; + + typedef [uuid(66504304-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_XSIZE_PIXELS; + + typedef [uuid(66504305-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_YSIZE_PIXELS; + + typedef [uuid(66504306-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_XPOS_HIMETRIC; + + typedef [uuid(66504307-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_YPOS_HIMETRIC; + + typedef [uuid(66504308-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_XSIZE_HIMETRIC; + + typedef [uuid(66504309-BE0F-101A-8BBB-00AA00300CAB), public] + long OLE_YSIZE_HIMETRIC; + + typedef [uuid(BF030640-9069-101B-AE2D-08002B2EC713), public] + float OLE_XPOS_CONTAINER; + + typedef [uuid(BF030641-9069-101B-AE2D-08002B2EC713), public] + float OLE_YPOS_CONTAINER; + + typedef [uuid(BF030642-9069-101B-AE2D-08002B2EC713), public] + float OLE_XSIZE_CONTAINER; + + typedef [uuid(BF030643-9069-101B-AE2D-08002B2EC713), public] + float OLE_YSIZE_CONTAINER; + + typedef [uuid(66504313-BE0F-101A-8BBB-00AA00300CAB), public] + int OLE_HANDLE; + + typedef [uuid(6650430B-BE0F-101A-8BBB-00AA00300CAB), public] + VARIANT_BOOL OLE_OPTEXCLUSIVE; + + typedef [uuid(BF030644-9069-101B-AE2D-08002B2EC713), public] + VARIANT_BOOL OLE_CANCELBOOL; + + typedef [uuid(BF030645-9069-101B-AE2D-08002B2EC713), public] + VARIANT_BOOL OLE_ENABLEDEFAULTBOOL; + + [ + uuid(6650430A-BE0F-101A-8BBB-00AA00300CAB) + ] + enum OLE_TRISTATE { + Unchecked = 0, + Checked = 1, + Gray = 2 + }; + + typedef [uuid(6650430D-BE0F-101A-8BBB-00AA00300CAB), public] + BSTR FONTNAME; + + typedef [uuid(6650430E-BE0F-101A-8BBB-00AA00300CAB), public] + CURRENCY FONTSIZE; + + typedef [uuid(6650430F-BE0F-101A-8BBB-00AA00300CAB), public] + VARIANT_BOOL FONTBOLD; + + typedef [uuid(66504310-BE0F-101A-8BBB-00AA00300CAB), public] + VARIANT_BOOL FONTITALIC; + + typedef [uuid(66504311-BE0F-101A-8BBB-00AA00300CAB), public] + VARIANT_BOOL FONTUNDERSCORE; + + typedef [uuid(66504312-BE0F-101A-8BBB-00AA00300CAB), public] + VARIANT_BOOL FONTSTRIKETHROUGH; + + + [ + odl, + uuid(BEF6E002-A874-101A-8BBA-00AA00300CAB), + helpstring("Font Object"), + hidden + ] + interface IFont : IUnknown { + [propget] HRESULT Name([out, retval] BSTR *pname); + [propput] HRESULT Name([in] BSTR pname); + + [propget] HRESULT Size([out, retval] CURRENCY *psize); + [propput] HRESULT Size([in] CURRENCY psize); + + [propget] HRESULT Bold([out, retval] VARIANT_BOOL *pbold); + [propput] HRESULT Bold([in] VARIANT_BOOL pbold); + + [propget] HRESULT Italic([out, retval] VARIANT_BOOL *pitalic); + [propput] HRESULT Italic([in] VARIANT_BOOL pitalic); + + [propget] HRESULT Underline([out, retval] VARIANT_BOOL *punderline); + [propput] HRESULT Underline([in] VARIANT_BOOL punderline); + + [propget] HRESULT Strikethrough([out, retval] VARIANT_BOOL *pstrikethrough); + [propput] HRESULT Strikethrough([in] VARIANT_BOOL pstrikethrough); + + [propget] HRESULT Weight([out, retval] short *pweight); + [propput] HRESULT Weight([in] short pweight); + + [propget] HRESULT Charset([out, retval] short *pcharset); + [propput] HRESULT Charset([in] short pcharset); + + [propget] HRESULT hFont([out, retval] OLE_HANDLE *phfont); + + HRESULT Clone([out] IFont **ppfont); + + HRESULT IsEqual([in] IFont *pfontOther); + + HRESULT SetRatio([in] long cyLogical, [in] long cyHimetric); + + HRESULT AddRefHfont([in] OLE_HANDLE hFont); + + HRESULT ReleaseHfont([in] OLE_HANDLE hFont); + }; + + + [ + odl, + uuid(BEF6E003-A874-101A-8BBA-00AA00300CAB) + ] + dispinterface Font { + properties: + [id(DISPID_FONT_NAME)] BSTR Name; + [id(DISPID_FONT_SIZE)] CURRENCY Size; + [id(DISPID_FONT_BOLD)] VARIANT_BOOL Bold; + [id(DISPID_FONT_ITALIC)] VARIANT_BOOL Italic; + [id(DISPID_FONT_UNDER)] VARIANT_BOOL Underline; + [id(DISPID_FONT_STRIKE)] VARIANT_BOOL Strikethrough; + [id(DISPID_FONT_WEIGHT)] short Weight; + [id(DISPID_FONT_CHARSET)] short Charset; + methods: + } + + typedef [public] Font IFontDisp; + + [ + uuid(0BE35203-8F91-11CE-9DE3-00AA004BB851) + ] + coclass StdFont { + [default] dispinterface Font; + interface IFont; + }; + + [ + odl, + uuid(7BF80980-BF32-101A-8BBB-00AA00300CAB), + helpstring("Picture Object"), + hidden + ] + interface IPicture : IUnknown { + [propget] HRESULT Handle([out, retval] OLE_HANDLE *phandle); + + [propget] HRESULT hPal([out, retval] OLE_HANDLE *phpal); + + [propget] HRESULT Type([out, retval] short *ptype); + + [propget] HRESULT Width([out, retval] OLE_XSIZE_HIMETRIC *pwidth); + + [propget] HRESULT Height([out, retval] OLE_YSIZE_HIMETRIC *pheight); + + HRESULT Render([in] int hdc, + [in] long x, + [in] long y, + [in] long cx, + [in] long cy, + [in] OLE_XPOS_HIMETRIC xSrc, + [in] OLE_YPOS_HIMETRIC ySrc, + [in] OLE_XSIZE_HIMETRIC cxSrc, + [in] OLE_YSIZE_HIMETRIC cySrc, + [in] void *prcWBounds); + + [propput] HRESULT hPal([in] OLE_HANDLE phpal); + + [propget] HRESULT CurDC([out, retval] int *phdcOut); + + HRESULT SelectPicture([in] int hdcIn, + [out] int *phdcOut, + [out] OLE_HANDLE *phbmpOut); + + [propget] HRESULT KeepOriginalFormat([out, retval] VARIANT_BOOL *pfkeep); + [propput] HRESULT KeepOriginalFormat([in] VARIANT_BOOL pfkeep); + + HRESULT PictureChanged(); + + HRESULT SaveAsFile([in] void *pstm, + [in] VARIANT_BOOL fSaveMemCopy, + [out] long *pcbSize); + + [propget] HRESULT Attributes([out, retval] long *pdwAttr); + + HRESULT SetHdc([in] OLE_HANDLE hdc); + }; + + [ + uuid(7BF80981-BF32-101A-8BBB-00AA00300CAB) + ] + dispinterface Picture { + properties: + [id(DISPID_PICT_HANDLE), readonly] OLE_HANDLE Handle; + [id(DISPID_PICT_HPAL)] OLE_HANDLE hPal; + [id(DISPID_PICT_TYPE), readonly] short Type; + [id(DISPID_PICT_WIDTH), readonly] OLE_XSIZE_HIMETRIC Width; + [id(DISPID_PICT_HEIGHT), readonly] OLE_YSIZE_HIMETRIC Height; + methods: + [id(DISPID_PICT_RENDER)] + void Render(int hdc, + long x, + long y, + long cx, + long cy, + OLE_XPOS_HIMETRIC xSrc, + OLE_YPOS_HIMETRIC ySrc, + OLE_XSIZE_HIMETRIC cxSrc, + OLE_YSIZE_HIMETRIC cySrc, + void *prcWBounds); + }; + + typedef [public] Picture IPictureDisp; + + [ + uuid(0BE35204-8F91-11CE-9DE3-00AA004BB851) + ] + coclass StdPicture { + [default] dispinterface Picture; + interface IPicture; + }; +}; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/scrrun/filesystem.c wine-staging-1.9.3~ubuntu12.04.1/dlls/scrrun/filesystem.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/scrrun/filesystem.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/scrrun/filesystem.c 2016-02-08 19:32:34.000000000 +0000 @@ -3221,9 +3221,27 @@ static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec, VARIANT_BOOL *pfExists) { - FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists); + UINT len; + WCHAR driveletter; + TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists); + + if (!pfExists) return E_POINTER; + + *pfExists = VARIANT_FALSE; + len = SysStringLen(DriveSpec); + + if (len >= 1) { + driveletter = toupperW(DriveSpec[0]); + if (driveletter >= 'A' && driveletter <= 'Z' + && (len < 2 || DriveSpec[1] == ':') + && (len < 3 || DriveSpec[2] == '\\')) { + const WCHAR root[] = {driveletter, ':', '\\', 0}; + UINT drivetype = GetDriveTypeW(root); + *pfExists = drivetype != DRIVE_NO_ROOT_DIR && drivetype != DRIVE_UNKNOWN ? VARIANT_TRUE : VARIANT_FALSE; + } + } - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret) @@ -3254,9 +3272,40 @@ static HRESULT WINAPI filesys_GetDrive(IFileSystem3 *iface, BSTR DriveSpec, IDrive **ppdrive) { - FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive); - - return E_NOTIMPL; + UINT len; + HRESULT hr; + WCHAR driveletter; + VARIANT_BOOL drive_exists; + + TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive); + + if (!ppdrive) + return E_POINTER; + + *ppdrive = NULL; + + /* DriveSpec may be one of: 'x', 'x:', 'x:\', '\\computer\share' */ + len = SysStringLen(DriveSpec); + if (!len) + return E_INVALIDARG; + else if (len <= 3) { + driveletter = toupperW(DriveSpec[0]); + if (driveletter < 'A' || driveletter > 'Z' + || (len >= 2 && DriveSpec[1] != ':') + || (len == 3 && DriveSpec[2] != '\\')) + return E_INVALIDARG; + hr = IFileSystem3_DriveExists(iface, DriveSpec, &drive_exists); + if (FAILED(hr)) + return hr; + if (drive_exists == VARIANT_FALSE) + return CTL_E_DEVICEUNAVAILABLE; + return create_drive(driveletter, ppdrive); + } else { + if (DriveSpec[0] != '\\' || DriveSpec[1] != '\\') + return E_INVALIDARG; + FIXME("%s not implemented yet\n", debugstr_w(DriveSpec)); + return E_NOTIMPL; + } } static HRESULT WINAPI filesys_GetFile(IFileSystem3 *iface, BSTR FilePath, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/scrrun/tests/filesystem.c wine-staging-1.9.3~ubuntu12.04.1/dlls/scrrun/tests/filesystem.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/scrrun/tests/filesystem.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/scrrun/tests/filesystem.c 2016-02-08 19:32:34.000000000 +0000 @@ -59,6 +59,47 @@ DeleteFileW(path); } +static IDrive *get_fixed_drive(void) +{ + IDriveCollection *drives; + IEnumVARIANT *iter; + IDrive *drive; + HRESULT hr; + + hr = IFileSystem3_get_Drives(fs3, &drives); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&iter); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDriveCollection_Release(drives); + + while (1) { + DriveTypeConst type; + VARIANT var; + + hr = IEnumVARIANT_Next(iter, 1, &var, NULL); + if (hr == S_FALSE) { + drive = NULL; + break; + } + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IDrive, (void**)&drive); + ok(hr == S_OK, "got 0x%08x\n", hr); + VariantClear(&var); + + hr = IDrive_get_DriveType(drive, &type); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (type == Fixed) + break; + + IDrive_Release(drive); + } + + IEnumVARIANT_Release(iter); + return drive; +} + static void test_interfaces(void) { static const WCHAR nonexistent_dirW[] = { @@ -1790,6 +1831,83 @@ SysFreeString(nameW); } +struct driveexists_test { + const WCHAR drivespec[10]; + const INT drivetype; + const VARIANT_BOOL expected_ret; +}; + +/* If 'drivetype' != -1, the first character of 'drivespec' will be replaced + * with the drive letter of a drive of this type. If such a drive does not exist, + * the test will be skipped. */ +static const struct driveexists_test driveexiststestdata[] = { + { {'N',':','\\',0}, DRIVE_NO_ROOT_DIR, VARIANT_FALSE }, + { {'R',':','\\',0}, DRIVE_REMOVABLE, VARIANT_TRUE }, + { {'F',':','\\',0}, DRIVE_FIXED, VARIANT_TRUE }, + { {'F',':',0}, DRIVE_FIXED, VARIANT_TRUE }, + { {'F','?',0}, DRIVE_FIXED, VARIANT_FALSE }, + { {'F',0}, DRIVE_FIXED, VARIANT_TRUE }, + { {'?',0}, -1, VARIANT_FALSE }, + { { 0 } } +}; + +static void test_DriveExists(void) +{ + const struct driveexists_test *ptr = driveexiststestdata; + HRESULT hr; + VARIANT_BOOL ret; + BSTR drivespec; + WCHAR root[] = {'?',':','\\',0}; + + hr = IFileSystem3_DriveExists(fs3, NULL, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + ret = VARIANT_TRUE; + hr = IFileSystem3_DriveExists(fs3, NULL, &ret); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(ret == VARIANT_FALSE, "got %x\n", ret); + + drivespec = SysAllocString(root); + hr = IFileSystem3_DriveExists(fs3, drivespec, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + SysFreeString(drivespec); + + for (; *ptr->drivespec; ptr++) { + drivespec = SysAllocString(ptr->drivespec); + if (ptr->drivetype != -1) { + for (root[0] = 'A'; root[0] <= 'Z'; root[0]++) + if (GetDriveTypeW(root) == ptr->drivetype) + break; + if (root[0] > 'Z') { + skip("No drive with type 0x%x found, skipping test %s.\n", + ptr->drivetype, wine_dbgstr_w(ptr->drivespec)); + SysFreeString(drivespec); + continue; + } + + /* Test both upper and lower case drive letters. */ + drivespec[0] = root[0]; + ret = ptr->expected_ret == VARIANT_TRUE ? VARIANT_FALSE : VARIANT_TRUE; + hr = IFileSystem3_DriveExists(fs3, drivespec, &ret); + ok(hr == S_OK, "got 0x%08x for drive spec %s (%s)\n", + hr, wine_dbgstr_w(drivespec), wine_dbgstr_w(ptr->drivespec)); + ok(ret == ptr->expected_ret, "got %d, expected %d for drive spec %s (%s)\n", + ret, ptr->expected_ret, wine_dbgstr_w(drivespec), wine_dbgstr_w(ptr->drivespec)); + + drivespec[0] = tolower(root[0]); + } + + ret = ptr->expected_ret == VARIANT_TRUE ? VARIANT_FALSE : VARIANT_TRUE; + hr = IFileSystem3_DriveExists(fs3, drivespec, &ret); + ok(hr == S_OK, "got 0x%08x for drive spec %s (%s)\n", + hr, wine_dbgstr_w(drivespec), wine_dbgstr_w(ptr->drivespec)); + ok(ret == ptr->expected_ret, "got %d, expected %d for drive spec %s (%s)\n", + ret, ptr->expected_ret, wine_dbgstr_w(drivespec), wine_dbgstr_w(ptr->drivespec)); + + SysFreeString(drivespec); + } +} + struct getdrivename_test { const WCHAR path[10]; const WCHAR drive[5]; @@ -1835,44 +1953,105 @@ } } -static void test_SerialNumber(void) +struct getdrive_test { + const WCHAR drivespec[12]; + HRESULT res; + const WCHAR driveletter[2]; +}; + +static void test_GetDrive(void) { - IDriveCollection *drives; - IEnumVARIANT *iter; - IDrive *drive; - LONG serial; HRESULT hr; - BSTR name; + IDrive *drive_fixed, *drive; + BSTR dl_fixed, drivespec; + WCHAR root[] = {'?',':','\\',0}; - hr = IFileSystem3_get_Drives(fs3, &drives); - ok(hr == S_OK, "got 0x%08x\n", hr); + drive = (void*)0xdeadbeef; + hr = IFileSystem3_GetDrive(fs3, NULL, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + ok(drive == (void*)0xdeadbeef, "got %p\n", drive); - hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&iter); - ok(hr == S_OK, "got 0x%08x\n", hr); - IDriveCollection_Release(drives); + for (root[0] = 'A'; root[0] <= 'Z'; root[0]++) + if (GetDriveTypeW(root) == DRIVE_NO_ROOT_DIR) + break; - while (1) { - DriveTypeConst type; - VARIANT var; + if (root[0] > 'Z') + skip("All drive letters are occupied, skipping test for nonexisting drive.\n"); + else { + drivespec = SysAllocString(root); + drive = (void*)0xdeadbeef; + hr = IFileSystem3_GetDrive(fs3, drivespec, &drive); + ok(hr == CTL_E_DEVICEUNAVAILABLE, "got 0x%08x\n", hr); + ok(drive == NULL, "got %p\n", drive); + SysFreeString(drivespec); + } - hr = IEnumVARIANT_Next(iter, 1, &var, NULL); - if (hr == S_FALSE) { - skip("No fixed drive found, skipping test.\n"); - IEnumVARIANT_Release(iter); - return; - } - ok(hr == S_OK, "got 0x%08x\n", hr); + drive_fixed = get_fixed_drive(); + if (!drive_fixed) { + skip("No fixed drive found, skipping test.\n"); + return; + } - hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IDrive, (void**)&drive); - ok(hr == S_OK, "got 0x%08x\n", hr); - VariantClear(&var); + hr = IDrive_get_DriveLetter(drive_fixed, &dl_fixed); + ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDrive_get_DriveType(drive, &type); - ok(hr == S_OK, "got 0x%08x\n", hr); - if (type == Fixed) - break; + if (FAILED(hr)) + skip("Could not retrieve drive letter of fixed drive, skipping test.\n"); + else { + WCHAR dl_upper = toupper(dl_fixed[0]); + WCHAR dl_lower = tolower(dl_fixed[0]); + struct getdrive_test testdata[] = { + { {dl_upper,0}, S_OK, {dl_upper,0} }, + { {dl_upper,':',0}, S_OK, {dl_upper,0} }, + { {dl_upper,':','\\',0}, S_OK, {dl_upper,0} }, + { {dl_lower,':','\\',0}, S_OK, {dl_upper,0} }, + { {dl_upper,'\\',0}, E_INVALIDARG, { 0 } }, + { {dl_lower,'\\',0}, E_INVALIDARG, { 0 } }, + { {'$',':','\\',0}, E_INVALIDARG, { 0 } }, + { {'\\','h','o','s','t','\\','s','h','a','r','e',0}, E_INVALIDARG, { 0 } }, + { {'h','o','s','t','\\','s','h','a','r','e',0}, E_INVALIDARG, { 0 } }, + { { 0 } }, + }; + struct getdrive_test *ptr = &testdata[0]; + + for (; *ptr->drivespec; ptr++) { + drivespec = SysAllocString(ptr->drivespec); + drive = (void*)0xdeadbeef; + hr = IFileSystem3_GetDrive(fs3, drivespec, &drive); + ok(hr == ptr->res, "got 0x%08x, expected 0x%08x for drive spec %s\n", + hr, ptr->res, wine_dbgstr_w(ptr->drivespec)); + ok(!lstrcmpW(ptr->drivespec, drivespec), "GetDrive modified its DriveSpec argument\n"); + SysFreeString(drivespec); + + if (*ptr->driveletter) { + BSTR driveletter; + hr = IDrive_get_DriveLetter(drive, &driveletter); + ok(hr == S_OK, "got 0x%08x for drive spec %s\n", hr, wine_dbgstr_w(ptr->drivespec)); + if (SUCCEEDED(hr)) { + ok(!lstrcmpW(ptr->driveletter, driveletter), "got %s, expected %s for drive spec %s\n", + wine_dbgstr_w(driveletter), wine_dbgstr_w(ptr->driveletter), + wine_dbgstr_w(ptr->drivespec)); + SysFreeString(driveletter); + } + IDrive_Release(drive); + } else + ok(drive == NULL, "got %p for drive spec %s\n", drive, wine_dbgstr_w(ptr->drivespec)); + } + SysFreeString(dl_fixed); + } +} - IDrive_Release(drive); +static void test_SerialNumber(void) +{ + IDrive *drive; + LONG serial; + HRESULT hr; + BSTR name; + + drive = get_fixed_drive(); + if (!drive) { + skip("No fixed drive found, skipping test.\n"); + return; } hr = IDrive_get_SerialNumber(drive, NULL); @@ -1902,7 +2081,6 @@ SysFreeString(name); IDrive_Release(drive); - IEnumVARIANT_Release(iter); } static const struct extension_test { @@ -2019,7 +2197,9 @@ test_WriteLine(); test_ReadAll(); test_Read(); + test_DriveExists(); test_GetDriveName(); + test_GetDrive(); test_SerialNumber(); test_GetExtensionName(); test_GetSpecialFolder(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/shell32/shfldr_unixfs.c wine-staging-1.9.3~ubuntu12.04.1/dlls/shell32/shfldr_unixfs.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/shell32/shfldr_unixfs.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/shell32/shfldr_unixfs.c 2016-02-08 19:32:34.000000000 +0000 @@ -1123,24 +1123,24 @@ } static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT cidl, - LPCITEMIDLIST* apidl, SFGAOF* rgfInOut) + LPCITEMIDLIST* apidl, SFGAOF* attrs) { UnixFolder *This = impl_from_IShellFolder2(iface); HRESULT hr = S_OK; - TRACE("(%p)->(%u %p %p)\n", This, cidl, apidl, rgfInOut); + TRACE("(%p)->(%u %p %p)\n", This, cidl, apidl, attrs); - if (!rgfInOut || (cidl && !apidl)) + if (!attrs || (cidl && !apidl)) return E_INVALIDARG; if (cidl == 0) { - *rgfInOut &= This->m_dwAttributes; + *attrs &= This->m_dwAttributes; } else { char szAbsolutePath[FILENAME_MAX], *pszRelativePath; UINT i; - *rgfInOut = SFGAO_CANCOPY|SFGAO_CANMOVE|SFGAO_CANLINK|SFGAO_CANRENAME|SFGAO_CANDELETE| - SFGAO_HASPROPSHEET|SFGAO_DROPTARGET|SFGAO_FILESYSTEM; + *attrs = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK | SFGAO_CANRENAME | SFGAO_CANDELETE | + SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSTEM; lstrcpyA(szAbsolutePath, This->m_pszPath); pszRelativePath = szAbsolutePath + lstrlenA(szAbsolutePath); for (i=0; i= sizeof(encoded)/2) { - if (str[strlen(str)-1] == '"') - strcat(str, ", "); - strcat(str, name); - strcat(str, "=\""); - strcat(str, param); - strcat(str, "\""); + fprintf(stderr, "string is too long!\n"); + assert(0); } + ptr = encoded; + for (i = 0; i < len; i++) + sprintf(&ptr[i * 2], "%02x", (unsigned char)str[i]); + ptr[2 * len] = '\0'; + return ptr; } -static int _todo_wait = 0; -#define todo_wait for (_todo_wait = 1; _todo_wait; _todo_wait = 0) - -static char shell_call[2048]=""; -static int bad_shellexecute = 0; -static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR filename, LPCSTR parameters, LPCSTR directory) +static unsigned decode_char(char c) { - INT_PTR rc, rcEmpty = 0; - - if(!verb) - rcEmpty = shell_execute_(file, line, "", filename, parameters, directory); - - strcpy(shell_call, "ShellExecute("); - strcat_param(shell_call, "verb", verb); - strcat_param(shell_call, "file", filename); - strcat_param(shell_call, "params", parameters); - strcat_param(shell_call, "dir", directory); - strcat(shell_call, ")"); - if (winetest_debug > 1) - trace_(file, line)("Called %s\n", shell_call); - - DeleteFileA(child_file); - SetLastError(0xcafebabe); - - /* FIXME: We cannot use ShellExecuteEx() here because if there is no - * association it displays the 'Open With' dialog and I could not find - * a flag to prevent this. - */ - rc=(INT_PTR)ShellExecuteA(NULL, verb, filename, parameters, directory, SW_HIDE); + if (c >= '0' && c <= '9') return c - '0'; + if (c >= 'a' && c <= 'f') return c - 'a' + 10; + assert(c >= 'A' && c <= 'F'); + return c - 'A' + 10; +} - if (rc > 32) - { - int wait_rc; - wait_rc=WaitForSingleObject(hEvent, 5000); - if (wait_rc == WAIT_TIMEOUT) - { - HWND wnd = FindWindowA("#32770", "Windows"); - if (!wnd) - wnd = FindWindowA("Shell_Flyout", ""); - if (wnd != NULL) - { - SendMessageA(wnd, WM_CLOSE, 0, 0); - win_skip("Skipping shellexecute of file with unassociated extension\n"); - skip_noassoc_tests = TRUE; - rc = SE_ERR_NOASSOC; - } - } - if (!_todo_wait) - ok_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32, - "%s WaitForSingleObject returned %d\n", shell_call, wait_rc); - else todo_wine - ok_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32, - "%s WaitForSingleObject returned %d\n", shell_call, wait_rc); - } - /* The child process may have changed the result file, so let profile - * functions know about it - */ - WritePrivateProfileStringA(NULL, NULL, NULL, child_file); - if (rc > 32) - dump_child_(file, line); +static char* decodeA(const char* str) +{ + static char decoded[1024]; + char* ptr; + size_t len,i; - if(!verb) + len = strlen(str) / 2; + if (!len--) return NULL; + if (len >= sizeof(decoded)) { - if (rc != rcEmpty && rcEmpty == SE_ERR_NOASSOC) /* NT4 */ - bad_shellexecute = 1; - ok_(file, line)(rc == rcEmpty || broken(rc != rcEmpty && rcEmpty == SE_ERR_NOASSOC) /* NT4 */, - "%s Got different return value with empty string: %lu %lu\n", shell_call, rc, rcEmpty); + fprintf(stderr, "string is too long!\n"); + assert(0); } - - return rc; + ptr = decoded; + for (i = 0; i < len; i++) + ptr[i] = (decode_char(str[2 * i]) << 4) | decode_char(str[2 * i + 1]); + ptr[len] = '\0'; + return ptr; } -#define shell_execute(verb, filename, parameters, directory) \ - shell_execute_(__FILE__, __LINE__, verb, filename, parameters, directory) -static INT_PTR shell_execute_ex_(const char* file, int line, - DWORD mask, LPCSTR verb, LPCSTR filename, - LPCSTR parameters, LPCSTR directory, - LPCSTR class) +static void WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...) { - char smask[11]; - SHELLEXECUTEINFOA sei; - BOOL success; - INT_PTR rc; - - /* Add some flags so we can wait for the child process */ - mask |= SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE; - - strcpy(shell_call, "ShellExecuteEx("); - sprintf(smask, "0x%x", mask); - strcat_param(shell_call, "mask", smask); - strcat_param(shell_call, "verb", verb); - strcat_param(shell_call, "file", filename); - strcat_param(shell_call, "params", parameters); - strcat_param(shell_call, "dir", directory); - strcat_param(shell_call, "class", class); - strcat(shell_call, ")"); - if (winetest_debug > 1) - trace_(file, line)("Called %s\n", shell_call); - - sei.cbSize=sizeof(sei); - sei.fMask=mask; - sei.hwnd=NULL; - sei.lpVerb=verb; - sei.lpFile=filename; - sei.lpParameters=parameters; - sei.lpDirectory=directory; - sei.nShow=SW_SHOWNORMAL; - sei.hInstApp=NULL; /* Out */ - sei.lpIDList=NULL; - sei.lpClass=class; - sei.hkeyClass=NULL; - sei.dwHotKey=0; - U(sei).hIcon=NULL; - sei.hProcess=(HANDLE)0xdeadbeef; /* Out */ - - DeleteFileA(child_file); - SetLastError(0xcafebabe); - success=ShellExecuteExA(&sei); - rc=(INT_PTR)sei.hInstApp; - ok_(file, line)((success && rc > 32) || (!success && rc <= 32), - "%s rc=%d and hInstApp=%ld is not allowed\n", shell_call, success, rc); + va_list valist; + char buffer[1024]; + DWORD w; - if (rc > 32) - { - int wait_rc; - if (sei.hProcess!=NULL) - { - wait_rc=WaitForSingleObject(sei.hProcess, 5000); - ok_(file, line)(wait_rc==WAIT_OBJECT_0, "WaitForSingleObject(hProcess) returned %d\n", wait_rc); - } - wait_rc=WaitForSingleObject(hEvent, 5000); - if (!_todo_wait) - ok_(file, line)(wait_rc==WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", wait_rc); - else todo_wine - ok_(file, line)(wait_rc==WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", wait_rc); - } - else - ok_(file, line)(sei.hProcess==NULL, "%s returned a process handle %p\n", shell_call, sei.hProcess); + va_start(valist, fmt); + vsprintf(buffer, fmt, valist); + va_end(valist); + WriteFile(h, buffer, strlen(buffer), &w, NULL); +} - /* The child process may have changed the result file, so let profile - * functions know about it - */ - WritePrivateProfileStringA(NULL, NULL, NULL, child_file); - if (rc > 32) - dump_child_(file, line); +static char* getChildString(const char* sect, const char* key) +{ + char buf[1024]; + char* ret; - return rc; + GetPrivateProfileStringA(sect, key, "-", buf, sizeof(buf), child_file); + if (buf[0] == '\0' || (buf[0] == '-' && buf[1] == '\0')) return NULL; + assert(!(strlen(buf) & 1)); + ret = decodeA(buf); + return ret; } -#define shell_execute_ex(mask, verb, filename, parameters, directory, class) \ - shell_execute_ex_(__FILE__, __LINE__, mask, verb, filename, parameters, directory, class) /*** * - * Functions to create / delete associations wrappers + * Child code * ***/ -static BOOL create_test_association(const char* extension) -{ - HKEY hkey, hkey_shell; - char class[MAX_PATH]; - LONG rc; - - sprintf(class, "shlexec%s", extension); - rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey, NULL); - ok(rc == ERROR_SUCCESS || rc == ERROR_ACCESS_DENIED, - "could not create association %s (rc=%d)\n", class, rc); - if (rc != ERROR_SUCCESS) - return FALSE; +static DWORD ddeInst; +static HSZ hszTopic; +static char ddeExec[MAX_PATH], ddeApplication[MAX_PATH]; +static BOOL post_quit_on_execute; - rc=RegSetValueExA(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1); - ok(rc==ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); - CloseHandle(hkey); +/* Handle DDE for doChild() and test_dde_default_app() */ +static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv, + HSZ hsz1, HSZ hsz2, HDDEDATA hData, + ULONG_PTR dwData1, ULONG_PTR dwData2) +{ + DWORD size = 0; - rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, class, 0, NULL, 0, - KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL); - ok(rc==ERROR_SUCCESS, "RegCreateKeyEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); + if (winetest_debug > 2) + trace("dde_cb: %04x, %04x, %p, %p, %p, %p, %08lx, %08lx\n", + uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2); - rc=RegCreateKeyExA(hkey, "shell", 0, NULL, 0, - KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL); - ok(rc==ERROR_SUCCESS, "RegCreateKeyEx 'shell' failed, expected ERROR_SUCCESS, got %d\n", rc); + switch (uType) + { + case XTYP_CONNECT: + if (!DdeCmpStringHandles(hsz1, hszTopic)) + { + size = DdeQueryStringA(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI); + ok(size < MAX_PATH, "got size %d\n", size); + assert(size < MAX_PATH); + return (HDDEDATA)TRUE; + } + return (HDDEDATA)FALSE; - CloseHandle(hkey); - CloseHandle(hkey_shell); + case XTYP_EXECUTE: + size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0); + ok(size < MAX_PATH, "got size %d\n", size); + assert(size < MAX_PATH); + DdeFreeDataHandle(hData); + if (post_quit_on_execute) + PostQuitMessage(0); + return (HDDEDATA)DDE_FACK; - return TRUE; + default: + return NULL; + } } -/* Based on RegDeleteTreeW from dlls/advapi32/registry.c */ -static LSTATUS myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey) +static HANDLE hEvent; +static void init_event(const char* child_file) { - LONG ret; - DWORD dwMaxSubkeyLen, dwMaxValueLen; - DWORD dwMaxLen, dwSize; - CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; - HKEY hSubKey = hKey; - - if(lpszSubKey) - { - ret = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); - if (ret) return ret; - } - - /* Get highest length for keys, values */ - ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL, - &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); - if (ret) goto cleanup; - - dwMaxSubkeyLen++; - dwMaxValueLen++; - dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); - if (dwMaxLen > sizeof(szNameBuf)/sizeof(CHAR)) - { - /* Name too big: alloc a buffer for it */ - if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR)))) - { - ret = ERROR_NOT_ENOUGH_MEMORY; - goto cleanup; - } - } - - - /* Recursively delete all the subkeys */ - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL, - NULL, NULL, NULL)) break; - - ret = myRegDeleteTreeA(hSubKey, lpszName); - if (ret) goto cleanup; - } - - if (lpszSubKey) - ret = RegDeleteKeyA(hKey, lpszSubKey); - else - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumValueA(hKey, 0, lpszName, &dwSize, - NULL, NULL, NULL, NULL)) break; - - ret = RegDeleteValueA(hKey, lpszName); - if (ret) goto cleanup; - } - -cleanup: - /* Free buffer if allocated */ - if (lpszName != szNameBuf) - HeapFree( GetProcessHeap(), 0, lpszName); - if(lpszSubKey) - RegCloseKey(hSubKey); - return ret; + char* event_name; + event_name=strrchr(child_file, '\\')+1; + hEvent=CreateEventA(NULL, FALSE, FALSE, event_name); } -static void delete_test_association(const char* extension) +/* + * This is just to make sure the child won't run forever stuck in a + * GetMessage() loop when DDE fails for some reason. + */ +static void CALLBACK childTimeout(HWND wnd, UINT msg, UINT_PTR timer, DWORD time) { - char class[MAX_PATH]; + trace("childTimeout called\n"); - sprintf(class, "shlexec%s", extension); - myRegDeleteTreeA(HKEY_CLASSES_ROOT, class); - myRegDeleteTreeA(HKEY_CLASSES_ROOT, extension); + PostQuitMessage(0); } -static void create_test_verb_dde(const char* extension, const char* verb, - int rawcmd, const char* cmdtail, const char *ddeexec, - const char *application, const char *topic, - const char *ifexec) +static void doChild(int argc, char** argv) { - HKEY hkey_shell, hkey_verb, hkey_cmd; - char shell[MAX_PATH]; - char* cmd; - LONG rc; - - sprintf(shell, "shlexec%s\\shell", extension); - rc=RegOpenKeyExA(HKEY_CLASSES_ROOT, shell, 0, - KEY_CREATE_SUB_KEY, &hkey_shell); - ok(rc == ERROR_SUCCESS, "%s key creation failed with %d\n", shell, rc); - - rc=RegCreateKeyExA(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY, - NULL, &hkey_verb, NULL); - ok(rc == ERROR_SUCCESS, "%s verb key creation failed with %d\n", verb, rc); + char *filename, buffer[MAX_PATH]; + HANDLE hFile, map; + int i; + UINT_PTR timer; - rc=RegCreateKeyExA(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_cmd, NULL); - ok(rc == ERROR_SUCCESS, "\'command\' key creation failed with %d\n", rc); + filename=argv[2]; + hFile=CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + if (hFile == INVALID_HANDLE_VALUE) + return; - if (rawcmd) + /* Arguments */ + childPrintf(hFile, "[Child]\r\n"); + if (winetest_debug > 2) { - rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1); + trace("cmdlineA='%s'\n", GetCommandLineA()); + trace("argcA=%d\n", argc); } - else + childPrintf(hFile, "cmdlineA=%s\r\n", encodeA(GetCommandLineA())); + childPrintf(hFile, "argcA=%d\r\n", argc); + for (i = 0; i < argc; i++) { - cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1); - sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail); - rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1); - ok(rc == ERROR_SUCCESS, "setting command failed with %d\n", rc); - HeapFree(GetProcessHeap(), 0, cmd); + if (winetest_debug > 2) + trace("argvA%d='%s'\n", i, argv[i]); + childPrintf(hFile, "argvA%d=%s\r\n", i, encodeA(argv[i])); } + GetModuleFileNameA(GetModuleHandleA(NULL), buffer, sizeof(buffer)); + childPrintf(hFile, "longPath=%s\r\n", encodeA(buffer)); - if (ddeexec) + /* Check environment variable inheritance */ + *buffer = '\0'; + SetLastError(0); + GetEnvironmentVariableA("ShlexecVar", buffer, sizeof(buffer)); + childPrintf(hFile, "ShlexecVarLE=%d\r\n", GetLastError()); + childPrintf(hFile, "ShlexecVar=%s\r\n", encodeA(buffer)); + + map = OpenFileMappingA(FILE_MAP_READ, FALSE, "winetest_shlexec_dde_map"); + if (map != NULL) { - HKEY hkey_ddeexec, hkey_application, hkey_topic, hkey_ifexec; + HANDLE dde_ready; + char *shared_block = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 4096); + CloseHandle(map); + if (shared_block[0] != '\0' || shared_block[1] != '\0') + { + HDDEDATA hdde; + HSZ hszApplication; + MSG msg; + UINT rc; - rc=RegCreateKeyExA(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE | - KEY_CREATE_SUB_KEY, NULL, &hkey_ddeexec, NULL); - ok(rc == ERROR_SUCCESS, "\'ddeexec\' key creation failed with %d\n", rc); - rc=RegSetValueExA(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec, - strlen(ddeexec)+1); - ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); + post_quit_on_execute = TRUE; + ddeInst = 0; + rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | + CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0); + ok(rc == DMLERR_NO_ERROR, "DdeInitializeA() returned %d\n", rc); + hszApplication = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI); + ok(hszApplication != NULL, "DdeCreateStringHandleA(%s) = NULL\n", shared_block); + shared_block += strlen(shared_block) + 1; + hszTopic = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI); + ok(hszTopic != NULL, "DdeCreateStringHandleA(%s) = NULL\n", shared_block); + hdde = DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF); + ok(hdde != NULL, "DdeNameService() failed le=%u\n", GetLastError()); - if (application) - { - rc=RegCreateKeyExA(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_application, NULL); - ok(rc == ERROR_SUCCESS, "\'application\' key creation failed with %d\n", rc); + timer = SetTimer(NULL, 0, 2500, childTimeout); - rc=RegSetValueExA(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application, - strlen(application)+1); - ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); - CloseHandle(hkey_application); - } - if (topic) - { - rc=RegCreateKeyExA(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_topic, NULL); - ok(rc == ERROR_SUCCESS, "\'topic\' key creation failed with %d\n", rc); - rc=RegSetValueExA(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic, - strlen(topic)+1); - ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); - CloseHandle(hkey_topic); + dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); + SetEvent(dde_ready); + CloseHandle(dde_ready); + + while (GetMessageA(&msg, NULL, 0, 0)) + { + if (winetest_debug > 2) + trace("msg %d lParam=%ld wParam=%lu\n", msg.message, msg.lParam, msg.wParam); + DispatchMessageA(&msg); + } + + Sleep(500); + KillTimer(NULL, timer); + hdde = DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER); + ok(hdde != NULL, "DdeNameService() failed le=%u\n", GetLastError()); + ok(DdeFreeStringHandle(ddeInst, hszTopic), "DdeFreeStringHandle(topic)\n"); + ok(DdeFreeStringHandle(ddeInst, hszApplication), "DdeFreeStringHandle(application)\n"); + ok(DdeUninitialize(ddeInst), "DdeUninitialize() failed\n"); } - if (ifexec) + else { - rc=RegCreateKeyExA(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_ifexec, NULL); - ok(rc == ERROR_SUCCESS, "\'ifexec\' key creation failed with %d\n", rc); - rc=RegSetValueExA(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec, - strlen(ifexec)+1); - ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); - CloseHandle(hkey_ifexec); + dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); + SetEvent(dde_ready); + CloseHandle(dde_ready); } - CloseHandle(hkey_ddeexec); + + UnmapViewOfFile(shared_block); + + childPrintf(hFile, "ddeExec=%s\r\n", encodeA(ddeExec)); } - CloseHandle(hkey_shell); - CloseHandle(hkey_verb); - CloseHandle(hkey_cmd); + childPrintf(hFile, "Failures=%d\r\n", winetest_get_failures()); + CloseHandle(hFile); + + init_event(filename); + SetEvent(hEvent); + CloseHandle(hEvent); } -static void create_test_verb(const char* extension, const char* verb, - int rawcmd, const char* cmdtail) +static void dump_child_(const char* file, int line) { - create_test_verb_dde(extension, verb, rawcmd, cmdtail, NULL, NULL, - NULL, NULL); + if (winetest_debug > 1) + { + char key[18]; + char* str; + int i, c; + + str=getChildString("Child", "cmdlineA"); + trace_(file, line)("cmdlineA='%s'\n", str); + c=GetPrivateProfileIntA("Child", "argcA", -1, child_file); + trace_(file, line)("argcA=%d\n",c); + for (i=0;i= sizeof(encoded)/2) + /* Note: if winetest_debug > 1 the ShellExecute() command has already been + * traced. + */ + if (!condition && winetest_debug <= 1 && !shell_call_traced) { - fprintf(stderr, "string is too long!\n"); - assert(0); + printf("Called %s\n", shell_call); + if (*assoc_desc) + printf("%s\n", assoc_desc); + shell_call_traced=1; } - ptr = encoded; - for (i = 0; i < len; i++) - sprintf(&ptr[i * 2], "%02x", (unsigned char)str[i]); - ptr[2 * len] = '\0'; - return ptr; + + va_start(valist, msg); + winetest_vok(condition, msg, valist); + va_end(valist); } +#define okShell_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : _okShell +#define okShell okShell_(__FILE__, __LINE__) -static unsigned decode_char(char c) +void reset_association_description(void) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - assert(c >= 'A' && c <= 'F'); - return c - 'A' + 10; + *assoc_desc = '\0'; } -static char* decodeA(const char* str) +static void okChildString_(const char* file, int line, const char* key, const char* expected, const char* bad) { - static char decoded[1024]; - char* ptr; - size_t len,i; - - len = strlen(str) / 2; - if (!len--) return NULL; - if (len >= sizeof(decoded)) + char* result; + result=getChildString("Child", key); + if (!result) { - fprintf(stderr, "string is too long!\n"); - assert(0); + okShell_(file, line)(FALSE, "%s expected '%s', but key not found or empty\n", key, expected); + return; } - ptr = decoded; - for (i = 0; i < len; i++) - ptr[i] = (decode_char(str[2 * i]) << 4) | decode_char(str[2 * i + 1]); - ptr[len] = '\0'; - return ptr; + okShell_(file, line)(lstrcmpiA(result, expected) == 0 || + broken(lstrcmpiA(result, bad) == 0), + "%s expected '%s', got '%s'\n", key, expected, result); } +#define okChildString(key, expected) okChildString_(__FILE__, __LINE__, (key), (expected), (expected)) +#define okChildStringBroken(key, expected, broken) okChildString_(__FILE__, __LINE__, (key), (expected), (broken)) -static void childPrintf(HANDLE h, const char* fmt, ...) +static int StrCmpPath(const char* s1, const char* s2) { - va_list valist; - char buffer[1024]; - DWORD w; + if (!s1 && !s2) return 0; + if (!s2) return 1; + if (!s1) return -1; + while (*s1) + { + if (!*s2) + { + if (*s1=='.') + s1++; + return (*s1-*s2); + } + if ((*s1=='/' || *s1=='\\') && (*s2=='/' || *s2=='\\')) + { + while (*s1=='/' || *s1=='\\') + s1++; + while (*s2=='/' || *s2=='\\') + s2++; + } + else if (toupper(*s1)==toupper(*s2)) + { + s1++; + s2++; + } + else + { + return (*s1-*s2); + } + } + if (*s2=='.') + s2++; + if (*s2) + return -1; + return 0; +} - va_start(valist, fmt); - vsprintf(buffer, fmt, valist); - va_end(valist); - WriteFile(h, buffer, strlen(buffer), &w, NULL); +static void okChildPath_(const char* file, int line, const char* key, const char* expected) +{ + char* result; + result=getChildString("Child", key); + if (!result) + { + okShell_(file,line)(FALSE, "%s expected '%s', but key not found or empty\n", key, expected); + return; + } + okShell_(file,line)(StrCmpPath(result, expected) == 0, + "%s expected '%s', got '%s'\n", key, expected, result); } +#define okChildPath(key, expected) okChildPath_(__FILE__, __LINE__, (key), (expected)) -static DWORD ddeInst; -static HSZ hszTopic; -static char ddeExec[MAX_PATH], ddeApplication[MAX_PATH]; -static BOOL post_quit_on_execute; +static void okChildInt_(const char* file, int line, const char* key, int expected) +{ + INT result; + result=GetPrivateProfileIntA("Child", key, expected, child_file); + okShell_(file,line)(result == expected, + "%s expected %d, but got %d\n", key, expected, result); +} +#define okChildInt(key, expected) okChildInt_(__FILE__, __LINE__, (key), (expected)) -static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hData, - ULONG_PTR dwData1, ULONG_PTR dwData2) +static void okChildIntBroken_(const char* file, int line, const char* key, int expected) { - DWORD size = 0; + INT result; + result=GetPrivateProfileIntA("Child", key, expected, child_file); + okShell_(file,line)(result == expected || broken(result != expected), + "%s expected %d, but got %d\n", key, expected, result); +} +#define okChildIntBroken(key, expected) okChildIntBroken_(__FILE__, __LINE__, (key), (expected)) - if (winetest_debug > 2) - trace("dde_cb: %04x, %04x, %p, %p, %p, %p, %08lx, %08lx\n", - uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2); - switch (uType) +/*** + * + * ShellExecute wrappers + * + ***/ + +static void strcat_param(char* str, const char* name, const char* param) +{ + if (param) { - case XTYP_CONNECT: - if (!DdeCmpStringHandles(hsz1, hszTopic)) + if (str[strlen(str)-1] == '"') + strcat(str, ", "); + strcat(str, name); + strcat(str, "=\""); + strcat(str, param); + strcat(str, "\""); + } +} + +static int _todo_wait = 0; +#define todo_wait for (_todo_wait = 1; _todo_wait; _todo_wait = 0) + +static int bad_shellexecute = 0; + +static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR filename, LPCSTR parameters, LPCSTR directory) +{ + INT_PTR rc, rcEmpty = 0; + + if(!verb) + rcEmpty = shell_execute_(file, line, "", filename, parameters, directory); + + shell_call_traced=0; + strcpy(shell_call, "ShellExecute("); + strcat_param(shell_call, "verb", verb); + strcat_param(shell_call, "file", filename); + strcat_param(shell_call, "params", parameters); + strcat_param(shell_call, "dir", directory); + strcat(shell_call, ")"); + if (winetest_debug > 1) + { + trace_(file, line)("Called %s\n", shell_call); + if (*assoc_desc) + trace_(file, line)("%s\n", assoc_desc); + shell_call_traced=1; + } + + DeleteFileA(child_file); + SetLastError(0xcafebabe); + + /* FIXME: We cannot use ShellExecuteEx() here because if there is no + * association it displays the 'Open With' dialog and I could not find + * a flag to prevent this. + */ + rc=(INT_PTR)ShellExecuteA(NULL, verb, filename, parameters, directory, SW_HIDE); + + if (rc > 32) + { + int wait_rc; + wait_rc=WaitForSingleObject(hEvent, 5000); + if (wait_rc == WAIT_TIMEOUT) + { + HWND wnd = FindWindowA("#32770", "Windows"); + if (!wnd) + wnd = FindWindowA("Shell_Flyout", ""); + if (wnd != NULL) { - size = DdeQueryStringA(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI); - ok(size < MAX_PATH, "got size %d\n", size); - assert(size < MAX_PATH); - return (HDDEDATA)TRUE; + SendMessageA(wnd, WM_CLOSE, 0, 0); + win_skip("Skipping shellexecute of file with unassociated extension\n"); + skip_noassoc_tests = TRUE; + rc = SE_ERR_NOASSOC; } - return (HDDEDATA)FALSE; - - case XTYP_EXECUTE: - size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0); - ok(size < MAX_PATH, "got size %d\n", size); - assert(size < MAX_PATH); - DdeFreeDataHandle(hData); - if (post_quit_on_execute) - PostQuitMessage(0); - return (HDDEDATA)DDE_FACK; + } + if (!_todo_wait) + okShell_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32, + "WaitForSingleObject returned %d\n", wait_rc); + else todo_wine + okShell_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32, + "WaitForSingleObject returned %d\n", wait_rc); + } + /* The child process may have changed the result file, so let profile + * functions know about it + */ + WritePrivateProfileStringA(NULL, NULL, NULL, child_file); + if (GetFileAttributesA(child_file) != INVALID_FILE_ATTRIBUTES) + { + int c; + dump_child_(file, line); + c = GetPrivateProfileIntA("Child", "Failures", -1, child_file); + if (c > 0) + winetest_add_failures(c); + okChildInt_(file, line, "ShlexecVarLE", 0); + okChildString_(file, line, "ShlexecVar", "Present", "Present"); + } - default: - return NULL; + if(!verb) + { + if (rc != rcEmpty && rcEmpty == SE_ERR_NOASSOC) /* NT4 */ + bad_shellexecute = 1; + okShell_(file, line)(rc == rcEmpty || + broken(rc != rcEmpty && rcEmpty == SE_ERR_NOASSOC) /* NT4 */, + "Got different return value with empty string: %lu %lu\n", rc, rcEmpty); } + + return rc; } +#define shell_execute(verb, filename, parameters, directory) \ + shell_execute_(__FILE__, __LINE__, verb, filename, parameters, directory) -/* - * This is just to make sure the child won't run forever stuck in a GetMessage() - * loop when DDE fails for some reason. - */ -static void CALLBACK childTimeout(HWND wnd, UINT msg, UINT_PTR timer, DWORD time) +static INT_PTR shell_execute_ex_(const char* file, int line, + DWORD mask, LPCSTR verb, LPCSTR filename, + LPCSTR parameters, LPCSTR directory, + LPCSTR class) { - trace("childTimeout called\n"); + char smask[11]; + SHELLEXECUTEINFOA sei; + BOOL success; + INT_PTR rc; - PostQuitMessage(0); + /* Add some flags so we can wait for the child process */ + mask |= SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE; + + shell_call_traced=0; + strcpy(shell_call, "ShellExecuteEx("); + sprintf(smask, "0x%x", mask); + strcat_param(shell_call, "mask", smask); + strcat_param(shell_call, "verb", verb); + strcat_param(shell_call, "file", filename); + strcat_param(shell_call, "params", parameters); + strcat_param(shell_call, "dir", directory); + strcat_param(shell_call, "class", class); + strcat(shell_call, ")"); + if (winetest_debug > 1) + { + trace_(file, line)("Called %s\n", shell_call); + if (*assoc_desc) + trace_(file, line)("%s\n", assoc_desc); + shell_call_traced=1; + } + + sei.cbSize=sizeof(sei); + sei.fMask=mask; + sei.hwnd=NULL; + sei.lpVerb=verb; + sei.lpFile=filename; + sei.lpParameters=parameters; + sei.lpDirectory=directory; + sei.nShow=SW_SHOWNORMAL; + sei.hInstApp=NULL; /* Out */ + sei.lpIDList=NULL; + sei.lpClass=class; + sei.hkeyClass=NULL; + sei.dwHotKey=0; + U(sei).hIcon=NULL; + sei.hProcess=(HANDLE)0xdeadbeef; /* Out */ + + DeleteFileA(child_file); + SetLastError(0xcafebabe); + success=ShellExecuteExA(&sei); + rc=(INT_PTR)sei.hInstApp; + okShell_(file, line)((success && rc > 32) || (!success && rc <= 32), + "rc=%d and hInstApp=%ld is not allowed\n", + success, rc); + + if (rc > 32) + { + DWORD wait_rc, rc; + if (sei.hProcess!=NULL) + { + wait_rc=WaitForSingleObject(sei.hProcess, 5000); + okShell_(file, line)(wait_rc==WAIT_OBJECT_0, + "WaitForSingleObject(hProcess) returned %d\n", + wait_rc); + wait_rc = GetExitCodeProcess(sei.hProcess, &rc); + okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%u\n", GetLastError()); + if (!_todo_wait) + okShell_(file, line)(rc == 0, "child returned %u\n", rc); + else todo_wine + okShell_(file, line)(rc == 0, "child returned %u\n", rc); + CloseHandle(sei.hProcess); + } + wait_rc=WaitForSingleObject(hEvent, 5000); + if (!_todo_wait) + okShell_(file, line)(wait_rc==WAIT_OBJECT_0, + "WaitForSingleObject returned %d\n", wait_rc); + else todo_wine + okShell_(file, line)(wait_rc==WAIT_OBJECT_0, + "WaitForSingleObject returned %d\n", wait_rc); + } + else + okShell_(file, line)(sei.hProcess==NULL, + "returned a process handle %p\n", sei.hProcess); + + /* The child process may have changed the result file, so let profile + * functions know about it + */ + WritePrivateProfileStringA(NULL, NULL, NULL, child_file); + if (GetFileAttributesA(child_file) != INVALID_FILE_ATTRIBUTES) + { + int c; + dump_child_(file, line); + c = GetPrivateProfileIntA("Child", "Failures", -1, child_file); + if (c > 0) + winetest_add_failures(c); + okChildInt_(file, line, "ShlexecVarLE", 0); + okChildString_(file, line, "ShlexecVar", "Present", "Present"); + } + + return rc; } +#define shell_execute_ex(mask, verb, filename, parameters, directory, class) \ + shell_execute_ex_(__FILE__, __LINE__, mask, verb, filename, parameters, directory, class) -static void doChild(int argc, char** argv) + +/*** + * + * Functions to create / delete associations wrappers + * + ***/ + +static BOOL create_test_association(const char* extension) { - char *filename, longpath[MAX_PATH] = ""; - HANDLE hFile, map; - int i; - int rc; - HSZ hszApplication; - UINT_PTR timer; - HANDLE dde_ready; - MSG msg; - char *shared_block; + HKEY hkey, hkey_shell; + char class[MAX_PATH]; + LONG rc; - filename=argv[2]; - hFile=CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - if (hFile == INVALID_HANDLE_VALUE) - return; + sprintf(class, "shlexec%s", extension); + rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey, NULL); + ok(rc == ERROR_SUCCESS || rc == ERROR_ACCESS_DENIED, + "could not create association %s (rc=%d)\n", class, rc); + if (rc != ERROR_SUCCESS) + return FALSE; + + rc=RegSetValueExA(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1); + ok(rc==ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); + CloseHandle(hkey); + + rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, class, 0, NULL, 0, + KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL); + ok(rc==ERROR_SUCCESS, "RegCreateKeyEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); + + rc=RegCreateKeyExA(hkey, "shell", 0, NULL, 0, + KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL); + ok(rc==ERROR_SUCCESS, "RegCreateKeyEx 'shell' failed, expected ERROR_SUCCESS, got %d\n", rc); + + CloseHandle(hkey); + CloseHandle(hkey_shell); + + return TRUE; +} - /* Arguments */ - childPrintf(hFile, "[Arguments]\r\n"); - if (winetest_debug > 2) - { - trace("cmdlineA='%s'\n", GetCommandLineA()); - trace("argcA=%d\n", argc); - } - childPrintf(hFile, "cmdlineA=%s\r\n", encodeA(GetCommandLineA())); - childPrintf(hFile, "argcA=%d\r\n", argc); - for (i = 0; i < argc; i++) +/* Based on RegDeleteTreeW from dlls/advapi32/registry.c */ +static LSTATUS myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey) +{ + LONG ret; + DWORD dwMaxSubkeyLen, dwMaxValueLen; + DWORD dwMaxLen, dwSize; + CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; + HKEY hSubKey = hKey; + + if(lpszSubKey) { - if (winetest_debug > 2) - trace("argvA%d='%s'\n", i, argv[i]); - childPrintf(hFile, "argvA%d=%s\r\n", i, encodeA(argv[i])); + ret = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); + if (ret) return ret; } - GetModuleFileNameA(GetModuleHandleA(NULL), longpath, MAX_PATH); - childPrintf(hFile, "longPath=%s\r\n", encodeA(longpath)); - map = OpenFileMappingA(FILE_MAP_READ, FALSE, "winetest_shlexec_dde_map"); - if (map != NULL) + /* Get highest length for keys, values */ + ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL, + &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); + if (ret) goto cleanup; + + dwMaxSubkeyLen++; + dwMaxValueLen++; + dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); + if (dwMaxLen > sizeof(szNameBuf)/sizeof(CHAR)) { - shared_block = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 4096); - CloseHandle(map); - if (shared_block[0] != '\0' || shared_block[1] != '\0') + /* Name too big: alloc a buffer for it */ + if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR)))) { - post_quit_on_execute = TRUE; - ddeInst = 0; - rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | - CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0); - ok(rc == DMLERR_NO_ERROR, "got %d\n", rc); - hszApplication = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI); - hszTopic = DdeCreateStringHandleA(ddeInst, shared_block + strlen(shared_block) + 1, CP_WINANSI); - assert(hszApplication && hszTopic); - assert(DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF)); + ret = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + } - timer = SetTimer(NULL, 0, 2500, childTimeout); - dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); - SetEvent(dde_ready); - CloseHandle(dde_ready); + /* Recursively delete all the subkeys */ + while (TRUE) + { + dwSize = dwMaxLen; + if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL, + NULL, NULL, NULL)) break; - while (GetMessageA(&msg, NULL, 0, 0)) - DispatchMessageA(&msg); + ret = myRegDeleteTreeA(hSubKey, lpszName); + if (ret) goto cleanup; + } - Sleep(500); - KillTimer(NULL, timer); - assert(DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER)); - assert(DdeFreeStringHandle(ddeInst, hszTopic)); - assert(DdeFreeStringHandle(ddeInst, hszApplication)); - assert(DdeUninitialize(ddeInst)); - } - else + if (lpszSubKey) + ret = RegDeleteKeyA(hKey, lpszSubKey); + else + while (TRUE) { - dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); - SetEvent(dde_ready); - CloseHandle(dde_ready); - } - - UnmapViewOfFile(shared_block); - - childPrintf(hFile, "ddeExec=%s\r\n", encodeA(ddeExec)); - } + dwSize = dwMaxLen; + if (RegEnumValueA(hKey, 0, lpszName, &dwSize, + NULL, NULL, NULL, NULL)) break; - CloseHandle(hFile); + ret = RegDeleteValueA(hKey, lpszName); + if (ret) goto cleanup; + } - init_event(filename); - SetEvent(hEvent); - CloseHandle(hEvent); +cleanup: + /* Free buffer if allocated */ + if (lpszName != szNameBuf) + HeapFree( GetProcessHeap(), 0, lpszName); + if(lpszSubKey) + RegCloseKey(hSubKey); + return ret; } -static char* getChildString(const char* sect, const char* key) +static void delete_test_association(const char* extension) { - char buf[1024]; - char* ret; + char class[MAX_PATH]; - GetPrivateProfileStringA(sect, key, "-", buf, sizeof(buf), child_file); - if (buf[0] == '\0' || (buf[0] == '-' && buf[1] == '\0')) return NULL; - assert(!(strlen(buf) & 1)); - ret = decodeA(buf); - return ret; + sprintf(class, "shlexec%s", extension); + myRegDeleteTreeA(HKEY_CLASSES_ROOT, class); + myRegDeleteTreeA(HKEY_CLASSES_ROOT, extension); } -static void dump_child_(const char* file, int line) +static void create_test_verb_dde(const char* extension, const char* verb, + int rawcmd, const char* cmdtail, const char *ddeexec, + const char *application, const char *topic, + const char *ifexec) { - if (winetest_debug > 1) - { - char key[18]; - char* str; - int i, c; + HKEY hkey_shell, hkey_verb, hkey_cmd; + char shell[MAX_PATH]; + char* cmd; + LONG rc; - str=getChildString("Arguments", "cmdlineA"); - trace_(file, line)("cmdlineA='%s'\n", str); - c=GetPrivateProfileIntA("Arguments", "argcA", -1, child_file); - trace_(file, line)("argcA=%d\n",c); - for (i=0;i 32, "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: rc=%lu\n", rc); /* if quoted, existing "drawback_file.noassoc" not prevents finding "drawback_file.noassoc foo.shlexec" on wine */ sprintf(fileA, "\"%s\\drawback_file.noassoc foo.shlexec\"", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); - ok(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */, - "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */, + "failed: rc=%lu\n", rc); /* error should be SE_ERR_FNF, not SE_ERR_NOASSOC */ sprintf(fileA, "\"%s\\drawback_file.noassoc\" foo.shlexec", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); - ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); /* ""command"" not works on wine (and real win9x and w2k) */ sprintf(fileA, "\"\"%s\\simple.shlexec\"\"", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); - todo_wine ok(rc > 32 || broken(rc == SE_ERR_FNF) /* Win9x/2000 */, - "%s failed: rc=%lu\n", shell_call, rc); + todo_wine okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win9x/2000 */, + "failed: rc=%lu\n", rc); /* nonexisting "drawback_nonexist.noassoc" not prevents finding "drawback_nonexist.noassoc foo.shlexec" on wine */ sprintf(fileA, "%s\\drawback_nonexist.noassoc foo.shlexec", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: rc=%lu\n", rc); /* is SEE_MASK_DOENVSUBST default flag? Should only be when XP emulates 9x (XP bug or real 95 or ME behavior ?) */ rc=shell_execute(NULL, "%TMPDIR%\\simple.shlexec", NULL, NULL); - todo_wine ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); /* quoted */ rc=shell_execute(NULL, "\"%TMPDIR%\\simple.shlexec\"", NULL, NULL); - todo_wine ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); /* test SEE_MASK_DOENVSUBST works */ rc=shell_execute_ex(SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI, NULL, "%TMPDIR%\\simple.shlexec", NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: rc=%lu\n", rc); /* quoted lpFile does not work on real win95 and nt4 */ rc=shell_execute_ex(SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI, NULL, "\"%TMPDIR%\\simple.shlexec\"", NULL, NULL, NULL); - ok(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */, - "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */, + "failed: rc=%lu\n", rc); } typedef struct @@ -1450,7 +1579,7 @@ /* trace("***** verb='%s' params='%s'\n", test->verb, test->params); */ rc = shell_execute_ex(SEE_MASK_DOENVSUBST, test->verb, fileA, test->params, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: rc=%lu\n", rc); count = 0; while (test->cmd.args[count]) @@ -1463,7 +1592,7 @@ else todo_wine okChildInt("argcA", 4 + count - 1); - cmd = getChildString("Arguments", "cmdlineA"); + cmd = getChildString("Child", "cmdlineA"); /* Our commands are such that the verb immediately precedes the * part we are interested in. */ @@ -1471,11 +1600,11 @@ if (cmd) cmd += strlen(test->verb); if (!cmd) cmd = "(null)"; if ((test->todo & 0x2) == 0) - ok(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)), - "%s: the cmdline is '%s' instead of '%s'\n", shell_call, cmd, test->cmd.cmd); + okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)), + "the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd); else todo_wine - ok(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)), - "%s: the cmdline is '%s' instead of '%s'\n", shell_call, cmd, test->cmd.cmd); + okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)), + "the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd); for (i = 0; i < count - 1; i++) { @@ -1500,9 +1629,9 @@ /* We need NOZONECHECKS on Win2003 to block a dialog */ rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: rc=%lu\n", rc); okChildInt("argcA", 4); - okChildString("argvA3", fileA); + okChildPath("argvA3", fileA); } static void test_filename(void) @@ -1555,10 +1684,9 @@ } if (rc > 32) rc=33; - ok(rc==test->rc || - broken(quotedfile && rc == SE_ERR_FNF), /* NT4 */ - "%s failed: rc=%ld err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc || + broken(quotedfile && rc == SE_ERR_FNF), /* NT4 */ + "failed: rc=%ld err=%u\n", rc, GetLastError()); if (rc == 33) { const char* verb; @@ -1600,13 +1728,11 @@ rc=33; if ((test->todo & 0x1)==0) { - ok(rc==test->rc, "%s failed: rc=%ld err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError()); } else todo_wine { - ok(rc==test->rc, "%s failed: rc=%ld err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError()); } if (rc==0) { @@ -1669,8 +1795,7 @@ */ sprintf(filename, "\"%s\\test file.shlexec\"", tmpdir); rc=shell_execute(NULL, filename, NULL, NULL); - ok(rc > 32, "%s failed: rc=%ld err=%u\n", shell_call, rc, - GetLastError()); + okShell(rc > 32, "failed: rc=%ld err=%u\n", rc, GetLastError()); okChildInt("argcA", 5); okChildString("argvA3", "Open"); sprintf(filename, "%s\\test file.shlexec", tmpdir); @@ -1781,20 +1906,20 @@ if (test->flags & URL_SUCCESS) { if ((test->todo & 0x1) == 0) - ok(rc > 32, "%s failed: bad rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: bad rc=%lu\n", rc); else todo_wine - ok(rc > 32, "%s failed: bad rc=%lu\n", shell_call, rc); + okShell(rc > 32, "failed: bad rc=%lu\n", rc); } else { if ((test->todo & 0x1) == 0) - ok(rc == SE_ERR_FNF || rc == SE_ERR_PNF || + okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF || broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */, - "%s failed: bad rc=%lu\n", shell_call, rc); + "failed: bad rc=%lu\n", rc); else todo_wine - ok(rc == SE_ERR_FNF || rc == SE_ERR_PNF || - broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */, - "%s failed: bad rc=%lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF || + broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */, + "failed: bad rc=%lu\n", rc); } if (rc == 33) { @@ -1993,7 +2118,7 @@ /* Should open through our association */ sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir); rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError()); okChildInt("argcA", 5); okChildString("argvA3", "Open"); sprintf(params, "%s\\test file.shlexec", tmpdir); @@ -2001,7 +2126,7 @@ okChildPath("argvA4", filename); todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError()); okChildInt("argcA", 5); todo_wine okChildString("argvA3", "Open"); sprintf(params, "%s\\test file.shlexec", tmpdir); @@ -2012,16 +2137,16 @@ /* Should just run our executable */ sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir); rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError()); okChildInt("argcA", 4); okChildString("argvA3", "Lnk"); /* An explicit class overrides lnk's ContextMenuHandler */ rc=shell_execute_ex(SEE_MASK_CLASSNAME | SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, "shlexec.shlexec"); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError()); okChildInt("argcA", 5); okChildString("argvA3", "Open"); - okChildString("argvA4", filename); + okChildPath("argvA4", filename); if (dllver.dwMajorVersion>=6) { @@ -2038,8 +2163,7 @@ c++; } rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, - GetLastError()); + okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError()); okChildInt("argcA", 4); okChildString("argvA3", "Lnk"); } @@ -2057,13 +2181,11 @@ rc=33; if ((test->todo & 0x1)==0) { - ok(rc==test->rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError()); } else todo_wine { - ok(rc==test->rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError()); } if (rc==0) { @@ -2109,7 +2231,7 @@ /* We need NOZONECHECKS on Win2003 to block a dialog */ rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params, NULL, NULL); - ok(rc > 32, "%s returned %lu\n", shell_call, rc); + okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); okChildString("argvA3", "Exec"); @@ -2120,7 +2242,7 @@ { rc=shell_execute(NULL, filename, params, NULL); todo_wine { - ok(rc==SE_ERR_NOASSOC, "%s returned %lu\n", shell_call, rc); + okShell(rc==SE_ERR_NOASSOC, "returned %lu\n", rc); } } } @@ -2132,11 +2254,25 @@ /* test combining executable and parameters */ sprintf(filename, "%s shlexec \"%s\" Exec", argv0, child_file); rc = shell_execute(NULL, filename, NULL, NULL); - ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); sprintf(filename, "\"%s\" shlexec \"%s\" Exec", argv0, child_file); rc = shell_execute(NULL, filename, NULL, NULL); - ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); + + /* A verb, even if invalid, overrides the normal handling of executables */ + todo_wait rc = shell_execute_ex(SEE_MASK_FLAG_NO_UI, + "notaverb", argv0, NULL, NULL, NULL); + todo_wine okShell(rc == SE_ERR_NOASSOC, "returned %lu\n", rc); + + /* A class overrides the normal handling of executables too */ + /* FIXME SEE_MASK_FLAG_NO_UI is only needed due to Wine's bug */ + rc = shell_execute_ex(SEE_MASK_CLASSNAME | SEE_MASK_FLAG_NO_UI, + NULL, argv0, NULL, NULL, ".shlexec"); + todo_wine okShell(rc > 32, "returned %lu\n", rc); + okChildInt("argcA", 5); + todo_wine okChildString("argvA3", "Open"); + todo_wine okChildPath("argvA4", argv0); } typedef struct @@ -2181,6 +2317,8 @@ static DWORD WINAPI hooked_WaitForInputIdle(HANDLE process, DWORD timeout) { + if (winetest_debug > 1) + trace("WaitForInputIdle() waiting for dde event\n"); return WaitForSingleObject(dde_ready_event, timeout); } @@ -2199,6 +2337,7 @@ PIMAGE_NT_HEADERS nt_headers; DWORD import_directory_rva; PIMAGE_IMPORT_DESCRIPTOR import_descriptor; + int hook_count = 0; base = (char *) GetModuleHandleA("shell32.dll"); nt_headers = (PIMAGE_NT_HEADERS)(base + ((PIMAGE_DOS_HEADER) base)->e_lfanew); @@ -2236,6 +2375,9 @@ VirtualProtect(&iat_entry->u1.Function, sizeof(ULONG_PTR), PAGE_READWRITE, &old_prot); iat_entry->u1.Function = (ULONG_PTR) new_func; VirtualProtect(&iat_entry->u1.Function, sizeof(ULONG_PTR), old_prot, &old_prot); + if (winetest_debug > 1) + trace("Hooked %s.WaitForInputIdle\n", import_module_name); + hook_count++; break; } } @@ -2247,6 +2389,7 @@ import_descriptor++; } + ok(hook_count, "Could not hook WaitForInputIdle()\n"); } static void test_dde(void) @@ -2296,7 +2439,7 @@ dde_ready_event = CreateEventA(NULL, FALSE, FALSE, "winetest_shlexec_dde_ready"); rc = shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, filename, NULL, NULL, NULL); CloseHandle(dde_ready_event); - ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okShell(32 < rc, "failed: rc=%lu err=%u\n", rc, GetLastError()); if (32 < rc) { @@ -2310,6 +2453,7 @@ sprintf(params, test->expectedDdeExec, filename); okChildPath("ddeExec", params); } + reset_association_description(); delete_test_association(".sde"); test++; @@ -2461,13 +2605,13 @@ if ((test->todo & 0x1)==0) { - ok(rc==test->rc[which], "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n", + rc, GetLastError()); } else todo_wine { - ok(rc==test->rc[which], "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); + okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n", + rc, GetLastError()); } if (rc == 33) { @@ -2484,6 +2628,7 @@ test->expectedDdeApplication[which], ddeApplication); } } + reset_association_description(); delete_test_association(".sde"); test++; @@ -2618,6 +2763,9 @@ create_test_verb(".shlexec", "QuotedLowerL", 0, "QuotedLowerL \"%l\""); create_test_verb(".shlexec", "UpperL", 0, "UpperL %L"); create_test_verb(".shlexec", "QuotedUpperL", 0, "QuotedUpperL \"%L\""); + + /* Set an environment variable to see if it is inherited */ + SetEnvironmentVariableA("ShlexecVar", "Present"); } static void cleanup_test(void) @@ -2662,7 +2810,7 @@ SetCurrentDirectoryA(tmpdir); rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, NULL, NULL); - ok(rc > 32, "%s returned %lu\n", shell_call, rc); + okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); okChildString("argvA3", "Exec"); todo_wine okChildPath("longPath", path); @@ -2670,12 +2818,12 @@ rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, NULL, NULL); - ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); /* Explicitly specify the directory to use */ rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, tmpdir, NULL); - ok(rc > 32, "%s returned %lu\n", shell_call, rc); + okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); okChildString("argvA3", "Exec"); todo_wine okChildPath("longPath", path); @@ -2683,11 +2831,11 @@ /* Specify it through an environment variable */ rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, "%TMPDIR%", NULL); - todo_wine ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); rc=shell_execute_ex(SEE_MASK_DOENVSUBST|SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, "%TMPDIR%", NULL); - ok(rc > 32, "%s returned %lu\n", shell_call, rc); + okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); okChildString("argvA3", "Exec"); todo_wine okChildPath("longPath", path); @@ -2696,7 +2844,7 @@ sprintf(dirpath, "%s:%s", curdir, tmpdir); rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI, NULL, "test2.exe", params, dirpath, NULL); - ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + okShell(rc == SE_ERR_FNF, "returned %lu\n", rc); } START_TEST(shlexec) @@ -2706,7 +2854,8 @@ if (myARGC >= 3) { doChild(myARGC, myARGV); - exit(0); + /* Skip the tests/failures trace for child processes */ + ExitProcess(winetest_get_failures()); } init_test(); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/shell32/tests/shlfolder.c wine-staging-1.9.3~ubuntu12.04.1/dlls/shell32/tests/shlfolder.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/shell32/tests/shlfolder.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/shell32/tests/shlfolder.c 2016-02-08 19:32:34.000000000 +0000 @@ -388,6 +388,14 @@ SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM, SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM, }; + static const ULONG full_attrs[5] = + { + SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR, + SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR, + SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM, + SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM, + SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM, + }; hr = IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList); ok(hr == S_OK, "EnumObjects failed %08x\n", hr); @@ -440,6 +448,11 @@ ok(flags == attrs[i] || flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */ "GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]); + + flags = ~0u; + hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags); + ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr); + ok((flags & ~SFGAO_HASSUBFOLDER) == full_attrs[i], "%d: got %08x expected %08x\n", i, flags, full_attrs[i]); } for (i=0;i<5;i++) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/strmbase/transform.c wine-staging-1.9.3~ubuntu12.04.1/dlls/strmbase/transform.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/strmbase/transform.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/strmbase/transform.c 2016-02-08 19:32:34.000000000 +0000 @@ -365,6 +365,8 @@ This->filter.state = State_Stopped; if (This->pFuncsTable->pfnStopStreaming) hr = This->pFuncsTable->pfnStopStreaming(This); + if (SUCCEEDED(hr)) + hr = BaseOutputPinImpl_Inactive(impl_BaseOutputPin_from_IPin(This->ppPins[1])); } LeaveCriticalSection(&This->csReceive); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/button.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/button.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/button.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/button.c 2016-02-08 19:32:34.000000000 +0000 @@ -364,6 +364,7 @@ case WM_CAPTURECHANGED: TRACE("WM_CAPTURECHANGED %p\n", hWnd); + if (hWnd == (HWND)lParam) break; state = get_button_state( hWnd ); if (state & BUTTON_BTNPRESSED) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/caret.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/caret.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/caret.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/caret.c 2016-02-08 19:32:34.000000000 +0000 @@ -86,7 +86,7 @@ req->x = 0; req->y = 0; req->hide = 0; - req->state = -1; /* toggle current state */ + req->state = CARET_STATE_TOGGLE; if ((ret = !wine_server_call( req ))) { hwnd = wine_server_ptr_handle( reply->full_handle ); @@ -256,7 +256,7 @@ req->x = x; req->y = y; req->hide = 0; - req->state = 1; + req->state = CARET_STATE_ON_IF_MOVED; if ((ret = !wine_server_call_err( req ))) { hwnd = wine_server_ptr_handle( reply->full_handle ); @@ -300,7 +300,7 @@ req->x = 0; req->y = 0; req->hide = 1; - req->state = 0; + req->state = CARET_STATE_OFF; if ((ret = !wine_server_call_err( req ))) { hwnd = wine_server_ptr_handle( reply->full_handle ); @@ -339,7 +339,7 @@ req->x = 0; req->y = 0; req->hide = -1; - req->state = 1; + req->state = CARET_STATE_ON; if ((ret = !wine_server_call_err( req ))) { hwnd = wine_server_ptr_handle( reply->full_handle ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/dialog.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/dialog.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/dialog.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/dialog.c 2016-02-08 19:32:34.000000000 +0000 @@ -1174,7 +1174,7 @@ */ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg ) { - INT dlgCode = 0; + INT dlgCode; if (CallMsgFilterW( msg, MSGF_DIALOGBOX )) return TRUE; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/input.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/input.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/input.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/input.c 2016-02-08 19:32:34.000000000 +0000 @@ -108,7 +108,7 @@ { USER_Driver->pSetCapture( hwnd, gui_flags ); - if (previous && previous != hwnd) + if (previous) SendMessageW( previous, WM_CAPTURECHANGED, 0, (LPARAM)hwnd ); if (prev_ret) *prev_ret = previous; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/message.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/message.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/message.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/message.c 2016-02-08 19:32:34.000000000 +0000 @@ -2489,7 +2489,7 @@ INT hittest; EVENTMSG event; GUITHREADINFO info; - MOUSEHOOKSTRUCT hook; + MOUSEHOOKSTRUCTEX hook; BOOL eatMsg; /* find the window to dispatch this mouse message to */ @@ -2585,17 +2585,19 @@ /* message is accepted now (but may still get dropped) */ - hook.pt = msg->pt; - hook.hwnd = msg->hwnd; - hook.wHitTestCode = hittest; - hook.dwExtraInfo = extra_info; + hook.s.pt = msg->pt; + hook.s.hwnd = msg->hwnd; + hook.s.wHitTestCode = hittest; + hook.s.dwExtraInfo = extra_info; + hook.mouseData = msg->wParam; if (HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, message, (LPARAM)&hook, TRUE )) { - hook.pt = msg->pt; - hook.hwnd = msg->hwnd; - hook.wHitTestCode = hittest; - hook.dwExtraInfo = extra_info; + hook.s.pt = msg->pt; + hook.s.hwnd = msg->hwnd; + hook.s.wHitTestCode = hittest; + hook.s.dwExtraInfo = extra_info; + hook.mouseData = msg->wParam; HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE ); accept_hardware_message( hw_id, TRUE ); return FALSE; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/tests/msg.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/tests/msg.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/tests/msg.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/tests/msg.c 2016-02-08 19:32:34.000000000 +0000 @@ -5942,7 +5942,7 @@ { WM_SETFOCUS, sent }, { WM_KILLFOCUS, sent|parent }, { WM_SETFOCUS, sent }, - { WM_COMMAND, sent|defwinproc }, + { WM_COMMAND, sent|defwinproc|wparam, MAKEWPARAM(1001, EN_SETFOCUS) }, { EM_SETSEL, sent|defwinproc|wparam|lparam, 0, INT_MAX }, { WM_CTLCOLOREDIT, sent|defwinproc|optional },/* Not sent on W2000, XP or Server 2003 */ { WM_CTLCOLOREDIT, sent|parent|optional },/* Not sent on W2000, XP or Server 2003 */ @@ -5971,7 +5971,7 @@ { WM_SETFOCUS, sent }, { WM_KILLFOCUS, sent|defwinproc }, { WM_SETFOCUS, sent }, - { WM_COMMAND, sent|defwinproc }, + { WM_COMMAND, sent|defwinproc|wparam, MAKEWPARAM(1001, EN_SETFOCUS) }, { EM_SETSEL, sent|defwinproc|wparam|lparam, 0, INT_MAX }, { WM_CTLCOLOREDIT, sent|defwinproc|optional },/* Not sent on W2000, XP or Server 2003 */ { WM_CTLCOLOREDIT, sent|parent|optional },/* Not sent on W2000, XP or Server 2003 */ @@ -8763,9 +8763,11 @@ static void test_timers_no_wnd(void) { + static UINT_PTR ids[0xffff]; UINT_PTR id, id2; DWORD start; MSG msg; + int i; count = 0; id = SetTimer(NULL, 0, 100, callback_count); @@ -8800,6 +8802,18 @@ count, TIMER_COUNT_EXPECTED); KillTimer(NULL, id); /* Note: SetSystemTimer doesn't support a NULL window, see test_timers */ + + /* Check what happens when we're running out of timers */ + for (i=0; i 0) KillTimer(NULL, ids[--i]); } static void test_timers_exception(DWORD code) @@ -15111,6 +15125,33 @@ flush_sequence(); } +static const struct message DoubleSetCaptureSeq[] = +{ + { WM_CAPTURECHANGED, sent }, + { 0 } +}; + +static void test_DoubleSetCapture(void) +{ + HWND hwnd; + + hwnd = CreateWindowExA(0, "TestWindowClass", "Test DoubleSetCapture", + WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL); + ok (hwnd != 0, "Failed to create overlapped window\n"); + + ShowWindow( hwnd, SW_SHOW ); + UpdateWindow( hwnd ); + flush_events(); + flush_sequence(); + + SetCapture( hwnd ); + SetCapture( hwnd ); + ok_sequence(DoubleSetCaptureSeq, "SetCapture( hwnd ) twice", FALSE); + + DestroyWindow(hwnd); +} + static void init_funcs(void) { HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); @@ -15251,6 +15292,7 @@ test_layered_window(); test_TrackPopupMenu(); test_TrackPopupMenuEmpty(); + test_DoubleSetCapture(); /* keep it the last test, under Windows it tends to break the tests * which rely on active/foreground windows being correct. */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/tests/winstation.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/tests/winstation.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/tests/winstation.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/tests/winstation.c 2016-02-08 19:32:34.000000000 +0000 @@ -205,6 +205,35 @@ else if (le == ERROR_ACCESS_DENIED) win_skip( "Not enough privileges for CreateWindowStation\n" ); + SetLastError( 0xdeadbeef ); + w2 = OpenWindowStationA( "", TRUE, WINSTA_ALL_ACCESS ); + ok( !w2, "open station succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + w2 = CreateWindowStationA( "", 0, WINSTA_ALL_ACCESS, NULL ); + ok( w2 != 0, "create station failed err %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + w3 = OpenWindowStationA( "", TRUE, WINSTA_ALL_ACCESS ); + todo_wine + ok( w3 != 0, "open station failed err %u\n", GetLastError() ); + CloseWindowStation( w3 ); + CloseWindowStation( w2 ); + + SetLastError( 0xdeadbeef ); + w2 = CreateWindowStationA( "foo\\bar", 0, WINSTA_ALL_ACCESS, NULL ); + ok( !w2, "create station succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_ACCESS_DENIED, + "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + w2 = OpenWindowStationA( "foo\\bar", TRUE, WINSTA_ALL_ACCESS ); + ok( !w2, "create station succeeded\n" ); + ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %u\n", GetLastError() ); + /* desktops */ d1 = GetThreadDesktop(GetCurrentThreadId()); initial_desktop = d1; @@ -239,6 +268,30 @@ d2 = OpenDesktopA( "dummy name", 0, TRUE, DESKTOP_ALL_ACCESS ); ok( !d2, "open dummy desktop succeeded\n" ); + SetLastError( 0xdeadbeef ); + d2 = CreateDesktopA( "", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); + todo_wine + ok( !d2, "create empty desktop succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + d2 = OpenDesktopA( "", 0, TRUE, DESKTOP_ALL_ACCESS ); + ok( !d2, "open mepty desktop succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + d2 = CreateDesktopA( "foo\\bar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); + ok( !d2, "create desktop succeeded\n" ); + ok( GetLastError() == ERROR_BAD_PATHNAME, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + d2 = OpenDesktopA( "foo\\bar", 0, TRUE, DESKTOP_ALL_ACCESS ); + ok( !d2, "open desktop succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_BAD_PATHNAME, "wrong error %u\n", GetLastError() ); + d2 = CreateDesktopA( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); ok( d2 != 0, "create foobar desktop failed\n" ); SetLastError( 0xdeadbeef ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/winstation.c wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/winstation.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/user32/winstation.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/user32/winstation.c 2016-02-08 19:32:34.000000000 +0000 @@ -118,8 +118,7 @@ ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); req->rootdir = wine_server_obj_handle( get_winstations_dir_handle() ); wine_server_add_data( req, name, len * sizeof(WCHAR) ); - /* it doesn't seem to set last error */ - wine_server_call( req ); + wine_server_call_err( req ); ret = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; @@ -316,8 +315,7 @@ req->attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF | ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); wine_server_add_data( req, name, len * sizeof(WCHAR) ); - /* it doesn't seem to set last error */ - wine_server_call( req ); + wine_server_call_err( req ); ret = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; @@ -359,7 +357,7 @@ req->access = access; req->attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); wine_server_add_data( req, name, len * sizeof(WCHAR) ); - if (!wine_server_call( req )) ret = wine_server_ptr_handle( reply->handle ); + if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle ); } SERVER_END_REQ; return ret; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/usp10/tests/usp10.c wine-staging-1.9.3~ubuntu12.04.1/dlls/usp10/tests/usp10.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/usp10/tests/usp10.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/usp10/tests/usp10.c 2016-02-08 19:32:34.000000000 +0000 @@ -456,6 +456,38 @@ static const itemTest t471[2] = {{{0,0,0,0,0},0,0,0,0,math_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},26,0,0,0,-1,FALSE}}; static const itemTest t472[2] = {{{0,0,0,0,0},0,0,0,2,math_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},26,0,0,0,-1,FALSE}}; + /* Mathematical and Numeric combinations */ + /* These have a leading hebrew character to force complicated itemization */ + static const WCHAR test48[] = {0x05e9,' ','1','2','3','.'}; + static const itemTest t481[4] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},5,0,0,0,0,FALSE}, + {{0,0,0,0,0},6,0,0,0,-1,FALSE}}; + static const WCHAR test49[] = {0x05e9,' ','1','2','.','1','2'}; + static const itemTest t491[3] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},7,0,0,0,-1,FALSE}}; + static const WCHAR test50[] = {0x05e9,' ','.','1','2','3'}; + static const itemTest t501[4] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,1,1,1,0,FALSE},{{0,0,0,0,0},3,0,1,2,0,FALSE}, + {{0,0,0,0,0},6,0,0,0,-1,FALSE}}; + static const WCHAR test51[] = {0x05e9,' ','a','b','.','1','2'}; + static const itemTest t511[5] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},1,0,0,0,latn_tag,FALSE},{{0,0,0,0,0},4,0,0,0,0,FALSE}, + {{0,0,0,0,0},5,0,0,2,0,FALSE},{{0,0,0,0,0},7,0,0,0,-1,FALSE}}; + static const WCHAR test52[] = {0x05e9,' ','1','2','.','a','b'}; + static const itemTest t521[5] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},4,0,0,0,0,FALSE}, + {{0,0,0,0,0},5,0,0,0,latn_tag,FALSE},{{0,0,0,0,0},7,0,0,0,-1,FALSE}}; + static const WCHAR test53[] = {0x05e9,' ','1','2','.','.','1','2'}; + static const itemTest t531[5] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},4,1,1,1,0,FALSE}, + {{0,0,0,0,0},6,0,1,2,0,FALSE},{{0,0,0,0,0},8,0,0,0,-1,FALSE}}; + static const WCHAR test54[] = {0x05e9,' ','1','2','+','1','2'}; + static const itemTest t541[3] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},7,0,0,0,-1,FALSE}}; + static const WCHAR test55[] = {0x05e9,' ','1','2','+','+','1','2'}; + static const itemTest t551[3] = {{{0,0,0,0,0},0,1,1,1,hebr_tag,FALSE}, + {{0,0,0,0,0},2,0,1,2,0,FALSE},{{0,0,0,0,0},8,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -590,6 +622,14 @@ test_items_ok(test45,24,&Control,&State,1,t451,FALSE,0); test_items_ok(test46,16,&Control,&State,1,t461,FALSE,0); test_items_ok(test47,26,&Control,&State,1,t471,FALSE,0); + test_items_ok(test48,6,&Control,&State,3,t481,FALSE,0); + test_items_ok(test49,7,&Control,&State,2,t491,FALSE,0); + test_items_ok(test50,6,&Control,&State,3,t501,FALSE,0); + test_items_ok(test51,7,&Control,&State,4,t511,FALSE,0); + test_items_ok(test52,7,&Control,&State,4,t521,FALSE,0); + test_items_ok(test53,8,&Control,&State,4,t531,FALSE,0); + test_items_ok(test54,7,&Control,&State,2,t541,FALSE,0); + test_items_ok(test55,8,&Control,&State,2,t551,FALSE,0); State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/usp10/usp10.c wine-staging-1.9.3~ubuntu12.04.1/dlls/usp10/usp10.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/usp10/usp10.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/usp10/usp10.c 2016-02-08 19:32:34.000000000 +0000 @@ -1307,9 +1307,15 @@ else if (is_indic(scripts[i])) last_indic = base_indic(scripts[i]); - /* Some unicode points (Zero Width Space U+200B - - Right-to-Left Mark U+200F) will force us into bidi mode */ - if (!forceLevels && pwcInChars[i] >= 0x200B && pwcInChars[i] <= 0x200F) + /* Some unicode points : + (Zero Width Space U+200B - Right-to-Left Mark U+200F) + (Left Right Embed U+202A - Left Right Override U+202D) + (Left Right Isolate U+2066 - Pop Directional Isolate U+2069) + will force us into bidi mode */ + if (!forceLevels && ((pwcInChars[i] >= 0x200B && pwcInChars[i] <= 0x200F) || + (pwcInChars[i] >= 0x202A && pwcInChars[i] <= 0x202E) || + (pwcInChars[i] >= 0x2066 && pwcInChars[i] <= 0x2069))) + forceLevels = TRUE; /* Diacritical marks merge with other scripts */ @@ -1385,8 +1391,8 @@ } else { - BOOL inNumber = FALSE; static const WCHAR math_punc[] = {'#','$','%','+',',','-','.','/',':',0x2212, 0x2044, 0x00a0,0}; + static const WCHAR repeatable_math_punc[] = {'#','$','%','+','-','/',0x2212, 0x2044,0}; strength = heap_alloc_zero(cInChars * sizeof(WORD)); if (!strength) @@ -1401,21 +1407,48 @@ strength[i] = BIDI_STRONG; } + /* Math punctuation bordered on both sides by numbers can be + merged into the number */ for (i = 0; i < cInChars; i++) { - /* Script_Numeric and select puncuation at level 0 get bumped to level 2 */ - if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && inNumber && strchrW(math_punc,pwcInChars[i])) + if (i > 0 && i < cInChars-1 && + scripts[i-1] == Script_Numeric && + strchrW(math_punc, pwcInChars[i])) { - scripts[i] = Script_Numeric; - levels[i] = 2; + if (scripts[i+1] == Script_Numeric) + { + scripts[i] = Script_Numeric; + levels[i] = levels[i-1]; + strength[i] = strength[i-1]; + i++; + } + else if (strchrW(repeatable_math_punc, pwcInChars[i])) + { + int j; + for (j = i+1; j < cInChars; j++) + { + if (scripts[j] == Script_Numeric) + { + for(;iuBidiLevel) && levels[i] == psState->uBidiLevel+1)) && scripts[i] == Script_Numeric) + } + + for (i = 0; i < cInChars; i++) + { + /* Script_Numeric at level 0 get bumped to level 2 */ + if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && scripts[i] == Script_Numeric) { levels[i] = 2; - inNumber = TRUE; } - else - inNumber = FALSE; /* Joiners get merged preferencially right */ if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ)) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/reader.c wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/reader.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/reader.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/reader.c 2016-02-08 19:32:34.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2015 Hans Leidekker for CodeWeavers + * Copyright 2015, 2016 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -164,6 +164,12 @@ return HeapAlloc( heap->handle, 0, size ); } +static void *ws_alloc_zero( WS_HEAP *handle, SIZE_T size ) +{ + struct heap *heap = (struct heap *)handle; + return HeapAlloc( heap->handle, HEAP_ZERO_MEMORY, size ); +} + void *ws_realloc( WS_HEAP *handle, void *ptr, SIZE_T size ) { struct heap *heap = (struct heap *)handle; @@ -323,6 +329,8 @@ heap_free( comment->value.bytes ); break; } + case WS_XML_NODE_TYPE_CDATA: + case WS_XML_NODE_TYPE_END_CDATA: case WS_XML_NODE_TYPE_END_ELEMENT: case WS_XML_NODE_TYPE_EOF: case WS_XML_NODE_TYPE_BOF: @@ -378,9 +386,13 @@ READER_STATE_INITIAL, READER_STATE_BOF, READER_STATE_STARTELEMENT, + READER_STATE_STARTATTRIBUTE, READER_STATE_STARTENDELEMENT, + READER_STATE_STARTCDATA, + READER_STATE_CDATA, READER_STATE_TEXT, READER_STATE_ENDELEMENT, + READER_STATE_ENDCDATA, READER_STATE_COMMENT, READER_STATE_EOF }; @@ -393,6 +405,7 @@ enum reader_state state; struct node *root; struct node *current; + ULONG current_attr; WS_XML_READER_INPUT_TYPE input_type; const unsigned char *input_data; ULONG input_size; @@ -1093,16 +1106,6 @@ WS_XML_STRING *prefix, *localname; HRESULT hr; - switch (reader->state) - { - case READER_STATE_TEXT: - case READER_STATE_STARTELEMENT: - case READER_STATE_STARTENDELEMENT: - break; - default: - return WS_E_INVALID_FORMAT; - } - if (read_cmp( reader, "current, node ); + reader->state = READER_STATE_STARTCDATA; + return S_OK; +} + +static HRESULT read_cdata( struct reader *reader ) +{ + unsigned int len = 0, ch, skip; + const unsigned char *start; + struct node *node; + WS_XML_TEXT_NODE *text; + WS_XML_UTF8_TEXT *utf8; + + start = read_current_ptr( reader ); + for (;;) + { + if (!read_cmp( reader, "]]>", 3 )) break; + if (!(ch = read_utf8_char( reader, &skip ))) return WS_E_INVALID_FORMAT; + read_skip( reader, skip ); + len += skip; + } + + if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return E_OUTOFMEMORY; + text = (WS_XML_TEXT_NODE *)node; + if (!(utf8 = alloc_utf8_text( start, len ))) + { + heap_free( node ); + return E_OUTOFMEMORY; + } + text->text = &utf8->text; + + read_insert_node( reader, reader->current, node ); + reader->state = READER_STATE_CDATA; + return S_OK; +} + +static HRESULT read_endcdata( struct reader *reader ) +{ + struct node *node; + + if (read_cmp( reader, "]]>", 3 )) return WS_E_INVALID_FORMAT; + read_skip( reader, 3 ); + + if (!(node = alloc_node( WS_XML_NODE_TYPE_END_CDATA ))) return E_OUTOFMEMORY; + read_insert_node( reader, reader->current->parent, node ); + reader->state = READER_STATE_ENDCDATA; + return S_OK; +} + static HRESULT read_node( struct reader *reader ) { HRESULT hr; @@ -1183,13 +1243,16 @@ reader->state = READER_STATE_EOF; return S_OK; } - if (!read_cmp( reader, "state == READER_STATE_STARTCDATA) return read_cdata( reader ); + else if (reader->state == READER_STATE_CDATA) return read_endcdata( reader ); + else if (!read_cmp( reader, "current->hdr; + if (reader->state != READER_STATE_STARTELEMENT || index >= elem->attributeCount) + return WS_E_INVALID_FORMAT; + + reader->current_attr = index; + reader->state = READER_STATE_STARTATTRIBUTE; + return S_OK; +} + +/************************************************************************** + * WsReadEndAttribute [webservices.@] + */ +HRESULT WINAPI WsReadEndAttribute( WS_XML_READER *handle, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader) return E_INVALIDARG; + + if (reader->state != READER_STATE_STARTATTRIBUTE) + return WS_E_INVALID_FORMAT; + + reader->state = READER_STATE_STARTELEMENT; + return S_OK; +} + static WCHAR *xmltext_to_widechar( WS_HEAP *heap, const WS_XML_TEXT *text ) { WCHAR *ret; @@ -1439,177 +1543,679 @@ return S_OK; } -/************************************************************************** - * WsReadType [webservices.@] - */ -HRESULT WINAPI WsReadType( WS_XML_READER *handle, WS_TYPE_MAPPING mapping, WS_TYPE type, - const void *desc, WS_READ_OPTION option, WS_HEAP *heap, void *value, - ULONG value_size, WS_ERROR *error ) +static HRESULT read_get_node_text( struct reader *reader, WS_XML_UTF8_TEXT **ret ) { - struct reader *reader = (struct reader *)handle; WS_XML_TEXT_NODE *text; - TRACE( "%p %u %u %p %u %p %p %u %p\n", handle, mapping, type, desc, option, heap, value, - value_size, error ); - if (error) FIXME( "ignoring error parameter\n" ); + if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_TEXT) + return WS_E_INVALID_FORMAT; - if (!reader || !value) return E_INVALIDARG; + text = (WS_XML_TEXT_NODE *)&reader->current->hdr.node; + if (text->text->textType != WS_XML_TEXT_TYPE_UTF8) + { + FIXME( "text type %u not supported\n", text->text->textType ); + return E_NOTIMPL; + } + *ret = (WS_XML_UTF8_TEXT *)text->text; + return S_OK; +} - if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_TEXT) +static HRESULT read_get_attribute_text( struct reader *reader, WS_XML_UTF8_TEXT **ret ) +{ + WS_XML_ELEMENT_NODE *elem = &reader->current->hdr; + WS_XML_ATTRIBUTE *attr; + + if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_ELEMENT || + reader->current_attr >= elem->attributeCount) return WS_E_INVALID_FORMAT; + + attr = elem->attributes[reader->current_attr]; + if (attr->value->textType != WS_XML_TEXT_TYPE_UTF8) { - FIXME( "only text nodes are supported\n" ); + FIXME( "text type %u not supported\n", attr->value->textType ); return E_NOTIMPL; } - text = (WS_XML_TEXT_NODE *)&reader->current->hdr.node; - if (text->text->textType != WS_XML_TEXT_TYPE_UTF8) + *ret = (WS_XML_UTF8_TEXT *)attr->value; + reader->current_attr++; + return S_OK; +} + +static HRESULT read_type_bool( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_BOOL_DESCRIPTION *desc, BOOL *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + ULONG len; + + if (desc) { - FIXME( "text type %u not supported\n", text->text->textType ); + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + len = utf8->value.length; + break; + + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; + len = utf8->value.length; + break; + + default: + FIXME( "mapping %u not supported\n", mapping ); return E_NOTIMPL; } + if (len == 4 && !memcmp( utf8->value.bytes, "true", 4 )) *ret = TRUE; + else if (len == 1 && !memcmp( utf8->value.bytes, "1", 1 )) *ret = TRUE; + else if (len == 5 && !memcmp( utf8->value.bytes, "false", 5 )) *ret = FALSE; + else if (len == 1 && !memcmp( utf8->value.bytes, "0", 1 )) *ret = FALSE; + else return WS_E_INVALID_FORMAT; + + return S_OK; +} + +static HRESULT read_type_int8( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_INT8_DESCRIPTION *desc, INT8 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + INT64 val; + + if (desc) + { + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } switch (mapping) { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + default: FIXME( "mapping %u not supported\n", mapping ); return E_NOTIMPL; } - switch (type) + if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT8, MAX_INT8, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_int16( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_INT16_DESCRIPTION *desc, INT16 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + INT64 val; + + if (desc) { - case WS_BOOL_TYPE: + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - ULONG len = utf8->value.length; - BOOL *ret = value; - - if (value_size != sizeof(BOOL)) return E_INVALIDARG; - - if (len == 4 && !memcmp( utf8->value.bytes, "true", 4 )) *ret = TRUE; - else if (len == 1 && !memcmp( utf8->value.bytes, "1", 1 )) *ret = TRUE; - else if (len == 5 && !memcmp( utf8->value.bytes, "false", 5 )) *ret = FALSE; - else if (len == 1 && !memcmp( utf8->value.bytes, "0", 1 )) *ret = FALSE; - else return WS_E_INVALID_FORMAT; + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; break; + + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; + break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_INT8_TYPE: + + if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT16, MAX_INT16, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_int32( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_INT32_DESCRIPTION *desc, INT32 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + INT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - INT8 *ret = value; - HRESULT hr; - INT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(INT8)) return E_INVALIDARG; - hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT8, MAX_INT8, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_INT16_TYPE: + + if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT32, MAX_INT32, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_int64( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_INT64_DESCRIPTION *desc, INT64 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + INT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - INT16 *ret = value; - HRESULT hr; - INT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(INT16)) return E_INVALIDARG; - hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT16, MAX_INT16, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_INT32_TYPE: + + if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT64, MAX_INT64, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_uint8( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_UINT8_DESCRIPTION *desc, UINT8 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + UINT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - INT32 *ret = value; - HRESULT hr; - INT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(INT32)) return E_INVALIDARG; - hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT32, MAX_INT32, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_INT64_TYPE: + + if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT8, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_uint16( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_UINT16_DESCRIPTION *desc, UINT16 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + UINT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - INT64 val, *ret = value; - HRESULT hr; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(INT64)) return E_INVALIDARG; - hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT64, MAX_INT64, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_UINT8_TYPE: + + if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT16, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_uint32( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_UINT32_DESCRIPTION *desc, UINT32 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + UINT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - UINT8 *ret = value; - HRESULT hr; - UINT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(UINT8)) return E_INVALIDARG; - hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT8, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_UINT16_TYPE: + + if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT32, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_uint64( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_UINT64_DESCRIPTION *desc, UINT64 *ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + UINT64 val; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - UINT16 *ret = value; - HRESULT hr; - UINT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(UINT16)) return E_INVALIDARG; - hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT16, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_UINT32_TYPE: + + if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT64, &val )) != S_OK) + return hr; + + *ret = val; + return S_OK; +} + +static HRESULT read_type_wsz( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_WSZ_DESCRIPTION *desc, WS_HEAP *heap, WCHAR **ret ) +{ + WS_XML_UTF8_TEXT *utf8; + HRESULT hr; + WCHAR *str; + + if (desc) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - UINT32 *ret = value; - HRESULT hr; - UINT64 val; + FIXME( "description not supported\n" ); + return E_NOTIMPL; + } + switch (mapping) + { + case WS_ATTRIBUTE_TYPE_MAPPING: + if ((hr = read_get_attribute_text( reader, &utf8 )) != S_OK) return hr; + break; - if (value_size != sizeof(UINT32)) return E_INVALIDARG; - hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT32, &val ); - if (hr != S_OK) return hr; - *ret = val; + case WS_ELEMENT_TYPE_MAPPING: + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_get_node_text( reader, &utf8 )) != S_OK) return hr; break; + + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; } - case WS_UINT64_TYPE: + + if (!(str = xmltext_to_widechar( heap, &utf8->text ))) return WS_E_QUOTA_EXCEEDED; + *ret = str; + return S_OK; +} + +static HRESULT read_type_struct( struct reader *, WS_TYPE_MAPPING, const WS_STRUCT_DESCRIPTION *, + WS_HEAP *, void ** ); + +static HRESULT read_type_struct_field( struct reader *reader, const WS_FIELD_DESCRIPTION *desc, + WS_HEAP *heap, char *buf ) +{ + char *ptr = buf + desc->offset; + WS_TYPE_MAPPING mapping; + HRESULT hr; + + if (desc->options && desc->options != WS_FIELD_POINTER && + desc->options != WS_FIELD_OPTIONAL && + desc->options != (WS_FIELD_POINTER | WS_FIELD_OPTIONAL)) { - WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; - UINT64 val, *ret = value; - HRESULT hr; + FIXME( "options 0x%x not supported\n", desc->options ); + return E_NOTIMPL; + } - if (value_size != sizeof(UINT64)) return E_INVALIDARG; - hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT64, &val ); - if (hr != S_OK) return hr; - *ret = val; + switch (desc->mapping) + { + case WS_ATTRIBUTE_FIELD_MAPPING: + mapping = WS_ATTRIBUTE_TYPE_MAPPING; + break; + + case WS_ELEMENT_FIELD_MAPPING: + mapping = WS_ELEMENT_TYPE_MAPPING; break; + + default: + FIXME( "unhandled field mapping %u\n", desc->mapping ); + return E_NOTIMPL; } + + switch (desc->type) + { + case WS_STRUCT_TYPE: + hr = read_type_struct( reader, mapping, desc->typeDescription, heap, (void **)ptr ); + break; + + case WS_BOOL_TYPE: + hr = read_type_bool( reader, mapping, desc->typeDescription, (BOOL *)ptr ); + break; + + case WS_INT8_TYPE: + hr = read_type_int8( reader, mapping, desc->typeDescription, (INT8 *)ptr ); + break; + + case WS_INT16_TYPE: + hr = read_type_int16( reader, mapping, desc->typeDescription, (INT16 *)ptr ); + break; + + case WS_INT32_TYPE: + hr = read_type_int32( reader, mapping, desc->typeDescription, (INT32 *)ptr ); + break; + + case WS_INT64_TYPE: + hr = read_type_int64( reader, mapping, desc->typeDescription, (INT64 *)ptr ); + break; + + case WS_UINT8_TYPE: + hr = read_type_uint8( reader, mapping, desc->typeDescription, (UINT8 *)ptr ); + break; + + case WS_UINT16_TYPE: + hr = read_type_uint16( reader, mapping, desc->typeDescription, (UINT16 *)ptr ); + break; + + case WS_UINT32_TYPE: + hr = read_type_uint32( reader, mapping, desc->typeDescription, (UINT32 *)ptr ); + break; + + case WS_UINT64_TYPE: + hr = read_type_uint64( reader, mapping, desc->typeDescription, (UINT64 *)ptr ); + break; + case WS_WSZ_TYPE: + hr = read_type_wsz( reader, mapping, desc->typeDescription, heap, (WCHAR **)ptr ); + break; + + default: + FIXME( "type %u not implemented\n", desc->type ); + return E_NOTIMPL; + } + + return hr; +} + +static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping, + const WS_STRUCT_DESCRIPTION *desc, WS_HEAP *heap, void **ret ) +{ + ULONG i; + HRESULT hr; + char *buf; + + if (!desc) return E_INVALIDARG; + + if (desc->structOptions) + { + FIXME( "struct options 0x%x not supported\n", desc->structOptions ); + return E_NOTIMPL; + } + + switch (mapping) + { + case WS_ELEMENT_TYPE_MAPPING: + if ((hr = read_to_startelement( reader, NULL )) != S_OK) return hr; + break; + + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_to_startelement( reader, NULL )) != S_OK) return hr; + if ((hr = read_startelement( reader )) != S_OK) return hr; + break; + + default: + FIXME( "unhandled mapping %u\n", mapping ); + return E_NOTIMPL; + } + + if (!(buf = ws_alloc_zero( heap, desc->size ))) return WS_E_QUOTA_EXCEEDED; + + for (i = 0; i < desc->fieldCount; i++) + { + if ((hr = read_type_struct_field( reader, desc->fields[i], heap, buf )) != S_OK) + { + ws_free( heap, buf ); + return hr; + } + } + + switch (mapping) { - WCHAR *str, **ret = value; + case WS_ELEMENT_TYPE_MAPPING: + if ((hr = read_endelement( reader )) != S_OK) return hr; + break; - if (value_size != sizeof(WCHAR *)) return E_INVALIDARG; - if (!(str = xmltext_to_widechar( heap, text->text ))) return E_OUTOFMEMORY; - *ret = str; + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_endelement( reader )) != S_OK) return hr; + if ((hr = read_node( reader )) != S_OK) return hr; + if (reader->state != READER_STATE_EOF) return WS_E_INVALID_FORMAT; break; + + default: break; + } + + *ret = buf; + return S_OK; +} + +static HRESULT read_type( struct reader *reader, WS_TYPE_MAPPING mapping, WS_TYPE type, + const void *desc, WS_READ_OPTION option, WS_HEAP *heap, + void *value, ULONG size ) +{ + switch (type) + { + case WS_STRUCT_TYPE: + { + void **ptr = value; + if (option != WS_READ_REQUIRED_POINTER || size != sizeof(*ptr)) + return E_INVALIDARG; + + return read_type_struct( reader, mapping, desc, heap, ptr ); + } + case WS_BOOL_TYPE: + { + BOOL *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_bool( reader, mapping, desc, ptr ); + } + case WS_INT8_TYPE: + { + INT8 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_int8( reader, mapping, desc, ptr ); + } + case WS_INT16_TYPE: + { + INT16 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_int16( reader, mapping, desc, ptr ); + } + case WS_INT32_TYPE: + { + INT32 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_int32( reader, mapping, desc, ptr ); + } + case WS_INT64_TYPE: + { + INT64 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_int64( reader, mapping, desc, ptr ); + } + case WS_UINT8_TYPE: + { + UINT8 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_uint8( reader, mapping, desc, ptr ); + } + case WS_UINT16_TYPE: + { + UINT16 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_uint16( reader, mapping, desc, ptr ); + } + case WS_UINT32_TYPE: + { + UINT32 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_uint32( reader, mapping, desc, ptr ); + } + case WS_UINT64_TYPE: + { + UINT64 *ptr = value; + if (option != WS_READ_REQUIRED_VALUE) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_uint64( reader, mapping, desc, ptr ); + } + case WS_WSZ_TYPE: + { + WCHAR **ptr = value; + if (option != WS_READ_REQUIRED_POINTER) + { + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + if (size != sizeof(*ptr)) return E_INVALIDARG; + return read_type_wsz( reader, mapping, desc, heap, ptr ); } default: FIXME( "type %u not supported\n", type ); return E_NOTIMPL; } +} - return S_OK; +/************************************************************************** + * WsReadType [webservices.@] + */ +HRESULT WINAPI WsReadType( WS_XML_READER *handle, WS_TYPE_MAPPING mapping, WS_TYPE type, + const void *desc, WS_READ_OPTION option, WS_HEAP *heap, void *value, + ULONG size, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + + TRACE( "%p %u %u %p %u %p %p %u %p\n", handle, mapping, type, desc, option, heap, value, + size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader || !value) return E_INVALIDARG; + + return read_type( reader, mapping, type, desc, option, heap, value, size ); } /************************************************************************** diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/tests/reader.c wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/tests/reader.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/tests/reader.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/tests/reader.c 2016-02-08 19:32:34.000000000 +0000 @@ -885,7 +885,7 @@ if (node) ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType ); hr = WsReadEndElement( reader, NULL ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08x\n", hr ); hr = WsGetReaderNode( reader, &node, NULL ); ok( hr == S_OK, "got %08x\n", hr ); @@ -1707,6 +1707,170 @@ WsFreeHeap( heap ); } +static void prepare_struct_type_test( WS_XML_READER *reader, const char *data ) +{ + HRESULT hr; + ULONG size = strlen( data ); + + hr = set_input( reader, data, size ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, size, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); +} + +static void test_simple_struct_type(void) +{ + static const WCHAR testW[] = {'t','e','s','t',0}; + HRESULT hr; + WS_XML_READER *reader; + WS_HEAP *heap; + WS_STRUCT_DESCRIPTION s; + WS_FIELD_DESCRIPTION f, *fields[1]; + WS_XML_STRING ns = {0, NULL}, localname = {3, (BYTE *)"str"}; + WS_XML_STRING localname2 = {4, (BYTE *)"test"}; + const WS_XML_NODE *node; + struct test { WCHAR *str; } *test; + + hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + prepare_struct_type_test( reader, "test" ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + /* element field mapping */ + memset( &f, 0, sizeof(f) ); + f.mapping = WS_ELEMENT_FIELD_MAPPING; + f.localName = &localname; + f.ns = &ns; + f.type = WS_WSZ_TYPE; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(struct test); + s.alignment = TYPE_ALIGNMENT(struct test); + s.fields = fields; + s.fieldCount = 1; + s.typeLocalName = &localname2; + s.typeNs = &ns; + + test = NULL; + prepare_struct_type_test( reader, "testtest2" ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + test = NULL; + prepare_struct_type_test( reader, "test" ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( test != NULL, "test not set\n" ); + if (test) + { + ok( test->str != NULL, "str not set\n" ); + if (test->str) ok( !lstrcmpW( test->str, testW ), "wrong data\n" ); + } + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + test = NULL; + prepare_struct_type_test( reader, "test" ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( test != NULL, "test not set\n" ); + if (test) + { + ok( test->str != NULL, "str not set\n" ); + if (test->str) ok( !lstrcmpW( test->str, testW ), "wrong data\n" ); + } + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + +static void test_cdata(void) +{ + static const char test[] = "]]>"; + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, test, sizeof(test) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(test) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_CDATA, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node; + ok( node->nodeType == WS_XML_NODE_TYPE_TEXT, "got %u\n", node->nodeType ); + ok( text->text != NULL, "text not set\n" ); + if (text->text) + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + ok( utf8->text.textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", utf8->text.textType ); + ok( utf8->value.length == 6, "got %u\n", utf8->value.length ); + ok( !memcmp( utf8->value.bytes, "", 6 ), "wrong data\n" ); + } + } + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_END_CDATA, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType ); + + WsFreeReader( reader ); +} + START_TEST(reader) { test_WsCreateError(); @@ -1724,4 +1888,6 @@ test_WsXmlStringEquals(); test_WsAlloc(); test_WsMoveReader(); + test_simple_struct_type(); + test_cdata(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/tests/writer.c wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/tests/writer.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/tests/writer.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/tests/writer.c 2016-02-08 19:32:34.000000000 +0000 @@ -636,6 +636,389 @@ WsFreeWriter( writer ); } +static void test_simple_struct_type(void) +{ + static const WCHAR valueW[] = {'v','a','l','u','e',0}; + HRESULT hr; + WS_XML_WRITER *writer; + WS_STRUCT_DESCRIPTION s; + WS_FIELD_DESCRIPTION f, *fields[1]; + WS_XML_STRING localname = {6, (BYTE *)"struct"}, ns = {0, NULL}; + struct test + { + const WCHAR *field; + } *test; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + memset( &f, 0, sizeof(f) ); + f.mapping = WS_TEXT_FIELD_MAPPING; + f.type = WS_WSZ_TYPE; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(struct test); + s.alignment = TYPE_ALIGNMENT(struct test); + s.fields = fields; + s.fieldCount = 1; + + test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) ); + test->field = valueW; + hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, NULL, + WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "value", __LINE__ ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteType( writer, WS_ELEMENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "value", __LINE__ ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartAttribute( writer, NULL, &localname, &ns, FALSE, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteType( writer, WS_ATTRIBUTE_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndAttribute( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + HeapFree( GetProcessHeap(), 0, test ); + WsFreeWriter( writer ); +} + +static void test_WsWriteElement(void) +{ + static const WCHAR testW[] = {'t','e','s','t',0}; + HRESULT hr; + WS_XML_WRITER *writer; + WS_STRUCT_DESCRIPTION s; + WS_FIELD_DESCRIPTION f, *fields[1]; + WS_ELEMENT_DESCRIPTION desc; + WS_XML_STRING localname = {3, (BYTE *)"str"}, ns = {0, NULL}; + struct test { const WCHAR *str; } *test; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* text field mapping */ + memset( &f, 0, sizeof(f) ); + f.mapping = WS_TEXT_FIELD_MAPPING; + f.type = WS_WSZ_TYPE; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(struct test); + s.alignment = TYPE_ALIGNMENT(struct test); + s.fields = fields; + s.fieldCount = 1; + + desc.elementLocalName = &localname; + desc.elementNs = &ns; + desc.type = WS_STRUCT_TYPE; + desc.typeDescription = &s; + + test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) ); + test->str = testW; + hr = WsWriteElement( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteElement( writer, NULL, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "test", __LINE__ ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "test", __LINE__ ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* attribute field mapping */ + f.mapping = WS_ATTRIBUTE_FIELD_MAPPING; + + /* requires localName and ns to be set */ + hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + f.localName = &localname; + f.ns = &ns; + hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + HeapFree( GetProcessHeap(), 0, test ); + WsFreeWriter( writer ); +} + +static void test_WsWriteValue(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_STRING localname = {1, (BYTE *)"t"}, ns = {0, NULL}; + ULONG i; + static const struct + { + WS_VALUE_TYPE type; + INT64 val; + ULONG size; + const char *result; + const char *result2; + } + tests[] = + { + { WS_BOOL_VALUE_TYPE, ~0, sizeof(BOOL), "true", "" }, + { WS_BOOL_VALUE_TYPE, FALSE, sizeof(BOOL), "false", "" }, + { WS_INT8_VALUE_TYPE, -128, sizeof(INT8), "-128", "" }, + { WS_INT16_VALUE_TYPE, -32768, sizeof(INT16), "-32768", "" }, + { WS_INT32_VALUE_TYPE, -2147483647 - 1, sizeof(INT32), "-2147483648", + "" }, + { WS_INT64_VALUE_TYPE, -9223372036854775807 - 1, sizeof(INT64), "-9223372036854775808", + "" }, + { WS_UINT8_VALUE_TYPE, 255, sizeof(UINT8), "255", "" }, + { WS_UINT16_VALUE_TYPE, 65535, sizeof(UINT16), "65535", "" }, + { WS_UINT32_VALUE_TYPE, ~0u, sizeof(UINT32), "4294967295", "" }, + { WS_UINT64_VALUE_TYPE, ~0, sizeof(UINT64), "18446744073709551615", + "" }, + }; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteValue( NULL, tests[0].type, &tests[0].val, tests[0].size, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteValue( writer, tests[0].type, &tests[0].val, tests[0].size, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* zero size */ + hr = WsWriteValue( writer, tests[0].type, &tests[0].val, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* NULL value */ + hr = WsWriteValue( writer, tests[0].type, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + /* element type mapping */ + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteValue( writer, tests[i].type, &tests[i].val, tests[i].size, NULL ); + ok( hr == S_OK, "%u: got %08x\n", i, hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, tests[i].result, __LINE__ ); + } + + /* attribute type mapping */ + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartAttribute( writer, NULL, &localname, &ns, FALSE, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteValue( writer, tests[i].type, &tests[i].val, tests[i].size, NULL ); + ok( hr == S_OK, "%u: got %08x\n", i, hr ); + + hr = WsWriteEndAttribute( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, tests[i].result2, __LINE__ ); + } + + WsFreeWriter( writer ); +} + +static void test_WsWriteAttribute(void) +{ + static const WCHAR testW[] = {'t','e','s','t',0}; + HRESULT hr; + WS_XML_WRITER *writer; + WS_STRUCT_DESCRIPTION s; + WS_FIELD_DESCRIPTION f, *fields[1]; + WS_ATTRIBUTE_DESCRIPTION desc; + WS_XML_STRING localname = {3, (BYTE *)"str"}, ns = {0, NULL}; + struct test { const WCHAR *str; } *test; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* text field mapping */ + memset( &f, 0, sizeof(f) ); + f.mapping = WS_TEXT_FIELD_MAPPING; + f.type = WS_WSZ_TYPE; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(struct test); + s.alignment = TYPE_ALIGNMENT(struct test); + s.fields = fields; + s.fieldCount = 1; + + desc.attributeLocalName = &localname; + desc.attributeNs = &ns; + desc.type = WS_STRUCT_TYPE; + desc.typeDescription = &s; + + test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) ); + test->str = testW; + hr = WsWriteAttribute( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteAttribute( writer, NULL, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteAttribute( writer, &desc, WS_WRITE_REQUIRED_POINTER, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsWriteAttribute( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteAttribute( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + HeapFree( GetProcessHeap(), 0, test ); + WsFreeWriter( writer ); +} + +static void test_WsWriteStartCData(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_STRING localname = {1, (BYTE *)"t"}, ns = {0, NULL}; + WS_XML_UTF8_TEXT text; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndCData( writer, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteStartCData( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, ""; + text.value.length = 6; + hr = WsWriteText( writer, &text.text, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteEndCData( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "]]>", __LINE__ ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "]]>", __LINE__ ); + + WsFreeWriter( writer ); +} + START_TEST(writer) { test_WsCreateWriter(); @@ -646,4 +1029,9 @@ test_WsWriteStartAttribute(); test_WsWriteType(); test_basic_type(); + test_simple_struct_type(); + test_WsWriteElement(); + test_WsWriteValue(); + test_WsWriteAttribute(); + test_WsWriteStartCData(); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/webservices.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/webservices.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/webservices.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/webservices.spec 2016-02-08 19:32:34.000000000 +0000 @@ -108,7 +108,7 @@ @ stub WsReadChars @ stub WsReadCharsUtf8 @ stub WsReadElement -@ stub WsReadEndAttribute +@ stdcall WsReadEndAttribute(ptr ptr) @ stdcall WsReadEndElement(ptr ptr) @ stub WsReadEndpointAddressExtension @ stub WsReadEnvelopeEnd @@ -118,7 +118,7 @@ @ stub WsReadMetadata @ stdcall WsReadNode(ptr ptr) @ stub WsReadQualifiedName -@ stub WsReadStartAttribute +@ stdcall WsReadStartAttribute(ptr long ptr) @ stdcall WsReadStartElement(ptr ptr) @ stdcall WsReadToStartElement(ptr ptr ptr ptr ptr) @ stdcall WsReadType(ptr long long ptr long ptr ptr long ptr) @@ -165,14 +165,14 @@ @ stub WsTrimXmlWhitespace @ stub WsVerifyXmlNCName @ stub WsWriteArray -@ stub WsWriteAttribute +@ stdcall WsWriteAttribute(ptr ptr long ptr long ptr) @ stub WsWriteBody @ stub WsWriteBytes @ stub WsWriteChars @ stub WsWriteCharsUtf8 -@ stub WsWriteElement +@ stdcall WsWriteElement(ptr ptr long ptr long ptr) @ stdcall WsWriteEndAttribute(ptr ptr) -@ stub WsWriteEndCData +@ stdcall WsWriteEndCData(ptr ptr) @ stdcall WsWriteEndElement(ptr ptr) @ stdcall WsWriteEndStartElement(ptr ptr) @ stub WsWriteEnvelopeEnd @@ -182,11 +182,11 @@ @ stub WsWriteNode @ stub WsWriteQualifiedName @ stdcall WsWriteStartAttribute(ptr ptr ptr ptr long ptr) -@ stub WsWriteStartCData +@ stdcall WsWriteStartCData(ptr ptr) @ stdcall WsWriteStartElement(ptr ptr ptr ptr ptr) @ stdcall WsWriteText(ptr ptr ptr) @ stdcall WsWriteType(ptr long long ptr long ptr long ptr) -@ stub WsWriteValue +@ stdcall WsWriteValue(ptr long ptr long ptr) @ stdcall WsWriteXmlBuffer(ptr ptr ptr) @ stdcall WsWriteXmlBufferToBytes(ptr ptr ptr ptr long ptr ptr ptr ptr) @ stub WsWriteXmlnsAttribute diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/writer.c wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/writer.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/webservices/writer.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/webservices/writer.c 2016-02-08 19:32:34.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2015 Hans Leidekker for CodeWeavers + * Copyright 2015, 2016 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -64,9 +64,11 @@ WRITER_STATE_STARTELEMENT, WRITER_STATE_STARTENDELEMENT, WRITER_STATE_STARTATTRIBUTE, + WRITER_STATE_STARTCDATA, WRITER_STATE_ENDSTARTELEMENT, WRITER_STATE_TEXT, - WRITER_STATE_ENDELEMENT + WRITER_STATE_ENDELEMENT, + WRITER_STATE_ENDCDATA }; struct writer @@ -670,6 +672,43 @@ return S_OK; } +static HRESULT write_add_attribute( struct writer *writer, const WS_XML_STRING *prefix, + const WS_XML_STRING *localname, const WS_XML_STRING *ns, + BOOL single ) +{ + WS_XML_ATTRIBUTE *attr; + WS_XML_ELEMENT_NODE *elem = &writer->current->hdr; + HRESULT hr; + + if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY; + + if (!prefix) prefix = elem->prefix; + + attr->singleQuote = !!single; + if (prefix && !(attr->prefix = alloc_xml_string( prefix->bytes, prefix->length ))) + { + free_attribute( attr ); + return E_OUTOFMEMORY; + } + if (!(attr->localName = alloc_xml_string( localname->bytes, localname->length ))) + { + free_attribute( attr ); + return E_OUTOFMEMORY; + } + if (!(attr->ns = alloc_xml_string( ns->bytes, ns->length ))) + { + free_attribute( attr ); + return E_OUTOFMEMORY; + } + if ((hr = append_attribute( elem, attr )) != S_OK) + { + free_attribute( attr ); + return hr; + } + writer->state = WRITER_STATE_STARTATTRIBUTE; + return S_OK; +} + /************************************************************************** * WsWriteStartAttribute [webservices.@] */ @@ -678,9 +717,6 @@ BOOL single, WS_ERROR *error ) { struct writer *writer = (struct writer *)handle; - WS_XML_ELEMENT_NODE *elem; - WS_XML_ATTRIBUTE *attr; - HRESULT hr = E_OUTOFMEMORY; TRACE( "%p %s %s %s %d %p\n", handle, debugstr_xmlstr(prefix), debugstr_xmlstr(localname), debugstr_xmlstr(ns), single, error ); @@ -689,75 +725,106 @@ if (!writer || !localname || !ns) return E_INVALIDARG; if (writer->state != WRITER_STATE_STARTELEMENT) return WS_E_INVALID_OPERATION; - elem = (WS_XML_ELEMENT_NODE *)writer->current; - if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY; - attr->singleQuote = !!single; + return write_add_attribute( writer, prefix, localname, ns, single ); +} - if (prefix && !(attr->prefix = alloc_xml_string( prefix->bytes, prefix->length ))) - goto error; +/************************************************************************** + * WsWriteStartCData [webservices.@] + */ +HRESULT WINAPI WsWriteStartCData( WS_XML_WRITER *handle, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + HRESULT hr; - if (!(attr->localName = alloc_xml_string( localname->bytes, localname->length ))) - goto error; + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); - if (!(attr->ns = alloc_xml_string( ns->bytes, ns->length ))) - goto error; + if (!writer) return E_INVALIDARG; - if ((hr = append_attribute( elem, attr )) != S_OK) goto error; + /* flush current start element if necessary */ + if (writer->state == WRITER_STATE_STARTELEMENT && ((hr = write_endstartelement( writer )) != S_OK)) + return hr; - writer->state = WRITER_STATE_STARTATTRIBUTE; + if ((hr = write_grow_buffer( writer, 9 )) != S_OK) return hr; + write_bytes( writer, (const BYTE *)"state = WRITER_STATE_STARTCDATA; return S_OK; - -error: - free_attribute( attr ); - return hr; } /************************************************************************** - * WsWriteStartElement [webservices.@] + * WsWriteEndCData [webservices.@] */ -HRESULT WINAPI WsWriteStartElement( WS_XML_WRITER *handle, const WS_XML_STRING *prefix, - const WS_XML_STRING *localname, const WS_XML_STRING *ns, - WS_ERROR *error ) +HRESULT WINAPI WsWriteEndCData( WS_XML_WRITER *handle, WS_ERROR *error ) { struct writer *writer = (struct writer *)handle; - struct node *node; - WS_XML_ELEMENT_NODE *elem; - HRESULT hr = E_OUTOFMEMORY; + HRESULT hr; - TRACE( "%p %s %s %s %p\n", handle, debugstr_xmlstr(prefix), debugstr_xmlstr(localname), - debugstr_xmlstr(ns), error ); + TRACE( "%p %p\n", handle, error ); if (error) FIXME( "ignoring error parameter\n" ); - if (!writer || !localname || !ns) return E_INVALIDARG; + if (!writer) return E_INVALIDARG; + if (writer->state != WRITER_STATE_STARTCDATA) return WS_E_INVALID_OPERATION; - /* flush current start element */ - if (writer->state == WRITER_STATE_STARTELEMENT) - { - if ((hr = write_startelement( writer )) != S_OK) return hr; - if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; - write_char( writer, '>' ); - } + if ((hr = write_grow_buffer( writer, 3 )) != S_OK) return hr; + write_bytes( writer, (const BYTE *)"]]>", 3 ); + writer->state = WRITER_STATE_ENDCDATA; + return S_OK; +} + +static HRESULT write_add_element_node( struct writer *writer, const WS_XML_STRING *prefix, + const WS_XML_STRING *localname, const WS_XML_STRING *ns ) +{ + struct node *node; + WS_XML_ELEMENT_NODE *elem, *current = &writer->current->hdr; + HRESULT hr; + + /* flush current start element if necessary */ + if (writer->state == WRITER_STATE_STARTELEMENT && ((hr = write_endstartelement( writer )) != S_OK)) + return hr; + + if (!prefix && current->node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + prefix = current->prefix; if (!(node = alloc_node( WS_XML_NODE_TYPE_ELEMENT ))) return E_OUTOFMEMORY; - elem = (WS_XML_ELEMENT_NODE *)node; + elem = &node->hdr; if (prefix && !(elem->prefix = alloc_xml_string( prefix->bytes, prefix->length ))) - goto error; - + { + free_node( node ); + return E_OUTOFMEMORY; + } if (!(elem->localName = alloc_xml_string( localname->bytes, localname->length ))) - goto error; - + { + free_node( node ); + return E_OUTOFMEMORY; + } if (!(elem->ns = alloc_xml_string( ns->bytes, ns->length ))) - goto error; - + { + free_node( node ); + return E_OUTOFMEMORY; + } write_insert_node( writer, node ); writer->state = WRITER_STATE_STARTELEMENT; return S_OK; +} -error: - free_node( node ); - return hr; +/************************************************************************** + * WsWriteStartElement [webservices.@] + */ +HRESULT WINAPI WsWriteStartElement( WS_XML_WRITER *handle, const WS_XML_STRING *prefix, + const WS_XML_STRING *localname, const WS_XML_STRING *ns, + WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + + TRACE( "%p %s %s %s %p\n", handle, debugstr_xmlstr(prefix), debugstr_xmlstr(localname), + debugstr_xmlstr(ns), error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !localname || !ns) return E_INVALIDARG; + + return write_add_element_node( writer, prefix, localname, ns ); } static inline void write_set_attribute_value( struct writer *writer, WS_XML_TEXT *text ) @@ -772,27 +839,32 @@ HRESULT WINAPI WsWriteText( WS_XML_WRITER *handle, const WS_XML_TEXT *text, WS_ERROR *error ) { struct writer *writer = (struct writer *)handle; - WS_XML_UTF8_TEXT *src, *dst; + WS_XML_UTF8_TEXT *dst, *src = (WS_XML_UTF8_TEXT *)text; + HRESULT hr; TRACE( "%p %p %p\n", handle, text, error ); if (!writer || !text) return E_INVALIDARG; - if (writer->state != WRITER_STATE_STARTATTRIBUTE) - { - FIXME( "can't handle writer state %u\n", writer->state ); - return E_NOTIMPL; - } if (text->textType != WS_XML_TEXT_TYPE_UTF8) { FIXME( "text type %u not supported\n", text->textType ); return E_NOTIMPL; } - src = (WS_XML_UTF8_TEXT *)text; - if (!(dst = alloc_utf8_text( src->value.bytes, src->value.length ))) - return E_OUTOFMEMORY; - write_set_attribute_value( writer, &dst->text ); + if (writer->state == WRITER_STATE_STARTATTRIBUTE) + { + if (!(dst = alloc_utf8_text( src->value.bytes, src->value.length ))) + return E_OUTOFMEMORY; + + write_set_attribute_value( writer, &dst->text ); + } + else + { + if ((hr = write_grow_buffer( writer, src->value.length )) != S_OK) return hr; + write_bytes( writer, src->value.bytes, src->value.length ); + } + return S_OK; } @@ -1113,12 +1185,153 @@ return hr; } +static HRESULT write_type_struct( struct writer *, WS_TYPE_MAPPING, const WS_STRUCT_DESCRIPTION *, + const void * ); + +static HRESULT write_type_struct_field( struct writer *writer, WS_TYPE_MAPPING mapping, + const WS_FIELD_DESCRIPTION *desc, const void *value ) +{ + HRESULT hr; + + if (desc->options && desc->options != WS_FIELD_POINTER && + desc->options != WS_FIELD_OPTIONAL && + desc->options != (WS_FIELD_POINTER | WS_FIELD_OPTIONAL)) + { + FIXME( "options 0x%x not supported\n", desc->options ); + return E_NOTIMPL; + } + + switch (desc->mapping) + { + case WS_ATTRIBUTE_FIELD_MAPPING: + if ((hr = write_add_attribute( writer, NULL, desc->localName, desc->ns, FALSE )) != S_OK) + return hr; + break; + + case WS_TEXT_FIELD_MAPPING: + break; + + default: + FIXME( "field mapping %u not supported\n", desc->mapping ); + return E_NOTIMPL; + } + + switch (desc->type) + { + case WS_STRUCT_TYPE: + { + const void * const *ptr = value; + if ((hr = write_type_struct( writer, mapping, desc->typeDescription, *ptr )) != S_OK) return hr; + break; + } + case WS_BOOL_TYPE: + { + const BOOL *ptr = value; + if ((hr = write_type_bool( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_INT8_TYPE: + { + const INT8 *ptr = value; + if ((hr = write_type_int8( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_INT16_TYPE: + { + const INT16 *ptr = value; + if ((hr = write_type_int16( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_INT32_TYPE: + { + const INT32 *ptr = value; + if ((hr = write_type_int32( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_INT64_TYPE: + { + const INT64 *ptr = value; + if ((hr = write_type_int64( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_UINT8_TYPE: + { + const UINT8 *ptr = value; + if ((hr = write_type_uint8( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_UINT16_TYPE: + { + const UINT16 *ptr = value; + if ((hr = write_type_uint16( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_UINT32_TYPE: + { + const UINT32 *ptr = value; + if ((hr = write_type_uint32( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_UINT64_TYPE: + { + const UINT64 *ptr = value; + if ((hr = write_type_uint64( writer, mapping, desc->typeDescription, ptr )) != S_OK) return hr; + break; + } + case WS_WSZ_TYPE: + { + const WCHAR * const *ptr = value; + if ((hr = write_type_wsz( writer, mapping, desc->typeDescription, *ptr )) != S_OK) return hr; + break; + } + default: + FIXME( "type %u not implemented\n", desc->type ); + return E_NOTIMPL; + } + + return S_OK; +} + +static HRESULT write_type_struct( struct writer *writer, WS_TYPE_MAPPING mapping, + const WS_STRUCT_DESCRIPTION *desc, const void *value ) +{ + ULONG i; + HRESULT hr; + const char *ptr; + + if (!desc) return E_INVALIDARG; + + if (desc->structOptions) + { + FIXME( "struct options 0x%x not supported\n", desc->structOptions ); + return E_NOTIMPL; + } + + for (i = 0; i < desc->fieldCount; i++) + { + ptr = (const char *)value + desc->fields[i]->offset; + if ((hr = write_type_struct_field( writer, mapping, desc->fields[i], ptr )) != S_OK) + return hr; + } + + return S_OK; +} + static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TYPE type, const void *desc, WS_WRITE_OPTION option, const void *value, ULONG size ) { switch (type) { + case WS_STRUCT_TYPE: + { + const void * const *ptr = value; + + if (!desc || option != WS_WRITE_REQUIRED_POINTER || size != sizeof(*ptr)) + return E_INVALIDARG; + + return write_type_struct( writer, mapping, desc, *ptr ); + } case WS_BOOL_TYPE: { const BOOL *ptr = value; @@ -1186,6 +1399,59 @@ } /************************************************************************** + * WsWriteAttribute [webservices.@] + */ +HRESULT WINAPI WsWriteAttribute( WS_XML_WRITER *handle, const WS_ATTRIBUTE_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *value, ULONG size, + WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + HRESULT hr; + + TRACE( "%p %p %u %p %u %p\n", handle, desc, option, value, size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !desc || !desc->attributeLocalName || !desc->attributeNs || !value) + return E_INVALIDARG; + + if (writer->state != WRITER_STATE_STARTELEMENT) return WS_E_INVALID_OPERATION; + + if ((hr = write_add_attribute( writer, NULL, desc->attributeLocalName, desc->attributeNs, + FALSE )) != S_OK) return hr; + + if ((hr = write_type( writer, WS_ATTRIBUTE_TYPE_MAPPING, desc->type, desc->typeDescription, + option, value, size )) != S_OK) return hr; + + writer->state = WRITER_STATE_STARTELEMENT; + return S_OK; +} + +/************************************************************************** + * WsWriteElement [webservices.@] + */ +HRESULT WINAPI WsWriteElement( WS_XML_WRITER *handle, const WS_ELEMENT_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *value, ULONG size, + WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + HRESULT hr; + + TRACE( "%p %p %u %p %u %p\n", handle, desc, option, value, size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !desc || !desc->elementLocalName || !desc->elementNs || !value) + return E_INVALIDARG; + + if ((hr = write_add_element_node( writer, NULL, desc->elementLocalName, desc->elementNs )) != S_OK) + return hr; + + if ((hr = write_type( writer, WS_ANY_ELEMENT_TYPE_MAPPING, desc->type, desc->typeDescription, + option, value, size )) != S_OK) return hr; + + return write_close_element( writer ); +} + +/************************************************************************** * WsWriteType [webservices.@] */ HRESULT WINAPI WsWriteType( WS_XML_WRITER *handle, WS_TYPE_MAPPING mapping, WS_TYPE type, @@ -1226,6 +1492,63 @@ return hr; } +static WS_TYPE map_value_type( WS_VALUE_TYPE type ) +{ + switch (type) + { + case WS_BOOL_VALUE_TYPE: return WS_BOOL_TYPE; + case WS_INT8_VALUE_TYPE: return WS_INT8_TYPE; + case WS_INT16_VALUE_TYPE: return WS_INT16_TYPE; + case WS_INT32_VALUE_TYPE: return WS_INT32_TYPE; + case WS_INT64_VALUE_TYPE: return WS_INT64_TYPE; + case WS_UINT8_VALUE_TYPE: return WS_UINT8_TYPE; + case WS_UINT16_VALUE_TYPE: return WS_UINT16_TYPE; + case WS_UINT32_VALUE_TYPE: return WS_UINT32_TYPE; + case WS_UINT64_VALUE_TYPE: return WS_UINT64_TYPE; + case WS_FLOAT_VALUE_TYPE: return WS_FLOAT_TYPE; + case WS_DOUBLE_VALUE_TYPE: return WS_DOUBLE_TYPE; + case WS_DECIMAL_VALUE_TYPE: return WS_DECIMAL_TYPE; + case WS_DATETIME_VALUE_TYPE: return WS_DATETIME_TYPE; + case WS_TIMESPAN_VALUE_TYPE: return WS_TIMESPAN_TYPE; + case WS_GUID_VALUE_TYPE: return WS_GUID_TYPE; + default: + FIXME( "unhandled type %u\n", type ); + return ~0u; + } +} + +/************************************************************************** + * WsWriteValue [webservices.@] + */ +HRESULT WINAPI WsWriteValue( WS_XML_WRITER *handle, WS_VALUE_TYPE value_type, const void *value, + ULONG size, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + WS_TYPE_MAPPING mapping; + WS_TYPE type; + + TRACE( "%p %u %p %u %p\n", handle, value_type, value, size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !value || (type = map_value_type( value_type )) == ~0u) return E_INVALIDARG; + + switch (writer->state) + { + case WRITER_STATE_STARTATTRIBUTE: + mapping = WS_ATTRIBUTE_TYPE_MAPPING; + break; + + case WRITER_STATE_STARTELEMENT: + mapping = WS_ELEMENT_TYPE_MAPPING; + break; + + default: + return WS_E_INVALID_FORMAT; + } + + return write_type( writer, mapping, type, NULL, WS_WRITE_REQUIRED_VALUE, value, size ); +} + /************************************************************************** * WsWriteXmlBuffer [webservices.@] */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c 2016-02-08 19:32:34.000000000 +0000 @@ -798,7 +798,7 @@ DWORD highest_constf = 0, clip_limit; max_constantsF -= reserved_vs_const(shader_data, reg_maps, gl_info); - max_constantsF -= count_bits(reg_maps->integer_constants); + max_constantsF -= wined3d_popcount(reg_maps->integer_constants); max_constantsF -= gl_info->reserved_arb_constants; for (i = 0; i < shader->limits->constant_float; ++i) @@ -819,7 +819,7 @@ else { unsigned int mask = ctx->cur_vs_args->clip.boolclip.clipplane_mask; - clip_limit = min(count_bits(mask), 4); + clip_limit = min(wined3d_popcount(mask), 4); } *num_clipplanes = min(clip_limit, max_constantsF - highest_constf - 1); max_constantsF -= *num_clipplanes; @@ -5212,130 +5212,148 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = { - /* WINED3DSIH_ABS */ shader_hw_map2gl, - /* WINED3DSIH_ADD */ shader_hw_map2gl, - /* WINED3DSIH_AND */ NULL, - /* WINED3DSIH_BEM */ pshader_hw_bem, - /* WINED3DSIH_BREAK */ shader_hw_break, - /* WINED3DSIH_BREAKC */ shader_hw_breakc, - /* WINED3DSIH_BREAKP */ NULL, - /* WINED3DSIH_CALL */ shader_hw_call, - /* WINED3DSIH_CALLNZ */ NULL, - /* WINED3DSIH_CMP */ pshader_hw_cmp, - /* WINED3DSIH_CND */ pshader_hw_cnd, - /* WINED3DSIH_CRS */ shader_hw_map2gl, - /* WINED3DSIH_CUT */ NULL, - /* WINED3DSIH_DCL */ shader_hw_nop, - /* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_hw_nop, - /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop, - /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop, - /* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop, - /* WINED3DSIH_DEF */ shader_hw_nop, - /* WINED3DSIH_DEFB */ shader_hw_nop, - /* WINED3DSIH_DEFI */ shader_hw_nop, - /* WINED3DSIH_DIV */ NULL, - /* WINED3DSIH_DP2 */ NULL, - /* WINED3DSIH_DP2ADD */ pshader_hw_dp2add, - /* WINED3DSIH_DP3 */ shader_hw_map2gl, - /* WINED3DSIH_DP4 */ shader_hw_map2gl, - /* WINED3DSIH_DST */ shader_hw_map2gl, - /* WINED3DSIH_DSX */ shader_hw_map2gl, - /* WINED3DSIH_DSY */ shader_hw_dsy, - /* WINED3DSIH_ELSE */ shader_hw_else, - /* WINED3DSIH_EMIT */ NULL, - /* WINED3DSIH_ENDIF */ shader_hw_endif, - /* WINED3DSIH_ENDLOOP */ shader_hw_endloop, - /* WINED3DSIH_ENDREP */ shader_hw_endrep, - /* WINED3DSIH_EQ */ NULL, - /* WINED3DSIH_EXP */ shader_hw_scalar_op, - /* WINED3DSIH_EXPP */ shader_hw_scalar_op, - /* WINED3DSIH_FRC */ shader_hw_map2gl, - /* WINED3DSIH_FTOI */ NULL, - /* WINED3DSIH_FTOU */ NULL, - /* WINED3DSIH_GE */ NULL, - /* WINED3DSIH_IADD */ NULL, - /* WINED3DSIH_IEQ */ NULL, - /* WINED3DSIH_IF */ NULL /* Hardcoded into the shader */, - /* WINED3DSIH_IFC */ shader_hw_ifc, - /* WINED3DSIH_IGE */ NULL, - /* WINED3DSIH_ILT */ NULL, - /* WINED3DSIH_IMAD */ NULL, - /* WINED3DSIH_IMAX */ NULL, - /* WINED3DSIH_IMIN */ NULL, - /* WINED3DSIH_IMUL */ NULL, - /* WINED3DSIH_INE */ NULL, - /* WINED3DSIH_INEG */ NULL, - /* WINED3DSIH_ISHL */ NULL, - /* WINED3DSIH_ITOF */ NULL, - /* WINED3DSIH_LABEL */ shader_hw_label, - /* WINED3DSIH_LD */ NULL, - /* WINED3DSIH_LIT */ shader_hw_map2gl, - /* WINED3DSIH_LOG */ shader_hw_scalar_op, - /* WINED3DSIH_LOGP */ shader_hw_scalar_op, - /* WINED3DSIH_LOOP */ shader_hw_loop, - /* WINED3DSIH_LRP */ shader_hw_lrp, - /* WINED3DSIH_LT */ NULL, - /* WINED3DSIH_M3x2 */ shader_hw_mnxn, - /* WINED3DSIH_M3x3 */ shader_hw_mnxn, - /* WINED3DSIH_M3x4 */ shader_hw_mnxn, - /* WINED3DSIH_M4x3 */ shader_hw_mnxn, - /* WINED3DSIH_M4x4 */ shader_hw_mnxn, - /* WINED3DSIH_MAD */ shader_hw_map2gl, - /* WINED3DSIH_MAX */ shader_hw_map2gl, - /* WINED3DSIH_MIN */ shader_hw_map2gl, - /* WINED3DSIH_MOV */ shader_hw_mov, - /* WINED3DSIH_MOVA */ shader_hw_mov, - /* WINED3DSIH_MOVC */ NULL, - /* WINED3DSIH_MUL */ shader_hw_map2gl, - /* WINED3DSIH_NE */ NULL, - /* WINED3DSIH_NOP */ shader_hw_nop, - /* WINED3DSIH_NRM */ shader_hw_nrm, - /* WINED3DSIH_OR */ NULL, - /* WINED3DSIH_PHASE */ shader_hw_nop, - /* WINED3DSIH_POW */ shader_hw_pow, - /* WINED3DSIH_RCP */ shader_hw_scalar_op, - /* WINED3DSIH_REP */ shader_hw_rep, - /* WINED3DSIH_RESINFO */ NULL, - /* WINED3DSIH_RET */ shader_hw_ret, - /* WINED3DSIH_ROUND_NI */ NULL, - /* WINED3DSIH_RSQ */ shader_hw_scalar_op, - /* WINED3DSIH_SAMPLE */ NULL, - /* WINED3DSIH_SAMPLE_GRAD */ NULL, - /* WINED3DSIH_SAMPLE_LOD */ NULL, - /* WINED3DSIH_SETP */ NULL, - /* WINED3DSIH_SGE */ shader_hw_map2gl, - /* WINED3DSIH_SGN */ shader_hw_sgn, - /* WINED3DSIH_SINCOS */ shader_hw_sincos, - /* WINED3DSIH_SLT */ shader_hw_map2gl, - /* WINED3DSIH_SQRT */ NULL, - /* WINED3DSIH_SUB */ shader_hw_map2gl, - /* WINED3DSIH_TEX */ pshader_hw_tex, - /* WINED3DSIH_TEXBEM */ pshader_hw_texbem, - /* WINED3DSIH_TEXBEML */ pshader_hw_texbem, - /* WINED3DSIH_TEXCOORD */ pshader_hw_texcoord, - /* WINED3DSIH_TEXDEPTH */ pshader_hw_texdepth, - /* WINED3DSIH_TEXDP3 */ pshader_hw_texdp3, - /* WINED3DSIH_TEXDP3TEX */ pshader_hw_texdp3tex, - /* WINED3DSIH_TEXKILL */ pshader_hw_texkill, - /* WINED3DSIH_TEXLDD */ shader_hw_texldd, - /* WINED3DSIH_TEXLDL */ shader_hw_texldl, - /* WINED3DSIH_TEXM3x2DEPTH */ pshader_hw_texm3x2depth, - /* WINED3DSIH_TEXM3x2PAD */ pshader_hw_texm3x2pad, - /* WINED3DSIH_TEXM3x2TEX */ pshader_hw_texm3x2tex, - /* WINED3DSIH_TEXM3x3 */ pshader_hw_texm3x3, - /* WINED3DSIH_TEXM3x3DIFF */ NULL, - /* WINED3DSIH_TEXM3x3PAD */ pshader_hw_texm3x3pad, - /* WINED3DSIH_TEXM3x3SPEC */ pshader_hw_texm3x3spec, - /* WINED3DSIH_TEXM3x3TEX */ pshader_hw_texm3x3tex, - /* WINED3DSIH_TEXM3x3VSPEC */ pshader_hw_texm3x3vspec, - /* WINED3DSIH_TEXREG2AR */ pshader_hw_texreg2ar, - /* WINED3DSIH_TEXREG2GB */ pshader_hw_texreg2gb, - /* WINED3DSIH_TEXREG2RGB */ pshader_hw_texreg2rgb, - /* WINED3DSIH_UDIV */ NULL, - /* WINED3DSIH_UGE */ NULL, - /* WINED3DSIH_USHR */ NULL, - /* WINED3DSIH_UTOF */ NULL, - /* WINED3DSIH_XOR */ NULL, + /* WINED3DSIH_ABS */ shader_hw_map2gl, + /* WINED3DSIH_ADD */ shader_hw_map2gl, + /* WINED3DSIH_AND */ NULL, + /* WINED3DSIH_BEM */ pshader_hw_bem, + /* WINED3DSIH_BREAK */ shader_hw_break, + /* WINED3DSIH_BREAKC */ shader_hw_breakc, + /* WINED3DSIH_BREAKP */ NULL, + /* WINED3DSIH_CALL */ shader_hw_call, + /* WINED3DSIH_CALLNZ */ NULL, + /* WINED3DSIH_CMP */ pshader_hw_cmp, + /* WINED3DSIH_CND */ pshader_hw_cnd, + /* WINED3DSIH_CRS */ shader_hw_map2gl, + /* WINED3DSIH_CUT */ NULL, + /* WINED3DSIH_DCL */ shader_hw_nop, + /* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_hw_nop, + /* WINED3DSIH_DCL_GLOBAL_FLAGS */ NULL, + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL, + /* WINED3DSIH_DCL_INPUT */ NULL, + /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop, + /* WINED3DSIH_DCL_INPUT_PS */ NULL, + /* WINED3DSIH_DCL_INPUT_PS_SGV */ NULL, + /* WINED3DSIH_DCL_INPUT_PS_SIV */ NULL, + /* WINED3DSIH_DCL_INPUT_SGV */ NULL, + /* WINED3DSIH_DCL_INPUT_SIV */ NULL, + /* WINED3DSIH_DCL_OUTPUT */ NULL, + /* WINED3DSIH_DCL_OUTPUT_SIV */ NULL, + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop, + /* WINED3DSIH_DCL_SAMPLER */ NULL, + /* WINED3DSIH_DCL_TEMPS */ NULL, + /* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop, + /* WINED3DSIH_DEF */ shader_hw_nop, + /* WINED3DSIH_DEFB */ shader_hw_nop, + /* WINED3DSIH_DEFI */ shader_hw_nop, + /* WINED3DSIH_DIV */ NULL, + /* WINED3DSIH_DP2 */ NULL, + /* WINED3DSIH_DP2ADD */ pshader_hw_dp2add, + /* WINED3DSIH_DP3 */ shader_hw_map2gl, + /* WINED3DSIH_DP4 */ shader_hw_map2gl, + /* WINED3DSIH_DST */ shader_hw_map2gl, + /* WINED3DSIH_DSX */ shader_hw_map2gl, + /* WINED3DSIH_DSY */ shader_hw_dsy, + /* WINED3DSIH_ELSE */ shader_hw_else, + /* WINED3DSIH_EMIT */ NULL, + /* WINED3DSIH_ENDIF */ shader_hw_endif, + /* WINED3DSIH_ENDLOOP */ shader_hw_endloop, + /* WINED3DSIH_ENDREP */ shader_hw_endrep, + /* WINED3DSIH_EQ */ NULL, + /* WINED3DSIH_EXP */ shader_hw_scalar_op, + /* WINED3DSIH_EXPP */ shader_hw_scalar_op, + /* WINED3DSIH_FRC */ shader_hw_map2gl, + /* WINED3DSIH_FTOI */ NULL, + /* WINED3DSIH_FTOU */ NULL, + /* WINED3DSIH_GE */ NULL, + /* WINED3DSIH_IADD */ NULL, + /* WINED3DSIH_IEQ */ NULL, + /* WINED3DSIH_IF */ NULL /* Hardcoded into the shader */, + /* WINED3DSIH_IFC */ shader_hw_ifc, + /* WINED3DSIH_IGE */ NULL, + /* WINED3DSIH_ILT */ NULL, + /* WINED3DSIH_IMAD */ NULL, + /* WINED3DSIH_IMAX */ NULL, + /* WINED3DSIH_IMIN */ NULL, + /* WINED3DSIH_IMUL */ NULL, + /* WINED3DSIH_INE */ NULL, + /* WINED3DSIH_INEG */ NULL, + /* WINED3DSIH_ISHL */ NULL, + /* WINED3DSIH_ITOF */ NULL, + /* WINED3DSIH_LABEL */ shader_hw_label, + /* WINED3DSIH_LD */ NULL, + /* WINED3DSIH_LIT */ shader_hw_map2gl, + /* WINED3DSIH_LOG */ shader_hw_scalar_op, + /* WINED3DSIH_LOGP */ shader_hw_scalar_op, + /* WINED3DSIH_LOOP */ shader_hw_loop, + /* WINED3DSIH_LRP */ shader_hw_lrp, + /* WINED3DSIH_LT */ NULL, + /* WINED3DSIH_M3x2 */ shader_hw_mnxn, + /* WINED3DSIH_M3x3 */ shader_hw_mnxn, + /* WINED3DSIH_M3x4 */ shader_hw_mnxn, + /* WINED3DSIH_M4x3 */ shader_hw_mnxn, + /* WINED3DSIH_M4x4 */ shader_hw_mnxn, + /* WINED3DSIH_MAD */ shader_hw_map2gl, + /* WINED3DSIH_MAX */ shader_hw_map2gl, + /* WINED3DSIH_MIN */ shader_hw_map2gl, + /* WINED3DSIH_MOV */ shader_hw_mov, + /* WINED3DSIH_MOVA */ shader_hw_mov, + /* WINED3DSIH_MOVC */ NULL, + /* WINED3DSIH_MUL */ shader_hw_map2gl, + /* WINED3DSIH_NE */ NULL, + /* WINED3DSIH_NOP */ shader_hw_nop, + /* WINED3DSIH_NOT */ NULL, + /* WINED3DSIH_NRM */ shader_hw_nrm, + /* WINED3DSIH_OR */ NULL, + /* WINED3DSIH_PHASE */ shader_hw_nop, + /* WINED3DSIH_POW */ shader_hw_pow, + /* WINED3DSIH_RCP */ shader_hw_scalar_op, + /* WINED3DSIH_REP */ shader_hw_rep, + /* WINED3DSIH_RESINFO */ NULL, + /* WINED3DSIH_RET */ shader_hw_ret, + /* WINED3DSIH_ROUND_NI */ NULL, + /* WINED3DSIH_ROUND_PI */ NULL, + /* WINED3DSIH_ROUND_Z */ NULL, + /* WINED3DSIH_RSQ */ shader_hw_scalar_op, + /* WINED3DSIH_SAMPLE */ NULL, + /* WINED3DSIH_SAMPLE_B */ NULL, + /* WINED3DSIH_SAMPLE_C */ NULL, + /* WINED3DSIH_SAMPLE_C_LZ */ NULL, + /* WINED3DSIH_SAMPLE_GRAD */ NULL, + /* WINED3DSIH_SAMPLE_LOD */ NULL, + /* WINED3DSIH_SETP */ NULL, + /* WINED3DSIH_SGE */ shader_hw_map2gl, + /* WINED3DSIH_SGN */ shader_hw_sgn, + /* WINED3DSIH_SINCOS */ shader_hw_sincos, + /* WINED3DSIH_SLT */ shader_hw_map2gl, + /* WINED3DSIH_SQRT */ NULL, + /* WINED3DSIH_SUB */ shader_hw_map2gl, + /* WINED3DSIH_TEX */ pshader_hw_tex, + /* WINED3DSIH_TEXBEM */ pshader_hw_texbem, + /* WINED3DSIH_TEXBEML */ pshader_hw_texbem, + /* WINED3DSIH_TEXCOORD */ pshader_hw_texcoord, + /* WINED3DSIH_TEXDEPTH */ pshader_hw_texdepth, + /* WINED3DSIH_TEXDP3 */ pshader_hw_texdp3, + /* WINED3DSIH_TEXDP3TEX */ pshader_hw_texdp3tex, + /* WINED3DSIH_TEXKILL */ pshader_hw_texkill, + /* WINED3DSIH_TEXLDD */ shader_hw_texldd, + /* WINED3DSIH_TEXLDL */ shader_hw_texldl, + /* WINED3DSIH_TEXM3x2DEPTH */ pshader_hw_texm3x2depth, + /* WINED3DSIH_TEXM3x2PAD */ pshader_hw_texm3x2pad, + /* WINED3DSIH_TEXM3x2TEX */ pshader_hw_texm3x2tex, + /* WINED3DSIH_TEXM3x3 */ pshader_hw_texm3x3, + /* WINED3DSIH_TEXM3x3DIFF */ NULL, + /* WINED3DSIH_TEXM3x3PAD */ pshader_hw_texm3x3pad, + /* WINED3DSIH_TEXM3x3SPEC */ pshader_hw_texm3x3spec, + /* WINED3DSIH_TEXM3x3TEX */ pshader_hw_texm3x3tex, + /* WINED3DSIH_TEXM3x3VSPEC */ pshader_hw_texm3x3vspec, + /* WINED3DSIH_TEXREG2AR */ pshader_hw_texreg2ar, + /* WINED3DSIH_TEXREG2GB */ pshader_hw_texreg2gb, + /* WINED3DSIH_TEXREG2RGB */ pshader_hw_texreg2rgb, + /* WINED3DSIH_UDIV */ NULL, + /* WINED3DSIH_UGE */ NULL, + /* WINED3DSIH_USHR */ NULL, + /* WINED3DSIH_UTOF */ NULL, + /* WINED3DSIH_XOR */ NULL, }; static BOOL get_bool_const(const struct wined3d_shader_instruction *ins, @@ -7904,15 +7922,15 @@ surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); } -static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, - const RECT *dst_rect, const struct wined3d_color *color) +static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) { FIXME("Color filling not implemented by arbfp_blit\n"); return WINED3DERR_INVALIDCALL; } -static HRESULT arbfp_blit_depth_fill(struct wined3d_device *device, - struct wined3d_surface *surface, const RECT *rect, float depth) +static HRESULT arbfp_blit_depth_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, + const RECT *rect, float depth) { FIXME("Depth filling not implemented by arbfp_blit.\n"); return WINED3DERR_INVALIDCALL; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/context.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/context.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/context.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/context.c 2016-02-08 19:32:34.000000000 +0000 @@ -1456,7 +1456,7 @@ unsigned int s; int swap_interval; DWORD state; - HDC hdc; + HDC hdc = 0; BOOL hdc_is_private = FALSE; TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); @@ -1837,6 +1837,7 @@ return ret; out: + if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); HeapFree(GetProcessHeap(), 0, ret->free_event_queries); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/device.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/device.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -599,7 +599,6 @@ { struct wined3d_color_key color_key; struct wined3d_resource_desc desc; - struct wined3d_surface *surface; HBITMAP hbm; BITMAP bm; HRESULT hr; @@ -623,7 +622,7 @@ bm.bmHeight = 32; } - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = WINED3DFMT_B5G6R5_UNORM; desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; @@ -633,20 +632,19 @@ desc.height = bm.bmHeight; desc.depth = 1; desc.size = 0; - if (FAILED(hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, + if (FAILED(hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, NULL, &wined3d_null_parent_ops, &device->logo_texture))) { ERR("Wine logo requested, but failed to create texture, hr %#x.\n", hr); goto out; } - surface = surface_from_resource(wined3d_texture_get_sub_resource(device->logo_texture, 0)); if (dcb) { - if (FAILED(hr = wined3d_surface_getdc(surface, &dcs))) + if (FAILED(hr = wined3d_texture_get_dc(device->logo_texture, 0, &dcs))) goto out; BitBlt(dcs, 0, 0, bm.bmWidth, bm.bmHeight, dcb, 0, 0, SRCCOPY); - wined3d_surface_releasedc(surface, dcs); + wined3d_texture_release_dc(device->logo_texture, 0, dcs); color_key.color_space_low_value = 0; color_key.color_space_high_value = 0; @@ -654,10 +652,12 @@ } else { - const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; const struct wined3d_color c = {1.0f, 1.0f, 1.0f, 1.0f}; + const RECT rect = {0, 0, desc.width, desc.height}; + struct wined3d_surface *surface; /* Fill the surface with a white color to show that wined3d is there */ + surface = surface_from_resource(wined3d_texture_get_sub_resource(device->logo_texture, 0)); surface_color_fill(surface, &rect, &c); } @@ -790,11 +790,13 @@ { GL_EXTCALL(glGenSamplers(1, &device->default_sampler)); checkGLcall("glGenSamplers"); + GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); + GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) { GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT)); - checkGLcall("glSamplerParamteri"); } + checkGLcall("glSamplerParamteri"); } else { @@ -993,12 +995,20 @@ goto err_out; } - if (swapchain_desc->backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), - NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) + if (swapchain_desc->backbuffer_count) { - ERR("Failed to create rendertarget view, hr %#x.\n", hr); - goto err_out; + struct wined3d_rendertarget_view_desc view_desc; + + view_desc.format_id = swapchain_desc->backbuffer_format; + view_desc.u.texture.level_idx = 0; + view_desc.u.texture.layer_idx = 0; + view_desc.u.texture.layer_count = 1; + if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, &swapchain->back_buffers[0]->resource, + NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) + { + ERR("Failed to create rendertarget view, hr %#x.\n", hr); + goto err_out; + } } device->swapchain_count = 1; @@ -2013,24 +2023,34 @@ { struct wined3d_texture *texture = state->textures[0]; struct wined3d_surface *depth_stencil, *surface; + RECT src_rect, dst_rect; - if (!texture || texture->resource.type != WINED3D_RTYPE_TEXTURE + if (!texture || texture->resource.type != WINED3D_RTYPE_TEXTURE_2D || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb->depth_stencil))) return; - wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); + SetRect(&dst_rect, 0, 0, surface->resource.width, surface->resource.height); + SetRect(&src_rect, 0, 0, depth_stencil->resource.width, depth_stencil->resource.height); + wined3d_surface_blt(surface, &dst_rect, depth_stencil, &src_rect, 0, NULL, WINED3D_TEXF_POINT); } void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value) { - DWORD old_value = device->state.render_states[state]; + DWORD old_value; TRACE("device %p, state %s (%#x), value %#x.\n", device, debug_d3drenderstate(state), state, value); + if (state > WINEHIGHEST_RENDER_STATE) + { + WARN("Unhandled render state %#x.\n", state); + return; + } + + old_value = device->state.render_states[state]; device->update_state->render_states[state] = value; /* Handle recording of state blocks. */ @@ -3584,8 +3604,9 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) { + unsigned int src_size, dst_size, src_skip_levels = 0; + unsigned int layer_count, level_count, i, j; enum wined3d_resource_type type; - unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; HRESULT hr; struct wined3d_context *context; @@ -3617,6 +3638,13 @@ return WINED3DERR_INVALIDCALL; } + layer_count = src_texture->layer_count; + if (layer_count != dst_texture->layer_count) + { + WARN("Source and destination have different layer counts.\n"); + return WINED3DERR_INVALIDCALL; + } + level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); @@ -3641,34 +3669,14 @@ /* Update every surface level of the texture. */ switch (type) { - case WINED3D_RTYPE_TEXTURE: - { - struct wined3d_surface *src_surface; - struct wined3d_surface *dst_surface; - - for (i = 0; i < level_count; ++i) - { - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); - hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); - if (FAILED(hr)) - { - WARN("Failed to update surface, hr %#x.\n", hr); - return hr; - } - } - break; - } - - case WINED3D_RTYPE_CUBE_TEXTURE: + case WINED3D_RTYPE_TEXTURE_2D: { + unsigned int src_levels = src_texture->level_count; + unsigned int dst_levels = dst_texture->level_count; struct wined3d_surface *src_surface; struct wined3d_surface *dst_surface; - unsigned int src_levels = wined3d_texture_get_level_count(src_texture); - unsigned int dst_levels = wined3d_texture_get_level_count(dst_texture); - for (i = 0; i < 6; ++i) + for (i = 0; i < layer_count; ++i) { for (j = 0; j < level_count; ++j) { @@ -3676,8 +3684,7 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); - hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); - if (FAILED(hr)) + if (FAILED(hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL))) { WARN("Failed to update surface, hr %#x.\n", hr); return hr; @@ -3687,7 +3694,7 @@ break; } - case WINED3D_RTYPE_VOLUME_TEXTURE: + case WINED3D_RTYPE_TEXTURE_3D: { for (i = 0; i < level_count; ++i) { @@ -3876,6 +3883,7 @@ { struct wined3d_surface *dst_surface, *src_surface; struct wined3d_texture *dst_texture, *src_texture; + RECT dst_rect, src_rect; unsigned int i, count; HRESULT hr; @@ -3913,7 +3921,7 @@ return; } - if (dst_resource->type != WINED3D_RTYPE_TEXTURE) + if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); return; @@ -3937,8 +3945,11 @@ dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); - if (FAILED(hr = wined3d_surface_blt(dst_surface, NULL, src_surface, NULL, 0, NULL, WINED3D_TEXF_POINT))) - ERR("Failed to blit, subresource %u, hr %#x.\n", i, hr); + SetRect(&dst_rect, 0, 0, dst_surface->resource.width, dst_surface->resource.height); + SetRect(&src_rect, 0, 0, src_surface->resource.width, src_surface->resource.height); + if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, + src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) + ERR("Failed to blit, sub-resource %u, hr %#x.\n", i, hr); } } @@ -3954,9 +3965,9 @@ HRESULT hr; TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " - "src_resource %p, src_sub_resource_idx %u, src_box %p.\n", + "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", device, dst_resource, dst_sub_resource_idx, dst_x, dst_y, dst_z, - src_resource, src_sub_resource_idx, src_box); + src_resource, src_sub_resource_idx, debug_box(src_box)); if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) { @@ -3980,7 +3991,7 @@ return WINED3DERR_INVALIDCALL; } - if (dst_resource->type != WINED3D_RTYPE_TEXTURE) + if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); return WINED3DERR_INVALIDCALL; @@ -4006,9 +4017,7 @@ { if (src_box->front >= src_box->back) { - WARN("Invalid box (%u, %u, %u)->(%u, %u, %u) specified.\n", - src_box->left, src_box->top, src_box->front, - src_box->right, src_box->bottom, src_box->back); + WARN("Invalid box %s specified.\n", debug_box(src_box)); return WINED3DERR_INVALIDCALL; } @@ -4031,7 +4040,7 @@ dst_rect.bottom = dst_y + (src_rect.bottom - src_rect.top); if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) - ERR("Failed to blit, hr %#x.\n", hr); + WARN("Failed to blit, hr %#x.\n", hr); return hr; } @@ -4049,8 +4058,8 @@ POINT dst_point; RECT src_rect; - TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n", - device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); + TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", + device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); if (resource->type == WINED3D_RTYPE_BUFFER) { @@ -4069,7 +4078,7 @@ return; } - if (resource->type != WINED3D_RTYPE_TEXTURE) + if (resource->type != WINED3D_RTYPE_TEXTURE_2D) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type)); return; @@ -4091,8 +4100,7 @@ || box->top >= box->bottom || box->bottom > sub_resource->height || box->front >= box->back) { - WARN("Invalid box (%u, %u, %u)->(%u, %u, %u) specified.\n", - box->left, box->top, box->front, box->right, box->bottom, box->back); + WARN("Invalid box %s specified.\n", debug_box(box)); return; } @@ -4142,7 +4150,7 @@ device, view, wine_dbgstr_rect(rect), color->r, color->g, color->b, color->a); resource = view->resource; - if (resource->type != WINED3D_RTYPE_TEXTURE && resource->type != WINED3D_RTYPE_CUBE_TEXTURE) + if (resource->type != WINED3D_RTYPE_TEXTURE_2D) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type)); return WINED3DERR_INVALIDCALL; @@ -4284,7 +4292,7 @@ data.row_pitch = map_desc.row_pitch; data.slice_pitch = map_desc.slice_pitch; - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = WINED3DFMT_B8G8R8A8_UNORM; desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; @@ -4295,7 +4303,7 @@ desc.depth = 1; desc.size = 0; - hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, + hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, &data, NULL, &wined3d_null_parent_ops, &texture); wined3d_surface_unmap(cursor_image); if (FAILED(hr)) @@ -4595,6 +4603,7 @@ const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode, wined3d_device_reset_cb callback, BOOL reset_state) { + struct wined3d_rendertarget_view_desc view_desc; struct wined3d_resource *resource, *cursor; struct wined3d_swapchain *swapchain; struct wined3d_display_mode m; @@ -4787,11 +4796,10 @@ { struct wined3d_resource_desc texture_desc; struct wined3d_texture *texture; - struct wined3d_rendertarget_view_desc view_desc; TRACE("Creating the depth stencil buffer\n"); - texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; + texture_desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; texture_desc.format = swapchain->desc.auto_depth_stencil_format; texture_desc.multisample_type = swapchain->desc.multisample_type; texture_desc.multisample_quality = swapchain->desc.multisample_quality; @@ -4830,12 +4838,18 @@ wined3d_rendertarget_view_decref(device->back_buffer_view); device->back_buffer_view = NULL; } - if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), - NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) + if (swapchain->desc.backbuffer_count) { - ERR("Failed to create rendertarget view, hr %#x.\n", hr); - return hr; + view_desc.format_id = swapchain_desc->backbuffer_format; + view_desc.u.texture.level_idx = 0; + view_desc.u.texture.layer_idx = 0; + view_desc.u.texture.layer_count = 1; + if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, &swapchain->back_buffers[0]->resource, + NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) + { + ERR("Failed to create rendertarget view, hr %#x.\n", hr); + return hr; + } } wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4909,6 +4923,13 @@ *parameters = device->create_parms; } +struct wined3d * CDECL wined3d_device_get_wined3d(const struct wined3d_device *device) +{ + TRACE("device %p.\n", device); + + return device->wined3d; +} + void CDECL wined3d_device_set_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp) { @@ -4981,9 +5002,8 @@ } break; - case WINED3D_RTYPE_TEXTURE: - case WINED3D_RTYPE_CUBE_TEXTURE: - case WINED3D_RTYPE_VOLUME_TEXTURE: + case WINED3D_RTYPE_TEXTURE_2D: + case WINED3D_RTYPE_TEXTURE_3D: for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) { struct wined3d_texture *texture = wined3d_texture_from_resource(resource); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/directx.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/directx.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/directx.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/directx.c 2016-02-08 19:32:34.000000000 +0000 @@ -123,8 +123,9 @@ {"GL_ARB_geometry_shader4", ARB_GEOMETRY_SHADER4 }, {"GL_ARB_half_float_pixel", ARB_HALF_FLOAT_PIXEL }, {"GL_ARB_half_float_vertex", ARB_HALF_FLOAT_VERTEX }, - {"GL_ARB_instanced_arrays", ARB_INSTANCED_ARRAYS, }, - {"GL_ARB_internalformat_query2", ARB_INTERNALFORMAT_QUERY2, }, + {"GL_ARB_instanced_arrays", ARB_INSTANCED_ARRAYS }, + {"GL_ARB_internalformat_query", ARB_INTERNALFORMAT_QUERY }, + {"GL_ARB_internalformat_query2", ARB_INTERNALFORMAT_QUERY2 }, {"GL_ARB_map_buffer_alignment", ARB_MAP_BUFFER_ALIGNMENT }, {"GL_ARB_map_buffer_range", ARB_MAP_BUFFER_RANGE }, {"GL_ARB_multisample", ARB_MULTISAMPLE }, @@ -153,6 +154,7 @@ {"GL_ARB_texture_query_levels", ARB_TEXTURE_QUERY_LEVELS }, {"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE }, {"GL_ARB_texture_rg", ARB_TEXTURE_RG }, + {"GL_ARB_texture_rgb10_a2ui", ARB_TEXTURE_RGB10_A2UI }, {"GL_ARB_timer_query", ARB_TIMER_QUERY }, {"GL_ARB_uniform_buffer_object", ARB_UNIFORM_BUFFER_OBJECT }, {"GL_ARB_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA }, @@ -194,6 +196,7 @@ {"GL_EXT_texture_env_combine", EXT_TEXTURE_ENV_COMBINE }, {"GL_EXT_texture_env_dot3", EXT_TEXTURE_ENV_DOT3 }, {"GL_EXT_texture_filter_anisotropic", EXT_TEXTURE_FILTER_ANISOTROPIC}, + {"GL_EXT_texture_integer", EXT_TEXTURE_INTEGER }, {"GL_EXT_texture_lod_bias", EXT_TEXTURE_LOD_BIAS }, {"GL_EXT_texture_mirror_clamp", EXT_TEXTURE_MIRROR_CLAMP }, {"GL_EXT_texture_snorm", EXT_TEXTURE_SNORM }, @@ -3408,6 +3411,7 @@ {ARB_TEXTURE_FLOAT, MAKEDWORD_VERSION(3, 0)}, {ARB_TEXTURE_RG, MAKEDWORD_VERSION(3, 0)}, {EXT_DRAW_BUFFERS2, MAKEDWORD_VERSION(3, 0)}, + {EXT_TEXTURE_INTEGER, MAKEDWORD_VERSION(3, 0)}, /* We don't want to enable EXT_GPU_SHADER4: even though similar * functionality is available in core GL 3.0 / GLSL 1.30, it's different * enough that reusing the same flag for the new features hurts more @@ -3433,10 +3437,12 @@ {ARB_INSTANCED_ARRAYS, MAKEDWORD_VERSION(3, 3)}, {ARB_SAMPLER_OBJECTS, MAKEDWORD_VERSION(3, 3)}, {ARB_SHADER_BIT_ENCODING, MAKEDWORD_VERSION(3, 3)}, + {ARB_TEXTURE_RGB10_A2UI, MAKEDWORD_VERSION(3, 3)}, {ARB_TIMER_QUERY, MAKEDWORD_VERSION(3, 3)}, {ARB_ES2_COMPATIBILITY, MAKEDWORD_VERSION(4, 1)}, + {ARB_INTERNALFORMAT_QUERY, MAKEDWORD_VERSION(4, 2)}, {ARB_MAP_BUFFER_ALIGNMENT, MAKEDWORD_VERSION(4, 2)}, {ARB_DEBUG_OUTPUT, MAKEDWORD_VERSION(4, 3)}, @@ -4402,36 +4408,44 @@ enum wined3d_device_type device_type, enum wined3d_format_id surface_format_id, BOOL windowed, enum wined3d_multisample_type multisample_type, DWORD *quality_levels) { - const struct wined3d_gl_info *gl_info; + const struct wined3d_gl_info *gl_info = &wined3d->adapters[adapter_idx].gl_info; + const struct wined3d_format *format = wined3d_get_format(gl_info, surface_format_id); + HRESULT hr = WINED3D_OK; - TRACE("wined3d %p, adapter_idx %u, device_type %s, surface_format %s,\n" + TRACE("wined3d %p, adapter_idx %u, device_type %s, surface_format %s, " "windowed %#x, multisample_type %#x, quality_levels %p.\n", wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(surface_format_id), windowed, multisample_type, quality_levels); if (adapter_idx >= wined3d->adapter_count) return WINED3DERR_INVALIDCALL; - - gl_info = &wined3d->adapters[adapter_idx].gl_info; - - if (multisample_type > gl_info->limits.samples) + if (surface_format_id == WINED3DFMT_UNKNOWN) + return WINED3DERR_INVALIDCALL; + if (multisample_type < WINED3D_MULTISAMPLE_NONE) + return WINED3DERR_INVALIDCALL; + if (multisample_type > WINED3D_MULTISAMPLE_16_SAMPLES) { - TRACE("Returning not supported.\n"); - if (quality_levels) - *quality_levels = 0; - + FIXME("multisample_type %u not handled yet.\n", multisample_type); return WINED3DERR_NOTAVAILABLE; } - if (quality_levels) + if (multisample_type && !(format->multisample_types & 1u << (multisample_type - 1))) + hr = WINED3DERR_NOTAVAILABLE; + + if (SUCCEEDED(hr) || (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE && format->multisample_types)) { - if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) - *quality_levels = gl_info->limits.samples; - else - *quality_levels = 1; + if (quality_levels) + { + if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) + *quality_levels = wined3d_popcount(format->multisample_types); + else + *quality_levels = 1; + } + return WINED3D_OK; } - return WINED3D_OK; + TRACE("Returning not supported.\n"); + return hr; } /* Check if the given DisplayFormat + DepthStencilFormat combination is valid for the Adapter */ @@ -4615,21 +4629,6 @@ switch (resource_type) { - case WINED3D_RTYPE_CUBE_TEXTURE: - format_flags |= WINED3DFMT_FLAG_TEXTURE; - allowed_usage = WINED3DUSAGE_AUTOGENMIPMAP - | WINED3DUSAGE_DYNAMIC - | WINED3DUSAGE_RENDERTARGET - | WINED3DUSAGE_SOFTWAREPROCESSING - | WINED3DUSAGE_QUERY_FILTER - | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING - | WINED3DUSAGE_QUERY_SRGBREAD - | WINED3DUSAGE_QUERY_SRGBWRITE - | WINED3DUSAGE_QUERY_VERTEXTEXTURE - | WINED3DUSAGE_QUERY_WRAPANDMIP; - gl_type = WINED3D_GL_RES_TYPE_TEX_CUBE; - break; - case WINED3D_RTYPE_SURFACE: if (!CheckSurfaceCapability(adapter, adapter_format, format, wined3d->flags & WINED3D_NO3D)) { @@ -4643,19 +4642,12 @@ gl_type = WINED3D_GL_RES_TYPE_RB; break; - case WINED3D_RTYPE_TEXTURE: - if ((usage & WINED3DUSAGE_DEPTHSTENCIL) - && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SHADOW) - && !gl_info->supported[ARB_SHADOW]) - { - TRACE("[FAILED] - No shadow sampler support.\n"); - return WINED3DERR_NOTAVAILABLE; - } - + case WINED3D_RTYPE_TEXTURE_2D: format_flags |= WINED3DFMT_FLAG_TEXTURE; allowed_usage = WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_DEPTHSTENCIL | WINED3DUSAGE_DYNAMIC + | WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_SOFTWAREPROCESSING | WINED3DUSAGE_QUERY_FILTER @@ -4666,9 +4658,21 @@ | WINED3DUSAGE_QUERY_VERTEXTEXTURE | WINED3DUSAGE_QUERY_WRAPANDMIP; gl_type = WINED3D_GL_RES_TYPE_TEX_2D; + if (usage & WINED3DUSAGE_LEGACY_CUBEMAP) + { + allowed_usage &= ~(WINED3DUSAGE_DEPTHSTENCIL | WINED3DUSAGE_QUERY_LEGACYBUMPMAP); + gl_type = WINED3D_GL_RES_TYPE_TEX_CUBE; + } + else if ((usage & WINED3DUSAGE_DEPTHSTENCIL) + && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SHADOW) + && !gl_info->supported[ARB_SHADOW]) + { + TRACE("[FAILED] - No shadow sampler support.\n"); + return WINED3DERR_NOTAVAILABLE; + } break; - case WINED3D_RTYPE_VOLUME_TEXTURE: + case WINED3D_RTYPE_TEXTURE_3D: case WINED3D_RTYPE_VOLUME: format_flags |= WINED3DFMT_FLAG_TEXTURE; allowed_usage = WINED3DUSAGE_DYNAMIC diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/glsl_shader.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/glsl_shader.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/glsl_shader.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/glsl_shader.c 2016-02-08 19:32:34.000000000 +0000 @@ -1685,12 +1685,12 @@ max_constantsF = gl_info->limits.glsl_vs_float_constants - 3; if (vs_args->clip_enabled) max_constantsF -= gl_info->limits.clipplanes; - max_constantsF -= count_bits(reg_maps->integer_constants); + max_constantsF -= wined3d_popcount(reg_maps->integer_constants); /* Strictly speaking a bool only uses one scalar, but the nvidia(Linux) compiler doesn't pack them properly, * so each scalar requires a full vec4. We could work around this by packing the booleans ourselves, but * for now take this into account when calculating the number of available constants */ - max_constantsF -= count_bits(reg_maps->boolean_constants); + max_constantsF -= wined3d_popcount(reg_maps->boolean_constants); /* Set by driver quirks in directx.c */ max_constantsF -= gl_info->reserved_glsl_constants; @@ -1734,8 +1734,8 @@ for (i = 0; i < reg_maps->sampler_map.count; ++i) { struct wined3d_shader_sampler_map_entry *entry; + const char *sampler_type_prefix, *sampler_type; BOOL shadow_sampler, tex_rect; - const char *sampler_type; entry = ®_maps->sampler_map.entries[i]; @@ -1745,6 +1745,28 @@ continue; } + switch (reg_maps->resource_info[entry->resource_idx].data_type) + { + case WINED3D_DATA_FLOAT: + case WINED3D_DATA_UNORM: + case WINED3D_DATA_SNORM: + sampler_type_prefix = ""; + break; + + case WINED3D_DATA_INT: + sampler_type_prefix = "i"; + break; + + case WINED3D_DATA_UINT: + sampler_type_prefix = "u"; + break; + + default: + sampler_type_prefix = ""; + ERR("Unhandled resource data type %#x.\n", reg_maps->resource_info[i].data_type); + break; + } + shadow_sampler = version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << entry->sampler_idx)); switch (reg_maps->resource_info[entry->resource_idx].type) { @@ -1792,7 +1814,8 @@ FIXME("Unhandled resource type %#x.\n", reg_maps->resource_info[i].type); break; } - shader_addline(buffer, "uniform %s %s_sampler%u;\n", sampler_type, prefix, entry->bind_idx); + shader_addline(buffer, "uniform %s%s %s_sampler%u;\n", + sampler_type_prefix, sampler_type, prefix, entry->bind_idx); } /* Declare uniforms for NP2 texcoord fixup: @@ -2383,6 +2406,13 @@ sprintf(register_name, "%s_cb%u[%u]", prefix, reg->idx[0].offset, reg->idx[1].offset); break; + case WINED3DSPR_IMMCONSTBUFFER: + if (reg->idx[0].rel_addr) + sprintf(register_name, "%s_icb[%s + %u]", prefix, rel_param0.param_str, reg->idx[0].offset); + else + sprintf(register_name, "%s_icb[%u]", prefix, reg->idx[0].offset); + break; + case WINED3DSPR_PRIMID: sprintf(register_name, "uint(gl_PrimitiveIDIn)"); break; @@ -2809,7 +2839,7 @@ } static void PRINTF_ATTR(8, 9) shader_glsl_gen_sample_code(const struct wined3d_shader_instruction *ins, - DWORD sampler, const struct glsl_sample_function *sample_function, DWORD swizzle, + unsigned int sampler_bind_idx, const struct glsl_sample_function *sample_function, DWORD swizzle, const char *dx, const char *dy, const char *bias, const char *coord_reg_fmt, ...) { const struct wined3d_shader_version *version = &ins->ctx->reg_maps->shader_version; @@ -2827,9 +2857,9 @@ if (version->type == WINED3D_SHADER_TYPE_PIXEL && version->major < 4) { const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; - fixup = priv->cur_ps_args->color_fixup[sampler]; + fixup = priv->cur_ps_args->color_fixup[sampler_bind_idx]; - if (priv->cur_ps_args->np2_fixup & (1u << sampler)) + if (priv->cur_ps_args->np2_fixup & (1u << sampler_bind_idx)) np2_fixup = TRUE; } else @@ -2843,7 +2873,7 @@ shader_addline(ins->ctx->buffer, "vec4("); shader_addline(ins->ctx->buffer, "%s(%s_sampler%u, ", - sample_function->name->buffer, shader_glsl_get_prefix(version->type), sampler); + sample_function->name->buffer, shader_glsl_get_prefix(version->type), sampler_bind_idx); for (;;) { @@ -2859,7 +2889,7 @@ if (np2_fixup) { const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; - const unsigned char idx = priv->cur_np2fixup_info->idx[sampler]; + const unsigned char idx = priv->cur_np2fixup_info->idx[sampler_bind_idx]; switch (shader_glsl_get_write_mask_size(sample_function->coord_mask)) { @@ -2953,11 +2983,14 @@ switch (ins->handler_idx) { case WINED3DSIH_EQ: op = "equal"; break; + case WINED3DSIH_IEQ: op = "equal"; break; case WINED3DSIH_GE: op = "greaterThanEqual"; break; case WINED3DSIH_IGE: op = "greaterThanEqual"; break; case WINED3DSIH_UGE: op = "greaterThanEqual"; break; case WINED3DSIH_LT: op = "lessThan"; break; + case WINED3DSIH_ILT: op = "lessThan"; break; case WINED3DSIH_NE: op = "notEqual"; break; + case WINED3DSIH_INE: op = "notEqual"; break; default: op = ""; ERR("Unhandled opcode %#x.\n", ins->handler_idx); @@ -2972,11 +3005,14 @@ switch (ins->handler_idx) { case WINED3DSIH_EQ: op = "=="; break; + case WINED3DSIH_IEQ: op = "=="; break; case WINED3DSIH_GE: op = ">="; break; case WINED3DSIH_IGE: op = ">="; break; case WINED3DSIH_UGE: op = ">="; break; case WINED3DSIH_LT: op = "<"; break; + case WINED3DSIH_ILT: op = "<"; break; case WINED3DSIH_NE: op = "!="; break; + case WINED3DSIH_INE: op = "!="; break; default: op = ""; ERR("Unhandled opcode %#x.\n", ins->handler_idx); @@ -2988,6 +3024,28 @@ } } +static void shader_glsl_unary_op(const struct wined3d_shader_instruction *ins) +{ + struct glsl_src_param src_param; + DWORD write_mask; + const char *op; + + switch (ins->handler_idx) + { + case WINED3DSIH_INEG: op = "-"; break; + case WINED3DSIH_NOT: op = "~"; break; + default: + op = ""; + ERR("Unhandled opcode %s.\n", + debug_d3dshaderinstructionhandler(ins->handler_idx)); + break; + } + + write_mask = shader_glsl_append_dst(ins->ctx->buffer, ins); + shader_glsl_add_src_param(ins, &ins->src[0], write_mask, &src_param); + shader_addline(ins->ctx->buffer, "%s%s);\n", op, src_param.param_str); +} + static void shader_glsl_imul(const struct wined3d_shader_instruction *ins) { struct wined3d_string_buffer *buffer = ins->ctx->buffer; @@ -3209,6 +3267,8 @@ case WINED3DSIH_MAX: instruction = "max"; break; case WINED3DSIH_MIN: instruction = "min"; break; case WINED3DSIH_ROUND_NI: instruction = "floor"; break; + case WINED3DSIH_ROUND_PI: instruction = "ceil"; break; + case WINED3DSIH_ROUND_Z: instruction = "trunc"; break; case WINED3DSIH_SQRT: instruction = "sqrt"; break; default: instruction = ""; FIXME("Opcode %s not yet handled in GLSL.\n", debug_d3dshaderinstructionhandler(ins->handler_idx)); @@ -3265,6 +3325,8 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) { + DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, + ins->ctx->reg_maps->shader_version.minor); struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param src0_param; const char *prefix, *suffix; @@ -3274,7 +3336,10 @@ dst_write_mask = shader_glsl_append_dst(buffer, ins); dst_size = shader_glsl_get_write_mask_size(dst_write_mask); - shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_3, &src0_param); + if (shader_version < WINED3D_SHADER_VERSION(4, 0)) + dst_write_mask = WINED3DSP_WRITEMASK_3; + + shader_glsl_add_src_param(ins, &ins->src[0], dst_write_mask, &src0_param); switch (ins->handler_idx) { @@ -3307,7 +3372,7 @@ break; } - if (dst_size > 1) + if (dst_size > 1 && shader_version < WINED3D_SHADER_VERSION(4, 0)) shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix, src0_param.param_str, suffix); else shader_addline(buffer, "%s%s%s);\n", prefix, src0_param.param_str, suffix); @@ -4258,7 +4323,7 @@ const struct wined3d_shader_version *version = &ins->ctx->reg_maps->shader_version; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; enum wined3d_shader_resource_type resource_type; - unsigned int resource_idx, sampler_idx, i; + unsigned int resource_idx, sampler_bind_idx, i; enum wined3d_data_type dst_data_type; struct glsl_src_param lod_param; char dst_swizzle[6]; @@ -4276,7 +4341,7 @@ resource_idx = ins->src[1].reg.idx[0].offset; resource_type = ins->ctx->reg_maps->resource_info[resource_idx].type; shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &lod_param); - sampler_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, + sampler_bind_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, resource_idx, WINED3D_SAMPLER_DEFAULT); if (resource_type >= ARRAY_SIZE(texture_size_component_count)) @@ -4291,7 +4356,7 @@ shader_addline(ins->ctx->buffer, "vec4("); shader_addline(ins->ctx->buffer, "textureSize(%s_sampler%u, %s), ", - shader_glsl_get_prefix(version->type), sampler_idx, lod_param.param_str); + shader_glsl_get_prefix(version->type), sampler_bind_idx, lod_param.param_str); for (i = 0; i < 3 - texture_size_component_count[resource_type]; ++i) shader_addline(ins->ctx->buffer, "0, "); @@ -4299,7 +4364,7 @@ if (gl_info->supported[ARB_TEXTURE_QUERY_LEVELS]) { shader_addline(ins->ctx->buffer, "textureQueryLevels(%s_sampler%u)", - shader_glsl_get_prefix(version->type), sampler_idx); + shader_glsl_get_prefix(version->type), sampler_bind_idx); } else { @@ -4315,48 +4380,64 @@ { struct glsl_src_param coord_param, lod_param; struct glsl_sample_function sample_function; - unsigned int sampler_idx; + unsigned int sampler_bind_idx; shader_glsl_get_sample_function(ins->ctx, ins->src[1].reg.idx[0].offset, WINED3D_GLSL_SAMPLE_LOAD, &sample_function); shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask, &coord_param); shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_3, &lod_param); - sampler_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, + sampler_bind_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, ins->src[1].reg.idx[0].offset, WINED3D_SAMPLER_DEFAULT); - shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, ins->src[1].swizzle, + shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->src[1].swizzle, NULL, NULL, lod_param.param_str, "%s", coord_param.param_str); shader_glsl_release_sample_function(ins->ctx, &sample_function); } static void shader_glsl_sample(const struct wined3d_shader_instruction *ins) { + const char *lod_param_str = NULL, *dx_param_str = NULL, *dy_param_str = NULL; + struct glsl_src_param coord_param, lod_param, dx_param, dy_param; + unsigned int resource_idx, sampler_idx, sampler_bind_idx; struct glsl_sample_function sample_function; - struct glsl_src_param coord_param; - unsigned int sampler_idx; + DWORD flags = 0; - shader_glsl_get_sample_function(ins->ctx, ins->src[1].reg.idx[0].offset, 0, &sample_function); - shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask, &coord_param); - sampler_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, - ins->src[1].reg.idx[0].offset, ins->src[2].reg.idx[0].offset); - shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, ins->src[1].swizzle, - NULL, NULL, NULL, "%s", coord_param.param_str); - shader_glsl_release_sample_function(ins->ctx, &sample_function); -} + if (ins->handler_idx == WINED3DSIH_SAMPLE_GRAD) + flags |= WINED3D_GLSL_SAMPLE_GRAD; + if (ins->handler_idx == WINED3DSIH_SAMPLE_LOD) + flags |= WINED3D_GLSL_SAMPLE_LOD; -static void shader_glsl_sample_lod(const struct wined3d_shader_instruction *ins) -{ - struct glsl_src_param coord_param, lod_param; - struct glsl_sample_function sample_function; - unsigned int sampler_idx; + resource_idx = ins->src[1].reg.idx[0].offset; + sampler_idx = ins->src[2].reg.idx[0].offset; - shader_glsl_get_sample_function(ins->ctx, ins->src[1].reg.idx[0].offset, - WINED3D_GLSL_SAMPLE_LOD, &sample_function); + shader_glsl_get_sample_function(ins->ctx, resource_idx, flags, &sample_function); shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask, &coord_param); - shader_glsl_add_src_param(ins, &ins->src[3], WINED3DSP_WRITEMASK_0, &lod_param); - sampler_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, - ins->src[1].reg.idx[0].offset, ins->src[2].reg.idx[0].offset); - shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, ins->src[1].swizzle, - NULL, NULL, lod_param.param_str, "%s", coord_param.param_str); + + switch (ins->handler_idx) + { + case WINED3DSIH_SAMPLE: + break; + case WINED3DSIH_SAMPLE_B: + shader_glsl_add_src_param(ins, &ins->src[3], WINED3DSP_WRITEMASK_0, &lod_param); + lod_param_str = lod_param.param_str; + break; + case WINED3DSIH_SAMPLE_GRAD: + shader_glsl_add_src_param(ins, &ins->src[3], sample_function.coord_mask, &dx_param); + shader_glsl_add_src_param(ins, &ins->src[4], sample_function.coord_mask, &dy_param); + dx_param_str = dx_param.param_str; + dy_param_str = dy_param.param_str; + break; + case WINED3DSIH_SAMPLE_LOD: + shader_glsl_add_src_param(ins, &ins->src[3], WINED3DSP_WRITEMASK_0, &lod_param); + lod_param_str = lod_param.param_str; + break; + default: + ERR("Unhandled opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx)); + break; + } + + sampler_bind_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, resource_idx, sampler_idx); + shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->src[1].swizzle, + dx_param_str, dy_param_str, lod_param_str, "%s", coord_param.param_str); shader_glsl_release_sample_function(ins->ctx, &sample_function); } @@ -7935,130 +8016,148 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = { - /* WINED3DSIH_ABS */ shader_glsl_map2gl, - /* WINED3DSIH_ADD */ shader_glsl_binop, - /* WINED3DSIH_AND */ shader_glsl_binop, - /* WINED3DSIH_BEM */ shader_glsl_bem, - /* WINED3DSIH_BREAK */ shader_glsl_break, - /* WINED3DSIH_BREAKC */ shader_glsl_breakc, - /* WINED3DSIH_BREAKP */ shader_glsl_breakp, - /* WINED3DSIH_CALL */ shader_glsl_call, - /* WINED3DSIH_CALLNZ */ shader_glsl_callnz, - /* WINED3DSIH_CMP */ shader_glsl_conditional_move, - /* WINED3DSIH_CND */ shader_glsl_cnd, - /* WINED3DSIH_CRS */ shader_glsl_cross, - /* WINED3DSIH_CUT */ shader_glsl_cut, - /* WINED3DSIH_DCL */ shader_glsl_nop, - /* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_glsl_nop, - /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop, - /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop, - /* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop, - /* WINED3DSIH_DEF */ shader_glsl_nop, - /* WINED3DSIH_DEFB */ shader_glsl_nop, - /* WINED3DSIH_DEFI */ shader_glsl_nop, - /* WINED3DSIH_DIV */ shader_glsl_binop, - /* WINED3DSIH_DP2 */ shader_glsl_dot, - /* WINED3DSIH_DP2ADD */ shader_glsl_dp2add, - /* WINED3DSIH_DP3 */ shader_glsl_dot, - /* WINED3DSIH_DP4 */ shader_glsl_dot, - /* WINED3DSIH_DST */ shader_glsl_dst, - /* WINED3DSIH_DSX */ shader_glsl_map2gl, - /* WINED3DSIH_DSY */ shader_glsl_map2gl, - /* WINED3DSIH_ELSE */ shader_glsl_else, - /* WINED3DSIH_EMIT */ shader_glsl_emit, - /* WINED3DSIH_ENDIF */ shader_glsl_end, - /* WINED3DSIH_ENDLOOP */ shader_glsl_end, - /* WINED3DSIH_ENDREP */ shader_glsl_end, - /* WINED3DSIH_EQ */ shader_glsl_relop, - /* WINED3DSIH_EXP */ shader_glsl_scalar_op, - /* WINED3DSIH_EXPP */ shader_glsl_expp, - /* WINED3DSIH_FRC */ shader_glsl_map2gl, - /* WINED3DSIH_FTOI */ shader_glsl_to_int, - /* WINED3DSIH_FTOU */ shader_glsl_to_uint, - /* WINED3DSIH_GE */ shader_glsl_relop, - /* WINED3DSIH_IADD */ shader_glsl_binop, - /* WINED3DSIH_IEQ */ NULL, - /* WINED3DSIH_IF */ shader_glsl_if, - /* WINED3DSIH_IFC */ shader_glsl_ifc, - /* WINED3DSIH_IGE */ shader_glsl_relop, - /* WINED3DSIH_ILT */ NULL, - /* WINED3DSIH_IMAD */ shader_glsl_mad, - /* WINED3DSIH_IMAX */ shader_glsl_map2gl, - /* WINED3DSIH_IMIN */ shader_glsl_map2gl, - /* WINED3DSIH_IMUL */ shader_glsl_imul, - /* WINED3DSIH_INE */ NULL, - /* WINED3DSIH_INEG */ NULL, - /* WINED3DSIH_ISHL */ shader_glsl_binop, - /* WINED3DSIH_ITOF */ shader_glsl_to_float, - /* WINED3DSIH_LABEL */ shader_glsl_label, - /* WINED3DSIH_LD */ shader_glsl_ld, - /* WINED3DSIH_LIT */ shader_glsl_lit, - /* WINED3DSIH_LOG */ shader_glsl_scalar_op, - /* WINED3DSIH_LOGP */ shader_glsl_scalar_op, - /* WINED3DSIH_LOOP */ shader_glsl_loop, - /* WINED3DSIH_LRP */ shader_glsl_lrp, - /* WINED3DSIH_LT */ shader_glsl_relop, - /* WINED3DSIH_M3x2 */ shader_glsl_mnxn, - /* WINED3DSIH_M3x3 */ shader_glsl_mnxn, - /* WINED3DSIH_M3x4 */ shader_glsl_mnxn, - /* WINED3DSIH_M4x3 */ shader_glsl_mnxn, - /* WINED3DSIH_M4x4 */ shader_glsl_mnxn, - /* WINED3DSIH_MAD */ shader_glsl_mad, - /* WINED3DSIH_MAX */ shader_glsl_map2gl, - /* WINED3DSIH_MIN */ shader_glsl_map2gl, - /* WINED3DSIH_MOV */ shader_glsl_mov, - /* WINED3DSIH_MOVA */ shader_glsl_mov, - /* WINED3DSIH_MOVC */ shader_glsl_conditional_move, - /* WINED3DSIH_MUL */ shader_glsl_binop, - /* WINED3DSIH_NE */ shader_glsl_relop, - /* WINED3DSIH_NOP */ shader_glsl_nop, - /* WINED3DSIH_NRM */ shader_glsl_nrm, - /* WINED3DSIH_OR */ shader_glsl_binop, - /* WINED3DSIH_PHASE */ shader_glsl_nop, - /* WINED3DSIH_POW */ shader_glsl_pow, - /* WINED3DSIH_RCP */ shader_glsl_scalar_op, - /* WINED3DSIH_REP */ shader_glsl_rep, - /* WINED3DSIH_RESINFO */ shader_glsl_resinfo, - /* WINED3DSIH_RET */ shader_glsl_ret, - /* WINED3DSIH_ROUND_NI */ shader_glsl_map2gl, - /* WINED3DSIH_RSQ */ shader_glsl_scalar_op, - /* WINED3DSIH_SAMPLE */ shader_glsl_sample, - /* WINED3DSIH_SAMPLE_GRAD */ NULL, - /* WINED3DSIH_SAMPLE_LOD */ shader_glsl_sample_lod, - /* WINED3DSIH_SETP */ NULL, - /* WINED3DSIH_SGE */ shader_glsl_compare, - /* WINED3DSIH_SGN */ shader_glsl_sgn, - /* WINED3DSIH_SINCOS */ shader_glsl_sincos, - /* WINED3DSIH_SLT */ shader_glsl_compare, - /* WINED3DSIH_SQRT */ shader_glsl_map2gl, - /* WINED3DSIH_SUB */ shader_glsl_binop, - /* WINED3DSIH_TEX */ shader_glsl_tex, - /* WINED3DSIH_TEXBEM */ shader_glsl_texbem, - /* WINED3DSIH_TEXBEML */ shader_glsl_texbem, - /* WINED3DSIH_TEXCOORD */ shader_glsl_texcoord, - /* WINED3DSIH_TEXDEPTH */ shader_glsl_texdepth, - /* WINED3DSIH_TEXDP3 */ shader_glsl_texdp3, - /* WINED3DSIH_TEXDP3TEX */ shader_glsl_texdp3tex, - /* WINED3DSIH_TEXKILL */ shader_glsl_texkill, - /* WINED3DSIH_TEXLDD */ shader_glsl_texldd, - /* WINED3DSIH_TEXLDL */ shader_glsl_texldl, - /* WINED3DSIH_TEXM3x2DEPTH */ shader_glsl_texm3x2depth, - /* WINED3DSIH_TEXM3x2PAD */ shader_glsl_texm3x2pad, - /* WINED3DSIH_TEXM3x2TEX */ shader_glsl_texm3x2tex, - /* WINED3DSIH_TEXM3x3 */ shader_glsl_texm3x3, - /* WINED3DSIH_TEXM3x3DIFF */ NULL, - /* WINED3DSIH_TEXM3x3PAD */ shader_glsl_texm3x3pad, - /* WINED3DSIH_TEXM3x3SPEC */ shader_glsl_texm3x3spec, - /* WINED3DSIH_TEXM3x3TEX */ shader_glsl_texm3x3tex, - /* WINED3DSIH_TEXM3x3VSPEC */ shader_glsl_texm3x3vspec, - /* WINED3DSIH_TEXREG2AR */ shader_glsl_texreg2ar, - /* WINED3DSIH_TEXREG2GB */ shader_glsl_texreg2gb, - /* WINED3DSIH_TEXREG2RGB */ shader_glsl_texreg2rgb, - /* WINED3DSIH_UDIV */ shader_glsl_udiv, - /* WINED3DSIH_UGE */ shader_glsl_relop, - /* WINED3DSIH_USHR */ shader_glsl_binop, - /* WINED3DSIH_UTOF */ shader_glsl_to_float, - /* WINED3DSIH_XOR */ shader_glsl_binop, + /* WINED3DSIH_ABS */ shader_glsl_map2gl, + /* WINED3DSIH_ADD */ shader_glsl_binop, + /* WINED3DSIH_AND */ shader_glsl_binop, + /* WINED3DSIH_BEM */ shader_glsl_bem, + /* WINED3DSIH_BREAK */ shader_glsl_break, + /* WINED3DSIH_BREAKC */ shader_glsl_breakc, + /* WINED3DSIH_BREAKP */ shader_glsl_breakp, + /* WINED3DSIH_CALL */ shader_glsl_call, + /* WINED3DSIH_CALLNZ */ shader_glsl_callnz, + /* WINED3DSIH_CMP */ shader_glsl_conditional_move, + /* WINED3DSIH_CND */ shader_glsl_cnd, + /* WINED3DSIH_CRS */ shader_glsl_cross, + /* WINED3DSIH_CUT */ shader_glsl_cut, + /* WINED3DSIH_DCL */ shader_glsl_nop, + /* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_glsl_nop, + /* WINED3DSIH_DCL_GLOBAL_FLAGS */ shader_glsl_nop, + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL, + /* WINED3DSIH_DCL_INPUT */ shader_glsl_nop, + /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop, + /* WINED3DSIH_DCL_INPUT_PS */ NULL, + /* WINED3DSIH_DCL_INPUT_PS_SGV */ NULL, + /* WINED3DSIH_DCL_INPUT_PS_SIV */ NULL, + /* WINED3DSIH_DCL_INPUT_SGV */ shader_glsl_nop, + /* WINED3DSIH_DCL_INPUT_SIV */ shader_glsl_nop, + /* WINED3DSIH_DCL_OUTPUT */ shader_glsl_nop, + /* WINED3DSIH_DCL_OUTPUT_SIV */ shader_glsl_nop, + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop, + /* WINED3DSIH_DCL_SAMPLER */ NULL, + /* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop, + /* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop, + /* WINED3DSIH_DEF */ shader_glsl_nop, + /* WINED3DSIH_DEFB */ shader_glsl_nop, + /* WINED3DSIH_DEFI */ shader_glsl_nop, + /* WINED3DSIH_DIV */ shader_glsl_binop, + /* WINED3DSIH_DP2 */ shader_glsl_dot, + /* WINED3DSIH_DP2ADD */ shader_glsl_dp2add, + /* WINED3DSIH_DP3 */ shader_glsl_dot, + /* WINED3DSIH_DP4 */ shader_glsl_dot, + /* WINED3DSIH_DST */ shader_glsl_dst, + /* WINED3DSIH_DSX */ shader_glsl_map2gl, + /* WINED3DSIH_DSY */ shader_glsl_map2gl, + /* WINED3DSIH_ELSE */ shader_glsl_else, + /* WINED3DSIH_EMIT */ shader_glsl_emit, + /* WINED3DSIH_ENDIF */ shader_glsl_end, + /* WINED3DSIH_ENDLOOP */ shader_glsl_end, + /* WINED3DSIH_ENDREP */ shader_glsl_end, + /* WINED3DSIH_EQ */ shader_glsl_relop, + /* WINED3DSIH_EXP */ shader_glsl_scalar_op, + /* WINED3DSIH_EXPP */ shader_glsl_expp, + /* WINED3DSIH_FRC */ shader_glsl_map2gl, + /* WINED3DSIH_FTOI */ shader_glsl_to_int, + /* WINED3DSIH_FTOU */ shader_glsl_to_uint, + /* WINED3DSIH_GE */ shader_glsl_relop, + /* WINED3DSIH_IADD */ shader_glsl_binop, + /* WINED3DSIH_IEQ */ shader_glsl_relop, + /* WINED3DSIH_IF */ shader_glsl_if, + /* WINED3DSIH_IFC */ shader_glsl_ifc, + /* WINED3DSIH_IGE */ shader_glsl_relop, + /* WINED3DSIH_ILT */ shader_glsl_relop, + /* WINED3DSIH_IMAD */ shader_glsl_mad, + /* WINED3DSIH_IMAX */ shader_glsl_map2gl, + /* WINED3DSIH_IMIN */ shader_glsl_map2gl, + /* WINED3DSIH_IMUL */ shader_glsl_imul, + /* WINED3DSIH_INE */ shader_glsl_relop, + /* WINED3DSIH_INEG */ shader_glsl_unary_op, + /* WINED3DSIH_ISHL */ shader_glsl_binop, + /* WINED3DSIH_ITOF */ shader_glsl_to_float, + /* WINED3DSIH_LABEL */ shader_glsl_label, + /* WINED3DSIH_LD */ shader_glsl_ld, + /* WINED3DSIH_LIT */ shader_glsl_lit, + /* WINED3DSIH_LOG */ shader_glsl_scalar_op, + /* WINED3DSIH_LOGP */ shader_glsl_scalar_op, + /* WINED3DSIH_LOOP */ shader_glsl_loop, + /* WINED3DSIH_LRP */ shader_glsl_lrp, + /* WINED3DSIH_LT */ shader_glsl_relop, + /* WINED3DSIH_M3x2 */ shader_glsl_mnxn, + /* WINED3DSIH_M3x3 */ shader_glsl_mnxn, + /* WINED3DSIH_M3x4 */ shader_glsl_mnxn, + /* WINED3DSIH_M4x3 */ shader_glsl_mnxn, + /* WINED3DSIH_M4x4 */ shader_glsl_mnxn, + /* WINED3DSIH_MAD */ shader_glsl_mad, + /* WINED3DSIH_MAX */ shader_glsl_map2gl, + /* WINED3DSIH_MIN */ shader_glsl_map2gl, + /* WINED3DSIH_MOV */ shader_glsl_mov, + /* WINED3DSIH_MOVA */ shader_glsl_mov, + /* WINED3DSIH_MOVC */ shader_glsl_conditional_move, + /* WINED3DSIH_MUL */ shader_glsl_binop, + /* WINED3DSIH_NE */ shader_glsl_relop, + /* WINED3DSIH_NOP */ shader_glsl_nop, + /* WINED3DSIH_NOT */ shader_glsl_unary_op, + /* WINED3DSIH_NRM */ shader_glsl_nrm, + /* WINED3DSIH_OR */ shader_glsl_binop, + /* WINED3DSIH_PHASE */ shader_glsl_nop, + /* WINED3DSIH_POW */ shader_glsl_pow, + /* WINED3DSIH_RCP */ shader_glsl_scalar_op, + /* WINED3DSIH_REP */ shader_glsl_rep, + /* WINED3DSIH_RESINFO */ shader_glsl_resinfo, + /* WINED3DSIH_RET */ shader_glsl_ret, + /* WINED3DSIH_ROUND_NI */ shader_glsl_map2gl, + /* WINED3DSIH_ROUND_PI */ shader_glsl_map2gl, + /* WINED3DSIH_ROUND_Z */ shader_glsl_map2gl, + /* WINED3DSIH_RSQ */ shader_glsl_scalar_op, + /* WINED3DSIH_SAMPLE */ shader_glsl_sample, + /* WINED3DSIH_SAMPLE_B */ shader_glsl_sample, + /* WINED3DSIH_SAMPLE_C */ NULL, + /* WINED3DSIH_SAMPLE_C_LZ */ NULL, + /* WINED3DSIH_SAMPLE_GRAD */ shader_glsl_sample, + /* WINED3DSIH_SAMPLE_LOD */ shader_glsl_sample, + /* WINED3DSIH_SETP */ NULL, + /* WINED3DSIH_SGE */ shader_glsl_compare, + /* WINED3DSIH_SGN */ shader_glsl_sgn, + /* WINED3DSIH_SINCOS */ shader_glsl_sincos, + /* WINED3DSIH_SLT */ shader_glsl_compare, + /* WINED3DSIH_SQRT */ shader_glsl_map2gl, + /* WINED3DSIH_SUB */ shader_glsl_binop, + /* WINED3DSIH_TEX */ shader_glsl_tex, + /* WINED3DSIH_TEXBEM */ shader_glsl_texbem, + /* WINED3DSIH_TEXBEML */ shader_glsl_texbem, + /* WINED3DSIH_TEXCOORD */ shader_glsl_texcoord, + /* WINED3DSIH_TEXDEPTH */ shader_glsl_texdepth, + /* WINED3DSIH_TEXDP3 */ shader_glsl_texdp3, + /* WINED3DSIH_TEXDP3TEX */ shader_glsl_texdp3tex, + /* WINED3DSIH_TEXKILL */ shader_glsl_texkill, + /* WINED3DSIH_TEXLDD */ shader_glsl_texldd, + /* WINED3DSIH_TEXLDL */ shader_glsl_texldl, + /* WINED3DSIH_TEXM3x2DEPTH */ shader_glsl_texm3x2depth, + /* WINED3DSIH_TEXM3x2PAD */ shader_glsl_texm3x2pad, + /* WINED3DSIH_TEXM3x2TEX */ shader_glsl_texm3x2tex, + /* WINED3DSIH_TEXM3x3 */ shader_glsl_texm3x3, + /* WINED3DSIH_TEXM3x3DIFF */ NULL, + /* WINED3DSIH_TEXM3x3PAD */ shader_glsl_texm3x3pad, + /* WINED3DSIH_TEXM3x3SPEC */ shader_glsl_texm3x3spec, + /* WINED3DSIH_TEXM3x3TEX */ shader_glsl_texm3x3tex, + /* WINED3DSIH_TEXM3x3VSPEC */ shader_glsl_texm3x3vspec, + /* WINED3DSIH_TEXREG2AR */ shader_glsl_texreg2ar, + /* WINED3DSIH_TEXREG2GB */ shader_glsl_texreg2gb, + /* WINED3DSIH_TEXREG2RGB */ shader_glsl_texreg2rgb, + /* WINED3DSIH_UDIV */ shader_glsl_udiv, + /* WINED3DSIH_UGE */ shader_glsl_relop, + /* WINED3DSIH_USHR */ shader_glsl_binop, + /* WINED3DSIH_UTOF */ shader_glsl_to_float, + /* WINED3DSIH_XOR */ shader_glsl_binop, }; static void shader_glsl_handle_instruction(const struct wined3d_shader_instruction *ins) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/resource.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/resource.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/resource.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/resource.c 2016-02-08 19:32:34.000000000 +0000 @@ -57,6 +57,7 @@ | WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_STATICDECL | WINED3DUSAGE_OVERLAY + | WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE; /* WINED3DUSAGE_WRITEONLY is supposed to result in write-combined mappings @@ -78,84 +79,93 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) { - const struct wined3d *d3d = device->wined3d; + enum wined3d_gl_resource_type base_type = WINED3D_GL_RES_TYPE_COUNT; + enum wined3d_gl_resource_type gl_type = WINED3D_GL_RES_TYPE_COUNT; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - static const enum wined3d_gl_resource_type gl_resource_types[][4] = + BOOL tex_2d_ok = FALSE; + unsigned int i; + + static const struct + { + enum wined3d_resource_type type; + DWORD cube_usage; + enum wined3d_gl_resource_type gl_type; + } + resource_types[] = { - /* 0 */ {WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_SURFACE */ {WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_VOLUME */ {WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_2D, - WINED3D_GL_RES_TYPE_TEX_RECT, WINED3D_GL_RES_TYPE_RB, WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_VOLUME_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_3D, WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_CUBE_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_CUBE, WINED3D_GL_RES_TYPE_COUNT}, - /* WINED3D_RTYPE_BUFFER */ {WINED3D_GL_RES_TYPE_BUFFER, WINED3D_GL_RES_TYPE_COUNT}, + {WINED3D_RTYPE_BUFFER, 0, WINED3D_GL_RES_TYPE_BUFFER}, + {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_2D}, + {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_RECT}, + {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_RB}, + {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_LEGACY_CUBEMAP, WINED3D_GL_RES_TYPE_TEX_CUBE}, + {WINED3D_RTYPE_TEXTURE_3D, 0, WINED3D_GL_RES_TYPE_TEX_3D}, }; - enum wined3d_gl_resource_type gl_type = WINED3D_GL_RES_TYPE_COUNT; - enum wined3d_gl_resource_type base_type = gl_resource_types[type][0]; resource_check_usage(usage); - if (base_type != WINED3D_GL_RES_TYPE_COUNT) + for (i = 0; i < ARRAY_SIZE(resource_types); ++i) { - unsigned int i; - BOOL tex_2d_ok = FALSE; + if (resource_types[i].type != type + || resource_types[i].cube_usage != (usage & WINED3DUSAGE_LEGACY_CUBEMAP)) + continue; + + gl_type = resource_types[i].gl_type; + if (base_type == WINED3D_GL_RES_TYPE_COUNT) + base_type = gl_type; + + if ((usage & WINED3DUSAGE_RENDERTARGET) && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) + { + WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); + continue; + } + if ((usage & WINED3DUSAGE_DEPTHSTENCIL) + && !(format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))) + { + WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); + continue; + } + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO + && usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL) + && !(format->flags[gl_type] & WINED3DFMT_FLAG_FBO_ATTACHABLE)) + { + WARN("Render target or depth stencil is not FBO attachable.\n"); + continue; + } + if ((usage & WINED3DUSAGE_TEXTURE) && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) + { + WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); + continue; + } + if (((width & (width - 1)) || (height & (height - 1))) + && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] + && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] + && gl_type == WINED3D_GL_RES_TYPE_TEX_2D) + { + TRACE("Skipping 2D texture type to try texture rectangle.\n"); + tex_2d_ok = TRUE; + continue; + } + break; + } - for (i = 0; (gl_type = gl_resource_types[type][i]) != WINED3D_GL_RES_TYPE_COUNT; i++) + if (base_type != WINED3D_GL_RES_TYPE_COUNT && i == ARRAY_SIZE(resource_types)) + { + if (tex_2d_ok) + { + /* Non power of 2 texture and rectangle textures or renderbuffers do not work. + * Use 2D textures, the texture code will pad to a power of 2 size. */ + gl_type = WINED3D_GL_RES_TYPE_TEX_2D; + } + else if (pool == WINED3D_POOL_SCRATCH) { - if ((usage & WINED3DUSAGE_RENDERTARGET) && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) - { - WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); - continue; - } - if ((usage & WINED3DUSAGE_DEPTHSTENCIL) && - !(format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))) - { - WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); - continue; - } - if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_FBO_ATTACHABLE)) - { - WARN("Render target or depth stencil is not FBO attachable.\n"); - continue; - } - if ((usage & WINED3DUSAGE_TEXTURE) && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) - { - WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); - continue; - } - if (((width & (width - 1)) || (height & (height - 1))) - && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] - && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] - && gl_type == WINED3D_GL_RES_TYPE_TEX_2D) - { - TRACE("Skipping 2D texture type to try texture rectangle.\n"); - tex_2d_ok = TRUE; - continue; - } - break; - } - - if (gl_type == WINED3D_GL_RES_TYPE_COUNT) - { - if (tex_2d_ok) - { - /* Non power of 2 texture and rectangle textures or renderbuffers do not work. - * Use 2D textures, the texture code will pad to a power of 2 size. */ - gl_type = WINED3D_GL_RES_TYPE_TEX_2D; - } - else if (pool == WINED3D_POOL_SCRATCH) - { - /* Needed for proper format information. */ - gl_type = base_type; - } - else - { - WARN("Did not find a suitable GL resource type, resource type, d3d type %u.\n", type); - return WINED3DERR_INVALIDCALL; - } + /* Needed for proper format information. */ + gl_type = base_type; + } + else + { + WARN("Did not find a suitable GL resource type for resource type %s.\n", + debug_d3dresourcetype(type)); + return WINED3DERR_INVALIDCALL; } } @@ -207,7 +217,7 @@ } /* Check that we have enough video ram left */ - if (pool == WINED3D_POOL_DEFAULT && d3d->flags & WINED3D_VIDMEM_ACCOUNTING) + if (pool == WINED3D_POOL_DEFAULT && device->wined3d->flags & WINED3D_VIDMEM_ACCOUNTING) { if (size > wined3d_device_get_available_texture_mem(device)) { @@ -298,8 +308,8 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { - TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x.\n", - resource, sub_resource_idx, map_desc, box, flags); + TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", + resource, sub_resource_idx, map_desc, debug_box(box), flags); return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags); } @@ -402,8 +412,8 @@ { struct wined3d_swapchain *swapchain; - /* Only texture resources can be onscreen. */ - if (resource->type != WINED3D_RTYPE_TEXTURE) + /* Only 2D texture resources can be onscreen. */ + if (resource->type != WINED3D_RTYPE_TEXTURE_2D) return TRUE; /* Not on a swapchain - must be offscreen */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader.c 2016-02-08 19:32:34.000000000 +0000 @@ -40,130 +40,148 @@ static const char * const shader_opcode_names[] = { - /* WINED3DSIH_ABS */ "abs", - /* WINED3DSIH_ADD */ "add", - /* WINED3DSIH_AND */ "and", - /* WINED3DSIH_BEM */ "bem", - /* WINED3DSIH_BREAK */ "break", - /* WINED3DSIH_BREAKC */ "breakc", - /* WINED3DSIH_BREAKP */ "breakp", - /* WINED3DSIH_CALL */ "call", - /* WINED3DSIH_CALLNZ */ "callnz", - /* WINED3DSIH_CMP */ "cmp", - /* WINED3DSIH_CND */ "cnd", - /* WINED3DSIH_CRS */ "crs", - /* WINED3DSIH_CUT */ "cut", - /* WINED3DSIH_DCL */ "dcl", - /* WINED3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer", - /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive", - /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology", - /* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", - /* WINED3DSIH_DEF */ "def", - /* WINED3DSIH_DEFB */ "defb", - /* WINED3DSIH_DEFI */ "defi", - /* WINED3DSIH_DIV */ "div", - /* WINED3DSIH_DP2 */ "dp2", - /* WINED3DSIH_DP2ADD */ "dp2add", - /* WINED3DSIH_DP3 */ "dp3", - /* WINED3DSIH_DP4 */ "dp4", - /* WINED3DSIH_DST */ "dst", - /* WINED3DSIH_DSX */ "dsx", - /* WINED3DSIH_DSY */ "dsy", - /* WINED3DSIH_ELSE */ "else", - /* WINED3DSIH_EMIT */ "emit", - /* WINED3DSIH_ENDIF */ "endif", - /* WINED3DSIH_ENDLOOP */ "endloop", - /* WINED3DSIH_ENDREP */ "endrep", - /* WINED3DSIH_EQ */ "eq", - /* WINED3DSIH_EXP */ "exp", - /* WINED3DSIH_EXPP */ "expp", - /* WINED3DSIH_FRC */ "frc", - /* WINED3DSIH_FTOI */ "ftoi", - /* WINED3DSIH_FTOU */ "ftou", - /* WINED3DSIH_GE */ "ge", - /* WINED3DSIH_IADD */ "iadd", - /* WINED3DSIH_IEQ */ "ieq", - /* WINED3DSIH_IF */ "if", - /* WINED3DSIH_IFC */ "ifc", - /* WINED3DSIH_IGE */ "ige", - /* WINED3DSIH_ILT */ "ilt", - /* WINED3DSIH_IMAD */ "imad", - /* WINED3DSIH_IMAX */ "imax", - /* WINED3DSIH_IMIN */ "imin", - /* WINED3DSIH_IMUL */ "imul", - /* WINED3DSIH_INE */ "ine", - /* WINED3DSIH_INEG */ "ineg", - /* WINED3DSIH_ISHL */ "ishl", - /* WINED3DSIH_ITOF */ "itof", - /* WINED3DSIH_LABEL */ "label", - /* WINED3DSIH_LD */ "ld", - /* WINED3DSIH_LIT */ "lit", - /* WINED3DSIH_LOG */ "log", - /* WINED3DSIH_LOGP */ "logp", - /* WINED3DSIH_LOOP */ "loop", - /* WINED3DSIH_LRP */ "lrp", - /* WINED3DSIH_LT */ "lt", - /* WINED3DSIH_M3x2 */ "m3x2", - /* WINED3DSIH_M3x3 */ "m3x3", - /* WINED3DSIH_M3x4 */ "m3x4", - /* WINED3DSIH_M4x3 */ "m4x3", - /* WINED3DSIH_M4x4 */ "m4x4", - /* WINED3DSIH_MAD */ "mad", - /* WINED3DSIH_MAX */ "max", - /* WINED3DSIH_MIN */ "min", - /* WINED3DSIH_MOV */ "mov", - /* WINED3DSIH_MOVA */ "mova", - /* WINED3DSIH_MOVC */ "movc", - /* WINED3DSIH_MUL */ "mul", - /* WINED3DSIH_NE */ "ne", - /* WINED3DSIH_NOP */ "nop", - /* WINED3DSIH_NRM */ "nrm", - /* WINED3DSIH_OR */ "or", - /* WINED3DSIH_PHASE */ "phase", - /* WINED3DSIH_POW */ "pow", - /* WINED3DSIH_RCP */ "rcp", - /* WINED3DSIH_REP */ "rep", - /* WINED3DSIH_RESINFO */ "resinfo", - /* WINED3DSIH_RET */ "ret", - /* WINED3DSIH_ROUND_NI */ "round_ni", - /* WINED3DSIH_RSQ */ "rsq", - /* WINED3DSIH_SAMPLE */ "sample", - /* WINED3DSIH_SAMPLE_GRAD */ "sample_d", - /* WINED3DSIH_SAMPLE_LOD */ "sample_l", - /* WINED3DSIH_SETP */ "setp", - /* WINED3DSIH_SGE */ "sge", - /* WINED3DSIH_SGN */ "sgn", - /* WINED3DSIH_SINCOS */ "sincos", - /* WINED3DSIH_SLT */ "slt", - /* WINED3DSIH_SQRT */ "sqrt", - /* WINED3DSIH_SUB */ "sub", - /* WINED3DSIH_TEX */ "texld", - /* WINED3DSIH_TEXBEM */ "texbem", - /* WINED3DSIH_TEXBEML */ "texbeml", - /* WINED3DSIH_TEXCOORD */ "texcrd", - /* WINED3DSIH_TEXDEPTH */ "texdepth", - /* WINED3DSIH_TEXDP3 */ "texdp3", - /* WINED3DSIH_TEXDP3TEX */ "texdp3tex", - /* WINED3DSIH_TEXKILL */ "texkill", - /* WINED3DSIH_TEXLDD */ "texldd", - /* WINED3DSIH_TEXLDL */ "texldl", - /* WINED3DSIH_TEXM3x2DEPTH */ "texm3x2depth", - /* WINED3DSIH_TEXM3x2PAD */ "texm3x2pad", - /* WINED3DSIH_TEXM3x2TEX */ "texm3x2tex", - /* WINED3DSIH_TEXM3x3 */ "texm3x3", - /* WINED3DSIH_TEXM3x3DIFF */ "texm3x3diff", - /* WINED3DSIH_TEXM3x3PAD */ "texm3x3pad", - /* WINED3DSIH_TEXM3x3SPEC */ "texm3x3spec", - /* WINED3DSIH_TEXM3x3TEX */ "texm3x3tex", - /* WINED3DSIH_TEXM3x3VSPEC */ "texm3x3vspec", - /* WINED3DSIH_TEXREG2AR */ "texreg2ar", - /* WINED3DSIH_TEXREG2GB */ "texreg2gb", - /* WINED3DSIH_TEXREG2RGB */ "texreg2rgb", - /* WINED3DSIH_UDIV */ "udiv", - /* WINED3DSIH_UGE */ "uge", - /* WINED3DSIH_USHR */ "ushr", - /* WINED3DSIH_UTOF */ "utof", - /* WINED3DSIH_XOR */ "xor", + /* WINED3DSIH_ABS */ "abs", + /* WINED3DSIH_ADD */ "add", + /* WINED3DSIH_AND */ "and", + /* WINED3DSIH_BEM */ "bem", + /* WINED3DSIH_BREAK */ "break", + /* WINED3DSIH_BREAKC */ "breakc", + /* WINED3DSIH_BREAKP */ "breakp", + /* WINED3DSIH_CALL */ "call", + /* WINED3DSIH_CALLNZ */ "callnz", + /* WINED3DSIH_CMP */ "cmp", + /* WINED3DSIH_CND */ "cnd", + /* WINED3DSIH_CRS */ "crs", + /* WINED3DSIH_CUT */ "cut", + /* WINED3DSIH_DCL */ "dcl", + /* WINED3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer", + /* WINED3DSIH_DCL_GLOBAL_FLAGS */ "dcl_globalFlags", + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer", + /* WINED3DSIH_DCL_INPUT */ "dcl_input", + /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive", + /* WINED3DSIH_DCL_INPUT_PS */ "dcl_input_ps", + /* WINED3DSIH_DCL_INPUT_PS_SGV */ "dcl_input_ps_sgv", + /* WINED3DSIH_DCL_INPUT_PS_SIV */ "dcl_input_ps_siv", + /* WINED3DSIH_DCL_INPUT_SGV */ "dcl_input_sgv", + /* WINED3DSIH_DCL_INPUT_SIV */ "dcl_input_siv", + /* WINED3DSIH_DCL_OUTPUT */ "dcl_output", + /* WINED3DSIH_DCL_OUTPUT_SIV */ "dcl_output_siv", + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology", + /* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler", + /* WINED3DSIH_DCL_TEMPS */ "dcl_temps", + /* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", + /* WINED3DSIH_DEF */ "def", + /* WINED3DSIH_DEFB */ "defb", + /* WINED3DSIH_DEFI */ "defi", + /* WINED3DSIH_DIV */ "div", + /* WINED3DSIH_DP2 */ "dp2", + /* WINED3DSIH_DP2ADD */ "dp2add", + /* WINED3DSIH_DP3 */ "dp3", + /* WINED3DSIH_DP4 */ "dp4", + /* WINED3DSIH_DST */ "dst", + /* WINED3DSIH_DSX */ "dsx", + /* WINED3DSIH_DSY */ "dsy", + /* WINED3DSIH_ELSE */ "else", + /* WINED3DSIH_EMIT */ "emit", + /* WINED3DSIH_ENDIF */ "endif", + /* WINED3DSIH_ENDLOOP */ "endloop", + /* WINED3DSIH_ENDREP */ "endrep", + /* WINED3DSIH_EQ */ "eq", + /* WINED3DSIH_EXP */ "exp", + /* WINED3DSIH_EXPP */ "expp", + /* WINED3DSIH_FRC */ "frc", + /* WINED3DSIH_FTOI */ "ftoi", + /* WINED3DSIH_FTOU */ "ftou", + /* WINED3DSIH_GE */ "ge", + /* WINED3DSIH_IADD */ "iadd", + /* WINED3DSIH_IEQ */ "ieq", + /* WINED3DSIH_IF */ "if", + /* WINED3DSIH_IFC */ "ifc", + /* WINED3DSIH_IGE */ "ige", + /* WINED3DSIH_ILT */ "ilt", + /* WINED3DSIH_IMAD */ "imad", + /* WINED3DSIH_IMAX */ "imax", + /* WINED3DSIH_IMIN */ "imin", + /* WINED3DSIH_IMUL */ "imul", + /* WINED3DSIH_INE */ "ine", + /* WINED3DSIH_INEG */ "ineg", + /* WINED3DSIH_ISHL */ "ishl", + /* WINED3DSIH_ITOF */ "itof", + /* WINED3DSIH_LABEL */ "label", + /* WINED3DSIH_LD */ "ld", + /* WINED3DSIH_LIT */ "lit", + /* WINED3DSIH_LOG */ "log", + /* WINED3DSIH_LOGP */ "logp", + /* WINED3DSIH_LOOP */ "loop", + /* WINED3DSIH_LRP */ "lrp", + /* WINED3DSIH_LT */ "lt", + /* WINED3DSIH_M3x2 */ "m3x2", + /* WINED3DSIH_M3x3 */ "m3x3", + /* WINED3DSIH_M3x4 */ "m3x4", + /* WINED3DSIH_M4x3 */ "m4x3", + /* WINED3DSIH_M4x4 */ "m4x4", + /* WINED3DSIH_MAD */ "mad", + /* WINED3DSIH_MAX */ "max", + /* WINED3DSIH_MIN */ "min", + /* WINED3DSIH_MOV */ "mov", + /* WINED3DSIH_MOVA */ "mova", + /* WINED3DSIH_MOVC */ "movc", + /* WINED3DSIH_MUL */ "mul", + /* WINED3DSIH_NE */ "ne", + /* WINED3DSIH_NOP */ "nop", + /* WINED3DSIH_NOT */ "not", + /* WINED3DSIH_NRM */ "nrm", + /* WINED3DSIH_OR */ "or", + /* WINED3DSIH_PHASE */ "phase", + /* WINED3DSIH_POW */ "pow", + /* WINED3DSIH_RCP */ "rcp", + /* WINED3DSIH_REP */ "rep", + /* WINED3DSIH_RESINFO */ "resinfo", + /* WINED3DSIH_RET */ "ret", + /* WINED3DSIH_ROUND_NI */ "round_ni", + /* WINED3DSIH_ROUND_PI */ "round_pi", + /* WINED3DSIH_ROUND_Z */ "round_z", + /* WINED3DSIH_RSQ */ "rsq", + /* WINED3DSIH_SAMPLE */ "sample", + /* WINED3DSIH_SAMPLE_B */ "sample_b", + /* WINED3DSIH_SAMPLE_C */ "sample_c", + /* WINED3DSIH_SAMPLE_C_LZ */ "sample_c_lz", + /* WINED3DSIH_SAMPLE_GRAD */ "sample_d", + /* WINED3DSIH_SAMPLE_LOD */ "sample_l", + /* WINED3DSIH_SETP */ "setp", + /* WINED3DSIH_SGE */ "sge", + /* WINED3DSIH_SGN */ "sgn", + /* WINED3DSIH_SINCOS */ "sincos", + /* WINED3DSIH_SLT */ "slt", + /* WINED3DSIH_SQRT */ "sqrt", + /* WINED3DSIH_SUB */ "sub", + /* WINED3DSIH_TEX */ "texld", + /* WINED3DSIH_TEXBEM */ "texbem", + /* WINED3DSIH_TEXBEML */ "texbeml", + /* WINED3DSIH_TEXCOORD */ "texcrd", + /* WINED3DSIH_TEXDEPTH */ "texdepth", + /* WINED3DSIH_TEXDP3 */ "texdp3", + /* WINED3DSIH_TEXDP3TEX */ "texdp3tex", + /* WINED3DSIH_TEXKILL */ "texkill", + /* WINED3DSIH_TEXLDD */ "texldd", + /* WINED3DSIH_TEXLDL */ "texldl", + /* WINED3DSIH_TEXM3x2DEPTH */ "texm3x2depth", + /* WINED3DSIH_TEXM3x2PAD */ "texm3x2pad", + /* WINED3DSIH_TEXM3x2TEX */ "texm3x2tex", + /* WINED3DSIH_TEXM3x3 */ "texm3x3", + /* WINED3DSIH_TEXM3x3DIFF */ "texm3x3diff", + /* WINED3DSIH_TEXM3x3PAD */ "texm3x3pad", + /* WINED3DSIH_TEXM3x3SPEC */ "texm3x3spec", + /* WINED3DSIH_TEXM3x3TEX */ "texm3x3tex", + /* WINED3DSIH_TEXM3x3VSPEC */ "texm3x3vspec", + /* WINED3DSIH_TEXREG2AR */ "texreg2ar", + /* WINED3DSIH_TEXREG2GB */ "texreg2gb", + /* WINED3DSIH_TEXREG2RGB */ "texreg2rgb", + /* WINED3DSIH_UDIV */ "udiv", + /* WINED3DSIH_UGE */ "uge", + /* WINED3DSIH_USHR */ "ushr", + /* WINED3DSIH_UTOF */ "utof", + /* WINED3DSIH_XOR */ "xor", }; static const char * const semantic_names[] = @@ -184,6 +202,20 @@ /* WINED3D_DECL_USAGE_SAMPLE */ "SAMPLE", }; +static const struct +{ + enum wined3d_sysval_semantic sysval_semantic; + const char *sysval_name; +} +sysval_semantic_names[] = +{ + {WINED3D_SV_POSITION, "SV_Position"}, + {WINED3D_SV_INSTANCEID, "SV_InstanceID"}, + {WINED3D_SV_PRIMITIVEID, "SV_PrimitiveID"}, + {WINED3D_SV_ISFRONTFACE, "SV_IsFrontFace"}, + {WINED3D_SV_SAMPLEINDEX, "SV_SampleIndex"}, +}; + const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx) { if (handler_idx >= sizeof(shader_opcode_names) / sizeof(*shader_opcode_names)) @@ -805,6 +837,12 @@ else reg_maps->cb_sizes[reg->idx[0].offset] = reg->idx[1].offset; } + else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER) + { + if (reg_maps->icb) + FIXME("Multiple immediate constant buffers.\n"); + reg_maps->icb = ins.declaration.icb; + } else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE) { if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY) @@ -1068,6 +1106,8 @@ --cur_loop_depth; } else if (ins.handler_idx == WINED3DSIH_SAMPLE + || ins.handler_idx == WINED3DSIH_SAMPLE_B + || ins.handler_idx == WINED3DSIH_SAMPLE_C_LZ || ins.handler_idx == WINED3DSIH_SAMPLE_GRAD || ins.handler_idx == WINED3DSIH_SAMPLE_LOD) { @@ -1136,7 +1176,7 @@ } else if (!input_signature->elements && reg_maps->input_registers) { - unsigned int count = count_bits(reg_maps->input_registers); + unsigned int count = wined3d_popcount(reg_maps->input_registers); struct wined3d_shader_signature_element *e; unsigned int i; @@ -1163,7 +1203,7 @@ } else if (reg_maps->output_registers) { - unsigned int count = count_bits(reg_maps->output_registers); + unsigned int count = wined3d_popcount(reg_maps->output_registers); struct wined3d_shader_signature_element *e; if (!(output_signature->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*output_signature->elements) * count))) @@ -1191,6 +1231,42 @@ return wined3d_log2i(map); } +static void shader_dump_global_flags(DWORD global_flags) +{ + if (global_flags & WINED3DSGF_REFACTORING_ALLOWED) + { + TRACE("refactoringAllowed"); + global_flags &= ~WINED3DSGF_REFACTORING_ALLOWED; + if (global_flags) + TRACE(" | "); + } + + if (global_flags & WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS) + { + TRACE("enableRawAndStructuredBuffers"); + global_flags &= ~WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS; + } + + if (global_flags) + TRACE("unknown_flags(%#x)", global_flags); +} + +static void shader_dump_sysval_semantic(enum wined3d_sysval_semantic semantic) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(sysval_semantic_names); ++i) + { + if (sysval_semantic_names[i].sysval_semantic == semantic) + { + TRACE("%s", sysval_semantic_names[i].sysval_name); + return; + } + } + + TRACE("unknown_sysval_semantic(%#x)", semantic); +} + static void shader_dump_decl_usage(const struct wined3d_shader_semantic *semantic, const struct wined3d_shader_version *shader_version) { @@ -1451,6 +1527,10 @@ TRACE("cb"); break; + case WINED3DSPR_IMMCONSTBUFFER: + TRACE("icb"); + break; + case WINED3DSPR_PRIMID: TRACE("primID"); break; @@ -1753,6 +1833,37 @@ } } +static void shader_dump_interpolation_mode(enum wined3d_shader_interpolation_mode interpolation_mode) +{ + switch (interpolation_mode) + { + case WINED3DSIM_CONSTANT: + TRACE("constant"); + break; + case WINED3DSIM_LINEAR: + TRACE("linear"); + break; + case WINED3DSIM_LINEAR_CENTROID: + TRACE("linear centroid"); + break; + case WINED3DSIM_LINEAR_NOPERSPECTIVE: + TRACE("linear noperspective"); + break; + case WINED3DSIM_LINEAR_SAMPLE: + TRACE("linear sample"); + break; + case WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID: + TRACE("linear noperspective centroid"); + break; + case WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE: + TRACE("linear noperspective sample"); + break; + default: + TRACE("", interpolation_mode); + break; + } +} + static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data, const DWORD *byte_code) { struct wined3d_shader_version shader_version; @@ -1810,13 +1921,71 @@ shader_dump_src_param(&ins.declaration.src, &shader_version); TRACE(", %s", ins.flags & WINED3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed"); } + else if (ins.handler_idx == WINED3DSIH_DCL_GLOBAL_FLAGS) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_global_flags(ins.flags); + } + else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER) + { + TRACE("%s {\n", shader_opcode_names[ins.handler_idx]); + for (i = 0; i < ins.declaration.icb->element_count / 4; ++i) + { + TRACE("{ 0x%08x, 0x%08x, 0x%08x, 0x%08x },\n", + ins.declaration.icb->data[4 * i + 0], + ins.declaration.icb->data[4 * i + 1], + ins.declaration.icb->data[4 * i + 2], + ins.declaration.icb->data[4 * i + 3]); + } + TRACE("}"); + } + else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_interpolation_mode(ins.flags); + TRACE(" "); + shader_dump_dst_param(&ins.declaration.dst, &shader_version); + } + else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS_SGV + || ins.handler_idx == WINED3DSIH_DCL_INPUT_SGV + || ins.handler_idx == WINED3DSIH_DCL_INPUT_SIV + || ins.handler_idx == WINED3DSIH_DCL_OUTPUT_SIV) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_dst_param(&ins.declaration.register_semantic.reg, &shader_version); + TRACE(", "); + shader_dump_sysval_semantic(ins.declaration.register_semantic.sysval_semantic); + } + else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS_SIV) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_interpolation_mode(ins.flags); + TRACE(" "); + shader_dump_dst_param(&ins.declaration.register_semantic.reg, &shader_version); + TRACE(", "); + shader_dump_sysval_semantic(ins.declaration.register_semantic.sysval_semantic); + } + else if (ins.handler_idx == WINED3DSIH_DCL_INPUT + || ins.handler_idx == WINED3DSIH_DCL_OUTPUT) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_dst_param(&ins.declaration.dst, &shader_version); + } else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE || ins.handler_idx == WINED3DSIH_DCL_OUTPUT_TOPOLOGY) { TRACE("%s ", shader_opcode_names[ins.handler_idx]); shader_dump_primitive_type(ins.declaration.primitive_type); } - else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT) + else if (ins.handler_idx == WINED3DSIH_DCL_SAMPLER) + { + TRACE("%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_dst_param(&ins.declaration.dst, &shader_version); + if (ins.flags == WINED3DSI_SAMPLER_COMPARISON_MODE) + TRACE(", comparisonMode"); + } + else if (ins.handler_idx == WINED3DSIH_DCL_TEMPS + || ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT) { TRACE("%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader_sm1.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader_sm1.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader_sm1.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader_sm1.c 2016-02-08 19:32:34.000000000 +0000 @@ -30,73 +30,73 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); /* DCL usage masks */ -#define WINED3DSP_DCL_USAGE_SHIFT 0 -#define WINED3DSP_DCL_USAGE_MASK (0xfu << WINED3DSP_DCL_USAGE_SHIFT) -#define WINED3DSP_DCL_USAGEINDEX_SHIFT 16 -#define WINED3DSP_DCL_USAGEINDEX_MASK (0xfu << WINED3DSP_DCL_USAGEINDEX_SHIFT) +#define WINED3D_SM1_DCL_USAGE_SHIFT 0 +#define WINED3D_SM1_DCL_USAGE_MASK (0xfu << WINED3D_SM1_DCL_USAGE_SHIFT) +#define WINED3D_SM1_DCL_USAGE_INDEX_SHIFT 16 +#define WINED3D_SM1_DCL_USAGE_INDEX_MASK (0xfu << WINED3D_SM1_DCL_USAGE_INDEX_SHIFT) /* DCL sampler type */ #define WINED3D_SM1_RESOURCE_TYPE_SHIFT 27 #define WINED3D_SM1_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM1_RESOURCE_TYPE_SHIFT) /* Opcode-related masks */ -#define WINED3DSI_OPCODE_MASK 0x0000ffff +#define WINED3D_SM1_OPCODE_MASK 0x0000ffff -#define WINED3D_OPCODESPECIFICCONTROL_SHIFT 16 -#define WINED3D_OPCODESPECIFICCONTROL_MASK (0xffu << WINED3D_OPCODESPECIFICCONTROL_SHIFT) +#define WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT 16 +#define WINED3D_SM1_INSTRUCTION_FLAGS_MASK (0xffu << WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT) -#define WINED3DSI_INSTLENGTH_SHIFT 24 -#define WINED3DSI_INSTLENGTH_MASK (0xfu << WINED3DSI_INSTLENGTH_SHIFT) +#define WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT 24 +#define WINED3D_SM1_INSTRUCTION_LENGTH_MASK (0xfu << WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT) -#define WINED3DSI_COISSUE (0x1u << 30) +#define WINED3D_SM1_COISSUE (0x1u << 30) -#define WINED3DSI_COMMENTSIZE_SHIFT 16 -#define WINED3DSI_COMMENTSIZE_MASK (0x7fffu << WINED3DSI_COMMENTSIZE_SHIFT) +#define WINED3D_SM1_COMMENT_SIZE_SHIFT 16 +#define WINED3D_SM1_COMMENT_SIZE_MASK (0x7fffu << WINED3D_SM1_COMMENT_SIZE_SHIFT) -#define WINED3DSHADER_INSTRUCTION_PREDICATED (0x1u << 28) +#define WINED3D_SM1_INSTRUCTION_PREDICATED (0x1u << 28) /* Register number mask */ -#define WINED3DSP_REGNUM_MASK 0x000007ff +#define WINED3D_SM1_REGISTER_NUMBER_MASK 0x000007ff /* Register type masks */ -#define WINED3DSP_REGTYPE_SHIFT 28 -#define WINED3DSP_REGTYPE_MASK (0x7u << WINED3DSP_REGTYPE_SHIFT) -#define WINED3DSP_REGTYPE_SHIFT2 8 -#define WINED3DSP_REGTYPE_MASK2 (0x18u << WINED3DSP_REGTYPE_SHIFT2) +#define WINED3D_SM1_REGISTER_TYPE_SHIFT 28 +#define WINED3D_SM1_REGISTER_TYPE_MASK (0x7u << WINED3D_SM1_REGISTER_TYPE_SHIFT) +#define WINED3D_SM1_REGISTER_TYPE_SHIFT2 8 +#define WINED3D_SM1_REGISTER_TYPE_MASK2 (0x18u << WINED3D_SM1_REGISTER_TYPE_SHIFT2) /* Relative addressing mask */ -#define WINED3DSHADER_ADDRESSMODE_SHIFT 13 -#define WINED3DSHADER_ADDRESSMODE_MASK (0x1u << WINED3DSHADER_ADDRESSMODE_SHIFT) +#define WINED3D_SM1_ADDRESS_MODE_SHIFT 13 +#define WINED3D_SM1_ADDRESS_MODE_MASK (0x1u << WINED3D_SM1_ADDRESS_MODE_SHIFT) /* Destination modifier mask */ -#define WINED3DSP_DSTMOD_SHIFT 20 -#define WINED3DSP_DSTMOD_MASK (0xfu << WINED3DSP_DSTMOD_SHIFT) +#define WINED3D_SM1_DST_MODIFIER_SHIFT 20 +#define WINED3D_SM1_DST_MODIFIER_MASK (0xfu << WINED3D_SM1_DST_MODIFIER_SHIFT) /* Destination shift mask */ -#define WINED3DSP_DSTSHIFT_SHIFT 24 -#define WINED3DSP_DSTSHIFT_MASK (0xfu << WINED3DSP_DSTSHIFT_SHIFT) +#define WINED3D_SM1_DSTSHIFT_SHIFT 24 +#define WINED3D_SM1_DSTSHIFT_MASK (0xfu << WINED3D_SM1_DSTSHIFT_SHIFT) /* Write mask */ #define WINED3D_SM1_WRITEMASK_SHIFT 16 #define WINED3D_SM1_WRITEMASK_MASK (0xfu << WINED3D_SM1_WRITEMASK_SHIFT) /* Swizzle mask */ -#define WINED3DSP_SWIZZLE_SHIFT 16 -#define WINED3DSP_SWIZZLE_MASK (0xffu << WINED3DSP_SWIZZLE_SHIFT) +#define WINED3D_SM1_SWIZZLE_SHIFT 16 +#define WINED3D_SM1_SWIZZLE_MASK (0xffu << WINED3D_SM1_SWIZZLE_SHIFT) /* Source modifier mask */ -#define WINED3DSP_SRCMOD_SHIFT 24 -#define WINED3DSP_SRCMOD_MASK (0xfu << WINED3DSP_SRCMOD_SHIFT) +#define WINED3D_SM1_SRC_MODIFIER_SHIFT 24 +#define WINED3D_SM1_SRC_MODIFIER_MASK (0xfu << WINED3D_SM1_SRC_MODIFIER_SHIFT) -#define WINED3DSP_END 0x0000ffff +#define WINED3D_SM1_END 0x0000ffff #define WINED3D_SM1_VERSION_MAJOR(version) (((version) >> 8) & 0xff) #define WINED3D_SM1_VERSION_MINOR(version) (((version) >> 0) & 0xff) -enum WINED3DSHADER_ADDRESSMODE_TYPE +enum wined3d_sm1_address_mode_type { - WINED3DSHADER_ADDRMODE_ABSOLUTE = 0u << WINED3DSHADER_ADDRESSMODE_SHIFT, - WINED3DSHADER_ADDRMODE_RELATIVE = 1u << WINED3DSHADER_ADDRESSMODE_SHIFT, + WINED3D_SM1_ADDRESS_MODE_ABSOLUTE = 0u << WINED3D_SM1_ADDRESS_MODE_SHIFT, + WINED3D_SM1_ADDRESS_MODE_RELATIVE = 1u << WINED3D_SM1_ADDRESS_MODE_SHIFT, }; enum wined3d_sm1_resource_type @@ -408,14 +408,14 @@ * VS >= 2.0 have relative addressing (with token) * VS >= 1.0 < 2.0 have relative addressing (without token) * The version check below should work in general */ - if (*ptr & WINED3DSHADER_ADDRMODE_RELATIVE) + if (*ptr & WINED3D_SM1_ADDRESS_MODE_RELATIVE) { if (priv->shader_version.major < 2) { *addr_token = (1u << 31) - | ((WINED3DSPR_ADDR << WINED3DSP_REGTYPE_SHIFT2) & WINED3DSP_REGTYPE_MASK2) - | ((WINED3DSPR_ADDR << WINED3DSP_REGTYPE_SHIFT) & WINED3DSP_REGTYPE_MASK) - | (WINED3DSP_NOSWIZZLE << WINED3DSP_SWIZZLE_SHIFT); + | ((WINED3DSPR_ADDR << WINED3D_SM1_REGISTER_TYPE_SHIFT2) & WINED3D_SM1_REGISTER_TYPE_MASK2) + | ((WINED3DSPR_ADDR << WINED3D_SM1_REGISTER_TYPE_SHIFT) & WINED3D_SM1_REGISTER_TYPE_MASK) + | (WINED3DSP_NOSWIZZLE << WINED3D_SM1_SWIZZLE_SHIFT); } else { @@ -435,7 +435,7 @@ while (opcode_table[i].handler_idx != WINED3DSIH_TABLE_SIZE) { - if ((code & WINED3DSI_OPCODE_MASK) == opcode_table[i].opcode + if ((code & WINED3D_SM1_OPCODE_MASK) == opcode_table[i].opcode && shader_version >= opcode_table[i].min_version && (!opcode_table[i].max_version || shader_version <= opcode_table[i].max_version)) { @@ -445,7 +445,7 @@ } FIXME("Unsupported opcode %#x(%d) masked %#x, shader version %#x\n", - code, code, code & WINED3DSI_OPCODE_MASK, shader_version); + code, code, code & WINED3D_SM1_OPCODE_MASK, shader_version); return NULL; } @@ -454,39 +454,39 @@ static int shader_skip_opcode(const struct wined3d_sm1_data *priv, const struct wined3d_sm1_opcode_info *opcode_info, DWORD opcode_token) { - /* Shaders >= 2.0 may contain address tokens, but fortunately they - * have a useful length mask - use it here. Shaders 1.0 contain no such tokens */ - return (priv->shader_version.major >= 2) - ? ((opcode_token & WINED3DSI_INSTLENGTH_MASK) >> WINED3DSI_INSTLENGTH_SHIFT) : opcode_info->param_count; + /* Shaders >= 2.0 may contain address tokens, but fortunately they + * have a useful length mask - use it here. Shaders 1.0 contain no such tokens */ + DWORD length = (opcode_token & WINED3D_SM1_INSTRUCTION_LENGTH_MASK) >> WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT; + return (priv->shader_version.major >= 2) ? length : opcode_info->param_count; } static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_src_param *src) { - src->reg.type = ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) - | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2); + src->reg.type = ((param & WINED3D_SM1_REGISTER_TYPE_MASK) >> WINED3D_SM1_REGISTER_TYPE_SHIFT) + | ((param & WINED3D_SM1_REGISTER_TYPE_MASK2) >> WINED3D_SM1_REGISTER_TYPE_SHIFT2); src->reg.data_type = WINED3D_DATA_FLOAT; - src->reg.idx[0].offset = param & WINED3DSP_REGNUM_MASK; + src->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK; src->reg.idx[0].rel_addr = rel_addr; src->reg.idx[1].offset = ~0U; src->reg.idx[1].rel_addr = NULL; - src->swizzle = (param & WINED3DSP_SWIZZLE_MASK) >> WINED3DSP_SWIZZLE_SHIFT; - src->modifiers = (param & WINED3DSP_SRCMOD_MASK) >> WINED3DSP_SRCMOD_SHIFT; + src->swizzle = (param & WINED3D_SM1_SWIZZLE_MASK) >> WINED3D_SM1_SWIZZLE_SHIFT; + src->modifiers = (param & WINED3D_SM1_SRC_MODIFIER_MASK) >> WINED3D_SM1_SRC_MODIFIER_SHIFT; } static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_dst_param *dst) { - dst->reg.type = ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) - | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2); + dst->reg.type = ((param & WINED3D_SM1_REGISTER_TYPE_MASK) >> WINED3D_SM1_REGISTER_TYPE_SHIFT) + | ((param & WINED3D_SM1_REGISTER_TYPE_MASK2) >> WINED3D_SM1_REGISTER_TYPE_SHIFT2); dst->reg.data_type = WINED3D_DATA_FLOAT; - dst->reg.idx[0].offset = param & WINED3DSP_REGNUM_MASK; + dst->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK; dst->reg.idx[0].rel_addr = rel_addr; dst->reg.idx[1].offset = ~0U; dst->reg.idx[1].rel_addr = NULL; dst->write_mask = (param & WINED3D_SM1_WRITEMASK_MASK) >> WINED3D_SM1_WRITEMASK_SHIFT; - dst->modifiers = (param & WINED3DSP_DSTMOD_MASK) >> WINED3DSP_DSTMOD_SHIFT; - dst->shift = (param & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT; + dst->modifiers = (param & WINED3D_SM1_DST_MODIFIER_MASK) >> WINED3D_SM1_DST_MODIFIER_SHIFT; + dst->shift = (param & WINED3D_SM1_DSTSHIFT_MASK) >> WINED3D_SM1_DSTSHIFT_SHIFT; } /* Read the parameters of an unrecognized opcode from the input stream @@ -511,20 +511,20 @@ FIXME("Unrecognized opcode param: token=0x%08x addr_token=0x%08x name=", token, addr_token); - if (token & WINED3DSHADER_ADDRMODE_RELATIVE) shader_parse_src_param(addr_token, NULL, &rel_addr); + if (token & WINED3D_SM1_ADDRESS_MODE_RELATIVE) shader_parse_src_param(addr_token, NULL, &rel_addr); if (!i) { struct wined3d_shader_dst_param dst; - shader_parse_dst_param(token, token & WINED3DSHADER_ADDRMODE_RELATIVE ? &rel_addr : NULL, &dst); + shader_parse_dst_param(token, token & WINED3D_SM1_ADDRESS_MODE_RELATIVE ? &rel_addr : NULL, &dst); shader_dump_dst_param(&dst, &priv->shader_version); } else { struct wined3d_shader_src_param src; - shader_parse_src_param(token, token & WINED3DSHADER_ADDRMODE_RELATIVE ? &rel_addr : NULL, &src); + shader_parse_src_param(token, token & WINED3D_SM1_ADDRESS_MODE_RELATIVE ? &rel_addr : NULL, &src); shader_dump_src_param(&src, &priv->shader_version); } FIXME("\n"); @@ -600,7 +600,7 @@ DWORD token, addr_token; *ptr += shader_get_param(priv, *ptr, &token, &addr_token); - if (token & WINED3DSHADER_ADDRMODE_RELATIVE) + if (token & WINED3D_SM1_ADDRESS_MODE_RELATIVE) { shader_parse_src_param(addr_token, NULL, src_rel_addr); shader_parse_src_param(token, src_rel_addr, src_param); @@ -617,7 +617,7 @@ DWORD token, addr_token; *ptr += shader_get_param(priv, *ptr, &token, &addr_token); - if (token & WINED3DSHADER_ADDRMODE_RELATIVE) + if (token & WINED3D_SM1_ADDRESS_MODE_RELATIVE) { shader_parse_src_param(addr_token, NULL, dst_rel_addr); shader_parse_dst_param(token, dst_rel_addr, dst_param); @@ -634,8 +634,8 @@ DWORD usage_token = *(*ptr)++; DWORD dst_token = *(*ptr)++; - semantic->usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT; - semantic->usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; + semantic->usage = (usage_token & WINED3D_SM1_DCL_USAGE_MASK) >> WINED3D_SM1_DCL_USAGE_SHIFT; + semantic->usage_idx = (usage_token & WINED3D_SM1_DCL_USAGE_INDEX_MASK) >> WINED3D_SM1_DCL_USAGE_INDEX_SHIFT; resource_type = (usage_token & WINED3D_SM1_RESOURCE_TYPE_MASK) >> WINED3D_SM1_RESOURCE_TYPE_SHIFT; if (resource_type >= ARRAY_SIZE(resource_type_table)) { @@ -674,9 +674,9 @@ const char *comment; UINT size; - while ((token & WINED3DSI_OPCODE_MASK) == WINED3D_SM1_OP_COMMENT) + while ((token & WINED3D_SM1_OPCODE_MASK) == WINED3D_SM1_OP_COMMENT) { - size = (token & WINED3DSI_COMMENTSIZE_MASK) >> WINED3DSI_COMMENTSIZE_SHIFT; + size = (token & WINED3D_SM1_COMMENT_SIZE_MASK) >> WINED3D_SM1_COMMENT_SIZE_SHIFT; comment = (const char *)++(*ptr); *ptr += size; @@ -730,9 +730,9 @@ } ins->handler_idx = opcode_info->handler_idx; - ins->flags = (opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK) >> WINED3D_OPCODESPECIFICCONTROL_SHIFT; - ins->coissue = opcode_token & WINED3DSI_COISSUE; - ins->predicate = opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED ? &priv->pred_param : NULL; + ins->flags = (opcode_token & WINED3D_SM1_INSTRUCTION_FLAGS_MASK) >> WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT; + ins->coissue = opcode_token & WINED3D_SM1_COISSUE; + ins->predicate = opcode_token & WINED3D_SM1_INSTRUCTION_PREDICATED ? &priv->pred_param : NULL; ins->dst_count = opcode_info->dst_count ? 1 : 0; ins->dst = &priv->dst_param; ins->src_count = opcode_info->param_count - opcode_info->dst_count; @@ -782,7 +782,7 @@ { shader_sm1_read_comment(ptr); - if (**ptr == WINED3DSP_END) + if (**ptr == WINED3D_SM1_END) { ++(*ptr); return TRUE; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader_sm4.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader_sm4.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/shader_sm4.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/shader_sm4.c 2016-02-08 19:32:34.000000000 +0000 @@ -41,6 +41,18 @@ #define WINED3D_SM4_INDEX_TYPE_SHIFT 11 #define WINED3D_SM4_INDEX_TYPE_MASK (0x1u << WINED3D_SM4_INDEX_TYPE_SHIFT) +#define WINED3D_SM4_SAMPLER_MODE_SHIFT 11 +#define WINED3D_SM4_SAMPLER_MODE_MASK (0xfu << WINED3D_SM4_SAMPLER_MODE_SHIFT) + +#define WINED3D_SM4_SHADER_DATA_TYPE_SHIFT 11 +#define WINED3D_SM4_SHADER_DATA_TYPE_MASK (0xfu << WINED3D_SM4_SHADER_DATA_TYPE_SHIFT) + +#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT 11 +#define WINED3D_SM4_INTERPOLATION_MODE_MASK (0xfu << WINED3D_SM4_INTERPOLATION_MODE_SHIFT) + +#define WINED3D_SM4_GLOBAL_FLAGS_SHIFT 11 +#define WINED3D_SM4_GLOBAL_FLAGS_MASK (0xffu << WINED3D_SM4_GLOBAL_FLAGS_SHIFT) + #define WINED3D_SM4_OPCODE_MASK 0xff #define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31) @@ -91,6 +103,7 @@ WINED3D_SM4_OP_DP2 = 0x0f, WINED3D_SM4_OP_DP3 = 0x10, WINED3D_SM4_OP_DP4 = 0x11, + WINED3D_SM4_OP_ELSE = 0x12, WINED3D_SM4_OP_EMIT = 0x13, WINED3D_SM4_OP_ENDIF = 0x15, WINED3D_SM4_OP_ENDLOOP = 0x16, @@ -120,18 +133,25 @@ WINED3D_SM4_OP_MAD = 0x32, WINED3D_SM4_OP_MIN = 0x33, WINED3D_SM4_OP_MAX = 0x34, + WINED3D_SM4_OP_SHADER_DATA = 0x35, WINED3D_SM4_OP_MOV = 0x36, WINED3D_SM4_OP_MOVC = 0x37, WINED3D_SM4_OP_MUL = 0x38, WINED3D_SM4_OP_NE = 0x39, + WINED3D_SM4_OP_NOT = 0x3b, WINED3D_SM4_OP_OR = 0x3c, WINED3D_SM4_OP_RESINFO = 0x3d, WINED3D_SM4_OP_RET = 0x3e, WINED3D_SM4_OP_ROUND_NI = 0x41, + WINED3D_SM4_OP_ROUND_PI = 0x42, + WINED3D_SM4_OP_ROUND_Z = 0x43, WINED3D_SM4_OP_RSQ = 0x44, WINED3D_SM4_OP_SAMPLE = 0x45, + WINED3D_SM4_OP_SAMPLE_C = 0x46, + WINED3D_SM4_OP_SAMPLE_C_LZ = 0x47, WINED3D_SM4_OP_SAMPLE_LOD = 0x48, WINED3D_SM4_OP_SAMPLE_GRAD = 0x49, + WINED3D_SM4_OP_SAMPLE_B = 0x4a, WINED3D_SM4_OP_SQRT = 0x4b, WINED3D_SM4_OP_SINCOS = 0x4d, WINED3D_SM4_OP_UDIV = 0x4e, @@ -141,23 +161,35 @@ WINED3D_SM4_OP_XOR = 0x57, WINED3D_SM4_OP_DCL_RESOURCE = 0x58, WINED3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59, + WINED3D_SM4_OP_DCL_SAMPLER = 0x5a, WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c, WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d, WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e, + WINED3D_SM4_OP_DCL_INPUT = 0x5f, + WINED3D_SM4_OP_DCL_INPUT_SGV = 0x60, + WINED3D_SM4_OP_DCL_INPUT_SIV = 0x61, + WINED3D_SM4_OP_DCL_INPUT_PS = 0x62, + WINED3D_SM4_OP_DCL_INPUT_PS_SGV = 0x63, + WINED3D_SM4_OP_DCL_INPUT_PS_SIV = 0x64, + WINED3D_SM4_OP_DCL_OUTPUT = 0x65, + WINED3D_SM4_OP_DCL_OUTPUT_SIV = 0x67, + WINED3D_SM4_OP_DCL_TEMPS = 0x68, + WINED3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a, }; enum wined3d_sm4_register_type { - WINED3D_SM4_RT_TEMP = 0x0, - WINED3D_SM4_RT_INPUT = 0x1, - WINED3D_SM4_RT_OUTPUT = 0x2, - WINED3D_SM4_RT_IMMCONST = 0x4, - WINED3D_SM4_RT_SAMPLER = 0x6, - WINED3D_SM4_RT_RESOURCE = 0x7, - WINED3D_SM4_RT_CONSTBUFFER = 0x8, - WINED3D_SM4_RT_PRIMID = 0xb, - WINED3D_SM4_RT_DEPTHOUT = 0xc, - WINED3D_SM4_RT_NULL = 0xd, + WINED3D_SM4_RT_TEMP = 0x0, + WINED3D_SM4_RT_INPUT = 0x1, + WINED3D_SM4_RT_OUTPUT = 0x2, + WINED3D_SM4_RT_IMMCONST = 0x4, + WINED3D_SM4_RT_SAMPLER = 0x6, + WINED3D_SM4_RT_RESOURCE = 0x7, + WINED3D_SM4_RT_CONSTBUFFER = 0x8, + WINED3D_SM4_RT_IMMCONSTBUFFER = 0x9, + WINED3D_SM4_RT_PRIMID = 0xb, + WINED3D_SM4_RT_DEPTHOUT = 0xc, + WINED3D_SM4_RT_NULL = 0xd, }; enum wined3d_sm4_output_primitive_type @@ -211,6 +243,18 @@ WINED3D_SM4_DATA_FLOAT = 0x5, }; +enum wined3d_sm4_sampler_mode +{ + WINED3D_SM4_SAMPLER_DEFAULT = 0x0, + WINED3D_SM4_SAMPLER_COMPARISON = 0x1, +}; + +enum wined3d_sm4_shader_data_type +{ + WINED3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER = 0x3, + WINED3D_SM4_SHADER_DATA_MESSAGE = 0x4, +}; + struct wined3d_shader_src_param_entry { struct list entry; @@ -232,6 +276,7 @@ struct wined3d_shader_dst_param dst_param[2]; struct list src_free; struct list src; + struct wined3d_shader_immediate_constant_buffer icb; }; struct wined3d_sm4_opcode_info @@ -258,71 +303,90 @@ */ static const struct wined3d_sm4_opcode_info opcode_table[] = { - {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, "F", "FF"}, - {WINED3D_SM4_OP_AND, WINED3DSIH_AND, "U", "UU"}, - {WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, "", ""}, - {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "U"}, - {WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, "", ""}, - {WINED3D_SM4_OP_DERIV_RTX, WINED3DSIH_DSX, "F", "F"}, - {WINED3D_SM4_OP_DERIV_RTY, WINED3DSIH_DSY, "F", "F"}, - {WINED3D_SM4_OP_DISCARD, WINED3DSIH_TEXKILL, "", "U"}, - {WINED3D_SM4_OP_DIV, WINED3DSIH_DIV, "F", "FF"}, - {WINED3D_SM4_OP_DP2, WINED3DSIH_DP2, "F", "FF"}, - {WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, "F", "FF"}, - {WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, "F", "FF"}, - {WINED3D_SM4_OP_EMIT, WINED3DSIH_EMIT, "", ""}, - {WINED3D_SM4_OP_ENDIF, WINED3DSIH_ENDIF, "", ""}, - {WINED3D_SM4_OP_ENDLOOP, WINED3DSIH_ENDLOOP, "", ""}, - {WINED3D_SM4_OP_EQ, WINED3DSIH_EQ, "U", "FF"}, - {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, "F", "F"}, - {WINED3D_SM4_OP_FRC, WINED3DSIH_FRC, "F", "F"}, - {WINED3D_SM4_OP_FTOI, WINED3DSIH_FTOI, "I", "F"}, - {WINED3D_SM4_OP_FTOU, WINED3DSIH_FTOU, "U", "F"}, - {WINED3D_SM4_OP_GE, WINED3DSIH_GE, "U", "FF"}, - {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, "I", "II"}, - {WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "U"}, - {WINED3D_SM4_OP_IEQ, WINED3DSIH_IEQ, "U", "II"}, - {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, "U", "II"}, - {WINED3D_SM4_OP_ILT, WINED3DSIH_ILT, "U", "II"}, - {WINED3D_SM4_OP_IMAD, WINED3DSIH_IMAD, "I", "III"}, - {WINED3D_SM4_OP_IMAX, WINED3DSIH_IMAX, "I", "II"}, - {WINED3D_SM4_OP_IMIN, WINED3DSIH_IMIN, "I", "II"}, - {WINED3D_SM4_OP_IMUL, WINED3DSIH_IMUL, "II", "II"}, - {WINED3D_SM4_OP_INE, WINED3DSIH_INE, "U", "II"}, - {WINED3D_SM4_OP_INEG, WINED3DSIH_INEG, "I", "I"}, - {WINED3D_SM4_OP_ISHL, WINED3DSIH_ISHL, "I", "II"}, - {WINED3D_SM4_OP_ITOF, WINED3DSIH_ITOF, "F", "I"}, - {WINED3D_SM4_OP_LD, WINED3DSIH_LD, "U", "IR"}, - {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, "F", "F"}, - {WINED3D_SM4_OP_LOOP, WINED3DSIH_LOOP, "", ""}, - {WINED3D_SM4_OP_LT, WINED3DSIH_LT, "U", "FF"}, - {WINED3D_SM4_OP_MAD, WINED3DSIH_MAD, "F", "FFF"}, - {WINED3D_SM4_OP_MIN, WINED3DSIH_MIN, "F", "FF"}, - {WINED3D_SM4_OP_MAX, WINED3DSIH_MAX, "F", "FF"}, - {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, "F", "F"}, - {WINED3D_SM4_OP_MOVC, WINED3DSIH_MOVC, "F", "UFF"}, - {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, "F", "FF"}, - {WINED3D_SM4_OP_NE, WINED3DSIH_NE, "U", "FF"}, - {WINED3D_SM4_OP_OR, WINED3DSIH_OR, "U", "UU"}, - {WINED3D_SM4_OP_RESINFO, WINED3DSIH_RESINFO, "F", "IR"}, - {WINED3D_SM4_OP_RET, WINED3DSIH_RET, "", ""}, - {WINED3D_SM4_OP_ROUND_NI, WINED3DSIH_ROUND_NI, "F", "F"}, - {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, "F", "F"}, - {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, "U", "FRS"}, - {WINED3D_SM4_OP_SAMPLE_LOD, WINED3DSIH_SAMPLE_LOD, "U", "FRSF"}, - {WINED3D_SM4_OP_SAMPLE_GRAD, WINED3DSIH_SAMPLE_GRAD, "U", "FRSFF"}, - {WINED3D_SM4_OP_SQRT, WINED3DSIH_SQRT, "F", "F"}, - {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, "FF", "F"}, - {WINED3D_SM4_OP_UDIV, WINED3DSIH_UDIV, "UU", "UU"}, - {WINED3D_SM4_OP_UGE, WINED3DSIH_UGE, "U", "UU"}, - {WINED3D_SM4_OP_USHR, WINED3DSIH_USHR, "U", "UU"}, - {WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, "F", "U"}, - {WINED3D_SM4_OP_XOR, WINED3DSIH_XOR, "U", "UU"}, - {WINED3D_SM4_OP_DCL_RESOURCE, WINED3DSIH_DCL, "R", ""}, - {WINED3D_SM4_OP_DCL_CONSTANT_BUFFER, WINED3DSIH_DCL_CONSTANT_BUFFER, "", ""}, - {WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", ""}, - {WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", ""}, - {WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""}, + {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, "F", "FF"}, + {WINED3D_SM4_OP_AND, WINED3DSIH_AND, "U", "UU"}, + {WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, "", ""}, + {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "U"}, + {WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, "", ""}, + {WINED3D_SM4_OP_DERIV_RTX, WINED3DSIH_DSX, "F", "F"}, + {WINED3D_SM4_OP_DERIV_RTY, WINED3DSIH_DSY, "F", "F"}, + {WINED3D_SM4_OP_DISCARD, WINED3DSIH_TEXKILL, "", "U"}, + {WINED3D_SM4_OP_DIV, WINED3DSIH_DIV, "F", "FF"}, + {WINED3D_SM4_OP_DP2, WINED3DSIH_DP2, "F", "FF"}, + {WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, "F", "FF"}, + {WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, "F", "FF"}, + {WINED3D_SM4_OP_ELSE, WINED3DSIH_ELSE, "", ""}, + {WINED3D_SM4_OP_EMIT, WINED3DSIH_EMIT, "", ""}, + {WINED3D_SM4_OP_ENDIF, WINED3DSIH_ENDIF, "", ""}, + {WINED3D_SM4_OP_ENDLOOP, WINED3DSIH_ENDLOOP, "", ""}, + {WINED3D_SM4_OP_EQ, WINED3DSIH_EQ, "U", "FF"}, + {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, "F", "F"}, + {WINED3D_SM4_OP_FRC, WINED3DSIH_FRC, "F", "F"}, + {WINED3D_SM4_OP_FTOI, WINED3DSIH_FTOI, "I", "F"}, + {WINED3D_SM4_OP_FTOU, WINED3DSIH_FTOU, "U", "F"}, + {WINED3D_SM4_OP_GE, WINED3DSIH_GE, "U", "FF"}, + {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, "I", "II"}, + {WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "U"}, + {WINED3D_SM4_OP_IEQ, WINED3DSIH_IEQ, "U", "II"}, + {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, "U", "II"}, + {WINED3D_SM4_OP_ILT, WINED3DSIH_ILT, "U", "II"}, + {WINED3D_SM4_OP_IMAD, WINED3DSIH_IMAD, "I", "III"}, + {WINED3D_SM4_OP_IMAX, WINED3DSIH_IMAX, "I", "II"}, + {WINED3D_SM4_OP_IMIN, WINED3DSIH_IMIN, "I", "II"}, + {WINED3D_SM4_OP_IMUL, WINED3DSIH_IMUL, "II", "II"}, + {WINED3D_SM4_OP_INE, WINED3DSIH_INE, "U", "II"}, + {WINED3D_SM4_OP_INEG, WINED3DSIH_INEG, "I", "I"}, + {WINED3D_SM4_OP_ISHL, WINED3DSIH_ISHL, "I", "II"}, + {WINED3D_SM4_OP_ITOF, WINED3DSIH_ITOF, "F", "I"}, + {WINED3D_SM4_OP_LD, WINED3DSIH_LD, "U", "IR"}, + {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, "F", "F"}, + {WINED3D_SM4_OP_LOOP, WINED3DSIH_LOOP, "", ""}, + {WINED3D_SM4_OP_LT, WINED3DSIH_LT, "U", "FF"}, + {WINED3D_SM4_OP_MAD, WINED3DSIH_MAD, "F", "FFF"}, + {WINED3D_SM4_OP_MIN, WINED3DSIH_MIN, "F", "FF"}, + {WINED3D_SM4_OP_MAX, WINED3DSIH_MAX, "F", "FF"}, + {WINED3D_SM4_OP_SHADER_DATA, WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER, "", ""}, + {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, "F", "F"}, + {WINED3D_SM4_OP_MOVC, WINED3DSIH_MOVC, "F", "UFF"}, + {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, "F", "FF"}, + {WINED3D_SM4_OP_NE, WINED3DSIH_NE, "U", "FF"}, + {WINED3D_SM4_OP_NOT, WINED3DSIH_NOT, "U", "U"}, + {WINED3D_SM4_OP_OR, WINED3DSIH_OR, "U", "UU"}, + {WINED3D_SM4_OP_RESINFO, WINED3DSIH_RESINFO, "F", "IR"}, + {WINED3D_SM4_OP_RET, WINED3DSIH_RET, "", ""}, + {WINED3D_SM4_OP_ROUND_NI, WINED3DSIH_ROUND_NI, "F", "F"}, + {WINED3D_SM4_OP_ROUND_PI, WINED3DSIH_ROUND_PI, "F", "F"}, + {WINED3D_SM4_OP_ROUND_Z, WINED3DSIH_ROUND_Z, "F", "F"}, + {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, "F", "F"}, + {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, "U", "FRS"}, + {WINED3D_SM4_OP_SAMPLE_C, WINED3DSIH_SAMPLE_C, "F", "FRSF"}, + {WINED3D_SM4_OP_SAMPLE_C_LZ, WINED3DSIH_SAMPLE_C_LZ, "F", "FRSF"}, + {WINED3D_SM4_OP_SAMPLE_LOD, WINED3DSIH_SAMPLE_LOD, "U", "FRSF"}, + {WINED3D_SM4_OP_SAMPLE_GRAD, WINED3DSIH_SAMPLE_GRAD, "U", "FRSFF"}, + {WINED3D_SM4_OP_SAMPLE_B, WINED3DSIH_SAMPLE_B, "U", "FRSF"}, + {WINED3D_SM4_OP_SQRT, WINED3DSIH_SQRT, "F", "F"}, + {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, "FF", "F"}, + {WINED3D_SM4_OP_UDIV, WINED3DSIH_UDIV, "UU", "UU"}, + {WINED3D_SM4_OP_UGE, WINED3DSIH_UGE, "U", "UU"}, + {WINED3D_SM4_OP_USHR, WINED3DSIH_USHR, "U", "UU"}, + {WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, "F", "U"}, + {WINED3D_SM4_OP_XOR, WINED3DSIH_XOR, "U", "UU"}, + {WINED3D_SM4_OP_DCL_RESOURCE, WINED3DSIH_DCL, "R", ""}, + {WINED3D_SM4_OP_DCL_CONSTANT_BUFFER, WINED3DSIH_DCL_CONSTANT_BUFFER, "", ""}, + {WINED3D_SM4_OP_DCL_SAMPLER, WINED3DSIH_DCL_SAMPLER, "", ""}, + {WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", ""}, + {WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT, WINED3DSIH_DCL_INPUT, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_SGV, WINED3DSIH_DCL_INPUT_SGV, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_SIV, WINED3DSIH_DCL_INPUT_SIV, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_PS, WINED3DSIH_DCL_INPUT_PS, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_PS_SGV, WINED3DSIH_DCL_INPUT_PS_SGV, "", ""}, + {WINED3D_SM4_OP_DCL_INPUT_PS_SIV, WINED3DSIH_DCL_INPUT_PS_SIV, "", ""}, + {WINED3D_SM4_OP_DCL_OUTPUT, WINED3DSIH_DCL_OUTPUT, "", ""}, + {WINED3D_SM4_OP_DCL_OUTPUT_SIV, WINED3DSIH_DCL_OUTPUT_SIV, "", ""}, + {WINED3D_SM4_OP_DCL_TEMPS, WINED3DSIH_DCL_TEMPS, "", ""}, + {WINED3D_SM4_OP_DCL_GLOBAL_FLAGS, WINED3DSIH_DCL_GLOBAL_FLAGS, "", ""}, }; static const enum wined3d_shader_register_type register_type_table[] = @@ -336,7 +400,7 @@ /* WINED3D_SM4_RT_SAMPLER */ WINED3DSPR_SAMPLER, /* WINED3D_SM4_RT_RESOURCE */ WINED3DSPR_RESOURCE, /* WINED3D_SM4_RT_CONSTBUFFER */ WINED3DSPR_CONSTBUFFER, - /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_IMMCONSTBUFFER */ WINED3DSPR_IMMCONSTBUFFER, /* UNKNOWN */ 0, /* WINED3D_SM4_RT_PRIMID */ WINED3DSPR_PRIMID, /* WINED3D_SM4_RT_DEPTHOUT */ WINED3DSPR_DEPTHOUT, @@ -789,7 +853,11 @@ opcode_token = *(*ptr)++; opcode = opcode_token & WINED3D_SM4_OPCODE_MASK; - len = ((opcode_token & WINED3D_SM4_INSTRUCTION_LENGTH_MASK) >> WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT) - 1; + + len = ((opcode_token & WINED3D_SM4_INSTRUCTION_LENGTH_MASK) >> WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT); + if (!len) + len = **ptr; + --len; if (TRACE_ON(d3d_bytecode)) { @@ -827,7 +895,33 @@ FIXME("Skipping modifier 0x%08x.\n", modifier); } - if (opcode == WINED3D_SM4_OP_DCL_RESOURCE) + if (opcode == WINED3D_SM4_OP_SHADER_DATA) + { + unsigned int icb_size; + enum wined3d_sm4_shader_data_type type; + + type = (opcode_token & WINED3D_SM4_SHADER_DATA_TYPE_MASK) >> WINED3D_SM4_SHADER_DATA_TYPE_SHIFT; + if (type != WINED3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER) + { + FIXME("Unhandled shader data type %#x.\n", type); + ins->handler_idx = WINED3DSIH_TABLE_SIZE; + return; + } + + ++p; + icb_size = len - 1; + if (icb_size % 4 || icb_size > MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE) + { + FIXME("Unexpected immediate constant buffer size %u.\n", len); + ins->handler_idx = WINED3DSIH_TABLE_SIZE; + return; + } + + priv->icb.element_count = len; + memcpy(priv->icb.data, p, sizeof(*p) * icb_size); + ins->declaration.icb = &priv->icb; + } + else if (opcode == WINED3D_SM4_OP_DCL_RESOURCE) { enum wined3d_sm4_resource_type resource_type; enum wined3d_sm4_data_type data_type; @@ -866,6 +960,13 @@ if (opcode_token & WINED3D_SM4_INDEX_TYPE_MASK) ins->flags |= WINED3DSI_INDEXED_DYNAMIC; } + else if (opcode == WINED3D_SM4_OP_DCL_SAMPLER) + { + ins->flags = (opcode_token & WINED3D_SM4_SAMPLER_MODE_MASK) >> WINED3D_SM4_SAMPLER_MODE_SHIFT; + if (ins->flags & ~WINED3D_SM4_SAMPLER_COMPARISON) + FIXME("Unhandled sampler mode %#x.\n", ins->flags); + shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_SAMPLER, &ins->declaration.dst); + } else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY) { enum wined3d_sm4_output_primitive_type primitive_type; @@ -896,10 +997,39 @@ ins->declaration.primitive_type = input_primitive_type_table[primitive_type]; } } - else if (opcode == WINED3D_SM4_OP_DCL_VERTICES_OUT) + else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PS) + { + ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; + shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.dst); + } + else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PS_SGV + || opcode == WINED3D_SM4_OP_DCL_INPUT_SGV + || opcode == WINED3D_SM4_OP_DCL_INPUT_SIV + || opcode == WINED3D_SM4_OP_DCL_OUTPUT_SIV) + { + shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.register_semantic.reg); + ins->declaration.register_semantic.sysval_semantic = *p++; + } + else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PS_SIV) + { + ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; + shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.register_semantic.reg); + ins->declaration.register_semantic.sysval_semantic = *p++; + } + else if (opcode == WINED3D_SM4_OP_DCL_INPUT + || opcode == WINED3D_SM4_OP_DCL_OUTPUT) + { + shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.dst); + } + else if (opcode == WINED3D_SM4_OP_DCL_VERTICES_OUT + || opcode == WINED3D_SM4_OP_DCL_TEMPS) { ins->declaration.count = *p++; } + else if (opcode == WINED3D_SM4_OP_DCL_GLOBAL_FLAGS) + { + ins->flags = (opcode_token & WINED3D_SM4_GLOBAL_FLAGS_MASK) >> WINED3D_SM4_GLOBAL_FLAGS_SHIFT; + } else { enum wined3d_shader_dst_modifier instruction_dst_modifier = WINED3DSPDM_NONE; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/surface.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/surface.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/surface.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/surface.c 2016-02-08 19:32:34.000000000 +0000 @@ -356,7 +356,7 @@ masks[2] = ((1u << format->blue_size) - 1) << format->blue_offset; } -static HRESULT surface_create_dib_section(struct wined3d_surface *surface) +HRESULT surface_create_dib_section(struct wined3d_surface *surface) { const struct wined3d_format *format = surface->resource.format; unsigned int format_flags = surface->container->resource.format_flags; @@ -1048,19 +1048,35 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const RECT *rect, float depth) { - const struct wined3d_resource *resource = &surface->container->resource; + struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; + struct wined3d_rendertarget_view_desc view_desc; + struct wined3d_rendertarget_view *view; const struct blit_shader *blitter; + HRESULT hr; - blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, WINED3D_BLIT_OP_DEPTH_FILL, - NULL, 0, 0, NULL, rect, resource->usage, resource->pool, resource->format); - if (!blitter) + if (!(blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, + WINED3D_BLIT_OP_DEPTH_FILL, NULL, 0, 0, NULL, rect, resource->usage, resource->pool, resource->format))) { FIXME("No blitter is capable of performing the requested depth fill operation.\n"); return WINED3DERR_INVALIDCALL; } - return blitter->depth_fill(device, surface, rect, depth); + view_desc.format_id = resource->format->id; + view_desc.u.texture.level_idx = surface->texture_level; + view_desc.u.texture.layer_idx = surface->texture_layer; + view_desc.u.texture.layer_count = 1; + if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, + resource, NULL, &wined3d_null_parent_ops, &view))) + { + ERR("Failed to create rendertarget view, hr %#x.\n", hr); + return hr; + } + + hr = blitter->depth_fill(device, view, rect, depth); + wined3d_rendertarget_view_decref(view); + + return hr; } static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, @@ -1093,12 +1109,20 @@ static ULONG surface_resource_incref(struct wined3d_resource *resource) { - return wined3d_surface_incref(surface_from_resource(resource)); + struct wined3d_surface *surface = surface_from_resource(resource); + + TRACE("surface %p, container %p.\n", surface, surface->container); + + return wined3d_texture_incref(surface->container); } static ULONG surface_resource_decref(struct wined3d_resource *resource) { - return wined3d_surface_decref(surface_from_resource(resource)); + struct wined3d_surface *surface = surface_from_resource(resource); + + TRACE("surface %p, container %p.\n", surface, surface->container); + + return wined3d_texture_decref(surface->container); } static void surface_unload(struct wined3d_resource *resource) @@ -1859,33 +1883,6 @@ return ret; } -ULONG CDECL wined3d_surface_incref(struct wined3d_surface *surface) -{ - TRACE("surface %p, container %p.\n", surface, surface->container); - - return wined3d_texture_incref(surface->container); -} - -ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface) -{ - TRACE("surface %p, container %p.\n", surface, surface->container); - - return wined3d_texture_decref(surface->container); -} - -void CDECL wined3d_surface_preload(struct wined3d_surface *surface) -{ - TRACE("surface %p.\n", surface); - - if (!surface->resource.device->d3d_initialized) - { - ERR("D3D not initialized.\n"); - return; - } - - wined3d_texture_preload(surface->container); -} - void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); @@ -1893,13 +1890,6 @@ return surface->resource.parent; } -struct wined3d_resource * CDECL wined3d_surface_get_resource(struct wined3d_surface *surface) -{ - TRACE("surface %p.\n", surface); - - return &surface->resource; -} - DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { unsigned int alignment; @@ -2340,12 +2330,13 @@ /* FIXME: Multisampled conversion? */ wined3d_resource_get_desc(&source->resource, &desc); - desc.resource_type = WINED3D_RTYPE_TEXTURE; + desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; desc.format = to_fmt; desc.usage = 0; desc.pool = WINED3D_POOL_SCRATCH; if (FAILED(wined3d_texture_create(source->resource.device, &desc, 1, - WINED3D_SURFACE_MAPPABLE | WINED3D_SURFACE_DISCARD, NULL, NULL, &wined3d_null_parent_ops, &ret))) + WINED3D_TEXTURE_CREATE_MAPPABLE | WINED3D_TEXTURE_CREATE_DISCARD, + NULL, NULL, &wined3d_null_parent_ops, &ret))) { ERR("Failed to create a destination surface for conversion.\n"); return NULL; @@ -2436,12 +2427,7 @@ return WINED3D_OK; } -struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_resource *resource) -{ - return surface_from_resource(resource); -} - -HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); @@ -2457,8 +2443,8 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -2467,8 +2453,8 @@ const struct wined3d_gl_info *gl_info; BYTE *base_memory; - TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", - surface, map_desc, box, flags); + TRACE("surface %p, map_desc %p, box %s, flags %#x.\n", + surface, map_desc, debug_box(box), flags); if (surface->resource.map_count) { @@ -2479,8 +2465,8 @@ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box && !surface_check_block_align(surface, box)) { - WARN("Map rect %p is misaligned for %ux%u blocks.\n", - box, format->block_width, format->block_height); + WARN("Map box %s is misaligned for %ux%u blocks.\n", + debug_box(box), format->block_width, format->block_height); if (surface->resource.pool == WINED3D_POOL_DEFAULT) return WINED3DERR_INVALIDCALL; @@ -2603,98 +2589,6 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) -{ - HRESULT hr; - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; - - TRACE("surface %p, dc %p.\n", surface, dc); - - /* Give more detailed info for ddraw. */ - if (surface->flags & SFLAG_DCINUSE) - return WINEDDERR_DCALREADYCREATED; - - /* Can't GetDC if the surface is locked. */ - if (surface->resource.map_count) - return WINED3DERR_INVALIDCALL; - - if (device->d3d_initialized) - context = context_acquire(surface->resource.device, NULL); - - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { - if (FAILED(hr = surface_create_dib_section(surface))) - { - if (context) - context_release(context); - return WINED3DERR_INVALIDCALL; - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM - || surface->pbo)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - - surface_load_location(surface, context, WINED3D_LOCATION_DIB); - surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); - - if (context) - context_release(context); - - surface->flags |= SFLAG_DCINUSE; - surface->resource.map_count++; - - *dc = surface->hDC; - TRACE("Returning dc %p.\n", *dc); - - return WINED3D_OK; -} - -HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -{ - TRACE("surface %p, dc %p.\n", surface, dc); - - if (!(surface->flags & SFLAG_DCINUSE)) - return WINEDDERR_NODC; - - if (surface->hDC != dc) - { - WARN("Application tries to release invalid DC %p, surface DC is %p.\n", - dc, surface->hDC); - return WINEDDERR_NODC; - } - - surface->resource.map_count--; - surface->flags &= ~SFLAG_DCINUSE; - - if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM - && surface->resource.map_binding != WINED3D_LOCATION_DIB)) - { - /* The game Salammbo modifies the surface contents without mapping the surface between - * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active - * copy and is copied to the screen, this update, which draws the mouse pointer, is lost. - * Do not only copy the DIB to the map location, but also make sure the map location is - * copied back to the DIB in the next getdc call. - * - * The same consideration applies to user memory surfaces. */ - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; - - if (device->d3d_initialized) - context = context_acquire(device, NULL); - - surface_load_location(surface, context, surface->resource.map_binding); - surface_invalidate_location(surface, WINED3D_LOCATION_DIB); - if (context) - context_release(context); - } - - return WINED3D_OK; -} - static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_context *old_ctx, DWORD dst_location) { @@ -2862,10 +2756,28 @@ * * AMD has a similar feature called Enhanced Quality Anti-Aliasing (EQAA), * but it does not have an equivalent OpenGL extension. */ + + /* We advertise as many WINED3D_MULTISAMPLE_NON_MASKABLE quality levels + * as the count of advertised multisample types for the surface format. */ if (surface->resource.multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) - samples = surface->resource.multisample_quality; + { + const struct wined3d_format *format = surface->resource.format; + unsigned int i, count = 0; + + for (i = 0; i < sizeof(format->multisample_types) * 8; ++i) + { + if (format->multisample_types & 1u << i) + { + if (surface->resource.multisample_quality == count++) + break; + } + } + samples = i + 1; + } else + { samples = surface->resource.multisample_type; + } gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_multisample); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_multisample); @@ -3379,18 +3291,35 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) { - struct wined3d_device *device = s->resource.device; + struct wined3d_resource *resource = &s->container->resource; + struct wined3d_device *device = resource->device; + struct wined3d_rendertarget_view_desc view_desc; + struct wined3d_rendertarget_view *view; const struct blit_shader *blitter; + HRESULT hr; - blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, WINED3D_BLIT_OP_COLOR_FILL, - NULL, 0, 0, NULL, rect, s->resource.usage, s->resource.pool, s->resource.format); - if (!blitter) + if (!(blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, + WINED3D_BLIT_OP_COLOR_FILL, NULL, 0, 0, NULL, rect, resource->usage, resource->pool, resource->format))) { FIXME("No blitter is capable of performing the requested color fill operation.\n"); return WINED3DERR_INVALIDCALL; } - return blitter->color_fill(device, s, rect, color); + view_desc.format_id = resource->format->id; + view_desc.u.texture.level_idx = s->texture_level; + view_desc.u.texture.layer_idx = s->texture_layer; + view_desc.u.texture.layer_count = 1; + if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, + resource, NULL, &wined3d_null_parent_ops, &view))) + { + ERR("Failed to create rendertarget view, hr %#x.\n", hr); + return hr; + } + + hr = blitter->color_fill(device, view, rect, color); + wined3d_rendertarget_view_decref(view); + + return hr; } static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RECT *dst_rect, @@ -4255,43 +4184,24 @@ } } -static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, - const RECT *dst_rect, const struct wined3d_color *color) +static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; - struct wined3d_rendertarget_view *view; + const RECT draw_rect = {0, 0, view->width, view->height}; struct wined3d_fb_state fb = {&view, NULL}; - HRESULT hr; - if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, - NULL, &wined3d_null_parent_ops, &view))) - { - ERR("Failed to create rendertarget view, hr %#x.\n", hr); - return hr; - } - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); - wined3d_rendertarget_view_decref(view); + device_clear_render_targets(device, 1, &fb, 1, rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); return WINED3D_OK; } -static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, - const RECT *dst_rect, float depth) +static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, + struct wined3d_rendertarget_view *view, const RECT *rect, float depth) { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; - struct wined3d_fb_state fb = {NULL, NULL}; - HRESULT hr; + const RECT draw_rect = {0, 0, view->width, view->height}; + struct wined3d_fb_state fb = {NULL, view}; - if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, - NULL, &wined3d_null_parent_ops, &fb.depth_stencil))) - { - ERR("Failed to create rendertarget view, hr %#x.\n", hr); - return hr; - } - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); - wined3d_rendertarget_view_decref(fb.depth_stencil); + device_clear_render_targets(device, 0, &fb, 1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); return WINED3D_OK; } @@ -4965,21 +4875,22 @@ return hr; } -static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, - const RECT *dst_rect, const struct wined3d_color *color) +static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) { + struct wined3d_surface *surface = wined3d_rendertarget_view_get_surface(view); static const RECT src_rect; WINEDDBLTFX BltFx; memset(&BltFx, 0, sizeof(BltFx)); BltFx.dwSize = sizeof(BltFx); - BltFx.u5.dwFillColor = wined3d_format_convert_from_float(dst_surface, color); - return surface_cpu_blt(dst_surface, dst_rect, NULL, &src_rect, + BltFx.u5.dwFillColor = wined3d_format_convert_from_float(surface, color); + return surface_cpu_blt(surface, rect, NULL, &src_rect, WINEDDBLT_COLORFILL, &BltFx, WINED3D_TEXF_POINT); } static HRESULT cpu_blit_depth_fill(struct wined3d_device *device, - struct wined3d_surface *surface, const RECT *rect, float depth) + struct wined3d_rendertarget_view *view, const RECT *rect, float depth) { FIXME("Depth filling not implemented by cpu_blit.\n"); return WINED3DERR_INVALIDCALL; @@ -5005,14 +4916,13 @@ cpu_blit_blit_surface, }; -HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, - struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, +HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, + struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; - RECT src_rect, dst_rect; BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC @@ -5024,8 +4934,8 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; - TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n", - dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), + TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", + dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), flags, fx, debug_d3dtexturefiltertype(filter)); TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); @@ -5066,13 +4976,11 @@ return WINEDDERR_SURFACEBUSY; } - surface_get_rect(dst_surface, dst_rect_in, &dst_rect); - - if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom - || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 - || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 - || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 - || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) + if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom + || dst_rect->left > dst_surface->resource.width || dst_rect->left < 0 + || dst_rect->top > dst_surface->resource.height || dst_rect->top < 0 + || dst_rect->right > dst_surface->resource.width || dst_rect->right < 0 + || dst_rect->bottom > dst_surface->resource.height || dst_rect->bottom < 0) { WARN("The application gave us a bad destination rectangle.\n"); return WINEDDERR_INVALIDRECT; @@ -5080,22 +4988,16 @@ if (src_surface) { - surface_get_rect(src_surface, src_rect_in, &src_rect); - - if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom - || src_rect.left > src_surface->resource.width || src_rect.left < 0 - || src_rect.top > src_surface->resource.height || src_rect.top < 0 - || src_rect.right > src_surface->resource.width || src_rect.right < 0 - || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) + if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom + || src_rect->left > src_surface->resource.width || src_rect->left < 0 + || src_rect->top > src_surface->resource.height || src_rect->top < 0 + || src_rect->right > src_surface->resource.width || src_rect->right < 0 + || src_rect->bottom > src_surface->resource.height || src_rect->bottom < 0) { - WARN("Application gave us bad source rectangle for Blt.\n"); + WARN("The application gave us a bad source rectangle.\n"); return WINEDDERR_INVALIDRECT; } } - else - { - memset(&src_rect, 0, sizeof(src_rect)); - } if (!fx || !(fx->dwDDFX)) flags &= ~WINEDDBLT_DDFX; @@ -5164,8 +5066,8 @@ } scale = src_surface - && (src_rect.right - src_rect.left != dst_rect.right - dst_rect.left - || src_rect.bottom - src_rect.top != dst_rect.bottom - dst_rect.top); + && (src_rect->right - src_rect->left != dst_rect->right - dst_rect->left + || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags @@ -5187,7 +5089,7 @@ if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) return WINED3DERR_INVALIDCALL; - if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, &dst_rect, depth))) + if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) return WINED3D_OK; } else @@ -5199,7 +5101,7 @@ } if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, - &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect))) + src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return WINED3D_OK; } } @@ -5231,7 +5133,7 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; - if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) + if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) return WINED3D_OK; } else @@ -5264,9 +5166,9 @@ TRACE("Not doing upload because of format conversion.\n"); else { - POINT dst_point = {dst_rect.left, dst_rect.top}; + POINT dst_point = {dst_rect->left, dst_rect->top}; - if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) + if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { @@ -5302,16 +5204,16 @@ } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, - &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, - &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) + src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, + dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) { struct wined3d_context *context; TRACE("Using FBO blit.\n"); context = context_acquire(device, NULL); surface_blt_fbo(device, context, filter, - src_surface, src_surface->container->resource.draw_binding, &src_rect, - dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); + src_surface, src_surface->container->resource.draw_binding, src_rect, + dst_surface, dst_surface->container->resource.draw_binding, dst_rect); context_release(context); surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); @@ -5321,12 +5223,12 @@ } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, - &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, - &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); + src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, + dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); if (blitter) { blitter->blit_surface(device, blit_op, filter, src_surface, - &src_rect, dst_surface, &dst_rect, color_key); + src_rect, dst_surface, dst_rect, color_key); return WINED3D_OK; } } @@ -5334,15 +5236,11 @@ fallback: /* Special cases for render targets. */ - if (SUCCEEDED(surface_blt_special(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter))) + if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) return WINED3D_OK; cpu: - - /* For the rest call the X11 surface implementation. For render targets - * this should be implemented OpenGL accelerated in surface_blt_special(), - * other blits are rather rare. */ - return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); + return surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); } static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, @@ -5351,8 +5249,8 @@ struct wined3d_device *device = container->resource.device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_format *format = wined3d_get_format(gl_info, desc->format); + BOOL lockable = flags & WINED3D_TEXTURE_CREATE_MAPPABLE; UINT multisample_quality = desc->multisample_quality; - BOOL lockable = flags & WINED3D_SURFACE_MAPPABLE; unsigned int resource_size; HRESULT hr; @@ -5410,7 +5308,7 @@ list_init(&surface->overlays); /* Flags */ - if (flags & WINED3D_SURFACE_DISCARD) + if (flags & WINED3D_TEXTURE_CREATE_DISCARD) surface->flags |= SFLAG_DISCARD; if (lockable || desc->format == WINED3DFMT_D16_LOCKABLE) surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU; @@ -5429,7 +5327,7 @@ /* Similar to lockable rendertargets above, creating the DIB section * during surface initialization prevents the sysmem pointer from changing - * after a wined3d_surface_getdc() call. */ + * after a wined3d_texture_get_dc() call. */ if ((desc->usage & WINED3DUSAGE_OWNDC) && !surface->hDC && SUCCEEDED(surface_create_dib_section(surface))) surface->resource.map_binding = WINED3D_LOCATION_DIB; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/swapchain.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/swapchain.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/swapchain.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/swapchain.c 2016-02-08 19:32:34.000000000 +0000 @@ -821,7 +821,7 @@ TRACE("Creating front buffer.\n"); - texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; + texture_desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; texture_desc.format = swapchain->desc.backbuffer_format; texture_desc.multisample_type = swapchain->desc.multisample_type; texture_desc.multisample_quality = swapchain->desc.multisample_quality; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/texture.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/texture.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/texture.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/texture.c 2016-02-08 19:32:34.000000000 +0000 @@ -28,7 +28,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops, - UINT layer_count, UINT level_count, const struct wined3d_resource_desc *desc, DWORD surface_flags, + UINT layer_count, UINT level_count, const struct wined3d_resource_desc *desc, DWORD flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) { @@ -37,11 +37,11 @@ TRACE("texture %p, texture_ops %p, layer_count %u, level_count %u, resource_type %s, format %s, " "multisample_type %#x, multisample_quality %#x, usage %s, pool %s, width %u, height %u, depth %u, " - "surface_flags %#x, device %p, parent %p, parent_ops %p, resource_ops %p.\n", + "flags %#x, device %p, parent %p, parent_ops %p, resource_ops %p.\n", texture, texture_ops, layer_count, level_count, debug_d3dresourcetype(desc->resource_type), debug_d3dformat(desc->format), desc->multisample_type, desc->multisample_quality, debug_d3dusage(desc->usage), debug_d3dpool(desc->pool), desc->width, desc->height, desc->depth, - surface_flags, device, parent, parent_ops, resource_ops); + flags, device, parent, parent_ops, resource_ops); if (FAILED(hr = resource_init(&texture->resource, device, desc->resource_type, format, desc->multisample_type, desc->multisample_quality, desc->usage, desc->pool, @@ -53,7 +53,7 @@ if ((desc->format == WINED3DFMT_DXT1 || desc->format == WINED3DFMT_DXT2 || desc->format == WINED3DFMT_DXT3 || desc->format == WINED3DFMT_DXT4 || desc->format == WINED3DFMT_DXT5) && !(format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE) - && desc->resource_type != WINED3D_RTYPE_VOLUME_TEXTURE && !once++) + && desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++) ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n"); WARN("Failed to initialize resource, returning %#x\n", hr); @@ -76,7 +76,7 @@ texture->filter_type = (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3D_TEXF_LINEAR : WINED3D_TEXF_NONE; texture->lod = 0; texture->flags = WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS; - if (surface_flags & WINED3D_SURFACE_PIN_SYSMEM) + if (flags & WINED3D_TEXTURE_CREATE_PIN_SYSMEM) texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM; return WINED3D_OK; @@ -610,9 +610,9 @@ return WINED3DERR_INVALIDCALL; } - if (texture->resource.type == WINED3D_RTYPE_VOLUME_TEXTURE) + if (texture->resource.type == WINED3D_RTYPE_TEXTURE_3D) { - WARN("Not supported on volume textures.\n"); + WARN("Not supported on 3D textures.\n"); return WINED3DERR_INVALIDCALL; } @@ -691,7 +691,7 @@ FIXME("texture %p stub!\n", texture); } -struct wined3d_resource * CDECL wined3d_texture_get_sub_resource(struct wined3d_texture *texture, +struct wined3d_resource * CDECL wined3d_texture_get_sub_resource(const struct wined3d_texture *texture, UINT sub_resource_idx) { UINT sub_count = texture->level_count * texture->layer_count; @@ -712,7 +712,7 @@ { struct wined3d_resource *sub_resource; - TRACE("texture %p, layer %u, dirty_region %p.\n", texture, layer, dirty_region); + TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region)); if (!(sub_resource = wined3d_texture_get_sub_resource(texture, layer * texture->level_count))) { @@ -949,119 +949,15 @@ texture2d_resource_sub_resource_unmap, }; -static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, - UINT levels, DWORD surface_flags, struct wined3d_device *device, void *parent, - const struct wined3d_parent_ops *parent_ops) -{ - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_resource_desc surface_desc; - unsigned int i, j; - HRESULT hr; - - /* TODO: It should only be possible to create textures for formats - * that are reported as supported. */ - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); - return WINED3DERR_INVALIDCALL; - } - - /* Calculate levels for mip mapping */ - if (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP) - { - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); - return WINED3DERR_INVALIDCALL; - } - } - - if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]) - { - UINT pow2_edge_length = 1; - while (pow2_edge_length < desc->width) - pow2_edge_length <<= 1; - - if (desc->width != pow2_edge_length) - { - if (desc->pool == WINED3D_POOL_SCRATCH) - { - /* SCRATCH textures cannot be used for texturing */ - WARN("Creating a scratch NPOT cube texture despite lack of HW support.\n"); - } - else - { - WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); - return WINED3DERR_INVALIDCALL; - } - } - } - - if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels, desc, - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x\n", hr); - return hr; - } - - texture->pow2_matrix[0] = 1.0f; - texture->pow2_matrix[5] = 1.0f; - texture->pow2_matrix[10] = 1.0f; - texture->pow2_matrix[15] = 1.0f; - texture->target = GL_TEXTURE_CUBE_MAP_ARB; - - /* Generate all the surfaces. */ - surface_desc = *desc; - surface_desc.resource_type = WINED3D_RTYPE_SURFACE; - for (i = 0; i < texture->level_count; ++i) - { - /* Create the 6 faces. */ - for (j = 0; j < 6; ++j) - { - static const GLenum cube_targets[6] = - { - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, - }; - UINT idx = j * texture->level_count + i; - struct wined3d_surface *surface; - - if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, - cube_targets[j], i, j, surface_flags, &surface))) - { - WARN("Failed to create surface, hr %#x.\n", hr); - wined3d_texture_cleanup(texture); - return hr; - } - - texture->sub_resources[idx] = &surface->resource; - TRACE("Created surface level %u @ %p.\n", i, surface); - } - surface_desc.width = max(1, surface_desc.width >> 1); - surface_desc.height = surface_desc.width; - } - - return WINED3D_OK; -} - static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, - UINT levels, DWORD surface_flags, struct wined3d_device *device, void *parent, + UINT level_count, DWORD flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops) { + unsigned int layer_count = desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP ? 6 : 1; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct wined3d_resource_desc surface_desc; UINT pow2_width, pow2_height; - unsigned int i; + unsigned int i, j; HRESULT hr; /* TODO: It should only be possible to create textures for formats @@ -1089,16 +985,16 @@ if (pow2_width != desc->width || pow2_height != desc->height) { - /* levels == 0 returns an error as well */ - if (levels != 1) + /* level_count == 0 returns an error as well */ + if (level_count != 1 || desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP) { if (desc->pool == WINED3D_POOL_SCRATCH) { - WARN("Creating a scratch mipmapped NPOT texture despite lack of HW support.\n"); + WARN("Creating a scratch mipmapped/cube NPOT texture despite lack of HW support.\n"); } else { - WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); + WARN("Attempted to create a mipmapped/cube NPOT texture without unconditional NPOT support.\n"); return WINED3DERR_INVALIDCALL; } } @@ -1114,15 +1010,15 @@ return WINED3DERR_INVALIDCALL; } - if (levels != 1) + if (level_count != 1) { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); return WINED3DERR_INVALIDCALL; } } - if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels, desc, - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) + if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, layer_count, level_count, desc, + flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); return hr; @@ -1141,7 +1037,10 @@ } else { - texture->target = GL_TEXTURE_2D; + if (desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP) + texture->target = GL_TEXTURE_CUBE_MAP_ARB; + else + texture->target = GL_TEXTURE_2D; if (desc->width == pow2_width && desc->height == pow2_height) { texture->pow2_matrix[0] = 1.0f; @@ -1169,18 +1068,32 @@ surface_desc.resource_type = WINED3D_RTYPE_SURFACE; for (i = 0; i < texture->level_count; ++i) { - struct wined3d_surface *surface; - - if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, - texture->target, i, 0, surface_flags, &surface))) + for (j = 0; j < texture->layer_count; ++j) { - WARN("Failed to create surface, hr %#x.\n", hr); - wined3d_texture_cleanup(texture); - return hr; - } + static const GLenum cube_targets[6] = + { + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, + }; + GLenum target = desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP ? cube_targets[j] : texture->target; + unsigned int idx = j * texture->level_count + i; + struct wined3d_surface *surface; + + if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, + target, i, j, flags, &surface))) + { + WARN("Failed to create surface, hr %#x.\n", hr); + wined3d_texture_cleanup(texture); + return hr; + } - texture->sub_resources[i] = &surface->resource; - TRACE("Created surface level %u @ %p.\n", i, surface); + texture->sub_resources[idx] = &surface->resource; + TRACE("Created surface level %u @ %p.\n", i, surface); + } /* Calculate the next mipmap level. */ surface_desc.width = max(1, surface_desc.width >> 1); surface_desc.height = max(1, surface_desc.height >> 1); @@ -1405,14 +1318,16 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect_in, - struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect_in, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) +HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, + const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, + const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { struct wined3d_resource *dst_resource, *src_resource = NULL; - TRACE("dst_texture %p, dst_sub_resource_idx %u, src_texture %p, src_sub_resource_idx %u.\n", - dst_texture, dst_sub_resource_idx, src_texture, src_sub_resource_idx); + TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_rect %s, src_texture %p, " + "src_sub_resource_idx %u, src_rect %s, flags %#x, fx %p, filter %s.\n", + dst_texture, dst_sub_resource_idx, wine_dbgstr_rect(dst_rect), src_texture, + src_sub_resource_idx, wine_dbgstr_rect(src_rect), flags, fx, debug_d3dtexturefiltertype(filter)); if (!(dst_resource = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx)) || dst_resource->type != WINED3D_RTYPE_SURFACE) @@ -1425,19 +1340,19 @@ return WINED3DERR_INVALIDCALL; } - return wined3d_surface_blt(surface_from_resource(dst_resource), dst_rect_in, - src_resource ? surface_from_resource(src_resource) : NULL, src_rect_in, flags, fx, filter); + return wined3d_surface_blt(surface_from_resource(dst_resource), dst_rect, + src_resource ? surface_from_resource(src_resource) : NULL, src_rect, flags, fx, filter); } HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, - UINT level_count, DWORD surface_flags, const struct wined3d_sub_resource_data *data, void *parent, + UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture) { struct wined3d_texture *object; HRESULT hr; - TRACE("device %p, desc %p, level_count %u, surface_flags %#x, data %p, parent %p, parent_ops %p, texture %p.\n", - device, desc, level_count, surface_flags, data, parent, parent_ops, texture); + TRACE("device %p, desc %p, level_count %u, flags %#x, data %p, parent %p, parent_ops %p, texture %p.\n", + device, desc, level_count, flags, data, parent, parent_ops, texture); if (!level_count) { @@ -1445,23 +1360,40 @@ return WINED3DERR_INVALIDCALL; } + if (desc->multisample_type != WINED3D_MULTISAMPLE_NONE) + { + const struct wined3d_format *format = wined3d_get_format(&device->adapter->gl_info, desc->format); + + if (desc->multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE + && desc->multisample_quality >= wined3d_popcount(format->multisample_types)) + { + WARN("Unsupported quality level %u requested for WINED3D_MULTISAMPLE_NON_MASKABLE.\n", + desc->multisample_quality); + return WINED3DERR_NOTAVAILABLE; + } + if (desc->multisample_type != WINED3D_MULTISAMPLE_NON_MASKABLE + && (!(format->multisample_types & 1u << (desc->multisample_type - 1)) + || desc->multisample_quality)) + { + WARN("Unsupported multisample type %u quality %u requested.\n", desc->multisample_type, + desc->multisample_quality); + return WINED3DERR_NOTAVAILABLE; + } + } + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; switch (desc->resource_type) { - case WINED3D_RTYPE_TEXTURE: - hr = texture_init(object, desc, level_count, surface_flags, device, parent, parent_ops); + case WINED3D_RTYPE_TEXTURE_2D: + hr = texture_init(object, desc, level_count, flags, device, parent, parent_ops); break; - case WINED3D_RTYPE_VOLUME_TEXTURE: + case WINED3D_RTYPE_TEXTURE_3D: hr = volumetexture_init(object, desc, level_count, device, parent, parent_ops); break; - case WINED3D_RTYPE_CUBE_TEXTURE: - hr = cubetexture_init(object, desc, level_count, surface_flags, device, parent, parent_ops); - break; - default: ERR("Invalid resource type %s.\n", debug_d3dresourcetype(desc->resource_type)); hr = WINED3DERR_INVALIDCALL; @@ -1492,7 +1424,11 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc) { + struct wined3d_device *device = texture->resource.device; + struct wined3d_context *context = NULL; struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; + HRESULT hr; TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); @@ -1505,12 +1441,55 @@ return WINED3DERR_INVALIDCALL; } - return wined3d_surface_getdc(surface_from_resource(sub_resource), dc); + surface = surface_from_resource(sub_resource); + + /* Give more detailed info for ddraw. */ + if (surface->flags & SFLAG_DCINUSE) + return WINEDDERR_DCALREADYCREATED; + + /* Can't GetDC if the surface is locked. */ + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; + + if (device->d3d_initialized) + context = context_acquire(device, NULL); + + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { + if (FAILED(hr = surface_create_dib_section(surface))) + { + if (context) + context_release(context); + return WINED3DERR_INVALIDCALL; + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM + || surface->pbo)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + + surface_load_location(surface, context, WINED3D_LOCATION_DIB); + surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); + + if (context) + context_release(context); + + surface->flags |= SFLAG_DCINUSE; + surface->resource.map_count++; + + *dc = surface->hDC; + TRACE("Returning dc %p.\n", *dc); + + return WINED3D_OK; } HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) { + struct wined3d_device *device = texture->resource.device; + struct wined3d_context *context = NULL; struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); @@ -1523,5 +1502,41 @@ return WINED3DERR_INVALIDCALL; } - return wined3d_surface_releasedc(surface_from_resource(sub_resource), dc); + surface = surface_from_resource(sub_resource); + + if (!(surface->flags & SFLAG_DCINUSE)) + return WINEDDERR_NODC; + + if (surface->hDC != dc) + { + WARN("Application tries to release invalid DC %p, surface DC is %p.\n", + dc, surface->hDC); + return WINEDDERR_NODC; + } + + surface->resource.map_count--; + surface->flags &= ~SFLAG_DCINUSE; + + if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM + && surface->resource.map_binding != WINED3D_LOCATION_DIB)) + { + /* The game Salammbo modifies the surface contents without mapping the surface between + * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active + * copy and is copied to the screen, this update, which draws the mouse pointer, is lost. + * Do not only copy the DIB to the map location, but also make sure the map location is + * copied back to the DIB in the next getdc call. + * + * The same consideration applies to user memory surfaces. */ + + if (device->d3d_initialized) + context = context_acquire(device, NULL); + + surface_load_location(surface, context, surface->resource.map_binding); + surface_invalidate_location(surface, WINED3D_LOCATION_DIB); + if (context) + context_release(context); + } + + return WINED3D_OK; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/utils.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/utils.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/utils.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/utils.c 2016-02-08 19:32:34.000000000 +0000 @@ -98,11 +98,13 @@ {WINED3DFMT_R8G8B8A8_UNORM, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, {WINED3DFMT_R8G8B8A8_UNORM_SRGB, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, {WINED3DFMT_R8G8B8A8_UINT, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, + {WINED3DFMT_R8G8B8A8_SINT, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, {WINED3DFMT_R8G8B8X8_UNORM, 8, 8, 8, 0, 0, 8, 16, 0, 4, 0, 0}, {WINED3DFMT_R16G16_UNORM, 16, 16, 0, 0, 0, 16, 0, 0, 4, 0, 0}, {WINED3DFMT_B10G10R10A2_UNORM, 10, 10, 10, 2, 20, 10, 0, 30, 4, 0, 0}, {WINED3DFMT_R16G16B16A16_UNORM, 16, 16, 16, 16, 0, 16, 32, 48, 8, 0, 0}, {WINED3DFMT_R8G8_UNORM, 8, 8, 0, 0, 0, 8, 0, 0, 2, 0, 0}, + {WINED3DFMT_R16_UNORM, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, /* Luminance */ {WINED3DFMT_L8_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_L8A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0}, @@ -192,6 +194,8 @@ {WINED3DFMT_R16G16B16A16_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_D32_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3DFMT_FLAG_FLOAT}, + {WINED3DFMT_R8G8B8A8_UINT, WINED3DFMT_FLAG_INTEGER}, + {WINED3DFMT_R8G8B8A8_SINT, WINED3DFMT_FLAG_INTEGER}, }; struct wined3d_format_block_info @@ -989,6 +993,10 @@ GL_RG, GL_FLOAT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, + {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, + GL_RGB, GL_FLOAT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, @@ -1087,6 +1095,14 @@ | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE | WINED3DFMT_FLAG_VTF, WINED3D_GL_EXT_NONE, NULL}, + {WINED3DFMT_R8G8B8A8_UINT, GL_RGBA8UI, GL_RGBA8UI, 0, + GL_RGBA_INTEGER, GL_UNSIGNED_INT_8_8_8_8_REV, 0, + WINED3DFMT_FLAG_TEXTURE, + ARB_TEXTURE_RGB10_A2UI, NULL}, + {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, + GL_RGBA_INTEGER, GL_BYTE, 0, + WINED3DFMT_FLAG_TEXTURE, + EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, @@ -1114,6 +1130,11 @@ GL_RG, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, + {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_RENDERTARGET, + GL_RED, GL_UNSIGNED_SHORT, 0, + ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, @@ -1809,6 +1830,7 @@ if (status == GL_FRAMEBUFFER_COMPLETE && ((format->flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) + && !(format->flags[type] & WINED3DFMT_FLAG_INTEGER) && format->id != WINED3DFMT_NULL && format->id != WINED3DFMT_P8_UINT && format->glFormat != GL_LUMINANCE && format->glFormat != GL_LUMINANCE_ALPHA && (format->red_size || format->alpha_size)) @@ -2150,10 +2172,11 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct wined3d_gl_info *gl_info) { + GLint count, multisample_types[MAX_MULTISAMPLE_TYPES]; struct fragment_caps fragment_caps; struct shader_caps shader_caps; BOOL srgb_write; - unsigned int i; + unsigned int i, j, max_log2; adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); adapter->shader_backend->shader_get_caps(gl_info, &shader_caps); @@ -2272,6 +2295,34 @@ } } + if (format->glInternal && format->flags[WINED3D_GL_RES_TYPE_RB] + & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) + { + if (gl_info->supported[ARB_INTERNALFORMAT_QUERY]) + { + GL_EXTCALL(glGetInternalformativ(GL_RENDERBUFFER, format->glInternal, + GL_NUM_SAMPLE_COUNTS, 1, &count)); + checkGLcall("glGetInternalformativ(GL_NUM_SAMPLE_COUNTS)"); + count = min(count, MAX_MULTISAMPLE_TYPES); + GL_EXTCALL(glGetInternalformativ(GL_RENDERBUFFER, format->glInternal, + GL_SAMPLES, count, multisample_types)); + checkGLcall("glGetInternalformativ(GL_SAMPLES)"); + for (j = 0; j < count; ++j) + { + if (multisample_types[j] > sizeof(format->multisample_types) * 8) + continue; + format->multisample_types |= 1u << (multisample_types[j] - 1); + } + } + else + { + max_log2 = wined3d_log2i(min(gl_info->limits.samples, + sizeof(format->multisample_types) * 8)); + for (j = 1; j <= max_log2; ++j) + format->multisample_types |= 1u << ((1u << j) - 1); + } + } + /* Texture conversion stuff */ format->convert = format_texture_info[i].convert; format->conv_byte_count = format_texture_info[i].conv_byte_count; @@ -2907,6 +2958,15 @@ /***************************************************************************** * Trace formatting of useful values */ +const char *debug_box(const struct wined3d_box *box) +{ + if (!box) + return "(null)"; + return wine_dbg_sprintf("(%u, %u, %u)-(%u, %u, %u)", + box->left, box->top, box->front, + box->right, box->bottom, box->back); +} + const char *debug_d3dformat(enum wined3d_format_id format_id) { switch (format_id) @@ -3190,14 +3250,13 @@ { switch (resource_type) { -#define RES_TO_STR(res) case res: return #res - RES_TO_STR(WINED3D_RTYPE_SURFACE); - RES_TO_STR(WINED3D_RTYPE_VOLUME); - RES_TO_STR(WINED3D_RTYPE_TEXTURE); - RES_TO_STR(WINED3D_RTYPE_VOLUME_TEXTURE); - RES_TO_STR(WINED3D_RTYPE_CUBE_TEXTURE); - RES_TO_STR(WINED3D_RTYPE_BUFFER); -#undef RES_TO_STR +#define WINED3D_TO_STR(x) case x: return #x + WINED3D_TO_STR(WINED3D_RTYPE_SURFACE); + WINED3D_TO_STR(WINED3D_RTYPE_VOLUME); + WINED3D_TO_STR(WINED3D_RTYPE_BUFFER); + WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_2D); + WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_3D); +#undef WINED3D_TO_STR default: FIXME("Unrecognized resource type %#x.\n", resource_type); return "unrecognized"; @@ -4037,17 +4096,6 @@ } } -/* This small helper function is used to convert a bitmask into the number of masked bits */ -unsigned int count_bits(unsigned int mask) -{ - unsigned int count; - for (count = 0; mask; ++count) - { - mask &= mask - 1; - } - return count; -} - /* Note: It's the caller's responsibility to ensure values can be expressed * in the requested format. UNORM formats for example can only express values * in the range 0.0f -> 1.0f. */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/view.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/view.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/view.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/view.c 2016-02-08 19:32:34.000000000 +0000 @@ -145,41 +145,21 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_rendertarget_view_create_from_surface(struct wined3d_surface *surface, - void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view) -{ - struct wined3d_rendertarget_view_desc desc; - - TRACE("surface %p, parent %p, parent_ops %p, view %p.\n", surface, parent, parent_ops, view); - - desc.format_id = surface->resource.format->id; - desc.u.texture.level_idx = surface->texture_level; - desc.u.texture.layer_idx = surface->texture_layer; - desc.u.texture.layer_count = 1; - - return wined3d_rendertarget_view_create(&desc, &surface->container->resource, parent, parent_ops, view); -} - HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view) { - struct wined3d_resource *sub_resource; + struct wined3d_rendertarget_view_desc desc; TRACE("texture %p, sub_resource_idx %u, parent %p, parent_ops %p, view %p.\n", texture, sub_resource_idx, parent, parent_ops, view); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx))) - return WINED3DERR_INVALIDCALL; - - if (sub_resource->type != WINED3D_RTYPE_SURFACE) - { - FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(texture->resource.type)); - return WINED3DERR_INVALIDCALL; - } + desc.format_id = texture->resource.format->id; + desc.u.texture.level_idx = sub_resource_idx % texture->level_count; + desc.u.texture.layer_idx = sub_resource_idx / texture->level_count; + desc.u.texture.layer_count = 1; - return wined3d_rendertarget_view_create_from_surface(surface_from_resource(sub_resource), - parent, parent_ops, view); + return wined3d_rendertarget_view_create(&desc, &texture->resource, parent, parent_ops, view); } ULONG CDECL wined3d_shader_resource_view_incref(struct wined3d_shader_resource_view *view) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/volume.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/volume.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/volume.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/volume.c 2016-02-08 19:32:34.000000000 +0000 @@ -517,8 +517,8 @@ const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; - TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", - volume, map_desc, box, flags); + TRACE("volume %p, map_desc %p, box %s, flags %#x.\n", + volume, map_desc, debug_box(box), flags); map_desc->data = NULL; if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) @@ -538,8 +538,8 @@ } if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) { - WARN("Map box is misaligned for %ux%u blocks.\n", - format->block_width, format->block_height); + WARN("Map box %s is misaligned for %ux%u blocks.\n", + debug_box(box), format->block_width, format->block_height); return WINED3DERR_INVALIDCALL; } @@ -612,14 +612,10 @@ if (!box) { - TRACE("No box supplied - all is ok\n"); map_desc->data = base_memory; } else { - TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", - box, box->left, box->top, box->right, box->bottom, box->front, box->back); - if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) { /* Compressed textures are block based, so calculate the offset of diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d_gl.h wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d_gl.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d_gl.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d_gl.h 2016-02-08 19:32:34.000000000 +0000 @@ -60,6 +60,7 @@ ARB_HALF_FLOAT_PIXEL, ARB_HALF_FLOAT_VERTEX, ARB_INSTANCED_ARRAYS, + ARB_INTERNALFORMAT_QUERY, ARB_INTERNALFORMAT_QUERY2, ARB_MAP_BUFFER_ALIGNMENT, ARB_MAP_BUFFER_RANGE, @@ -89,6 +90,7 @@ ARB_TEXTURE_QUERY_LEVELS, ARB_TEXTURE_RECTANGLE, ARB_TEXTURE_RG, + ARB_TEXTURE_RGB10_A2UI, ARB_TIMER_QUERY, ARB_UNIFORM_BUFFER_OBJECT, ARB_VERTEX_ARRAY_BGRA, @@ -128,6 +130,7 @@ EXT_TEXTURE_ENV_COMBINE, EXT_TEXTURE_ENV_DOT3, EXT_TEXTURE_FILTER_ANISOTROPIC, + EXT_TEXTURE_INTEGER, EXT_TEXTURE_LOD_BIAS, EXT_TEXTURE_MIRROR_CLAMP, EXT_TEXTURE_SNORM, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d_private.h wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d_private.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d_private.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d_private.h 2016-02-08 19:32:34.000000000 +0000 @@ -185,6 +185,7 @@ #define MAX_SAMPLER_OBJECTS 16 #define MAX_SHADER_RESOURCE_VIEWS 128 #define MAX_VERTEX_BLENDS 4 +#define MAX_MULTISAMPLE_TYPES 8 struct min_lookup { @@ -257,6 +258,17 @@ } } +static inline unsigned int wined3d_popcount(unsigned int x) +{ +#ifdef HAVE___BUILTIN_POPCOUNT + return __builtin_popcount(x); +#else + x -= x >> 1 & 0x55555555; + x = (x & 0x33333333) + (x >> 2 & 0x33333333); + return ((x + (x >> 4)) & 0x0f0f0f0f) * 0x01010101 >> 24; +#endif +} + #define ORM_BACKBUFFER 0 #define ORM_FBO 1 @@ -347,6 +359,7 @@ WINED3DSPR_PREDICATE = 19, WINED3DSPR_IMMCONST, WINED3DSPR_CONSTBUFFER, + WINED3DSPR_IMMCONSTBUFFER, WINED3DSPR_PRIMID, WINED3DSPR_NULL, WINED3DSPR_RESOURCE, @@ -403,12 +416,30 @@ WINED3DSPDM_MSAMPCENTROID = 4, }; +enum wined3d_shader_interpolation_mode +{ + WINED3DSIM_CONSTANT = 1, + WINED3DSIM_LINEAR = 2, + WINED3DSIM_LINEAR_CENTROID = 3, + WINED3DSIM_LINEAR_NOPERSPECTIVE = 4, + WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID = 5, + WINED3DSIM_LINEAR_SAMPLE = 6, + WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE = 7, +}; + +enum wined3d_shader_global_flags +{ + WINED3DSGF_REFACTORING_ALLOWED = 0x1, + WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8, +}; + /* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ #define WINED3DSI_TEXLD_PROJECT 0x1 #define WINED3DSI_TEXLD_BIAS 0x2 #define WINED3DSI_INDEXED_DYNAMIC 0x4 #define WINED3DSI_RESINFO_RCP_FLOAT 0x1 #define WINED3DSI_RESINFO_UINT 0x2 +#define WINED3DSI_SAMPLER_COMPARISON_MODE 0x1 enum wined3d_shader_rel_op { @@ -447,6 +478,8 @@ * Shader model 3 according to msdn (and for software shaders) */ #define MAX_LABELS 16 +#define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE 4096 + struct wined3d_string_buffer { struct list entry; @@ -472,8 +505,20 @@ WINED3DSIH_CUT, WINED3DSIH_DCL, WINED3DSIH_DCL_CONSTANT_BUFFER, + WINED3DSIH_DCL_GLOBAL_FLAGS, + WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER, + WINED3DSIH_DCL_INPUT, WINED3DSIH_DCL_INPUT_PRIMITIVE, + WINED3DSIH_DCL_INPUT_PS, + WINED3DSIH_DCL_INPUT_PS_SGV, + WINED3DSIH_DCL_INPUT_PS_SIV, + WINED3DSIH_DCL_INPUT_SGV, + WINED3DSIH_DCL_INPUT_SIV, + WINED3DSIH_DCL_OUTPUT, + WINED3DSIH_DCL_OUTPUT_SIV, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, + WINED3DSIH_DCL_SAMPLER, + WINED3DSIH_DCL_TEMPS, WINED3DSIH_DCL_VERTICES_OUT, WINED3DSIH_DEF, WINED3DSIH_DEFB, @@ -534,6 +579,7 @@ WINED3DSIH_MUL, WINED3DSIH_NE, WINED3DSIH_NOP, + WINED3DSIH_NOT, WINED3DSIH_NRM, WINED3DSIH_OR, WINED3DSIH_PHASE, @@ -543,8 +589,13 @@ WINED3DSIH_RESINFO, WINED3DSIH_RET, WINED3DSIH_ROUND_NI, + WINED3DSIH_ROUND_PI, + WINED3DSIH_ROUND_Z, WINED3DSIH_RSQ, WINED3DSIH_SAMPLE, + WINED3DSIH_SAMPLE_B, + WINED3DSIH_SAMPLE_C, + WINED3DSIH_SAMPLE_C_LZ, WINED3DSIH_SAMPLE_GRAD, WINED3DSIH_SAMPLE_LOD, WINED3DSIH_SETP, @@ -621,6 +672,12 @@ size_t count; }; +struct wined3d_shader_immediate_constant_buffer +{ + UINT element_count; + DWORD data[MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE]; +}; + #define WINED3D_SHADER_VERSION(major, minor) (((major) << 8) | (minor)) struct wined3d_shader_reg_maps @@ -631,6 +688,7 @@ WORD labels; /* MAX_LABELS, 16 */ DWORD temporary; /* MAX_REG_TEMP, 32 */ DWORD *constf; /* pixel, vertex */ + const struct wined3d_shader_immediate_constant_buffer *icb; union { DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */ @@ -736,6 +794,12 @@ struct wined3d_shader_dst_param reg; }; +struct wined3d_shader_register_semantic +{ + struct wined3d_shader_dst_param reg; + enum wined3d_sysval_semantic sysval_semantic; +}; + struct wined3d_shader_instruction { const struct wined3d_shader_context *ctx; @@ -750,9 +814,12 @@ union { struct wined3d_shader_semantic semantic; + struct wined3d_shader_register_semantic register_semantic; enum wined3d_primitive_type primitive_type; + struct wined3d_shader_dst_param dst; struct wined3d_shader_src_param src; UINT count; + const struct wined3d_shader_immediate_constant_buffer *icb; } declaration; }; @@ -1395,10 +1462,10 @@ const struct wined3d_d3d_info *d3d_info, enum wined3d_blit_op blit_op, const RECT *src_rect, DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format, const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format); - HRESULT (*color_fill)(struct wined3d_device *device, struct wined3d_surface *dst_surface, - const RECT *dst_rect, const struct wined3d_color *color); + HRESULT (*color_fill)(struct wined3d_device *device, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color); HRESULT (*depth_fill)(struct wined3d_device *device, - struct wined3d_surface *surface, const RECT *rect, float depth); + struct wined3d_rendertarget_view *view, const RECT *rect, float depth); void (*blit_surface)(struct wined3d_device *device, enum wined3d_blit_op op, DWORD filter, struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect, @@ -2466,9 +2533,13 @@ ? surface->container->texture_srgb.name : surface->container->texture_rgb.name; } +HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, + struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, + const WINEDDBLTFX *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void surface_set_dirty(struct wined3d_surface *surface) DECLSPEC_HIDDEN; HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; +HRESULT surface_create_dib_section(struct wined3d_surface *surface) DECLSPEC_HIDDEN; GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2480,6 +2551,8 @@ struct wined3d_context *context) DECLSPEC_HIDDEN; HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; +HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -2487,6 +2560,7 @@ const struct wined3d_surface *rt) DECLSPEC_HIDDEN; void surface_set_texture_target(struct wined3d_surface *surface, GLenum target, GLint level) DECLSPEC_HIDDEN; void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN; +HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN; HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, @@ -2795,10 +2869,7 @@ struct wined3d_resource *resource; struct wined3d_texture *texture; - if (!view) - return NULL; - - if (view->resource->type != WINED3D_RTYPE_TEXTURE && view->resource->type != WINED3D_RTYPE_CUBE_TEXTURE) + if (!view || view->resource->type != WINED3D_RTYPE_TEXTURE_2D) return NULL; texture = wined3d_texture_from_resource(view->resource); @@ -2865,6 +2936,7 @@ */ /* Trace routines */ +const char *debug_box(const struct wined3d_box *box) DECLSPEC_HIDDEN; const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx) DECLSPEC_HIDDEN; const char *debug_d3dformat(enum wined3d_format_id format_id) DECLSPEC_HIDDEN; const char *debug_d3ddevicetype(enum wined3d_device_type device_type) DECLSPEC_HIDDEN; @@ -2931,7 +3003,6 @@ /* Math utils */ void multiply_matrix(struct wined3d_matrix *dest, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2) DECLSPEC_HIDDEN; -unsigned int count_bits(unsigned int mask) DECLSPEC_HIDDEN; void wined3d_release_dc(HWND window, HDC dc) DECLSPEC_HIDDEN; @@ -3210,6 +3281,7 @@ #define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00040000 #define WINED3DFMT_FLAG_TEXTURE 0x00080000 #define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00100000 +#define WINED3DFMT_FLAG_INTEGER 0x00200000 struct wined3d_rational { @@ -3257,6 +3329,7 @@ GLint glFormat; GLint glType; UINT conv_byte_count; + DWORD multisample_types; unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; struct wined3d_rational height_scale; struct color_fixup_desc color_fixup; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wined3d/wined3d.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wined3d/wined3d.spec 2016-02-08 19:32:34.000000000 +0000 @@ -99,6 +99,7 @@ @ cdecl wined3d_device_get_vs_consts_i(ptr long ptr long) @ cdecl wined3d_device_get_vs_resource_view(ptr long) @ cdecl wined3d_device_get_vs_sampler(ptr long) +@ cdecl wined3d_device_get_wined3d(ptr) @ cdecl wined3d_device_incref(ptr) @ cdecl wined3d_device_init_3d(ptr ptr) @ cdecl wined3d_device_init_gdi(ptr ptr) @@ -188,7 +189,6 @@ @ cdecl wined3d_resource_unmap(ptr long) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) -@ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr) @ cdecl wined3d_rendertarget_view_create_from_sub_resource(ptr long ptr ptr ptr) @ cdecl wined3d_rendertarget_view_decref(ptr) @ cdecl wined3d_rendertarget_view_get_parent(ptr) @@ -222,20 +222,10 @@ @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) -@ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long) -@ cdecl wined3d_surface_decref(ptr) -@ cdecl wined3d_surface_from_resource(ptr) @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) @ cdecl wined3d_surface_get_parent(ptr) @ cdecl wined3d_surface_get_pitch(ptr) -@ cdecl wined3d_surface_get_resource(ptr) -@ cdecl wined3d_surface_getdc(ptr ptr) -@ cdecl wined3d_surface_incref(ptr) -@ cdecl wined3d_surface_map(ptr ptr ptr long) -@ cdecl wined3d_surface_preload(ptr) -@ cdecl wined3d_surface_releasedc(ptr ptr) @ cdecl wined3d_surface_set_overlay_position(ptr long long) -@ cdecl wined3d_surface_unmap(ptr) @ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr) @ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.h wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.h 2016-02-08 19:32:34.000000000 +0000 @@ -22,6 +22,12 @@ #include "macdrv_cocoa.h" +enum { + WineQueryProcessEvents = 1 << 0, + WineQueryNoPreemptWait = 1 << 1, +}; + + @class WineWindow; @@ -42,7 +48,7 @@ - (void) postEvent:(macdrv_event*)inEvent; - (void) discardEventsMatchingMask:(macdrv_event_mask)mask forWindow:(NSWindow*)window; - - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout processEvents:(BOOL)processEvents; + - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout flags:(NSUInteger)flags; - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout; - (void) resetMouseEventPositions:(CGPoint)pos; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.m wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.m --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.m 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_event.m 2016-02-08 19:32:34.000000000 +0000 @@ -294,13 +294,15 @@ }]; } - - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout processEvents:(BOOL)processEvents + - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout flags:(NSUInteger)flags { + int type; macdrv_event* event; NSDate* timeoutDate = [NSDate dateWithTimeIntervalSinceNow:timeout]; BOOL timedout; - event = macdrv_create_event(QUERY_EVENT, (WineWindow*)query->window); + type = (flags & WineQueryNoPreemptWait) ? QUERY_EVENT_NO_PREEMPT_WAIT : QUERY_EVENT; + event = macdrv_create_event(type, (WineWindow*)query->window); event->query_event.query = macdrv_retain_query(query); query->done = FALSE; @@ -308,13 +310,13 @@ macdrv_release_event(event); timedout = ![[WineApplicationController sharedController] waitUntilQueryDone:&query->done timeout:timeoutDate - processEvents:processEvents]; + processEvents:(flags & WineQueryProcessEvents) != 0]; return !timedout && query->status; } - (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout { - return [self query:query timeout:timeout processEvents:FALSE]; + return [self query:query timeout:timeout flags:0]; } - (void) resetMouseEventPositions:(CGPoint)pos @@ -654,6 +656,7 @@ CFRelease(event->keyboard_changed.input_source); break; case QUERY_EVENT: + case QUERY_EVENT_NO_PREEMPT_WAIT: macdrv_release_query(event->query_event.query); break; case WINDOW_GOT_FOCUS: diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_window.m wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_window.m --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/cocoa_window.m 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/cocoa_window.m 2016-02-08 19:32:34.000000000 +0000 @@ -649,7 +649,7 @@ query->ime_char_rect.data = [window imeData]; query->ime_char_rect.range = CFRangeMake(aRange.location, aRange.length); - if ([window.queue query:query timeout:1]) + if ([window.queue query:query timeout:0.3 flags:WineQueryNoPreemptWait]) { aRange = NSMakeRange(query->ime_char_rect.range.location, query->ime_char_rect.range.length); ret = NSRectFromCGRect(query->ime_char_rect.rect); @@ -2657,7 +2657,7 @@ query->drag_drop.op = [sender draggingSourceOperationMask]; query->drag_drop.pasteboard = (CFTypeRef)[pb retain]; - [self.queue query:query timeout:3 * 60 processEvents:YES]; + [self.queue query:query timeout:3 * 60 flags:WineQueryProcessEvents]; ret = query->status; macdrv_release_query(query); @@ -3230,11 +3230,11 @@ /*********************************************************************** * macdrv_send_text_input_event */ -int macdrv_send_text_input_event(int pressed, unsigned int flags, int repeat, int keyc, void* data) +void macdrv_send_text_input_event(int pressed, unsigned int flags, int repeat, int keyc, void* data, int* done) { - __block BOOL ret; - - OnMainThread(^{ + OnMainThreadAsync(^{ + BOOL ret; + macdrv_event* event; WineWindow* window = (WineWindow*)[NSApp keyWindow]; if (![window isKindOfClass:[WineWindow class]]) { @@ -3266,7 +3266,11 @@ } else ret = FALSE; - }); - return ret; + event = macdrv_create_event(SENT_TEXT_INPUT, window); + event->sent_text_input.handled = ret; + event->sent_text_input.done = done; + [[window queue] postEvent:event]; + macdrv_release_event(event); + }); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/event.c wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/event.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/event.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/event.c 2016-02-08 19:32:34.000000000 +0000 @@ -45,8 +45,10 @@ "MOUSE_MOVED_ABSOLUTE", "MOUSE_SCROLL", "QUERY_EVENT", + "QUERY_EVENT_NO_PREEMPT_WAIT", "REASSERT_WINDOW_POSITION", "RELEASE_CAPTURE", + "SENT_TEXT_INPUT", "STATUS_ITEM_MOUSE_BUTTON", "STATUS_ITEM_MOUSE_MOVE", "WINDOW_BROUGHT_FORWARD", @@ -116,8 +118,10 @@ if (mask & QS_SENDMESSAGE) { event_mask |= event_mask_for_type(QUERY_EVENT); + event_mask |= event_mask_for_type(QUERY_EVENT_NO_PREEMPT_WAIT); event_mask |= event_mask_for_type(REASSERT_WINDOW_POSITION); event_mask |= event_mask_for_type(RELEASE_CAPTURE); + event_mask |= event_mask_for_type(SENT_TEXT_INPUT); event_mask |= event_mask_for_type(WINDOW_BROUGHT_FORWARD); event_mask |= event_mask_for_type(WINDOW_CLOSE_REQUESTED); event_mask |= event_mask_for_type(WINDOW_DRAG_BEGIN); @@ -135,7 +139,7 @@ /*********************************************************************** * macdrv_query_event * - * Handler for QUERY_EVENT queries. + * Handler for QUERY_EVENT and QUERY_EVENT_NO_PREEMPT_WAIT queries. */ static void macdrv_query_event(HWND hwnd, const macdrv_event *event) { @@ -237,6 +241,7 @@ macdrv_mouse_scroll(hwnd, event); break; case QUERY_EVENT: + case QUERY_EVENT_NO_PREEMPT_WAIT: macdrv_query_event(hwnd, event); break; case REASSERT_WINDOW_POSITION: @@ -245,6 +250,9 @@ case RELEASE_CAPTURE: macdrv_release_capture(hwnd, event); break; + case SENT_TEXT_INPUT: + macdrv_sent_text_input(event); + break; case STATUS_ITEM_MOUSE_BUTTON: macdrv_status_item_mouse_button(event); break; @@ -336,6 +344,7 @@ } if (data->current_event && data->current_event->type != QUERY_EVENT && + data->current_event->type != QUERY_EVENT_NO_PREEMPT_WAIT && data->current_event->type != APP_QUIT_REQUESTED && data->current_event->type != WINDOW_DRAG_BEGIN) event_mask = 0; /* don't process nested events */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/ime.c wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/ime.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/ime.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/ime.c 2016-02-08 19:32:34.000000000 +0000 @@ -690,7 +690,7 @@ LPIMEPRIVATE myPrivate; HWND hwndDefault; UINT repeat; - INT rc; + int done = 0; TRACE("uVKey 0x%04x uScanCode 0x%04x fuState %u hIMC %p\n", uVKey, uScanCode, fuState, hIMC); @@ -717,9 +717,12 @@ UnlockRealIMC(hIMC); TRACE("Processing Mac 0x%04x\n", vkey); - rc = macdrv_process_text_input(uVKey, uScanCode, repeat, lpbKeyState, hIMC); + macdrv_process_text_input(uVKey, uScanCode, repeat, lpbKeyState, hIMC, &done); - if (!rc) + while (!done) + MsgWaitForMultipleObjectsEx(0, NULL, INFINITE, QS_POSTMESSAGE | QS_SENDMESSAGE, 0); + + if (done < 0) { UINT msgs = 0; UINT msg = (uScanCode & 0x8000) ? WM_KEYUP : WM_KEYDOWN; @@ -1482,6 +1485,15 @@ IME_NotifyComplete(himc); } +/*********************************************************************** + * macdrv_sent_text_input + */ +void macdrv_sent_text_input(const macdrv_event *event) +{ + TRACE("handled: %s\n", event->sent_text_input.handled ? "TRUE" : "FALSE"); + *event->sent_text_input.done = event->sent_text_input.handled ? 1 : -1; +} + /************************************************************************** * query_ime_char_rect diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/keyboard.c wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/keyboard.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/keyboard.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/keyboard.c 2016-02-08 19:32:34.000000000 +0000 @@ -1117,12 +1117,11 @@ /*********************************************************************** * macdrv_process_text_input */ -BOOL macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, void *himc) +void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, void *himc, int* done) { struct macdrv_thread_data *thread_data = macdrv_thread_data(); unsigned int flags; int keyc; - BOOL ret = FALSE; TRACE("vkey 0x%04x scan 0x%04x repeat %u himc %p\n", vkey, scan, repeat, himc); @@ -1149,15 +1148,11 @@ if (thread_data->keyc2vkey[keyc] == vkey) break; if (keyc >= sizeof(thread_data->keyc2vkey)/sizeof(thread_data->keyc2vkey[0])) - goto done; + return; TRACE("flags 0x%08x keyc 0x%04x\n", flags, keyc); - ret = macdrv_send_text_input_event(((scan & 0x8000) == 0), flags, repeat, keyc, himc); - -done: - TRACE(" -> %s\n", ret ? "TRUE" : "FALSE"); - return ret; + macdrv_send_text_input_event(((scan & 0x8000) == 0), flags, repeat, keyc, himc, done); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/macdrv_cocoa.h wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/macdrv_cocoa.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/macdrv_cocoa.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/macdrv_cocoa.h 2016-02-08 19:32:34.000000000 +0000 @@ -199,8 +199,10 @@ MOUSE_MOVED_ABSOLUTE, MOUSE_SCROLL, QUERY_EVENT, + QUERY_EVENT_NO_PREEMPT_WAIT, REASSERT_WINDOW_POSITION, RELEASE_CAPTURE, + SENT_TEXT_INPUT, STATUS_ITEM_MOUSE_BUTTON, STATUS_ITEM_MOUSE_MOVE, WINDOW_BROUGHT_FORWARD, @@ -286,6 +288,10 @@ struct macdrv_query *query; } query_event; struct { + int handled; + int *done; + } sent_text_input; + struct { macdrv_status_item item; int button; int down; @@ -438,8 +444,8 @@ extern void macdrv_add_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; extern void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; extern uint32_t macdrv_window_background_color(void) DECLSPEC_HIDDEN; -extern int macdrv_send_text_input_event(int pressed, unsigned int flags, int repeat, int keyc, - void* data) DECLSPEC_HIDDEN; +extern void macdrv_send_text_input_event(int pressed, unsigned int flags, int repeat, int keyc, + void* data, int* done) DECLSPEC_HIDDEN; /* keyboard */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/macdrv.h wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/macdrv.h --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winemac.drv/macdrv.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winemac.drv/macdrv.h 2016-02-08 19:32:34.000000000 +0000 @@ -224,10 +224,11 @@ * Mac IME driver */ -extern BOOL macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, - void *himc) DECLSPEC_HIDDEN; +extern void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, + void *himc, int* done) DECLSPEC_HIDDEN; extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN; +extern void macdrv_sent_text_input(const macdrv_event *event) DECLSPEC_HIDDEN; extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN; #endif /* __WINE_MACDRV_H */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wininet/tests/http.c wine-staging-1.9.3~ubuntu12.04.1/dlls/wininet/tests/http.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wininet/tests/http.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wininet/tests/http.c 2016-02-08 19:32:34.000000000 +0000 @@ -5809,15 +5809,33 @@ static void WINAPI header_cb( HINTERNET handle, DWORD_PTR ctx, DWORD status, LPVOID info, DWORD len ) { - if (status == INTERNET_STATUS_REQUEST_COMPLETE) SetEvent( (HANDLE)ctx ); + BOOL ret; + DWORD index, size; + char buf[256]; + + if (status == INTERNET_STATUS_SENDING_REQUEST) + { + ret = HttpAddRequestHeadersA( handle, "winetest: winetest", ~0u, HTTP_ADDREQ_FLAG_ADD ); + ok( ret, "HttpAddRequestHeadersA failed %u\n", GetLastError() ); + SetEvent( (HANDLE)ctx ); + } + else if (status == INTERNET_STATUS_REQUEST_SENT) + { + index = 0; + size = sizeof(buf); + ret = HttpQueryInfoA( handle, HTTP_QUERY_RAW_HEADERS_CRLF|HTTP_QUERY_FLAG_REQUEST_HEADERS, + buf, &size, &index ); + ok( ret, "HttpQueryInfoA failed %u\n", GetLastError() ); + ok( strstr( buf, "winetest: winetest" ) != NULL, "header missing\n" ); + SetEvent( (HANDLE)ctx ); + } } static void test_concurrent_header_access(void) { HINTERNET ses, con, req; - DWORD index, len, err; + DWORD err; BOOL ret; - char buf[128]; HANDLE wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = InternetOpenA( "winetest", 0, NULL, NULL, INTERNET_FLAG_ASYNC ); @@ -5838,16 +5856,7 @@ ok( !ret, "HttpSendRequestA succeeded\n" ); ok( err == ERROR_IO_PENDING, "got %u\n", ERROR_IO_PENDING ); - ret = HttpAddRequestHeadersA( req, "winetest: winetest", ~0u, HTTP_ADDREQ_FLAG_ADD ); - ok( ret, "HttpAddRequestHeadersA failed %u\n", GetLastError() ); - - index = 0; - len = sizeof(buf); - ret = HttpQueryInfoA( req, HTTP_QUERY_RAW_HEADERS_CRLF|HTTP_QUERY_FLAG_REQUEST_HEADERS, - buf, &len, &index ); - ok( ret, "HttpQueryInfoA failed %u\n", GetLastError() ); - ok( strstr( buf, "winetest: winetest" ) != NULL, "header missing\n" ); - + WaitForSingleObject( wait, 5000 ); WaitForSingleObject( wait, 5000 ); InternetCloseHandle( req ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/winspool.drv/info.c wine-staging-1.9.3~ubuntu12.04.1/dlls/winspool.drv/info.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/winspool.drv/info.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/winspool.drv/info.c 2016-02-08 19:32:34.000000000 +0000 @@ -781,13 +781,15 @@ DO_FUNC(cupsPrintFile) #define CUPS_OPT_FUNCS \ DO_FUNC(cupsGetNamedDest); \ - DO_FUNC(cupsGetPPD3) + DO_FUNC(cupsGetPPD3); \ + DO_FUNC(cupsLastErrorString) #define DO_FUNC(f) static typeof(f) *p##f CUPS_FUNCS; #undef DO_FUNC static cups_dest_t * (*pcupsGetNamedDest)(http_t *, const char *, const char *); static http_status_t (*pcupsGetPPD3)(http_t *, const char *, time_t *, char *, size_t); +static const char * (*pcupsLastErrorString)(void); static http_status_t cupsGetPPD3_wrapper( http_t *http, const char *name, time_t *modtime, char *buffer, @@ -8237,6 +8239,8 @@ TRACE( "\t%d: %s = %s\n", i, options[i].name, options[i].value ); ret = pcupsPrintFile( queue, unixname, unix_doc_title, num_options, options ); + if (ret == 0 && pcupsLastErrorString) + WARN("cupsPrintFile failed with error %s\n", debugstr_a(pcupsLastErrorString())); pcupsFreeOptions( num_options, options ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/wpcap/wpcap.spec wine-staging-1.9.3~ubuntu12.04.1/dlls/wpcap/wpcap.spec --- wine-staging-1.9.2~ubuntu12.04.1/dlls/wpcap/wpcap.spec 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/wpcap/wpcap.spec 2016-02-08 19:32:34.000000000 +0000 @@ -74,5 +74,5 @@ @ cdecl pcap_snapshot(ptr) wine_pcap_snapshot @ cdecl pcap_stats(ptr ptr) wine_pcap_stats @ stub pcap_stats_ex -@ stub pcap_strerror +@ cdecl pcap_strerror(long) msvcrt.strerror @ cdecl wsockinit() wine_wsockinit diff -Nru wine-staging-1.9.2~ubuntu12.04.1/dlls/xaudio2_7/xaudio_dll.c wine-staging-1.9.3~ubuntu12.04.1/dlls/xaudio2_7/xaudio_dll.c --- wine-staging-1.9.2~ubuntu12.04.1/dlls/xaudio2_7/xaudio_dll.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/dlls/xaudio2_7/xaudio_dll.c 2016-02-08 19:32:34.000000000 +0000 @@ -38,6 +38,8 @@ static HINSTANCE instance; +#define IN_AL_PERIODS 4 + #if XAUDIO2_VER == 0 #define COMPAT_E_INVALID_CALL E_INVALIDARG #define COMPAT_E_DEVICE_INVALIDATED XAUDIO20_E_DEVICE_INVALIDATED @@ -2133,6 +2135,30 @@ return buf->offs_bytes < buf->cur_end_bytes; } +#if XAUDIO2_VER > 0 +static UINT32 get_underrun_warning(XA2SourceImpl *src) +{ + UINT32 period_bytes = src->xa2->period_frames * src->submit_blocksize; + UINT32 total = 0, i; + + for(i = 0; i < src->nbufs && total < IN_AL_PERIODS * period_bytes; ++i){ + XA2Buffer *buf = &src->buffers[(src->first_buf + i) % XAUDIO2_MAX_QUEUED_BUFFERS]; + total += buf->cur_end_bytes - buf->offs_bytes; + if(buf->xa2buffer.LoopCount == XAUDIO2_LOOP_INFINITE) + return 0; + if(buf->xa2buffer.LoopCount > 0){ + total += (buf->loop_end_bytes - buf->xa2buffer.LoopBegin) * (buf->xa2buffer.LoopCount - buf->looped); + total += buf->play_end_bytes - buf->loop_end_bytes; + } + } + + if(total >= IN_AL_PERIODS * period_bytes) + return 0; + + return ((IN_AL_PERIODS * period_bytes - total) / period_bytes + 1) * period_bytes; +} +#endif + /* Looping: * * The looped section of a buffer is a subset of the play area which is looped @@ -2148,7 +2174,7 @@ * * In the simple case, playback will start at PlayBegin. At LoopEnd, playback * will move to LoopBegin and repeat that loop LoopCount times. Then, playback - * will cease at LoopEnd. + * will cease at PlayEnd. * * If PlayLength is zero, then PlayEnd is the end of the buffer. * @@ -2208,9 +2234,9 @@ alGetSourcei(src->al_src, AL_BYTE_OFFSET, &bufpos); - /* maintain 4 periods in AL */ + /* maintain IN_AL_PERIODS periods in AL */ while(src->cur_buf != (src->first_buf + src->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS && - src->in_al_bytes - bufpos < 4 * src->xa2->period_frames * src->submit_blocksize){ + src->in_al_bytes - bufpos < IN_AL_PERIODS * src->xa2->period_frames * src->submit_blocksize){ TRACE("%p: going to queue a period from buffer %u\n", src, src->cur_buf); /* starting from an empty buffer */ @@ -2288,8 +2314,11 @@ #if XAUDIO2_VER == 0 IXAudio20VoiceCallback_OnVoiceProcessingPassStart((IXAudio20VoiceCallback*)src->cb); #else - /* TODO: detect incoming underrun and inform callback */ - IXAudio2VoiceCallback_OnVoiceProcessingPassStart(src->cb, 0); + UINT32 underrun; + underrun = get_underrun_warning(src); + if(underrun > 0) + TRACE("Calling OnVoiceProcessingPassStart with BytesRequired: %u\n", underrun); + IXAudio2VoiceCallback_OnVoiceProcessingPassStart(src->cb, underrun); #endif } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/config.h.in wine-staging-1.9.3~ubuntu12.04.1/include/config.h.in --- wine-staging-1.9.2~ubuntu12.04.1/include/config.h.in 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/config.h.in 2016-02-08 19:32:34.000000000 +0000 @@ -1311,6 +1311,9 @@ /* Define to 1 if you have the `__builtin_clz' built-in function. */ #undef HAVE___BUILTIN_CLZ +/* Define to 1 if you have the `__builtin_popcount' built-in function. */ +#undef HAVE___BUILTIN_POPCOUNT + /* Define to 1 if you have the `__res_getservers' function. */ #undef HAVE___RES_GETSERVERS diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/d3d11.idl wine-staging-1.9.3~ubuntu12.04.1/include/d3d11.idl --- wine-staging-1.9.2~ubuntu12.04.1/include/d3d11.idl 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/d3d11.idl 2016-02-08 19:32:34.000000000 +0000 @@ -1016,7 +1016,11 @@ D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x00800000, D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x01000000, D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x02000000, - D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x04000000 + D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x04000000, + D3D11_FORMAT_SUPPORT_DECODER_OUTPUT = 0x08000000, + D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D11_FORMAT_SUPPORT_VIDEO_ENCODER = 0x40000000, } D3D11_FORMAT_SUPPORT; typedef enum D3D11_CLEAR_FLAG diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/ddk/ndis.h wine-staging-1.9.3~ubuntu12.04.1/include/ddk/ndis.h --- wine-staging-1.9.2~ubuntu12.04.1/include/ddk/ndis.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/ddk/ndis.h 2016-02-08 19:32:34.000000000 +0000 @@ -23,8 +23,15 @@ typedef void *NDIS_HANDLE, *PNDIS_HANDLE; typedef int NDIS_STATUS, *PNDIS_STATUS; +typedef struct _NDIS_SPIN_LOCK +{ + KSPIN_LOCK SpinLock; + KIRQL OldIrql; +} NDIS_SPIN_LOCK, *PNDIS_SPIN_LOCK; + #define NDIS_STATUS_FAILURE ((NDIS_STATUS) STATUS_UNSUCCESSFUL) NDIS_STATUS WINAPI NdisAllocateMemoryWithTag(void **, UINT, ULONG); +void WINAPI NdisAllocateSpinLock(NDIS_SPIN_LOCK *); #endif /* _NDIS_ */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/gdiplusflat.h wine-staging-1.9.3~ubuntu12.04.1/include/gdiplusflat.h --- wine-staging-1.9.2~ubuntu12.04.1/include/gdiplusflat.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/gdiplusflat.h 2016-02-08 19:32:34.000000000 +0000 @@ -619,6 +619,7 @@ GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*); +GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *, GpMatrix *); GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*); GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*); @@ -637,6 +638,7 @@ GpStatus WINGDIPAPI GdipSetPenMode(GpPen*,GpPenAlignment); GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen*,REAL); GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen*,GpLineCap); +GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *, GpMatrix *); GpStatus WINGDIPAPI GdipSetPenWidth(GpPen*,REAL); GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen*,GpDashCap*); GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen*,GpLineCap*); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/msvcrt/crtdefs.h wine-staging-1.9.3~ubuntu12.04.1/include/msvcrt/crtdefs.h --- wine-staging-1.9.2~ubuntu12.04.1/include/msvcrt/crtdefs.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/msvcrt/crtdefs.h 2016-02-08 19:32:34.000000000 +0000 @@ -44,7 +44,7 @@ #ifndef __stdcall # ifdef __i386__ # ifdef __GNUC__ -# ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */ +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__) # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__)) # else # define __stdcall __attribute__((__stdcall__)) @@ -55,21 +55,29 @@ # error You need to define __stdcall for your compiler # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __stdcall __attribute__((ms_abi)) -# else +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __stdcall __attribute__((ms_abi)) +# endif +# else /* __i386__ */ # define __stdcall -# endif +# endif /* __i386__ */ #endif /* __stdcall */ #ifndef __cdecl # if defined(__i386__) && defined(__GNUC__) -# ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */ +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__) # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)) # else # define __cdecl __attribute__((__cdecl__)) # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __cdecl __attribute__((ms_abi)) +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __cdecl __attribute__((ms_abi)) +# endif # elif !defined(_MSC_VER) # define __cdecl # endif diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/ntddndis.h wine-staging-1.9.3~ubuntu12.04.1/include/ntddndis.h --- wine-staging-1.9.2~ubuntu12.04.1/include/ntddndis.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/ntddndis.h 2016-02-08 19:32:34.000000000 +0000 @@ -57,6 +57,62 @@ #define IOCTL_NDIS_RESERVED12 _NDIS_CONTROL_CODE(0x14, METHOD_BUFFERED) #define IOCTL_NDIS_RESERVED13 _NDIS_CONTROL_CODE(0x15, METHOD_BUFFERED) +#define OID_GEN_SUPPORTED_LIST 0x00010101 +#define OID_GEN_HARDWARE_STATUS 0x00010102 +#define OID_GEN_MEDIA_SUPPORTED 0x00010103 +#define OID_GEN_MEDIA_IN_USE 0x00010104 +#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 +#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 +#define OID_GEN_LINK_SPEED 0x00010107 +#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 +#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 +#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010a +#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010b +#define OID_GEN_VENDOR_ID 0x0001010c +#define OID_GEN_VENDOR_DESCRIPTION 0x0001010d +#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010e +#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010f +#define OID_GEN_DRIVER_VERSION 0x00010110 +#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 +#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 +#define OID_GEN_MAC_OPTIONS 0x00010113 +#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 +#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 + +#define OID_802_3_PERMANENT_ADDRESS 0x01010101 +#define OID_802_3_CURRENT_ADDRESS 0x01010102 +#define OID_802_3_MULTICAST_LIST 0x01010103 +#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 +#define OID_802_3_MAC_OPTIONS 0x01010105 +#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 +#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 +#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 +#define OID_802_3_XMIT_DEFERRED 0x01020201 +#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 +#define OID_802_3_RCV_OVERRUN 0x01020203 +#define OID_802_3_XMIT_UNDERRUN 0x01020204 +#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 +#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 +#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 +#define OID_802_3_ADD_MULTICAST_ADDRESS 0x01010208 +#define OID_802_3_DELETE_MULTICAST_ADDRESS 0x01010209 + +#define OID_802_5_PERMANENT_ADDRESS 0x02010101 +#define OID_802_5_CURRENT_ADDRESS 0x02010102 +#define OID_802_5_CURRENT_FUNCTIONAL 0x02010103 +#define OID_802_5_CURRENT_GROUP 0x02010104 +#define OID_802_5_LAST_OPEN_STATUS 0x02010105 +#define OID_802_5_CURRENT_RING_STATUS 0x02010106 +#define OID_802_5_CURRENT_RING_STATE 0x02010107 +#define OID_802_5_LINE_ERRORS 0x02020101 +#define OID_802_5_LOST_FRAMES 0x02020102 +#define OID_802_5_BURST_ERRORS 0x02020201 +#define OID_802_5_AC_ERRORS 0x02020202 +#define OID_802_5_ABORT_DELIMETERS 0x02020203 +#define OID_802_5_FRAME_COPIED_ERRORS 0x02020204 +#define OID_802_5_FREQUENCY_ERRORS 0x02020205 +#define OID_802_5_TOKEN_ERRORS 0x02020206 +#define OID_802_5_INTERNAL_ERRORS 0x02020207 #define OID_802_11_BSSID 0x0d010101 #define OID_802_11_SSID 0x0d010102 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/oleidl.idl wine-staging-1.9.3~ubuntu12.04.1/include/oleidl.idl --- wine-staging-1.9.2~ubuntu12.04.1/include/oleidl.idl 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/oleidl.idl 2016-02-08 19:32:34.000000000 +0000 @@ -956,3 +956,18 @@ [in] POINTL pt, [in, out] DWORD *pdwEffect); } + +/***************************************************************************** + * IDropSourceNotify interface + */ +[ + object, + uuid(0000012b-0000-0000-c000-000000000046), + pointer_default(unique), + local +] +interface IDropSourceNotify : IUnknown +{ + HRESULT DragTargetEnter( [in] HWND hwnd ); + HRESULT DragTargetLeave( void ); +} diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/webservices.h wine-staging-1.9.3~ubuntu12.04.1/include/webservices.h --- wine-staging-1.9.2~ubuntu12.04.1/include/webservices.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/webservices.h 2016-02-08 19:32:34.000000000 +0000 @@ -590,10 +590,12 @@ HRESULT WINAPI WsWriteElement(WS_XML_WRITER*, const WS_ELEMENT_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsWriteEndAttribute(WS_XML_WRITER*, WS_ERROR*); +HRESULT WINAPI WsWriteEndCData(WS_XML_WRITER*, WS_ERROR*); HRESULT WINAPI WsWriteEndElement(WS_XML_WRITER*, WS_ERROR*); HRESULT WINAPI WsWriteEndStartElement(WS_XML_WRITER*, WS_ERROR*); HRESULT WINAPI WsWriteStartAttribute(WS_XML_WRITER*, const WS_XML_STRING*, const WS_XML_STRING*, const WS_XML_STRING*, BOOL, WS_ERROR*); +HRESULT WINAPI WsWriteStartCData(WS_XML_WRITER*, WS_ERROR*); HRESULT WINAPI WsWriteStartElement(WS_XML_WRITER*, const WS_XML_STRING*, const WS_XML_STRING*, const WS_XML_STRING*, WS_ERROR*); HRESULT WINAPI WsWriteText(WS_XML_WRITER*, const WS_XML_TEXT*, WS_ERROR*); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/windef.h wine-staging-1.9.3~ubuntu12.04.1/include/windef.h --- wine-staging-1.9.2~ubuntu12.04.1/include/windef.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/windef.h 2016-02-08 19:32:34.000000000 +0000 @@ -64,7 +64,11 @@ # error You need to define __stdcall for your compiler # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __stdcall __attribute__((ms_abi)) +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __stdcall __attribute__((ms_abi)) +# endif # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ @@ -78,7 +82,11 @@ # define __cdecl __attribute__((__cdecl__)) # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __cdecl __attribute__((ms_abi)) +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __cdecl __attribute__((ms_abi)) +# endif # elif !defined(_MSC_VER) # define __cdecl # endif diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/wine/server_protocol.h wine-staging-1.9.3~ubuntu12.04.1/include/wine/server_protocol.h --- wine-staging-1.9.2~ubuntu12.04.1/include/wine/server_protocol.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/wine/server_protocol.h 2016-02-08 19:32:34.000000000 +0000 @@ -4222,6 +4222,13 @@ #define SET_CARET_POS 0x01 #define SET_CARET_HIDE 0x02 #define SET_CARET_STATE 0x04 +enum caret_state +{ + CARET_STATE_OFF, + CARET_STATE_ON, + CARET_STATE_TOGGLE, + CARET_STATE_ON_IF_MOVED +}; @@ -5261,6 +5268,23 @@ +struct open_job_request +{ + struct request_header __header; + unsigned int access; + unsigned int attributes; + obj_handle_t rootdir; + /* VARARG(name,unicode_str); */ +}; +struct open_job_reply +{ + struct reply_header __header; + obj_handle_t handle; + char __pad_12[4]; +}; + + + struct assign_job_request { struct request_header __header; @@ -5598,6 +5622,7 @@ REQ_get_suspend_context, REQ_set_suspend_context, REQ_create_job, + REQ_open_job, REQ_assign_job, REQ_process_in_job, REQ_set_job_limits, @@ -5875,6 +5900,7 @@ struct get_suspend_context_request get_suspend_context_request; struct set_suspend_context_request set_suspend_context_request; struct create_job_request create_job_request; + struct open_job_request open_job_request; struct assign_job_request assign_job_request; struct process_in_job_request process_in_job_request; struct set_job_limits_request set_job_limits_request; @@ -6150,6 +6176,7 @@ struct get_suspend_context_reply get_suspend_context_reply; struct set_suspend_context_reply set_suspend_context_reply; struct create_job_reply create_job_reply; + struct open_job_reply open_job_reply; struct assign_job_reply assign_job_reply; struct process_in_job_reply process_in_job_reply; struct set_job_limits_reply set_job_limits_reply; @@ -6157,6 +6184,6 @@ struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 500 +#define SERVER_PROTOCOL_VERSION 502 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/wine/wined3d.h wine-staging-1.9.3~ubuntu12.04.1/include/wine/wined3d.h --- wine-staging-1.9.2~ubuntu12.04.1/include/wine/wined3d.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/wine/wined3d.h 2016-02-08 19:32:34.000000000 +0000 @@ -657,10 +657,9 @@ { WINED3D_RTYPE_SURFACE = 1, WINED3D_RTYPE_VOLUME = 2, - WINED3D_RTYPE_TEXTURE = 3, - WINED3D_RTYPE_VOLUME_TEXTURE = 4, - WINED3D_RTYPE_CUBE_TEXTURE = 5, - WINED3D_RTYPE_BUFFER = 6, + WINED3D_RTYPE_BUFFER = 3, + WINED3D_RTYPE_TEXTURE_2D = 4, + WINED3D_RTYPE_TEXTURE_3D = 5, }; enum wined3d_pool @@ -742,7 +741,10 @@ enum wined3d_sysval_semantic { WINED3D_SV_POSITION = 1, + WINED3D_SV_PRIMITIVEID = 7, WINED3D_SV_INSTANCEID = 8, + WINED3D_SV_ISFRONTFACE = 9, + WINED3D_SV_SAMPLEINDEX = 10, WINED3D_SV_DEPTH = 0xffffffff, WINED3D_SV_TARGET0 = 0, @@ -821,6 +823,8 @@ #define WINED3DUSAGE_DMAP 0x00004000 #define WINED3DUSAGE_TEXTAPI 0x10000000 #define WINED3DUSAGE_MASK 0x10007fff + +#define WINED3DUSAGE_LEGACY_CUBEMAP 0x00800000 #define WINED3DUSAGE_TEXTURE 0x01000000 #define WINED3DUSAGE_OWNDC 0x02000000 #define WINED3DUSAGE_STATICDECL 0x04000000 @@ -1471,9 +1475,9 @@ #define WINED3D_PALETTE_ALLOW_256 0x00000002 #define WINED3D_PALETTE_ALPHA 0x00000004 -#define WINED3D_SURFACE_MAPPABLE 0x00000001 -#define WINED3D_SURFACE_DISCARD 0x00000002 -#define WINED3D_SURFACE_PIN_SYSMEM 0x00000004 +#define WINED3D_TEXTURE_CREATE_MAPPABLE 0x00000001 +#define WINED3D_TEXTURE_CREATE_DISCARD 0x00000002 +#define WINED3D_TEXTURE_CREATE_PIN_SYSMEM 0x00000004 #define WINED3D_APPEND_ALIGNED_ELEMENT 0xffffffff @@ -2219,6 +2223,7 @@ struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device, UINT idx); struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx); +struct wined3d * __cdecl wined3d_device_get_wined3d(const struct wined3d_device *device); ULONG __cdecl wined3d_device_incref(struct wined3d_device *device); HRESULT __cdecl wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc); HRESULT __cdecl wined3d_device_init_gdi(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc); @@ -2426,8 +2431,6 @@ HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view); -HRESULT __cdecl wined3d_rendertarget_view_create_from_surface(struct wined3d_surface *surface, - void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view); HRESULT __cdecl wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view); @@ -2471,23 +2474,10 @@ ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); -HRESULT __cdecl wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, - struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, - const WINEDDBLTFX *blt_fx, enum wined3d_texture_filter_type filter); -ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface); -struct wined3d_surface * __cdecl wined3d_surface_from_resource(struct wined3d_resource *resource); HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y); void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); -struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); -HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc); -ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface); -HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); -void __cdecl wined3d_surface_preload(struct wined3d_surface *surface); -HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc); HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y); -HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx); HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface, @@ -2528,7 +2518,7 @@ struct wined3d_texture *src_texture, unsigned int src_idx, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, - UINT level_count, DWORD surface_flags, const struct wined3d_sub_resource_data *data, void *parent, + UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture); @@ -2538,7 +2528,7 @@ DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture); struct wined3d_resource * __cdecl wined3d_texture_get_resource(struct wined3d_texture *texture); -struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(struct wined3d_texture *texture, +struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(const struct wined3d_texture *texture, UINT sub_resource_idx); ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture); void __cdecl wined3d_texture_preload(struct wined3d_texture *texture); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/winnt.h wine-staging-1.9.3~ubuntu12.04.1/include/winnt.h --- wine-staging-1.9.2~ubuntu12.04.1/include/winnt.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/winnt.h 2016-02-08 19:32:34.000000000 +0000 @@ -3549,6 +3549,7 @@ COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002, COMIMAGE_FLAGS_IL_LIBRARY = 0x00000004, COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008, + COMIMAGE_FLAGS_NATIVE_ENTRYPOINT= 0x00000010, COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000, COR_VERSION_MAJOR_V2 = 2, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/winternl.h wine-staging-1.9.3~ubuntu12.04.1/include/winternl.h --- wine-staging-1.9.2~ubuntu12.04.1/include/winternl.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/winternl.h 2016-02-08 19:32:34.000000000 +0000 @@ -2191,11 +2191,11 @@ NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); -NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); +NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); -NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); +NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG); -NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); +NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG); @@ -2209,7 +2209,7 @@ NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *); NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); -NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); +NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*); NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *); NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/include/winuser.h wine-staging-1.9.3~ubuntu12.04.1/include/winuser.h --- wine-staging-1.9.2~ubuntu12.04.1/include/winuser.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/include/winuser.h 2016-02-08 19:32:34.000000000 +0000 @@ -385,6 +385,17 @@ ULONG_PTR dwExtraInfo; } MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT; +typedef struct +{ + struct { /* MOUSEHOOKSTRUCT */ + POINT pt; + HWND hwnd; + UINT wHitTestCode; + ULONG_PTR dwExtraInfo; + } DUMMYSTRUCTNAME; + DWORD mouseData; +} MOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX; + /* Hardware hook structure */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/loader/wine.inf.in wine-staging-1.9.3~ubuntu12.04.1/loader/wine.inf.in --- wine-staging-1.9.2~ubuntu12.04.1/loader/wine.inf.in 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/loader/wine.inf.in 2016-02-08 19:32:34.000000000 +0000 @@ -218,13 +218,13 @@ HKCR,Msi.Patch\DefaultIcon,,2,"msiexec.exe" HKCR,Msi.Patch\shell\Open\command,,2,"%11%\msiexec.exe /p ""%1""" HKCR,rtffile,,2,"Rich Text Document" -HKCR,rtffile\shell\open\command,,2,"%11%\wordpad.exe %1" -HKCR,rtffile\shell\print\command,,2,"%11%\wordpad.exe /p %1" +HKCR,rtffile\shell\open\command,,2,"""%16422%\Windows NT\Accessories\wordpad.exe"" %1" +HKCR,rtffile\shell\print\command,,2,"""%16422%\Windows NT\Accessories\wordpad.exe"" /p %1" HKCR,txtfile,,2,"Text Document" HKCR,txtfile\shell\open\command,,2,"%11%\notepad.exe %1" HKCR,txtfile\shell\print\command,,2,"%11%\notepad.exe /p %1" -HKCR,wrifile\shell\open\command,,2,"%11%\wordpad.exe %1" -HKCR,wrifile\shell\print\command,,2,"%11%\wordpad.exe /p %1" +HKCR,wrifile\shell\open\command,,2,"""%16422%\Windows NT\Accessories\wordpad.exe"" %1" +HKCR,wrifile\shell\print\command,,2,"""%16422%\Windows NT\Accessories\wordpad.exe"" /p %1" HKCR,xmlfile,,2,"XML Document" HKCR,xmlfile\shell\open\command,,2,"""%11%\winebrowser.exe"" -nohome" HKCR,xmlfile\shell\open\ddeexec,,2,"""%1"",,-1,0,,,," diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0002-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0002-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0002-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0002-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 1e410019e0bed6db36906ade6dbab10416730556 Mon Sep 17 00:00:00 2001 +From d15b2a48d5caa7e642e66d3fb1e4bdbe56b8b8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 Jan 2016 13:01:15 +0100 Subject: kernelbase: Add dll and add stub for QuirkIsEnabled. @@ -16,10 +16,10 @@ create mode 100644 dlls/kernelbase/misc.c diff --git a/configure.ac b/configure.ac -index 5f178ee..0fbb0bf 100644 +index c47c0fd..dc89f99 100644 --- a/configure.ac +++ b/configure.ac -@@ -2980,6 +2980,7 @@ WINE_CONFIG_TEST(dlls/jscript/tests) +@@ -2989,6 +2989,7 @@ WINE_CONFIG_TEST(dlls/jscript/tests) WINE_CONFIG_DLL(jsproxy,,[implib]) WINE_CONFIG_DLL(kernel32,,[clean,implib,mc]) WINE_CONFIG_TEST(dlls/kernel32/tests) @@ -39,7 +39,7 @@ + misc.c diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec new file mode 100644 -index 0000000..83fff3e +index 0000000..392637b --- /dev/null +++ b/dlls/kernelbase/kernelbase.spec @@ -0,0 +1,1726 @@ @@ -752,7 +752,7 @@ +@ stdcall GetTimeFormatEx(wstr long ptr wstr ptr long) kernel32.GetTimeFormatEx +@ stdcall GetTimeFormatW(long long ptr wstr ptr long) kernel32.GetTimeFormatW +@ stdcall GetTimeZoneInformation(ptr) kernel32.GetTimeZoneInformation -+@ stub GetTimeZoneInformationForYear ++@ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear +@ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation +@ stdcall GetTraceEnableFlags(int64) advapi32.GetTraceEnableFlags +@ stdcall GetTraceEnableLevel(int64) advapi32.GetTraceEnableLevel @@ -1826,7 +1826,7 @@ 422 stdcall -noname SHGlobalCounterCreateNamedA(str long) 423 stdcall -noname SHGlobalCounterCreateNamedW(wstr long) diff --git a/tools/make_specfiles b/tools/make_specfiles -index e50ba18..3ff47f1 100755 +index 808d159..ae316a0 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -221,6 +221,13 @@ my @dll_groups = @@ -1844,5 +1844,5 @@ "api-ms-win-downlevel-ole32-l1-1-0", "api-ms-win-core-com-l1-1-0", -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0032-shcore-Implement-stub-for-GetDpiForMonitor.patch wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0032-shcore-Implement-stub-for-GetDpiForMonitor.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0032-shcore-Implement-stub-for-GetDpiForMonitor.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0032-shcore-Implement-stub-for-GetDpiForMonitor.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,86 @@ +From 0effbe0e3eeb84626ec6b64848fe6cfb1279dc02 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 26 Jan 2016 15:39:10 +0100 +Subject: shcore: Implement stub for GetDpiForMonitor. + +--- + dlls/shcore/Makefile.in | 1 + + dlls/shcore/main.c | 16 ++++++++++++++++ + dlls/shcore/shcore.spec | 2 +- + include/shellscalingapi.h | 8 ++++++++ + 4 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in +index ec2e95f..0b172fc 100644 +--- a/dlls/shcore/Makefile.in ++++ b/dlls/shcore/Makefile.in +@@ -1,4 +1,5 @@ + MODULE = shcore.dll ++IMPORTS = gdi32 user32 + + C_SRCS = \ + main.c +diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c +index 0e59d38..ce0d9ed 100644 +--- a/dlls/shcore/main.c ++++ b/dlls/shcore/main.c +@@ -21,6 +21,8 @@ + + #include "windef.h" + #include "winbase.h" ++#include "wingdi.h" ++#include "winuser.h" + #include "shellscalingapi.h" + #include "wine/debug.h" + +@@ -47,3 +49,17 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) + FIXME("(%u): stub\n", value); + return E_NOTIMPL; + } ++ ++HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) ++{ ++ HDC hDC; ++ ++ TRACE("(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y); ++ ++ hDC = GetDC(0); ++ if (x) *x = GetDeviceCaps(hDC, LOGPIXELSX); ++ if (y) *y = GetDeviceCaps(hDC, LOGPIXELSY); ++ ReleaseDC(0, hDC); ++ ++ return S_OK; ++} +diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec +index 1624319..4d6e845 100644 +--- a/dlls/shcore/shcore.spec ++++ b/dlls/shcore/shcore.spec +@@ -6,7 +6,7 @@ + @ stub DllGetActivationFactory + @ stdcall -private DllGetClassObject(ptr ptr ptr) shell32.DllGetClassObject + @ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID +-@ stub GetDpiForMonitor ++@ stdcall GetDpiForMonitor(long long ptr ptr) + @ stub GetDpiForShellUIComponent + @ stub GetProcessDpiAwareness + @ stub GetProcessReference +diff --git a/include/shellscalingapi.h b/include/shellscalingapi.h +index 6d7a167..56ae94a 100644 +--- a/include/shellscalingapi.h ++++ b/include/shellscalingapi.h +@@ -26,4 +26,12 @@ typedef enum PROCESS_DPI_AWARENESS + PROCESS_PER_MONITOR_DPI_AWARE = 2, + } PROCESS_DPI_AWARENESS; + ++typedef enum MONITOR_DPI_TYPE ++{ ++ MDT_EFFECTIVE_DPI = 0, ++ MDT_ANGULAR_DPI = 1, ++ MDT_RAW_DPI = 2, ++ MDT_DEFAULT = MDT_EFFECTIVE_DPI, ++} MONITOR_DPI_TYPE; ++ + #endif /* __WINE_SHELLSCALINGAPI_H */ +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0033-kernelbase-Add-stub-for-QuirkIsEnabled3.patch wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0033-kernelbase-Add-stub-for-QuirkIsEnabled3.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0033-kernelbase-Add-stub-for-QuirkIsEnabled3.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0033-kernelbase-Add-stub-for-QuirkIsEnabled3.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,58 @@ +From d1cb153363aec82f8b7c5dbb0f382880e01fc2d4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 4 Feb 2016 06:19:57 +0100 +Subject: kernelbase: Add stub for QuirkIsEnabled3. + +--- + .../api-ms-win-core-quirks-l1-1-0.spec | 2 +- + dlls/kernelbase/kernelbase.spec | 2 +- + dlls/kernelbase/misc.c | 10 ++++++++++ + 3 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/dlls/api-ms-win-core-quirks-l1-1-0/api-ms-win-core-quirks-l1-1-0.spec b/dlls/api-ms-win-core-quirks-l1-1-0/api-ms-win-core-quirks-l1-1-0.spec +index 54ce373..1485512 100644 +--- a/dlls/api-ms-win-core-quirks-l1-1-0/api-ms-win-core-quirks-l1-1-0.spec ++++ b/dlls/api-ms-win-core-quirks-l1-1-0/api-ms-win-core-quirks-l1-1-0.spec +@@ -2,7 +2,7 @@ + @ stub QuirkGetData2 + @ stdcall QuirkIsEnabled(ptr) kernelbase.QuirkIsEnabled + @ stub QuirkIsEnabled2 +-@ stub QuirkIsEnabled3 ++@ stdcall QuirkIsEnabled3(ptr ptr) kernelbase.QuirkIsEnabled3 + @ stub QuirkIsEnabledForPackage + @ stub QuirkIsEnabledForPackage2 + @ stub QuirkIsEnabledForProcess +diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec +index 83fff3e..dbba3cc 100644 +--- a/dlls/kernelbase/kernelbase.spec ++++ b/dlls/kernelbase/kernelbase.spec +@@ -1188,7 +1188,7 @@ + @ stub QuirkGetData2 + @ stub QuirkGetData + @ stub QuirkIsEnabled2 +-@ stub QuirkIsEnabled3 ++@ stdcall QuirkIsEnabled3(ptr ptr) + @ stdcall QuirkIsEnabled(ptr) + @ stub QuirkIsEnabledForPackage2 + @ stub QuirkIsEnabledForPackage3 +diff --git a/dlls/kernelbase/misc.c b/dlls/kernelbase/misc.c +index be1591a..e703e6d 100644 +--- a/dlls/kernelbase/misc.c ++++ b/dlls/kernelbase/misc.c +@@ -35,3 +35,13 @@ BOOL WINAPI QuirkIsEnabled(void *arg) + FIXME("(%p): stub\n", arg); + return FALSE; + } ++ ++/*********************************************************************** ++ * QuirkIsEnabled3 (KERNELBASE.@) ++ */ ++BOOL WINAPI QuirkIsEnabled3(void *arg1, void *arg2) ++{ ++ static int once; ++ if (!once++) FIXME("(%p, %p): stub\n", arg1, arg2); ++ return FALSE; ++} +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0034-shcore-Add-stub-for-GetProcessDpiAwareness.patch wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0034-shcore-Add-stub-for-GetProcessDpiAwareness.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0034-shcore-Add-stub-for-GetProcessDpiAwareness.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/api-ms-win-Stub_DLLs/0034-shcore-Add-stub-for-GetProcessDpiAwareness.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,44 @@ +From 3d855b15e9f99f1cc3168cc9e606cb698e078a4b Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 6 Feb 2016 02:38:14 +0100 +Subject: shcore: Add stub for GetProcessDpiAwareness. + +--- + dlls/shcore/main.c | 7 +++++++ + dlls/shcore/shcore.spec | 2 +- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c +index ce0d9ed..f2d362d 100644 +--- a/dlls/shcore/main.c ++++ b/dlls/shcore/main.c +@@ -50,6 +50,13 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) + return E_NOTIMPL; + } + ++HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *value) ++{ ++ FIXME("(%p, %p): stub\n", process, value); ++ if (value) *value = PROCESS_DPI_UNAWARE; ++ return S_OK; ++} ++ + HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) + { + HDC hDC; +diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec +index 4d6e845..34f989f 100644 +--- a/dlls/shcore/shcore.spec ++++ b/dlls/shcore/shcore.spec +@@ -8,7 +8,7 @@ + @ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID + @ stdcall GetDpiForMonitor(long long ptr ptr) + @ stub GetDpiForShellUIComponent +-@ stub GetProcessDpiAwareness ++@ stdcall GetProcessDpiAwareness(long ptr) + @ stub GetProcessReference + @ stub GetScaleFactorForDevice + @ stub GetScaleFactorForMonitor +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,239 @@ +From a33160eef805e950e8b3c36c74f0688ca9e2328e Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 7 Feb 2016 12:52:26 +0800 +Subject: avifil32: Add support for AVIFile interface proxies. [v2] + +--- + dlls/avifil32/Makefile.in | 4 +- + dlls/avifil32/avifil32.idl | 25 ++++++---- + dlls/avifil32/avifile_ifaces.idl | 105 +++++++++++++++++++++++++++++++++++++++ + dlls/avifil32/avifile_private.h | 1 + + dlls/avifil32/factory.c | 8 ++- + 5 files changed, 130 insertions(+), 13 deletions(-) + create mode 100644 dlls/avifil32/avifile_ifaces.idl + +diff --git a/dlls/avifil32/Makefile.in b/dlls/avifil32/Makefile.in +index 81d2ff8..4030514 100644 +--- a/dlls/avifil32/Makefile.in ++++ b/dlls/avifil32/Makefile.in +@@ -1,6 +1,6 @@ + MODULE = avifil32.dll + IMPORTLIB = avifil32 +-IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32 ++IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32 rpcrt4 + + C_SRCS = \ + acmstream.c \ +@@ -17,3 +17,5 @@ C_SRCS = \ + IDL_SRCS = avifil32.idl + + RC_SRCS = avifil32.rc ++ ++dlldata_EXTRADEFS = -DENTRY_PREFIX=avifil32_ +diff --git a/dlls/avifil32/avifil32.idl b/dlls/avifil32/avifil32.idl +index 1f50f15..e23c176 100644 +--- a/dlls/avifil32/avifil32.idl ++++ b/dlls/avifil32/avifil32.idl +@@ -18,39 +18,42 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#pragma makedep proxy + #pragma makedep register + ++#include "avifile_ifaces.idl" ++ ++[ ++ helpstring("IAVIStream & IAVIFile Proxy"), ++ threading(both), ++ uuid(0002000d-0000-0000-c000-000000000046) ++] ++coclass PSFactoryBuffer { interface IFactoryBuffer; } ++ + [ + helpstring("Microsoft AVI Files"), +- threading(apartment), ++ threading(both), + uuid(00020000-0000-0000-C000-000000000046) + ] + coclass AVIFile { interface IAVIFile; } + + [ + helpstring("AVI Compressed Stream"), +- threading(apartment), ++ threading(both), + uuid(00020001-0000-0000-c000-000000000046) + ] + coclass ICMStream { interface IAVIStream; } + + [ + helpstring("Microsoft Wave File"), +- threading(apartment), ++ threading(both), + uuid(00020003-0000-0000-c000-000000000046) + ] + coclass WAVFile { interface IAVIFile; } + + [ +- helpstring("IAVIStream & IAVIFile Proxy"), +- threading(apartment), +- uuid(0002000d-0000-0000-c000-000000000046) +-] +-coclass AVIProxy { } +- +-[ + helpstring("ACM Compressed Audio Stream"), +- threading(apartment), ++ threading(both), + uuid(0002000f-0000-0000-c000-000000000046) + ] + coclass ACMStream { interface IAVIStream; } +diff --git a/dlls/avifil32/avifile_ifaces.idl b/dlls/avifil32/avifile_ifaces.idl +new file mode 100644 +index 0000000..f9280e5 +--- /dev/null ++++ b/dlls/avifil32/avifile_ifaces.idl +@@ -0,0 +1,105 @@ ++/* ++ * Proxy support for avifil32 ++ * ++ * Copyright 2016 Dmitry Timoshkov ++ * ++ * 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 ++ */ ++ ++/* ++ * These interface descriptions are supposed to be used for automatic proxy ++ * generation by an IDL compiler. ++ * ++ * While it's possible to convert include/vfw.h to an .idl, that's proved to ++ * be a major waste of an effort because the resulting interface descriptions ++ * can't be used for automatic proxy generation since they are not compatible ++ * with IDL compiler restrictions for proxies, and fixing them up would make ++ * generated vfw.h source incompatible with PSDK's equivalent. ++ */ ++ ++import "wtypes.idl"; ++import "unknwn.idl"; ++ ++typedef struct _AVISTREAMINFOW ++{ ++ DWORD fccType; ++ DWORD fccHandler; ++ DWORD dwFlags; ++ DWORD dwCaps; ++ WORD wPriority; ++ WORD wLanguage; ++ DWORD dwScale; ++ DWORD dwRate; ++ DWORD dwStart; ++ DWORD dwLength; ++ DWORD dwInitialFrames; ++ DWORD dwSuggestedBufferSize; ++ DWORD dwQuality; ++ DWORD dwSampleSize; ++ RECT rcFrame; ++ DWORD dwEditCount; ++ DWORD dwFormatChangeCount; ++ WCHAR szName[64]; ++} AVISTREAMINFOW; ++ ++[ ++ object, ++ uuid(00020021-0000-0000-c000-000000000046) ++] ++interface IAVIStream : IUnknown ++{ ++ HRESULT Create(LPARAM lParam1, LPARAM lParam2); ++ HRESULT Info(AVISTREAMINFOW *psi, LONG lSize); ++ LONG FindSample(LONG lPos, LONG lFlags); ++ HRESULT ReadFormat(LONG lPos, [out,size_is(*lpcbFormat)] char *lpFormat, [in,out] LONG *lpcbFormat); ++ HRESULT SetFormat(LONG lPos, [in,size_is(cbFormat)] char *lpFormat, LONG cbFormat); ++ HRESULT Read(LONG lStart, LONG lSamples, [out,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples); ++ HRESULT Write(LONG lStart, LONG lSamples, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten); ++ HRESULT Delete(LONG lStart, LONG lSamples); ++ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer); ++ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer); ++ HRESULT SetInfo(AVISTREAMINFOW *plInfo, LONG cbInfo); ++}; ++ ++typedef struct _AVIFILEINFOW ++{ ++ DWORD dwMaxBytesPerSec; ++ DWORD dwFlags; ++ DWORD dwCaps; ++ DWORD dwStreams; ++ DWORD dwSuggestedBufferSize; ++ DWORD dwWidth; ++ DWORD dwHeight; ++ DWORD dwScale; ++ DWORD dwRate; ++ DWORD dwLength; ++ DWORD dwEditCount; ++ WCHAR szFileType[64]; ++} AVIFILEINFOW; ++ ++[ ++ object, ++ uuid(00020020-0000-0000-c000-000000000046) ++] ++interface IAVIFile : IUnknown ++{ ++ HRESULT Info(AVIFILEINFOW *pfi, LONG lSize); ++ HRESULT GetStream(IAVIStream **ppStream, DWORD fccType, LONG lParam); ++ HRESULT CreateStream(IAVIStream **ppStream, AVISTREAMINFOW *psi); ++ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer); ++ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer); ++ HRESULT EndRecord(void); ++ HRESULT DeleteStream(DWORD fccType, LONG lParam); ++}; +diff --git a/dlls/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h +index 0fd74c4..9cce2d3 100644 +--- a/dlls/avifil32/avifile_private.h ++++ b/dlls/avifil32/avifile_private.h +@@ -67,5 +67,6 @@ extern PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pstream) DECLSPEC_HIDDEN; + extern PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, const PAVISTREAM *ppStreams) DECLSPEC_HIDDEN; + + extern LPCWSTR AVIFILE_BasenameW(LPCWSTR szFileName) DECLSPEC_HIDDEN; ++extern HRESULT WINAPI avifil32_DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) DECLSPEC_HIDDEN; + + #endif +diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c +index c74a716..1b8988d 100644 +--- a/dlls/avifil32/factory.c ++++ b/dlls/avifil32/factory.c +@@ -195,12 +195,18 @@ LPCWSTR AVIFILE_BasenameW(LPCWSTR szPath) + */ + HRESULT WINAPI DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) + { ++ HRESULT hr; ++ + TRACE("(%s,%s,%p)\n", debugstr_guid(pclsid), debugstr_guid(piid), ppv); + + if (pclsid == NULL || piid == NULL || ppv == NULL) + return E_FAIL; + +- return AVIFILE_CreateClassFactory(pclsid,piid,ppv); ++ hr = AVIFILE_CreateClassFactory(pclsid,piid,ppv); ++ if (SUCCEEDED(hr)) ++ return hr; ++ ++ return avifil32_DllGetClassObject(pclsid,piid,ppv); + } + + /***************************************************************************** +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/definition wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-AVIFile_Proxies/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38564] Add support for AVIFile interface proxies diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/0001-avifil32-Correctly-handle-compressed-frames-when-des.patch wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/0001-avifil32-Correctly-handle-compressed-frames-when-des.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/0001-avifil32-Correctly-handle-compressed-frames-when-des.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/0001-avifil32-Correctly-handle-compressed-frames-when-des.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,141 @@ +From 23ce6bcd9ebd67d6b5ed991bad555ecbc014a08d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Mon, 8 Feb 2016 04:55:07 +0100 +Subject: avifil32: Correctly handle compressed frames when desired format is + specified. + +--- + dlls/avifil32/getframe.c | 102 +++++++++++++++++++++++------------------------ + 1 file changed, 50 insertions(+), 52 deletions(-) + +diff --git a/dlls/avifil32/getframe.c b/dlls/avifil32/getframe.c +index 46b1683..7d98d2e 100644 +--- a/dlls/avifil32/getframe.c ++++ b/dlls/avifil32/getframe.c +@@ -406,8 +406,6 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, + lpbi->biSize + lpbi->biClrUsed * sizeof(RGBQUAD)); + if (lpbi->biBitCount <= 8) + ICDecompressGetPalette(This->hic, This->lpInFormat, This->lpOutFormat); +- +- return AVIERR_OK; + } else { + if (bBestDisplay) { + ICGetDisplayFormat(This->hic, This->lpInFormat, +@@ -417,64 +415,64 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, + AVIFILE_CloseCompressor(This); + return AVIERR_NOCOMPRESSOR; + } ++ } + +- /* check output format */ +- if (This->lpOutFormat->biClrUsed == 0 && +- This->lpOutFormat->biBitCount <= 8) +- This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount; +- if (This->lpOutFormat->biSizeImage == 0 && +- This->lpOutFormat->biCompression == BI_RGB) { +- This->lpOutFormat->biSizeImage = +- DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight; +- } ++ /* check output format */ ++ if (This->lpOutFormat->biClrUsed == 0 && ++ This->lpOutFormat->biBitCount <= 8) ++ This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount; ++ if (This->lpOutFormat->biSizeImage == 0 && ++ This->lpOutFormat->biCompression == BI_RGB) { ++ This->lpOutFormat->biSizeImage = ++ DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight; ++ } + +- if (lpBits == NULL) { +- DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD); ++ if (lpBits == NULL) { ++ DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD); + +- size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage; +- This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size); +- if (This->lpOutFormat == NULL) { +- AVIFILE_CloseCompressor(This); +- return AVIERR_MEMORY; +- } +- This->lpOutBuffer = DIBPTR(This->lpOutFormat); +- } else +- This->lpOutBuffer = lpBits; +- +- /* for user size was irrelevant */ +- if (dx == -1) +- dx = This->lpOutFormat->biWidth; +- if (dy == -1) +- dy = This->lpOutFormat->biHeight; +- +- /* need to resize? */ +- if (x != 0 || y != 0) { +- if (dy == This->lpOutFormat->biHeight && +- dx == This->lpOutFormat->biWidth) +- This->bResize = FALSE; +- else +- This->bResize = TRUE; ++ size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage; ++ This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size); ++ if (This->lpOutFormat == NULL) { ++ AVIFILE_CloseCompressor(This); ++ return AVIERR_MEMORY; + } ++ This->lpOutBuffer = DIBPTR(This->lpOutFormat); ++ } else ++ This->lpOutBuffer = lpBits; ++ ++ /* for user size was irrelevant */ ++ if (dx == -1) ++ dx = This->lpOutFormat->biWidth; ++ if (dy == -1) ++ dy = This->lpOutFormat->biHeight; ++ ++ /* need to resize? */ ++ if (x != 0 || y != 0) { ++ if (dy == This->lpOutFormat->biHeight && ++ dx == This->lpOutFormat->biWidth) ++ This->bResize = FALSE; ++ else ++ This->bResize = TRUE; ++ } + +- if (This->bResize) { +- This->x = x; +- This->y = y; +- This->dx = dx; +- This->dy = dy; +- +- if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0, +- 0,This->lpInFormat->biWidth, +- This->lpInFormat->biHeight,This->lpOutFormat, +- This->lpOutBuffer, x, y, dx, dy) == ICERR_OK) +- return AVIERR_OK; +- } else if (ICDecompressBegin(This->hic, This->lpInFormat, +- This->lpOutFormat) == ICERR_OK) ++ if (This->bResize) { ++ This->x = x; ++ This->y = y; ++ This->dx = dx; ++ This->dy = dy; ++ ++ if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0, ++ 0,This->lpInFormat->biWidth, ++ This->lpInFormat->biHeight,This->lpOutFormat, ++ This->lpOutBuffer, x, y, dx, dy) == ICERR_OK) + return AVIERR_OK; ++ } else if (ICDecompressBegin(This->hic, This->lpInFormat, ++ This->lpOutFormat) == ICERR_OK) ++ return AVIERR_OK; + +- AVIFILE_CloseCompressor(This); ++ AVIFILE_CloseCompressor(This); + +- return AVIERR_COMPRESSOR; +- } ++ return AVIERR_COMPRESSOR; + } + + static const struct IGetFrameVtbl igetframeVtbl = { +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/definition wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifil32-IGetFrame_fnSetFormat/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Correctly handle compressed frames when desired format is specified diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0001-avifile-Correctly-convert-result-of-AVIStreamGetFram.patch wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0001-avifile-Correctly-convert-result-of-AVIStreamGetFram.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0001-avifile-Correctly-convert-result-of-AVIStreamGetFram.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0001-avifile-Correctly-convert-result-of-AVIStreamGetFram.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,186 @@ +From e68b9f65a4f9c7f9c10b11152cac04bcdf6facf9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Mon, 8 Feb 2016 04:44:24 +0100 +Subject: avifile.dll16: Correctly convert result of AVIStreamGetFrame to a segptr. + +--- + dlls/avifile.dll16/Makefile.in | 3 + + dlls/avifile.dll16/avifile.dll16.spec | 6 +- + dlls/avifile.dll16/main.c | 137 ++++++++++++++++++++++++++++++++++ + 3 files changed, 143 insertions(+), 3 deletions(-) + create mode 100644 dlls/avifile.dll16/main.c + +diff --git a/dlls/avifile.dll16/Makefile.in b/dlls/avifile.dll16/Makefile.in +index 6050c6c..4152c2f 100644 +--- a/dlls/avifile.dll16/Makefile.in ++++ b/dlls/avifile.dll16/Makefile.in +@@ -1,3 +1,6 @@ + MODULE = avifile.dll16 + IMPORTS = avifil32 + EXTRADLLFLAGS = -m16 -Wb,--main-module,avifil32.dll ++ ++C_SRCS = \ ++ main.c +diff --git a/dlls/avifile.dll16/avifile.dll16.spec b/dlls/avifile.dll16/avifile.dll16.spec +index 71a6c74..0e19413 100644 +--- a/dlls/avifile.dll16/avifile.dll16.spec ++++ b/dlls/avifile.dll16/avifile.dll16.spec +@@ -20,9 +20,9 @@ + 105 stub AVIMAKECOMPRESSEDSTREAM + 106 stub AVIMAKEFILEFROMSTREAMS + 107 stub AVIMAKESTREAMFROMCLIPBOARD +-110 pascal AVIStreamGetFrame(long long) AVIStreamGetFrame +-111 pascal AVIStreamGetFrameClose(long) AVIStreamGetFrameClose +-112 pascal AVIStreamGetFrameOpen(long ptr) AVIStreamGetFrameOpen ++110 pascal AVIStreamGetFrame(long long) AVIStreamGetFrame16 ++111 pascal AVIStreamGetFrameClose(long) AVIStreamGetFrameClose16 ++112 pascal AVIStreamGetFrameOpen(long ptr) AVIStreamGetFrameOpen16 + 120 stub _AVISAVE + 121 stub AVISAVEV + 122 stub AVISAVEOPTIONS +diff --git a/dlls/avifile.dll16/main.c b/dlls/avifile.dll16/main.c +new file mode 100644 +index 0000000..f780c43 +--- /dev/null ++++ b/dlls/avifile.dll16/main.c +@@ -0,0 +1,137 @@ ++/* ++ * Wrapper for 16 bit avifile functions ++ * ++ * Copyright 2016 Michael Müller ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "wine/winbase16.h" ++#include "winternl.h" ++#include "wingdi.h" ++#include "vfw.h" ++ ++#include "wine/debug.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(avifile16); ++ ++struct frame_wrapper16 ++{ ++ PGETFRAME pg; ++ PVOID ptr; ++ DWORD size; ++ WORD sel; ++ WORD count; ++}; ++ ++static void free_segptr_frame(struct frame_wrapper16 *wrapper) ++{ ++ int i; ++ ++ if (!wrapper->sel) ++ return; ++ ++ for (i = 0; i < wrapper->count; i++) ++ FreeSelector16(wrapper->sel + (i << __AHSHIFT)); ++ ++ wrapper->sel = 0; ++} ++ ++static SEGPTR alloc_segptr_frame(struct frame_wrapper16 *wrapper, void *ptr, DWORD size) ++{ ++ int i; ++ ++ if (wrapper->sel) ++ { ++ if (wrapper->ptr == ptr && wrapper->size == size) ++ return MAKESEGPTR(wrapper->sel, 0); ++ free_segptr_frame(wrapper); ++ } ++ ++ wrapper->ptr = ptr; ++ wrapper->size = size; ++ wrapper->count = (size + 0xffff) / 0x10000; ++ wrapper->sel = AllocSelectorArray16(wrapper->count); ++ if (!wrapper->sel) ++ return 0; ++ ++ for (i = 0; i < wrapper->count; i++) ++ { ++ SetSelectorBase(wrapper->sel + (i << __AHSHIFT), (DWORD)ptr + i * 0x10000); ++ SetSelectorLimit16(wrapper->sel + (i << __AHSHIFT), size - 1); ++ size -= 0x10000; ++ } ++ ++ return MAKESEGPTR(wrapper->sel, 0); ++} ++ ++/*********************************************************************** ++ * AVIStreamGetFrameOpen (AVIFILE.112) ++ */ ++PGETFRAME WINAPI AVIStreamGetFrameOpen16(PAVISTREAM pstream, LPBITMAPINFOHEADER lpbiWanted) ++{ ++ struct frame_wrapper16 *wrapper; ++ PGETFRAME pg; ++ ++ pg = AVIStreamGetFrameOpen(pstream, lpbiWanted); ++ if (!pg) return NULL; ++ ++ wrapper = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wrapper)); ++ if (!wrapper) ++ { ++ AVIStreamGetFrameClose(pg); ++ return NULL; ++ } ++ ++ wrapper->pg = pg; ++ return (PGETFRAME)wrapper; ++} ++ ++/*********************************************************************** ++ * AVIStreamGetFrame (AVIFILE.110) ++ */ ++SEGPTR WINAPI AVIStreamGetFrame16(PGETFRAME pg, LONG pos) ++{ ++ struct frame_wrapper16 *wrapper = (void *)pg; ++ BITMAPINFOHEADER *bih; ++ ++ if (!pg) return 0; ++ ++ bih = AVIStreamGetFrame(wrapper->pg, pos); ++ if (bih) ++ { ++ DWORD size = bih->biSize + bih->biSizeImage; ++ return alloc_segptr_frame(wrapper, bih, size); ++ } ++ ++ return 0; ++} ++ ++ ++/*********************************************************************** ++ * AVIStreamGetFrameClose (AVIFILE.111) ++ */ ++HRESULT WINAPI AVIStreamGetFrameClose16(PGETFRAME pg) ++{ ++ struct frame_wrapper16 *wrapper = (void *)pg; ++ HRESULT hr; ++ ++ if (!pg) return S_OK; ++ ++ hr = AVIStreamGetFrameClose(wrapper->pg); ++ free_segptr_frame(wrapper); ++ HeapFree(GetProcessHeap(), 0, wrapper); ++ return hr; ++} +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0002-avifile-Convert-between-AVISTREAMINFO-16-bit-and-AVI.patch wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0002-avifile-Convert-between-AVISTREAMINFO-16-bit-and-AVI.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0002-avifile-Convert-between-AVISTREAMINFO-16-bit-and-AVI.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/0002-avifile-Convert-between-AVISTREAMINFO-16-bit-and-AVI.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,148 @@ +From 3cdd530b2c17ee0cdc6a1fcc37b28c180310656a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Mon, 8 Feb 2016 14:02:09 +0100 +Subject: avifile.dll16: Convert between AVISTREAMINFO (16 bit) and AVISTREAMINFOA. + +--- + dlls/avifile.dll16/avifile.dll16.spec | 4 +- + dlls/avifile.dll16/main.c | 100 ++++++++++++++++++++++++++++++++++ + 2 files changed, 102 insertions(+), 2 deletions(-) + +diff --git a/dlls/avifile.dll16/avifile.dll16.spec b/dlls/avifile.dll16/avifile.dll16.spec +index 0e19413..7a1aaea 100644 +--- a/dlls/avifile.dll16/avifile.dll16.spec ++++ b/dlls/avifile.dll16/avifile.dll16.spec +@@ -36,13 +36,13 @@ + 141 pascal AVIFileRelease(long) AVIFileRelease + 142 pascal AVIFileInfo(long ptr long) AVIFileInfoA + 143 pascal AVIFileGetStream(long ptr long long) AVIFileGetStream +-144 pascal AVIFileCreateStream(long ptr ptr) AVIFileCreateStreamA ++144 pascal AVIFileCreateStream(long ptr ptr) AVIFileCreateStream16 + 146 pascal AVIFileWriteData(long long ptr long) AVIFileWriteData + 147 pascal AVIFileReadData(long long ptr ptr) AVIFileReadData + 148 pascal AVIFileEndRecord(long) AVIFileEndRecord + 160 pascal AVIStreamAddRef(long) AVIStreamAddRef + 161 pascal AVIStreamRelease(long) AVIStreamRelease +-162 pascal AVIStreamInfo(long ptr long) AVIStreamInfoA ++162 pascal AVIStreamInfo(long ptr long) AVIStreamInfo16 + 163 pascal AVIStreamFindSample(long long long) AVIStreamFindSample + 164 pascal AVIStreamReadFormat(long long ptr ptr) AVIStreamReadFormat + 165 pascal AVIStreamReadData(long long ptr ptr) AVIStreamReadData +diff --git a/dlls/avifile.dll16/main.c b/dlls/avifile.dll16/main.c +index f780c43..8df1fe5 100644 +--- a/dlls/avifile.dll16/main.c ++++ b/dlls/avifile.dll16/main.c +@@ -27,6 +27,27 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(avifile16); + ++typedef struct _AVISTREAMINFO16 { ++ DWORD fccType; ++ DWORD fccHandler; ++ DWORD dwFlags; ++ DWORD dwCaps; ++ WORD wPriority; ++ WORD wLanguage; ++ DWORD dwScale; ++ DWORD dwRate; ++ DWORD dwStart; ++ DWORD dwLength; ++ DWORD dwInitialFrames; ++ DWORD dwSuggestedBufferSize; ++ DWORD dwQuality; ++ DWORD dwSampleSize; ++ RECT16 rcFrame; ++ DWORD dwEditCount; ++ DWORD dwFormatChangeCount; ++ CHAR szName[64]; ++} AVISTREAMINFO16, *LPAVISTREAMINFO16, *PAVISTREAMINFO16; ++ + struct frame_wrapper16 + { + PGETFRAME pg; +@@ -135,3 +156,82 @@ HRESULT WINAPI AVIStreamGetFrameClose16(PGETFRAME pg) + HeapFree(GetProcessHeap(), 0, wrapper); + return hr; + } ++ ++/*********************************************************************** ++ * AVIFileCreateStream (AVIFILE.144) ++ */ ++HRESULT WINAPI AVIFileCreateStream16(PAVIFILE pfile, PAVISTREAM *ppavi, LPAVISTREAMINFO16 asi16) ++{ ++ AVISTREAMINFOA asi; ++ ++ if (!asi16) ++ return AVIFileCreateStreamA(pfile, ppavi, NULL); ++ ++ asi.fccType = asi16->fccType; ++ asi.fccHandler = asi16->fccHandler; ++ asi.dwFlags = asi16->dwFlags; ++ asi.dwCaps = asi16->dwCaps; ++ asi.wPriority = asi16->wPriority; ++ asi.wLanguage = asi16->wLanguage; ++ asi.dwScale = asi16->dwScale; ++ asi.dwRate = asi16->dwRate; ++ asi.dwStart = asi16->dwStart; ++ asi.dwLength = asi16->dwLength; ++ asi.dwInitialFrames = asi16->dwInitialFrames; ++ asi.dwSuggestedBufferSize = asi16->dwSuggestedBufferSize; ++ asi.dwQuality = asi16->dwQuality; ++ asi.dwSampleSize = asi16->dwSampleSize; ++ asi.rcFrame.left = asi16->rcFrame.left; ++ asi.rcFrame.top = asi16->rcFrame.top; ++ asi.rcFrame.right = asi16->rcFrame.right; ++ asi.rcFrame.bottom = asi16->rcFrame.bottom; ++ asi.dwEditCount = asi16->dwEditCount; ++ asi.dwFormatChangeCount = asi16->dwFormatChangeCount; ++ memcpy(&asi.szName, &asi16->szName, sizeof(asi.szName)); ++ ++ return AVIFileCreateStreamA(pfile, ppavi, &asi); ++} ++ ++ ++/*********************************************************************** ++ * AVIStreamInfo (AVIFILE.162) ++ */ ++HRESULT WINAPI AVIStreamInfo16(PAVISTREAM pstream, LPAVISTREAMINFO16 asi16, LONG size) ++{ ++ AVISTREAMINFOA asi; ++ HRESULT hr; ++ ++ if (!asi16) ++ return AVIStreamInfoA(pstream, NULL, size); ++ ++ if (size < sizeof(AVISTREAMINFO16)) ++ return AVIERR_BADSIZE; ++ ++ hr = AVIStreamInfoA(pstream, &asi, sizeof(asi)); ++ if (SUCCEEDED(hr)) ++ { ++ asi16->fccType = asi.fccType; ++ asi16->fccHandler = asi.fccHandler; ++ asi16->dwFlags = asi.dwFlags; ++ asi16->dwCaps = asi.dwCaps; ++ asi16->wPriority = asi.wPriority; ++ asi16->wLanguage = asi.wLanguage; ++ asi16->dwScale = asi.dwScale; ++ asi16->dwRate = asi.dwRate; ++ asi16->dwStart = asi.dwStart; ++ asi16->dwLength = asi.dwLength; ++ asi16->dwInitialFrames = asi.dwInitialFrames; ++ asi16->dwSuggestedBufferSize = asi.dwSuggestedBufferSize; ++ asi16->dwQuality = asi.dwQuality; ++ asi16->dwSampleSize = asi.dwSampleSize; ++ asi16->rcFrame.left = asi.rcFrame.left; ++ asi16->rcFrame.top = asi.rcFrame.top; ++ asi16->rcFrame.right = asi.rcFrame.right; ++ asi16->rcFrame.bottom = asi.rcFrame.bottom; ++ asi16->dwEditCount = asi.dwEditCount; ++ asi16->dwFormatChangeCount = asi.dwFormatChangeCount; ++ memcpy(&asi16->szName, &asi.szName, sizeof(asi.szName)); ++ } ++ ++ return hr; ++} +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/definition wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/avifile.dll16-AVIStreamGetFrame/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,2 @@ +Fixes: Correctly convert result of AVIStreamGetFrame to a segptr in avifile.dll16 +Fixes: Convert between AVISTREAMINFO (16 bit) and AVISTREAMINFOA in avifile.dll16 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Device_Caps/0001-ddraw-Don-t-set-HWTRANSFORMANDLIGHT-flag-on-d3d7-RGB.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Device_Caps/0001-ddraw-Don-t-set-HWTRANSFORMANDLIGHT-flag-on-d3d7-RGB.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Device_Caps/0001-ddraw-Don-t-set-HWTRANSFORMANDLIGHT-flag-on-d3d7-RGB.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Device_Caps/0001-ddraw-Don-t-set-HWTRANSFORMANDLIGHT-flag-on-d3d7-RGB.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,116 @@ +From 63d0af4a9607ae31514604032a5504457ad84097 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 01:15:07 +0100 +Subject: ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB device. + +--- + dlls/ddraw/ddraw.c | 9 +++++++++ + dlls/ddraw/tests/ddraw7.c | 18 ++++++++++++++++++ + 2 files changed, 27 insertions(+) + +diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c +index 89ce07a..64548a0 100644 +--- a/dlls/ddraw/ddraw.c ++++ b/dlls/ddraw/ddraw.c +@@ -48,6 +48,7 @@ static struct enum_device_entry + char interface_name[100]; + char device_name[100]; + const GUID *device_guid; ++ DWORD remove_caps; + } device_list7[] = + { + /* T&L HAL device */ +@@ -55,6 +56,7 @@ static struct enum_device_entry + "WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D", + "Wine D3D7 T&L HAL", + &IID_IDirect3DTnLHalDevice, ++ 0, + }, + + /* HAL device */ +@@ -62,6 +64,7 @@ static struct enum_device_entry + "WINE Direct3D7 Hardware acceleration using WineD3D", + "Direct3D HAL", + &IID_IDirect3DHALDevice, ++ 0, + }, + + /* RGB device */ +@@ -69,6 +72,7 @@ static struct enum_device_entry + "WINE Direct3D7 RGB Software Emulation using WineD3D", + "Wine D3D7 RGB", + &IID_IDirect3DRGBDevice, ++ D3DDEVCAPS_HWTRANSFORMANDLIGHT, + }, + }; + +@@ -3565,6 +3569,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA + { + struct ddraw *ddraw = impl_from_IDirect3D7(iface); + D3DDEVICEDESC7 device_desc7; ++ DWORD dev_caps; + HRESULT hr; + size_t i; + +@@ -3581,11 +3586,15 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA + return hr; + } + ++ dev_caps = device_desc7.dwDevCaps; ++ + for (i = 0; i < sizeof(device_list7)/sizeof(device_list7[0]); i++) + { + HRESULT ret; + + device_desc7.deviceGUID = *device_list7[i].device_guid; ++ device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps; ++ + ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context); + if (ret != DDENUMRET_OK) + { +diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c +index 34167c1..76dabee 100644 +--- a/dlls/ddraw/tests/ddraw7.c ++++ b/dlls/ddraw/tests/ddraw7.c +@@ -230,6 +230,19 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 + return DDENUMRET_OK; + } + ++static HRESULT WINAPI enum_devtype_software_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx) ++{ ++ BOOL *software_ok = ctx; ++ if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DRGBDevice)) ++ { ++ ok(!(desc->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT), ++ "RGB emulation device shouldn't have HWTRANSFORMANDLIGHT flag\n"); ++ *software_ok = TRUE; ++ return DDENUMRET_CANCEL; ++ } ++ return DDENUMRET_OK; ++} ++ + static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) + { + IDirectDrawSurface7 *surface, *ds; +@@ -240,6 +253,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) + IDirect3D7 *d3d7; + HRESULT hr; + BOOL hal_ok = FALSE; ++ BOOL software_ok = FALSE; + const GUID *devtype = &IID_IDirect3DHALDevice; + + if (!(ddraw = create_ddraw())) +@@ -283,6 +297,10 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) + ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); + if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice; + ++ hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_software_cb , &software_ok); ++ ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); ++ if (!software_ok) win_skip("RGB device not found, unable to check flags\n"); ++ + memset(&z_fmt, 0, sizeof(z_fmt)); + hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt); + if (FAILED(hr) || !z_fmt.dwSize) +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Device_Caps/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Device_Caps/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Device_Caps/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Device_Caps/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB device diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/0001-ddraw-Allow-size-and-format-conversions-in-IDirect3D.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/0001-ddraw-Allow-size-and-format-conversions-in-IDirect3D.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/0001-ddraw-Allow-size-and-format-conversions-in-IDirect3D.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/0001-ddraw-Allow-size-and-format-conversions-in-IDirect3D.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,17 +1,17 @@ -From f1ad7b7975ed611a4989986f35ea3695eca0f26c Mon Sep 17 00:00:00 2001 +From aee6d79ac93aecb6eb7927e42736609d0d473c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 30 May 2015 02:55:03 +0200 Subject: ddraw: Allow size and format conversions in IDirect3DTexture2::Load. --- - dlls/ddraw/surface.c | 147 ++++++++++++++++++++++++++------------------------- - 1 file changed, 76 insertions(+), 71 deletions(-) + dlls/ddraw/surface.c | 151 +++++++++++++++++++++++++++------------------------ + 1 file changed, 80 insertions(+), 71 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index 8a10eff..cb71a65 100644 +index 6a07cd7..cacf14c 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c -@@ -5062,6 +5062,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface) +@@ -5041,6 +5041,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface) return impl_from_IDirectDrawSurface7(next_level); } @@ -58,10 +58,22 @@ /***************************************************************************** * IDirect3DTexture2::Load * -@@ -5095,90 +5135,56 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu +@@ -5062,7 +5102,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu + { + struct ddraw_surface *dst_surface = impl_from_IDirect3DTexture2(iface); + struct ddraw_surface *src_surface = unsafe_impl_from_IDirect3DTexture2(src_texture); +- struct wined3d_resource *dst_resource, *src_resource; ++ RECT src_rect, dst_rect; + HRESULT hr; + + TRACE("iface %p, src_texture %p.\n", iface, src_texture); +@@ -5075,90 +5115,60 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu wined3d_mutex_lock(); +- dst_resource = wined3d_texture_get_resource(dst_surface->wined3d_texture); +- src_resource = wined3d_texture_get_resource(src_surface->wined3d_texture); +- - if (((src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) - != (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)) - || (src_surface->surface_desc.u2.dwMipMapCount != dst_surface->surface_desc.u2.dwMipMapCount)) @@ -143,37 +155,37 @@ + return E_FAIL; + } -- /* Copy the main memory texture into the surface that corresponds -- * to the OpenGL texture object. */ -- -- hr = wined3d_surface_map(src_surface->wined3d_surface, &src_map_desc, NULL, 0); -- if (FAILED(hr)) +- if (FAILED(hr = wined3d_resource_sub_resource_map(src_resource, +- src_surface->sub_resource_idx, &src_map_desc, NULL, 0))) - { - ERR("Failed to lock source surface, hr %#x.\n", hr); - wined3d_mutex_unlock(); - return D3DERR_TEXTURE_LOAD_FAILED; - } - -- hr = wined3d_surface_map(dst_surface->wined3d_surface, &dst_map_desc, NULL, 0); -- if (FAILED(hr)) +- if (FAILED(hr = wined3d_resource_sub_resource_map(dst_resource, +- dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0))) - { - ERR("Failed to lock destination surface, hr %#x.\n", hr); -- wined3d_surface_unmap(src_surface->wined3d_surface); +- wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx); - wined3d_mutex_unlock(); - return D3DERR_TEXTURE_LOAD_FAILED; - } -- ++ /* Suppress the ALLOCONLOAD flag */ ++ dst_surface->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD; + - if (dst_surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC) - memcpy(dst_map_desc.data, src_map_desc.data, src_surface->surface_desc.u1.dwLinearSize); - else - memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight); -+ /* Suppress the ALLOCONLOAD flag */ -+ dst_surface->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD; ++ SetRect(&src_rect, 0, 0, src_surface->surface_desc.dwWidth, src_surface->surface_desc.dwHeight); ++ SetRect(&dst_rect, 0, 0, dst_surface->surface_desc.dwWidth, dst_surface->surface_desc.dwHeight); -- wined3d_surface_unmap(src_surface->wined3d_surface); -- wined3d_surface_unmap(dst_surface->wined3d_surface); -+ hr = wined3d_surface_blt(dst_surface->wined3d_surface, NULL, src_surface->wined3d_surface, -+ NULL, 0, NULL, WINED3D_TEXF_LINEAR); +- wined3d_resource_sub_resource_unmap(dst_resource, dst_surface->sub_resource_idx); +- wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx); ++ hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx, &dst_rect, ++ src_surface->wined3d_texture, src_surface->sub_resource_idx, &src_rect, ++ 0, NULL, WINED3D_TEXF_LINEAR); + if (FAILED(hr)) + { + ERR("Failed to blit surface, hr %#x.\n", hr); @@ -182,7 +194,7 @@ } if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) -@@ -5191,12 +5197,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu +@@ -5171,12 +5181,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu else dst_surface = NULL; @@ -199,5 +211,5 @@ wined3d_mutex_unlock(); -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-IDirect3DTexture2_Load/definition 2016-02-08 20:07:32.000000000 +0000 @@ -1 +1,2 @@ Fixes: Fix scaling behaviour of images and mipmap levels in IDirect3DTexture2_Load (needed for example by Prezzie Hunt) +Depends: wined3d-resource_map diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,90 @@ +From 4227226984e3726aba1b0570db87679776842c5a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 7 Feb 2016 18:52:16 +0100 +Subject: Revert "ddraw: Use wined3d_texture_get_sub_resource() in + ddraw_surface7_Flip()." + +This reverts commit b1709522307a160a7c151f5293095a3c26ab998f. +--- + dlls/ddraw/surface.c | 6 +++--- + dlls/wined3d/surface.c | 7 +++++++ + dlls/wined3d/wined3d.spec | 1 + + include/wine/wined3d.h | 1 + + 4 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c +index f1ba858..a6fbceb 100644 +--- a/dlls/ddraw/surface.c ++++ b/dlls/ddraw/surface.c +@@ -1268,7 +1268,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 + wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); + wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); + dst_impl->wined3d_rtv = src_rtv; +- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); ++ wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); + dst_impl->wined3d_surface = src_impl->wined3d_surface; + prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); + wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); +@@ -1300,7 +1300,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 + wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); + wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); + dst_impl->wined3d_rtv = src_rtv; +- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); ++ wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); + dst_impl->wined3d_surface = src_impl->wined3d_surface; + prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); + wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); +@@ -1318,7 +1318,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 + wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, tmp_rtv, FALSE); + wined3d_rendertarget_view_set_parent(tmp_rtv, src_impl); + src_impl->wined3d_rtv = tmp_rtv; +- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(texture, 0), src_impl); ++ wined3d_resource_set_parent(wined3d_surface_get_resource(tmp), src_impl); + src_impl->wined3d_surface = tmp; + wined3d_resource_set_parent(wined3d_texture_get_resource(texture), ddraw_texture); + src_impl->wined3d_texture = texture; +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 2a36619..e6c6258 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1890,6 +1890,13 @@ void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) + return surface->resource.parent; + } + ++struct wined3d_resource * CDECL wined3d_surface_get_resource(struct wined3d_surface *surface) ++{ ++ TRACE("surface %p.\n", surface); ++ ++ return &surface->resource; ++} ++ + DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) + { + unsigned int alignment; +diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec +index 86d03f0..c07e0ca 100644 +--- a/dlls/wined3d/wined3d.spec ++++ b/dlls/wined3d/wined3d.spec +@@ -225,6 +225,7 @@ + @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) + @ cdecl wined3d_surface_get_parent(ptr) + @ cdecl wined3d_surface_get_pitch(ptr) ++@ cdecl wined3d_surface_get_resource(ptr) + @ cdecl wined3d_surface_set_overlay_position(ptr long long) + @ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr) + @ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr) +diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h +index 8f9d80a..1b13a20 100644 +--- a/include/wine/wined3d.h ++++ b/include/wine/wined3d.h +@@ -2477,6 +2477,7 @@ ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); + HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y); + void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); + DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); ++struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); + HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y); + HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect, + struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,64 @@ +From e70e6047539d266d0b7101e92ba789eed5cf9928 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 7 Feb 2016 18:52:49 +0100 +Subject: Revert "ddraw: Move the mip-level dimensions fix-up from + ddraw_surface_init() to ddraw_surface_create()." + +This reverts commit 7d45318aeac41e2efabb9ddfbf95ecbea103e67d. +--- + dlls/ddraw/surface.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c +index a6fbceb..923a935 100644 +--- a/dlls/ddraw/surface.c ++++ b/dlls/ddraw/surface.c +@@ -5643,8 +5643,8 @@ static HRESULT CDECL ddraw_reset_enum_callback(struct wined3d_resource *resource + HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, + struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) + { +- struct wined3d_resource_desc wined3d_desc, wined3d_mip_desc; + struct ddraw_surface *root, *mip, **attach; ++ struct wined3d_resource_desc wined3d_desc; + struct wined3d_texture *wined3d_texture; + struct wined3d_resource *resource; + struct wined3d_display_mode mode; +@@ -6103,17 +6103,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ + mip_desc = &mip->surface_desc; + + if (j) +- { +- wined3d_resource_get_desc(resource, &wined3d_mip_desc); +- mip_desc->dwWidth = wined3d_mip_desc.width; +- mip_desc->dwHeight = wined3d_mip_desc.height; +- + mip_desc->ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL; +- } + else +- { + mip_desc->ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL; +- } + + if (mip_desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) + { +@@ -6241,6 +6233,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, + { + struct ddraw_texture *texture = wined3d_texture_get_parent(wined3d_texture); + DDSURFACEDESC2 *desc = &surface->surface_desc; ++ struct wined3d_resource_desc wined3d_desc; + unsigned int version = texture->version; + + surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl; +@@ -6272,6 +6265,9 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, + } + + *desc = texture->surface_desc; ++ wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc); ++ desc->dwWidth = wined3d_desc.width; ++ desc->dwHeight = wined3d_desc.height; + surface->first_attached = surface; + + if (format_is_compressed(&desc->u4.ddpfPixelFormat)) +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ddraw-Revert_Surface_Init/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [40094] Revert patches to move mip-level dimensions fixup (causes regressions in multiple games) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/dxdiagn-Display_Information/0001-dxdiagn-Add-several-more-fields-for-DisplayDevices.patch wine-staging-1.9.3~ubuntu12.04.1/patches/dxdiagn-Display_Information/0001-dxdiagn-Add-several-more-fields-for-DisplayDevices.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/dxdiagn-Display_Information/0001-dxdiagn-Add-several-more-fields-for-DisplayDevices.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/dxdiagn-Display_Information/0001-dxdiagn-Add-several-more-fields-for-DisplayDevices.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,238 @@ +From 90a30be3a8ef4132092e26c05695521449e68d2c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 17:48:00 +0100 +Subject: dxdiagn: Add several more fields for DisplayDevices. + +--- + dlls/dxdiagn/provider.c | 159 +++++++++++++++++++++++++++++++++++++++++ + dlls/dxdiagn/tests/container.c | 2 + + 2 files changed, 161 insertions(+) + +diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c +index 5665d01..4f964ad 100644 +--- a/dlls/dxdiagn/provider.c ++++ b/dlls/dxdiagn/provider.c +@@ -60,6 +60,8 @@ static const WCHAR dwHeight[] = {'d','w','H','e','i','g','h','t',0}; + static const WCHAR dwBpp[] = {'d','w','B','p','p',0}; + static const WCHAR szDisplayMemoryLocalized[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szDisplayMemoryEnglish[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','E','n','g','l','i','s','h',0}; ++static const WCHAR szDisplayModeLocalized[] = {'s','z','D','i','s','p','l','a','y','M','o','d','e','L','o','c','a','l','i','z','e','d',0}; ++static const WCHAR szDisplayModeEnglish[] = {'s','z','D','i','s','p','l','a','y','M','o','d','e','E','n','g','l','i','s','h',0}; + static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0}; + static const WCHAR szDriverVersion[] = {'s','z','D','r','i','v','e','r','V','e','r','s','i','o','n',0}; + static const WCHAR szSubSysId[] = {'s','z','S','u','b','S','y','s','I','d',0}; +@@ -69,6 +71,30 @@ static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t',' + static const WCHAR szChipType[] = {'s','z','C','h','i','p','T','y','p','e',0}; + static const WCHAR szDACType[] = {'s','z','D','A','C','T','y','p','e',0}; + static const WCHAR szRevision[] = {'s','z','R','e','v','i','s','i','o','n',0}; ++static const WCHAR szMonitorName[] = {'s','z','M','o','n','i','t','o','r','N','a','m','e',0}; ++static const WCHAR szMonitorMaxRes[] = {'s','z','M','o','n','i','t','o','r','M','a','x','R','e','s',0}; ++static const WCHAR szDriverAttributes[] = {'s','z','D','r','i','v','e','r','A','t','t','r','i','b','u','t','e','s',0}; ++static const WCHAR szDriverLanguageEnglish[] = {'s','z','D','r','i','v','e','r','L','a','n','g','u','a','g','e','E','n','g','l','i','s','h',0}; ++static const WCHAR szDriverLanguageLocalized[] = {'s','z','D','r','i','v','e','r','L','a','n','g','u','a','g','e','L','o','c','a','l','i','z','e','d',0}; ++static const WCHAR szDriverDateEnglish[] = {'s','z','D','r','i','v','e','r','D','a','t','e','E','n','g','l','i','s','h',0}; ++static const WCHAR szDriverDateLocalized[] = {'s','z','D','r','i','v','e','r','D','a','t','e','L','o','c','a','l','i','z','e','d',0}; ++static const WCHAR lDriverSize[] = {'l','D','r','i','v','e','r','S','i','z','e',0}; ++static const WCHAR szMiniVdd[] = {'s','z','M','i','n','i','V','d','d',0}; ++static const WCHAR szMiniVddDateLocalized[] = {'s','z','M','i','n','i','V','d','d','D','a','t','e','L','o','c','a','l','i','z','e','d',0}; ++static const WCHAR szMiniVddDateEnglish[] = {'s','z','M','i','n','i','V','d','d','D','a','t','e','E','n','g','l','i','s','h',0}; ++static const WCHAR lMiniVddSize[] = {'l','M','i','n','i','V','d','d','S','i','z','e',0}; ++static const WCHAR szVdd[] = {'s','z','V','d','d',0}; ++static const WCHAR bCanRenderWindow[] = {'b','C','a','n','R','e','n','d','e','r','W','i','n','d','o','w',0}; ++static const WCHAR bDriverBeta[] = {'b','D','r','i','v','e','r','B','e','t','a',0}; ++static const WCHAR bDriverDebug[] = {'b','D','r','i','v','e','r','D','e','b','u','g',0}; ++static const WCHAR bDriverSigned[] = {'b','D','r','i','v','e','r','S','i','g','n','e','d',0}; ++static const WCHAR bDriverSignedValid[] = {'b','D','r','i','v','e','r','S','i','g','n','e','d','V','a','l','i','d',0}; ++static const WCHAR szDriverSignDate[] = {'s','z','D','r','i','v','e','r','S','i','g','n','D','a','t','e',0}; ++static const WCHAR dwDDIVersion[] = {'d','w','D','D','I','V','e','r','s','i','o','n',0}; ++static const WCHAR szDDIVersionEnglish[] = {'s','z','D','D','I','V','e','r','s','i','o','n','E','n','g','l','i','s','h',0}; ++static const WCHAR szDDIVersionLocalized[] = {'s','z','D','D','I','V','e','r','s','i','o','n','L','o','c','a','l','i','z','e','d',0}; ++static const WCHAR iAdapter[] = {'i','A','d','a','p','t','e','r',0}; ++static const WCHAR dwWHQLLevel[] = {'d','w','W','H','Q','L','L','e','v','e','l',0}; + + struct IDxDiagProviderImpl + { +@@ -326,6 +352,23 @@ static inline HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, con + return S_OK; + } + ++static inline HRESULT add_i4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, LONG data) ++{ ++ IDxDiagContainerImpl_Property *prop; ++ ++ prop = allocate_property_information(propName); ++ if (!prop) ++ return E_OUTOFMEMORY; ++ ++ V_VT(&prop->vProp) = VT_I4; ++ V_I4(&prop->vProp) = data; ++ ++ list_add_tail(&node->properties, &prop->entry); ++ ++node->nProperties; ++ ++ return S_OK; ++} ++ + static inline HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data) + { + IDxDiagContainerImpl_Property *prop; +@@ -925,6 +968,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bNoHardware[] = {'b','N','o','H','a','r','d','w','a','r','e',0}; ++ static const WCHAR mode_fmtW[] = {'%','d',' ','x',' ','%','d',' ','(','%','d',' ','b','i','t',')',' ','(','%','d','H','z',')',0}; ++ static const WCHAR gernericPNPMonitorW[] = {'G','e','n','e','r','i','c',' ','P','n','P',' ','M','o','n','i','t','o','r',0}; ++ static const WCHAR failedToGetParameterW[] = {'F','a','i','l','e','d',' ','t','o',' ','g','e','t',' ','p','a','r','a','m','e','t','e','r',0}; ++ static const WCHAR driverAttributesW[] = {'F','i','n','a','l',' ','R','e','t','a','i','l',0}; ++ static const WCHAR englishW[] = {'E','n','g','l','i','s','h',0}; ++ static const WCHAR driverDateEnglishW[] = {'1','/','1','/','2','0','1','6',' ','1','0',':','0','0',':','0','0',0}; ++ static const WCHAR driverDateLocalW[] = {'1','/','1','/','2','0','1','6',' ','1','0',':','0','0',':','0','0',' ','A','M',0}; ++ static const WCHAR naW[] = {'n','/','a',0}; ++ static const WCHAR ddi11W[] = {'1','1',0}; + + D3DADAPTER_IDENTIFIER9 adapter_info; + D3DDISPLAYMODE adapter_mode; +@@ -1021,6 +1073,17 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node + hr = add_ui4_property(display_adapter, dwBpp, depth_for_pixelformat(adapter_mode.Format)); + if (FAILED(hr)) + goto cleanup; ++ ++ snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), mode_fmtW, adapter_mode.Width, adapter_mode.Height, ++ depth_for_pixelformat(adapter_mode.Format), adapter_mode.RefreshRate); ++ ++ hr = add_bstr_property(display_adapter, szDisplayModeLocalized, buffer); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDisplayModeEnglish, buffer); ++ if (FAILED(hr)) ++ goto cleanup; + } + + hr = add_bstr_property(display_adapter, szKeyDeviceKey, szEmpty); +@@ -1074,6 +1137,102 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node + hr = add_bool_property(display_adapter, bNoHardware, FALSE); + if (FAILED(hr)) + goto cleanup; ++ ++ hr = add_bool_property(display_adapter, bCanRenderWindow, TRUE); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szMonitorName, gernericPNPMonitorW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szMonitorMaxRes, failedToGetParameterW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverAttributes, driverAttributesW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverLanguageEnglish, englishW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverLanguageLocalized, englishW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverDateEnglish, driverDateEnglishW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverDateLocalized, driverDateLocalW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_i4_property(display_adapter, lDriverSize, 10 * 1024 * 1024); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szMiniVdd, naW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szMiniVddDateLocalized, naW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szMiniVddDateEnglish, naW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_i4_property(display_adapter, lMiniVddSize, 0); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szVdd, naW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bool_property(display_adapter, bDriverBeta, FALSE); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bool_property(display_adapter, bDriverDebug, FALSE); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bool_property(display_adapter, bDriverSigned, TRUE); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bool_property(display_adapter, bDriverSignedValid, TRUE); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDriverSignDate, naW); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_ui4_property(display_adapter, dwDDIVersion, 11); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDDIVersionEnglish, ddi11W); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_bstr_property(display_adapter, szDDIVersionLocalized, ddi11W); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_ui4_property(display_adapter, iAdapter, index); ++ if (FAILED(hr)) ++ goto cleanup; ++ ++ hr = add_ui4_property(display_adapter, dwWHQLLevel, 0); ++ if (FAILED(hr)) ++ goto cleanup; + } + + hr = S_OK; +diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c +index 5bc5161..e5afba7 100644 +--- a/dlls/dxdiagn/tests/container.c ++++ b/dlls/dxdiagn/tests/container.c +@@ -942,6 +942,7 @@ static void test_DxDiag_DisplayDevices(void) + static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0}; + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; ++ static const WCHAR iAdapter[] = {'i','A','d','a','p','t','e','r',0}; + + static const struct property_test property_tests[] = + { +@@ -966,6 +967,7 @@ static void test_DxDiag_DisplayDevices(void) + {b3DAccelerationExists, VT_BOOL}, + {b3DAccelerationEnabled, VT_BOOL}, + {bDDAccelerationEnabled, VT_BOOL}, ++ {iAdapter, VT_UI4}, + }; + + IDxDiagContainer *display_cont = NULL; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/dxdiagn-Display_Information/definition wine-staging-1.9.3~ubuntu12.04.1/patches/dxdiagn-Display_Information/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/dxdiagn-Display_Information/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/dxdiagn-Display_Information/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [34686] Return additional properties for display devices in dxdiagn diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/gitapply.sh wine-staging-1.9.3~ubuntu12.04.1/patches/gitapply.sh --- wine-staging-1.9.2~ubuntu12.04.1/patches/gitapply.sh 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/gitapply.sh 2016-02-08 20:07:32.000000000 +0000 @@ -2,7 +2,7 @@ # # Wrapper to apply binary patches without git. # -# Copyright (C) 2014-2015 Sebastian Lackner +# Copyright (C) 2014-2016 Sebastian Lackner # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -237,7 +237,7 @@ BEGIN{ ofs=1; } -!/^(--- |\+\+\+ |old |new |copy |rename |similarity |index |GIT |literal |delta )/{ +!/^(--- |\+\+\+ |old |deleted |new |copy |rename |similarity |index |GIT |literal |delta )/{ ofs=0; exit 0; } END{ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -From 351e216da1c1325ec354183ebf027b09b3d008c7 Mon Sep 17 00:00:00 2001 -From: Alex Henrie -Date: Sat, 19 Sep 2015 12:58:37 +0200 -Subject: kernel32: Set error if dstlen < 0 in codepage conversion functions - ---- - dlls/kernel32/locale.c | 4 ++-- - dlls/kernel32/tests/codepage.c | 48 +++++++++++++++++++++++++----------------- - 2 files changed, 31 insertions(+), 21 deletions(-) - -diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c -index c0a66ef..6ede521 100644 ---- a/dlls/kernel32/locale.c -+++ b/dlls/kernel32/locale.c -@@ -2125,7 +2125,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen, - const union cptable *table; - int ret; - -- if (!src || !srclen || (!dst && dstlen)) -+ if (!src || !srclen || (!dst && dstlen) || dstlen < 0) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return 0; -@@ -2341,7 +2341,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, - const union cptable *table; - int ret, used_tmp; - -- if (!src || !srclen || (!dst && dstlen)) -+ if (!src || !srclen || (!dst && dstlen) || dstlen < 0) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return 0; -diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c -index 54f62ae..6718a3b 100644 ---- a/dlls/kernel32/tests/codepage.c -+++ b/dlls/kernel32/tests/codepage.c -@@ -28,6 +28,7 @@ - #include "winbase.h" - #include "winnls.h" - -+static const char foobarA[] = "foobar"; - static const WCHAR foobarW[] = {'f','o','o','b','a','r',0}; - - static void test_destination_buffer(void) -@@ -144,48 +145,57 @@ static void test_negative_source_length(void) - static void test_negative_dest_length(void) - { - int len, i; -- static char buf[LONGBUFLEN]; -+ static WCHAR bufW[LONGBUFLEN]; -+ static char bufA[LONGBUFLEN]; - static WCHAR originalW[LONGBUFLEN]; - static char originalA[LONGBUFLEN]; - DWORD theError; - - /* Test return on -1 dest length */ - SetLastError( 0xdeadbeef ); -- memset(buf,'x',sizeof(buf)); -- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1, NULL, NULL); -- todo_wine { -- ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -- "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError()); -- } -+ memset(bufA,'x',sizeof(bufA)); -+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1, NULL, NULL); -+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -+ "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError()); -+ -+ SetLastError( 0xdeadbeef ); -+ memset(bufW,'x',sizeof(bufW)); -+ len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1, bufW, -1); -+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -+ "MultiByteToWideChar(destlen -1): len=%d error=%x\n", len, GetLastError()); - - /* Test return on -1000 dest length */ - SetLastError( 0xdeadbeef ); -- memset(buf,'x',sizeof(buf)); -- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1000, NULL, NULL); -- todo_wine { -- ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -- "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError()); -- } -+ memset(bufA,'x',sizeof(bufA)); -+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1000, NULL, NULL); -+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -+ "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError()); -+ -+ SetLastError( 0xdeadbeef ); -+ memset(bufW,'x',sizeof(bufW)); -+ len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1000, bufW, -1); -+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, -+ "MultiByteToWideChar(destlen -1000): len=%d error=%x\n", len, GetLastError()); - - /* Test return on INT_MAX dest length */ - SetLastError( 0xdeadbeef ); -- memset(buf,'x',sizeof(buf)); -- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, INT_MAX, NULL, NULL); -- ok(len == 7 && !lstrcmpA(buf, "foobar") && GetLastError() == 0xdeadbeef, -+ memset(bufA,'x',sizeof(bufA)); -+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, INT_MAX, NULL, NULL); -+ ok(len == 7 && !lstrcmpA(bufA, "foobar") && GetLastError() == 0xdeadbeef, - "WideCharToMultiByte(destlen INT_MAX): len=%d error=%x\n", len, GetLastError()); - - /* Test return on INT_MAX dest length and very long input */ - SetLastError( 0xdeadbeef ); -- memset(buf,'x',sizeof(buf)); -+ memset(bufA,'x',sizeof(bufA)); - for (i=0; i < LONGBUFLEN - 1; i++) { - originalW[i] = 'Q'; - originalA[i] = 'Q'; - } - originalW[LONGBUFLEN-1] = 0; - originalA[LONGBUFLEN-1] = 0; -- len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, buf, INT_MAX, NULL, NULL); -+ len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, bufA, INT_MAX, NULL, NULL); - theError = GetLastError(); -- ok(len == LONGBUFLEN && !lstrcmpA(buf, originalA) && theError == 0xdeadbeef, -+ ok(len == LONGBUFLEN && !lstrcmpA(bufA, originalA) && theError == 0xdeadbeef, - "WideCharToMultiByte(srclen %d, destlen INT_MAX): len %d error=%x\n", LONGBUFLEN, len, theError); - - } --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/definition wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Codepage_Conversion/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Codepage conversion should fail when destination length is < 0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/0001-kernel32-Strip-invalid-characters-from-mask-in-FindF.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/0001-kernel32-Strip-invalid-characters-from-mask-in-FindF.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/0001-kernel32-Strip-invalid-characters-from-mask-in-FindF.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/0001-kernel32-Strip-invalid-characters-from-mask-in-FindF.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,49 @@ +From 07791ffe43d1fda2618994f98986ab5e9cbf3c97 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 18:31:25 +0100 +Subject: kernel32: Strip invalid characters from mask in FindFirstFileExW. + +--- + dlls/kernel32/file.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c +index b6dba6a..3297f4b 100644 +--- a/dlls/kernel32/file.c ++++ b/dlls/kernel32/file.c +@@ -2009,12 +2009,32 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level, + } + else + { ++ static const WCHAR invalidW[] = { '<', '>', '\"', 0 }; ++ static const WCHAR wildcardW[] = { '*', 0 }; ++ DWORD mask_len; ++ + if (!RtlCreateUnicodeString( &info->mask, mask )) + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + goto error; + } + ++ /* strip invalid characters from mask */ ++ mask_len = info->mask.Length / sizeof(WCHAR); ++ while (mask_len && strchrW(invalidW, mask[mask_len - 1])) ++ mask_len--; ++ ++ if (!mask_len) ++ { ++ strcpyW( info->mask.Buffer, wildcardW ); ++ info->mask.Length = strlenW(wildcardW) * sizeof(WCHAR); ++ } ++ else ++ { ++ info->mask.Buffer[mask_len] = 0; ++ info->mask.Length = mask_len * sizeof(WCHAR); ++ } ++ + /* truncate dir name before mask */ + *mask = 0; + nt_name.Length = (mask - nt_name.Buffer) * sizeof(WCHAR); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/0002-kernel32-tests-Add-tests-for-FindFirstFileA-with-inv.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/0002-kernel32-tests-Add-tests-for-FindFirstFileA-with-inv.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/0002-kernel32-tests-Add-tests-for-FindFirstFileA-with-inv.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/0002-kernel32-tests-Add-tests-for-FindFirstFileA-with-inv.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,135 @@ +From 29a12264fdd49cdb5b815064c2767e7fc349133b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 18:32:09 +0100 +Subject: kernel32/tests: Add tests for FindFirstFileA with invalid characters. + +Includes testcases by Vincent Pelletier. +--- + dlls/kernel32/tests/file.c | 100 ++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 99 insertions(+), 1 deletion(-) + +diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c +index 53dc04b..a7ac09c 100644 +--- a/dlls/kernel32/tests/file.c ++++ b/dlls/kernel32/tests/file.c +@@ -2517,11 +2517,85 @@ static char get_windows_drive(void) + return windowsdir[0]; + } + ++struct ++{ ++ const char *path; ++ BOOL expected; ++} ++static const invalid_char_tests[] = ++{ ++ { "./test-dir", TRUE }, ++ { "./test-dir/", FALSE }, ++ { ".\\test-dir", TRUE }, ++ { ".\\test-dir\\", FALSE }, ++ { "/>test-dir", FALSE }, ++ { "<\"test->dir", FALSE }, ++ { "dir", FALSE }, ++ { ">dir", FALSE }, ++ { ">>test-dir", FALSE }, ++ { ">test->dir", FALSE }, ++ { ">test-dir", FALSE }, ++ { "\"test-dir\"", FALSE }, ++ { "\"test-file\"", FALSE }, ++ { "test-/>dir", FALSE }, ++ { "test-dir/", FALSE }, ++ { "test-dir//", FALSE }, ++ { "test-dir/:", FALSE }, ++ { "test-dir/<", TRUE }, ++ { "test-dir/>", TRUE }, ++ { "test-dir/\"", TRUE }, ++ { "test-dir/\\", FALSE }, ++ { "test-dir/|", FALSE }, ++ { "test-dir<", TRUE }, ++ { "test-dir<><>\"\"\"\"<<<>", TRUE }, ++ { "test-dir<>", TRUE }, ++ { "test-dir<\"", TRUE }, ++ { "test-dir>", TRUE }, ++ { "test-dir>/", FALSE }, ++ { "test-dir><", TRUE }, ++ { "test-dir>>", TRUE }, ++ { "test-dir>\"", TRUE }, ++ { "test-dir\"", TRUE }, ++ { "test-dir\"/", FALSE }, ++ { "test-dir\"<", TRUE }, ++ { "test-dir\">", TRUE }, ++ { "test-dir\"\"", TRUE }, ++ { "test-dir\"\"\"\"\"", TRUE }, ++ { "test-dir\\", FALSE }, ++ { "test-dir\\/", FALSE }, ++ { "test-dir\\<", TRUE }, ++ { "test-dir\\>", TRUE }, ++ { "test-dir\\\"", TRUE }, ++ { "test-dir\\\\", FALSE }, ++ { "test-file/", FALSE }, ++ { "test-file/<", FALSE }, ++ { "test-file/>", FALSE }, ++ { "test-file/\"", FALSE }, ++ { "test-file<", TRUE }, ++ { "test-file<<", TRUE }, ++ { "test-file<>", TRUE }, ++ { "test-file<\"", TRUE }, ++ { "test-file>", TRUE }, ++ { "test-file><", TRUE }, ++ { "test-file>>", TRUE }, ++ { "test-file>\"", TRUE }, ++ { "test-file\"", TRUE }, ++ { "test-file\"<", TRUE }, ++ { "test-file\">", TRUE }, ++ { "test-file\"\"", TRUE }, ++ { "test-file\\", FALSE }, ++ { "test-file\\<", FALSE }, ++ { "test-file\\>", FALSE }, ++ { "test-file\\\"", FALSE }, ++}; ++ + static void test_FindFirstFileA(void) + { + HANDLE handle; + WIN32_FIND_DATAA data; +- int err; ++ int err, i; + char buffer[5] = "C:\\"; + char buffer2[100]; + char nonexistent[MAX_PATH]; +@@ -2689,6 +2763,30 @@ static void test_FindFirstFileA(void) + err = GetLastError(); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); + ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); ++ ++ /* try FindFirstFileA with invalid characters */ ++ CreateDirectoryA("test-dir", NULL); ++ _lclose(_lcreat("test-file", 0)); ++ ++ for (i = 0; i < sizeof(invalid_char_tests) / sizeof(invalid_char_tests[0]); i++) ++ { ++ handle = FindFirstFileA(invalid_char_tests[i].path, &data); ++ if (invalid_char_tests[i].expected) ++ { ++ ok(handle != INVALID_HANDLE_VALUE, "FindFirstFileA on %s should succeed\n", ++ invalid_char_tests[i].path); ++ } ++ else ++ { ++ ok(handle == INVALID_HANDLE_VALUE, "FindFirstFileA on %s should fail\n", ++ invalid_char_tests[i].path); ++ } ++ if (handle != INVALID_HANDLE_VALUE) ++ FindClose(handle); ++ } ++ ++ DeleteFileA("test-file"); ++ RemoveDirectoryA("test-dir"); + } + + static void test_FindNextFileA(void) +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/definition wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-FindFirstFile/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-FindFirstFile/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [22635] Strip invalid characters from mask in FindFirstFileExW diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0005-server-Show-warning-if-message-mode-is-not-supported.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0005-server-Show-warning-if-message-mode-is-not-supported.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0005-server-Show-warning-if-message-mode-is-not-supported.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0005-server-Show-warning-if-message-mode-is-not-supported.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 47754a35cfc710d9900a1f25cde3c6d0a62f1a38 Mon Sep 17 00:00:00 2001 +From 630edc66479db789c7541e2c356a41090524d838 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 4 Aug 2014 00:29:26 +0200 Subject: server: Show warning if message mode is not supported. @@ -13,10 +13,10 @@ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 4cac2ca..d585d6c 100644 +index 3883e5a..9e98f36 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c -@@ -3506,6 +3506,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, +@@ -3507,6 +3507,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, NTSTATUS status; data_size_t len; struct object_attributes *objattr; @@ -24,7 +24,7 @@ TRACE("(%p %x %s %p %x %d %x %d %d %d %d %d %d %p)\n", handle, access, debugstr_w(attr->ObjectName->Buffer), iosb, sharing, dispo, -@@ -3518,15 +3519,16 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, +@@ -3521,15 +3522,16 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, if ((status = alloc_object_attributes( attr, &objattr, &len ))) return status; @@ -45,7 +45,7 @@ req->maxinstances = max_inst; req->outsize = outbound_quota; req->insize = inbound_quota; -@@ -3534,9 +3536,13 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, +@@ -3537,9 +3539,13 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, wine_server_add_data( req, objattr, len ); status = wine_server_call( req ); if (!status) *handle = wine_server_ptr_handle( reply->handle ); @@ -60,23 +60,23 @@ return status; } diff --git a/server/named_pipe.c b/server/named_pipe.c -index 2621642..51650cd 100644 +index 7a97e35..ee6008c 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -939,6 +939,8 @@ DECL_HANDLER(create_named_pipe) +@@ -934,6 +934,8 @@ DECL_HANDLER(create_named_pipe) return; } + reply->flags = req->flags & ~(NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ); + - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; - + if (!name.len) /* pipes need a root directory even without a name */ + { + if (!objattr->rootdir) diff --git a/server/protocol.def b/server/protocol.def -index 4becb8f..9facc59 100644 +index a5a45eb..2d87f03 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -2376,6 +2376,7 @@ enum message_type +@@ -2370,6 +2370,7 @@ enum message_type unsigned int flags; VARARG(objattr,object_attributes); /* object attributes */ @REPLY @@ -85,5 +85,5 @@ @END -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0009-server-Use-SOCK_SEQPACKET-socket-in-combination-with.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0009-server-Use-SOCK_SEQPACKET-socket-in-combination-with.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0009-server-Use-SOCK_SEQPACKET-socket-in-combination-with.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0009-server-Use-SOCK_SEQPACKET-socket-in-combination-with.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 504a202bba0312a71c4e5ea662e4a498c46be82a Mon Sep 17 00:00:00 2001 +From 6f7aea78c09e8c1ef0e93aef214ac28fe223d544 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 4 Aug 2014 05:01:11 +0200 Subject: server: Use SOCK_SEQPACKET socket in combination with SO_PEEK_OFF to @@ -149,7 +149,7 @@ ret = RpcReadFile(hnp, ibuf + 8, sizeof(ibuf), &readden, NULL); ok(ret, "RpcReadFile 10\n"); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 5e3a9e1..dfb7812 100644 +index eef36ad..420984c 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -91,6 +91,10 @@ @@ -163,7 +163,7 @@ #include "ntstatus.h" #define WIN32_NO_STATUS #define NONAMELESSUNION -@@ -508,18 +512,57 @@ static NTSTATUS unix_fd_avail(int fd, int *avail) +@@ -509,18 +513,57 @@ static NTSTATUS unix_fd_avail(int fd, int *avail) STATUS_PIPE_BROKEN : STATUS_SUCCESS; } @@ -224,7 +224,7 @@ { if (*total) return STATUS_SUCCESS; -@@ -535,16 +578,17 @@ static NTSTATUS read_unix_fd(int fd, char *buf, ULONG *total, ULONG length, +@@ -536,16 +579,17 @@ static NTSTATUS read_unix_fd(int fd, char *buf, ULONG *total, ULONG length, return STATUS_PIPE_BROKEN; } } @@ -246,7 +246,7 @@ } /*********************************************************************** -@@ -1102,13 +1146,14 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap +@@ -1103,13 +1147,14 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap /* helper function for NtWriteFile and FILE_AsyncWriteService */ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG length, enum server_fd_type type) { @@ -262,7 +262,7 @@ if (result >= 0) { *total += result; -@@ -1117,6 +1162,17 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt +@@ -1118,6 +1163,17 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt else if (type != FD_TYPE_FILE) /* no async I/O on regular files */ return STATUS_PENDING; } @@ -280,7 +280,7 @@ else if (errno != EINTR) { if (errno == EAGAIN) -@@ -1707,20 +1763,40 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc +@@ -1708,20 +1764,40 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc status = unix_fd_avail( fd, &avail ); if (!status) { @@ -329,7 +329,7 @@ if (needs_close) close( fd ); } diff --git a/server/named_pipe.c b/server/named_pipe.c -index 51650cd..670eafe 100644 +index 3e1eff0..3d9917f 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -42,6 +42,10 @@ @@ -351,8 +351,8 @@ #include "handle.h" #include "thread.h" #include "request.h" -@@ -787,14 +792,43 @@ static struct pipe_server *find_available_server( struct named_pipe *pipe ) - return NULL; +@@ -799,14 +804,43 @@ static int named_pipe_link_name( struct object *obj, struct object_name *name, s + return 1; } +/* check if message mode named pipes are supported */ @@ -396,7 +396,7 @@ if (!(server = find_available_server( pipe ))) { -@@ -813,7 +847,10 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc +@@ -825,7 +859,10 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc if ((client = create_pipe_client( options, pipe->flags ))) { @@ -408,7 +408,7 @@ { assert( !server->fd ); -@@ -823,32 +860,55 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc +@@ -835,32 +872,55 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc if (is_overlapped( options )) fcntl( fds[1], F_SETFL, O_NONBLOCK ); if (is_overlapped( server->options )) fcntl( fds[0], F_SETFL, O_NONBLOCK ); @@ -483,16 +483,16 @@ release_object( client ); client = NULL; } -@@ -939,7 +999,7 @@ DECL_HANDLER(create_named_pipe) +@@ -951,7 +1011,7 @@ DECL_HANDLER(create_named_pipe) return; } - reply->flags = req->flags & ~(NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ); + reply->flags = messagemode_flags(req->flags); - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; -@@ -1035,6 +1095,9 @@ DECL_HANDLER(set_named_pipe_info) + if (!name.len) /* pipes need a root directory even without a name */ + { +@@ -1054,6 +1114,9 @@ DECL_HANDLER(set_named_pipe_info) { struct pipe_server *server; struct pipe_client *client = NULL; @@ -502,7 +502,7 @@ server = get_pipe_server_obj( current->process, req->handle, FILE_WRITE_ATTRIBUTES ); if (!server) -@@ -1061,10 +1124,20 @@ DECL_HANDLER(set_named_pipe_info) +@@ -1080,10 +1143,20 @@ DECL_HANDLER(set_named_pipe_info) else if (client) { client->pipe_flags = server->pipe->flags | req->flags; @@ -524,7 +524,7 @@ if (client) diff --git a/server/sock.c b/server/sock.c -index 57d3d93..ede97d9 100644 +index a11964f..0a2e079 100644 --- a/server/sock.c +++ b/server/sock.c @@ -61,6 +61,7 @@ @@ -543,7 +543,7 @@ static const struct object_ops sock_ops = { -@@ -956,7 +956,7 @@ static int sock_get_ntstatus( int err ) +@@ -958,7 +958,7 @@ static int sock_get_ntstatus( int err ) } /* set the last error depending on errno */ @@ -585,5 +585,5 @@ + +#endif /* __WINE_SERVER_SOCK_H */ -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0020-server-Return-correct-error-codes-for-NtWriteFile-wh.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0020-server-Return-correct-error-codes-for-NtWriteFile-wh.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-Named_Pipe/0020-server-Return-correct-error-codes-for-NtWriteFile-wh.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-Named_Pipe/0020-server-Return-correct-error-codes-for-NtWriteFile-wh.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 82f162911442f78bae91fe8655cd2f4a33f638f7 Mon Sep 17 00:00:00 2001 +From f31780d39178e9e4aa98962d04a51e4f7440757d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 6 Jun 2015 01:21:05 +0200 Subject: server: Return correct error codes for NtWriteFile when pipes are @@ -25,10 +25,10 @@ CloseHandle(hfile); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 8e6dc12..15a957d 100644 +index a925899..af4b64e 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c -@@ -1210,6 +1210,9 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt +@@ -1211,6 +1211,9 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt return STATUS_SUCCESS; else if (errno == EFAULT) return STATUS_INVALID_USER_BUFFER; @@ -39,10 +39,10 @@ } } diff --git a/server/named_pipe.c b/server/named_pipe.c -index 2297976..1759b00 100644 +index 55c0db7..e4dbf26 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -145,6 +145,7 @@ static const struct object_ops named_pipe_ops = +@@ -147,6 +147,7 @@ static const struct object_ops named_pipe_ops = /* server end functions */ static void pipe_server_dump( struct object *obj, int verbose ); static struct fd *pipe_server_get_fd( struct object *obj ); @@ -50,8 +50,8 @@ static void pipe_server_destroy( struct object *obj); static obj_handle_t pipe_server_flush( struct fd *fd, const async_data_t *async, int blocking ); static enum server_fd_type pipe_server_get_fd_type( struct fd *fd ); -@@ -168,7 +169,7 @@ static const struct object_ops pipe_server_ops = - no_lookup_name, /* lookup_name */ +@@ -172,7 +173,7 @@ static const struct object_ops pipe_server_ops = + NULL, /* unlink_name */ no_open_file, /* open_file */ no_alloc_handle, /* alloc_handle */ - fd_close_handle, /* close_handle */ @@ -59,7 +59,7 @@ pipe_server_destroy /* destroy */ }; -@@ -190,6 +191,7 @@ static const struct fd_ops pipe_server_fd_ops = +@@ -194,6 +195,7 @@ static const struct fd_ops pipe_server_fd_ops = static void pipe_client_dump( struct object *obj, int verbose ); static int pipe_client_signaled( struct object *obj, struct wait_queue_entry *entry ); static struct fd *pipe_client_get_fd( struct object *obj ); @@ -67,8 +67,8 @@ static void pipe_client_destroy( struct object *obj ); static obj_handle_t pipe_client_flush( struct fd *fd, const async_data_t *async, int blocking ); static enum server_fd_type pipe_client_get_fd_type( struct fd *fd ); -@@ -211,7 +213,7 @@ static const struct object_ops pipe_client_ops = - no_lookup_name, /* lookup_name */ +@@ -217,7 +219,7 @@ static const struct object_ops pipe_client_ops = + NULL, /* unlink_name */ no_open_file, /* open_file */ no_alloc_handle, /* alloc_handle */ - fd_close_handle, /* close_handle */ @@ -76,7 +76,7 @@ pipe_client_destroy /* destroy */ }; -@@ -276,6 +278,8 @@ static const struct fd_ops named_pipe_device_fd_ops = +@@ -284,6 +286,8 @@ static const struct fd_ops named_pipe_device_fd_ops = default_fd_cancel_async /* cancel_async */ }; @@ -85,7 +85,7 @@ static void named_pipe_dump( struct object *obj, int verbose ) { fputs( "Named pipe\n", stderr ); -@@ -386,6 +390,23 @@ static void do_disconnect( struct pipe_server *server ) +@@ -394,6 +398,23 @@ static void do_disconnect( struct pipe_server *server ) server->fd = NULL; } @@ -109,7 +109,7 @@ static void pipe_server_destroy( struct object *obj) { struct pipe_server *server = (struct pipe_server *)obj; -@@ -412,6 +433,24 @@ static void pipe_server_destroy( struct object *obj) +@@ -420,6 +441,24 @@ static void pipe_server_destroy( struct object *obj) release_object( server->pipe ); } @@ -135,7 +135,7 @@ { struct pipe_client *client = (struct pipe_client *)obj; diff --git a/server/protocol.def b/server/protocol.def -index e6e52de..4a24595 100644 +index 2d87f03..1dc70d4 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2378,6 +2378,7 @@ enum message_type @@ -147,5 +147,5 @@ /* Get named pipe information by handle */ -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/0001-kernel32-Do-not-inherit-QT_-environment-variables-to.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/0001-kernel32-Do-not-inherit-QT_-environment-variables-to.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/0001-kernel32-Do-not-inherit-QT_-environment-variables-to.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/0001-kernel32-Do-not-inherit-QT_-environment-variables-to.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,29 @@ +From c62a9b8f39fcdd2209959e831e3801162b41420c Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 27 Jan 2016 06:56:09 +0100 +Subject: kernel32: Do not inherit QT_* environment variables to Windows + environment. + +If necessary, QT environment variables can still be set by adding a WINE +prefix, for example: WINEQT_QPA_PLATFORM=... +--- + dlls/kernel32/process.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c +index 6e7b23e..bb6c2dd 100644 +--- a/dlls/kernel32/process.c ++++ b/dlls/kernel32/process.c +@@ -135,7 +135,8 @@ static inline BOOL is_special_env_var( const char *var ) + !strncmp( var, "PWD=", sizeof("PWD=")-1 ) || + !strncmp( var, "HOME=", sizeof("HOME=")-1 ) || + !strncmp( var, "TEMP=", sizeof("TEMP=")-1 ) || +- !strncmp( var, "TMP=", sizeof("TMP=")-1 )); ++ !strncmp( var, "TMP=", sizeof("TMP=")-1 ) || ++ !strncmp( var, "QT_", sizeof("QT_")-1 )); + } + + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/definition wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-QT_Environment_Variables/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Do not inherit QT_* environment variables to Windows environment diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-VirtualProtect/0001-kernel32-Allow-to-pass-NULL-as-old-protection-in-Vir.patch wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-VirtualProtect/0001-kernel32-Allow-to-pass-NULL-as-old-protection-in-Vir.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-VirtualProtect/0001-kernel32-Allow-to-pass-NULL-as-old-protection-in-Vir.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-VirtualProtect/0001-kernel32-Allow-to-pass-NULL-as-old-protection-in-Vir.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,33 @@ +From d14a5ed33cdc95ff03c64f6fa574d07da5515825 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 21:23:10 +0100 +Subject: kernel32: Allow to pass NULL as old protection in VirtualProtect for + Win9X. + +--- + dlls/kernel32/virtual.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c +index 03ef38c..e164151 100644 +--- a/dlls/kernel32/virtual.c ++++ b/dlls/kernel32/virtual.c +@@ -235,7 +235,14 @@ BOOL WINAPI VirtualProtect( LPVOID addr, SIZE_T size, DWORD new_prot, LPDWORD ol + BOOL WINAPI VirtualProtectEx( HANDLE process, LPVOID addr, SIZE_T size, + DWORD new_prot, LPDWORD old_prot ) + { +- NTSTATUS status = NtProtectVirtualMemory( process, &addr, &size, new_prot, old_prot ); ++ NTSTATUS status; ++ DWORD dummy; ++ ++ /* Win9x allows to pass NULL as old_prot while it fails on NT */ ++ if (!old_prot && (GetVersion() & 0x80000000)) ++ old_prot = &dummy; ++ ++ status = NtProtectVirtualMemory( process, &addr, &size, new_prot, old_prot ); + if (status) SetLastError( RtlNtStatusToDosError(status) ); + return !status; + } +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-VirtualProtect/definition wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-VirtualProtect/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/kernel32-VirtualProtect/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/kernel32-VirtualProtect/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Allow to pass NULL as old protection in VirtualProtect for Win9X diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/mmsystem.dll16-Fix_Argument_Order/0001-mmsystem.dll16-Fix-argument-order-in-GlobalAlloc16-c.patch wine-staging-1.9.3~ubuntu12.04.1/patches/mmsystem.dll16-Fix_Argument_Order/0001-mmsystem.dll16-Fix-argument-order-in-GlobalAlloc16-c.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/mmsystem.dll16-Fix_Argument_Order/0001-mmsystem.dll16-Fix-argument-order-in-GlobalAlloc16-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/mmsystem.dll16-Fix_Argument_Order/0001-mmsystem.dll16-Fix-argument-order-in-GlobalAlloc16-c.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,25 @@ +From f1183d4c50ba5fc854873bdc8a6c96ace56a2e00 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 8 Feb 2016 03:24:47 +0100 +Subject: mmsystem.dll16: Fix argument order in GlobalAlloc16 call. + +--- + dlls/mmsystem.dll16/mmsystem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/mmsystem.dll16/mmsystem.c b/dlls/mmsystem.dll16/mmsystem.c +index fdf1318..d90240d 100644 +--- a/dlls/mmsystem.dll16/mmsystem.c ++++ b/dlls/mmsystem.dll16/mmsystem.c +@@ -1943,7 +1943,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE16 lpHndl, DWORD + + TRACE("(%p, %p, %08x, %08x)!\n", fpThreadAddr, lpHndl, dwPmt, dwFlags); + +- hndl = GlobalAlloc16(sizeof(WINE_MMTHREAD), GMEM_SHARE|GMEM_ZEROINIT); ++ hndl = GlobalAlloc16(GMEM_SHARE|GMEM_ZEROINIT, sizeof(WINE_MMTHREAD)); + + if (hndl == 0) { + ret = 2; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0001-mshtml-Wine-Gecko-2.44-release.patch wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0001-mshtml-Wine-Gecko-2.44-release.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0001-mshtml-Wine-Gecko-2.44-release.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0001-mshtml-Wine-Gecko-2.44-release.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1741 +0,0 @@ -From d232b192f5da398d764d89525628eb7a75344c9c Mon Sep 17 00:00:00 2001 -From: Jacek Caban -Date: Wed, 6 Jan 2016 14:33:41 +0100 -Subject: mshtml: Wine Gecko 2.44 release. - ---- - dlls/appwiz.cpl/addons.c | 6 +- - dlls/mshtml/mshtml_private.h | 5 +- - dlls/mshtml/mutation.c | 10 +- - dlls/mshtml/nsembed.c | 16 +- - dlls/mshtml/nsiface.idl | 241 ++++++++--------- - dlls/mshtml/nsio.c | 604 +++++++++++++++---------------------------- - 6 files changed, 348 insertions(+), 534 deletions(-) - -diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c -index 193fe90..c453340 100644 ---- a/dlls/appwiz.cpl/addons.c -+++ b/dlls/appwiz.cpl/addons.c -@@ -51,14 +51,14 @@ - - WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl); - --#define GECKO_VERSION "2.40" -+#define GECKO_VERSION "2.44-beta1" - - #ifdef __i386__ - #define ARCH_STRING "x86" --#define GECKO_SHA "7001a6ed5b02d0ae4e73b14c92018d604b87f3ad" -+#define GECKO_SHA "8b520c7f95d04407df0bf1cd949194c59c02aae5" - #elif defined(__x86_64__) - #define ARCH_STRING "x86_64" --#define GECKO_SHA "356c414527b08b015b6dc53dbbf78d752320ae90" -+#define GECKO_SHA "5df3777fb93bdf040d1cee6ac94a7fedbb34de56" - #else - #define ARCH_STRING "" - #define GECKO_SHA "???" -diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h -index c32824e..fdfcb7b 100644 ---- a/dlls/mshtml/mshtml_private.h -+++ b/dlls/mshtml/mshtml_private.h -@@ -41,6 +41,8 @@ - - #define NS_ERROR_GENERATE_FAILURE(module,code) \ - ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) -+#define NS_ERROR_GENERATE_SUCCESS(module,code) \ -+ ((nsresult) (((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) - - #define NS_OK ((nsresult)0x00000000L) - #define NS_ERROR_FAILURE ((nsresult)0x80004005L) -@@ -57,6 +59,7 @@ - - #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2) - #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18) -+#define NS_SUCCESS_DEFAULT_ACTION NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_NETWORK, 66) - - #define NS_FAILED(res) ((res) & 0x80000000) - #define NS_SUCCEEDED(res) (!NS_FAILED(res)) -@@ -841,7 +844,7 @@ HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**) DECLSPEC_HIDDEN; - BOOL load_gecko(void) DECLSPEC_HIDDEN; - void close_gecko(void) DECLSPEC_HIDDEN; - void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*) DECLSPEC_HIDDEN; --void init_nsio(nsIComponentManager*,nsIComponentRegistrar*) DECLSPEC_HIDDEN; -+void init_nsio(nsIComponentManager*) DECLSPEC_HIDDEN; - void release_nsio(void) DECLSPEC_HIDDEN; - BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN; - void set_viewer_zoom(NSContainer*,float) DECLSPEC_HIDDEN; -diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c -index 04b1d7f..a07c52d 100644 ---- a/dlls/mshtml/mutation.c -+++ b/dlls/mshtml/mutation.c -@@ -526,12 +526,17 @@ static void NSAPI nsDocumentObserver_CharacterDataChanged(nsIDocumentObserver *i - } - - static void NSAPI nsDocumentObserver_AttributeWillChange(nsIDocumentObserver *iface, nsIDocument *aDocument, -- nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType) -+ nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) - { - } - - static void NSAPI nsDocumentObserver_AttributeChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, -- nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType) -+ nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) -+{ -+} -+ -+static void NSAPI nsDocumentObserver_NativeAnonymousChildListChange(nsIDocumentObserver *iface, nsIDocument *aDocument, -+ nsIContent *aContent, cpp_bool aIsRemove) - { - } - -@@ -722,6 +727,7 @@ static const nsIDocumentObserverVtbl nsDocumentObserverVtbl = { - nsDocumentObserver_CharacterDataChanged, - nsDocumentObserver_AttributeWillChange, - nsDocumentObserver_AttributeChanged, -+ nsDocumentObserver_NativeAnonymousChildListChange, - nsDocumentObserver_AttributeSetToCurrentValue, - nsDocumentObserver_ContentAppended, - nsDocumentObserver_ContentInserted, -diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c -index 866b712..8d9345f 100644 ---- a/dlls/mshtml/nsembed.c -+++ b/dlls/mshtml/nsembed.c -@@ -458,9 +458,9 @@ static void set_environment(LPCWSTR gre_path) - if(TRACE_ON(gecko)) - debug_level = 5; - else if(WARN_ON(gecko)) -- debug_level = 3; -- else if(ERR_ON(gecko)) - debug_level = 2; -+ else if(ERR_ON(gecko)) -+ debug_level = 1; - - sprintfW(buf, debug_formatW, debug_level); - SetEnvironmentVariableW(nspr_log_modulesW, buf); -@@ -721,12 +721,7 @@ static BOOL init_xpcom(const PRUnichar *gre_path) - if(NS_FAILED(nsres)) - ERR("Could not get nsIComponentManager: %08x\n", nsres); - -- nsres = NS_GetComponentRegistrar(®istrar); -- if(NS_SUCCEEDED(nsres)) -- init_nsio(pCompMgr, registrar); -- else -- ERR("NS_GetComponentRegistrar failed: %08x\n", nsres); -- -+ init_nsio(pCompMgr); - init_mutation(pCompMgr); - set_preferences(); - -@@ -735,9 +730,12 @@ static BOOL init_xpcom(const PRUnichar *gre_path) - if(NS_FAILED(nsres)) - ERR("Could not get category manager service: %08x\n", nsres); - -- if(registrar) { -+ nsres = NS_GetComponentRegistrar(®istrar); -+ if(NS_SUCCEEDED(nsres)) { - register_nsservice(registrar, pServMgr); - nsIComponentRegistrar_Release(registrar); -+ }else { -+ ERR("NS_GetComponentRegistrar failed: %08x\n", nsres); - } - - init_node_cc(); -diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl -index ccb2547..962bb6f 100644 ---- a/dlls/mshtml/nsiface.idl -+++ b/dlls/mshtml/nsiface.idl -@@ -25,7 +25,7 @@ - - #pragma makedep header - --cpp_quote("#define GECKO_VERSION \"2.40\"") -+cpp_quote("#define GECKO_VERSION \"2.44-beta1\"") - cpp_quote("#define GECKO_VERSION_STRING \"Wine Gecko \" GECKO_VERSION") - - import "wtypes.idl"; -@@ -191,7 +191,6 @@ typedef nsISupports nsIDOMBlob; - typedef nsISupports nsIPrivacyTransitionObserver; - typedef nsISupports nsIDOMHTMLPropertiesCollection; - typedef nsISupports mozIDOMApplication; --typedef nsISupports nsILoadGroupConnectionInfo; - typedef nsISupports nsIDOMCrypto; - typedef nsISupports nsIDOMPkcs11; - typedef nsISupports nsIDocShellTreeOwner; -@@ -398,7 +397,7 @@ interface nsISeekableStream : nsISupports - - [ - object, -- uuid(395fe045-7d18-4adb-a3fd-af98c8a1af11), -+ uuid(92073a54-6d78-4f30-913a-b871813208c6), - local - ] - interface nsIURI : nsISupports -@@ -427,6 +426,7 @@ interface nsIURI : nsISupports - nsresult Clone(nsIURI **_retval); - nsresult Resolve(const nsACString *relativePath, nsACString *_retval); - nsresult GetAsciiSpec(nsACString *aAsciiSpec); -+ nsresult GetAsciiHostPort(nsACString *aAsciiHostPort); - nsresult GetAsciiHost(nsACString *aAsciiHost); - nsresult GetOriginCharset(nsACString *aOriginCharset); - nsresult GetRef(nsACString *aRef); -@@ -439,7 +439,7 @@ interface nsIURI : nsISupports - - [ - object, -- uuid(1419aa16-f134-4154-9886-00c7c5147a13), -+ uuid(86adcd89-0b70-47a2-b0fe-5bb2c5f37e31), - local - ] - interface nsIURL : nsIURI -@@ -462,7 +462,7 @@ interface nsIURL : nsIURI - - [ - object, -- uuid(7750029c-1b0a-414e-8359-a77f24a2a0a6), -+ uuid(e91ac988-27c2-448b-b1a1-3822e1ef1987), - local - ] - interface nsIFileURL : nsIURL -@@ -535,7 +535,7 @@ interface nsIStreamListener : nsIRequestObserver - - [ - object, -- uuid(afb57ac2-bce5-4ee3-bb34-385089a9ba5c), -+ uuid(f0c87725-7a35-463c-9ceb-2c07f23406cc), - local - ] - interface nsILoadGroup : nsIRequest -@@ -550,14 +550,14 @@ interface nsILoadGroup : nsIRequest - nsresult GetActiveCount(uint32_t *aActiveCount); - nsresult GetNotificationCallbacks(nsIInterfaceRequestor **aNotificationCallbacks); - nsresult SetNotificationCallbacks(nsIInterfaceRequestor *aNotificationCallbacks); -- nsresult GetConnectionInfo(nsILoadGroupConnectionInfo **aConnectionInfo); -+ nsresult GetSchedulingContextID(nsID *aSchedulingContextID); - nsresult GetDefaultLoadFlags(nsLoadFlags *aDefaultLoadFlags); - nsresult SetDefaultLoadFlags(nsLoadFlags aDefaultLoadFlags); - } - - [ - object, -- uuid(1bc48693-c45d-45f4-8ab1-46e323037fe1), -+ uuid(2c389865-23db-4aa7-9fe5-60cc7b00697e), - local - ] - interface nsIChannel : nsIRequest -@@ -571,6 +571,7 @@ interface nsIChannel : nsIRequest - const UINT LOAD_CLASSIFY_URI = 1 << 22; - const UINT LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE = 1 << 23; - const UINT LOAD_EXPLICIT_CREDENTIALS = 1 << 24; -+ const UINT LOAD_BYPASS_SERVICE_WORKER = 1 << 25; - - nsresult GetOriginalURI(nsIURI **aOriginalURI); - nsresult SetOriginalURI(nsIURI *aOriginalURI); -@@ -587,7 +588,9 @@ interface nsIChannel : nsIRequest - nsresult GetContentLength(int64_t *aContentLength); - nsresult SetContentLength(int64_t aContentLength); - nsresult Open(nsIInputStream **_retval); -+ nsresult Open2(nsIInputStream **_retval); - nsresult AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext); -+ nsresult AsyncOpen2(nsIStreamListener *aListener); - nsresult GetContentDisposition(uint32_t *aContentDisposition); - nsresult SetContentDisposition(uint32_t aContentDisposition); - nsresult GetContentDispositionFilename(nsAString *aContentDispositionFilename); -@@ -609,7 +612,7 @@ interface nsIHttpHeaderVisitor : nsISupports - - [ - object, -- uuid(86ad7e1f-3a64-4e0f-a104-395ebecd7d5c), -+ uuid(e90acf2d-eaf2-41d8-97b2-c8d99f6437a1), - local - ] - interface nsIHttpChannel : nsIChannel -@@ -622,7 +625,9 @@ interface nsIHttpChannel : nsIChannel - nsresult SetReferrerWithPolicy(nsIURI *referrer, uint32_t referrerPolicy); - nsresult GetRequestHeader(const nsACString *aHeader, nsACString *_retval); - nsresult SetRequestHeader(const nsACString *aHeader, const nsACString *aValue, bool aMerge); -+ nsresult SetEmptyRequestHeader(const nsACString *aHeader); - nsresult VisitRequestHeaders(nsIHttpHeaderVisitor *aVisitor); -+ nsresult VisitNonDefaultRequestHeaders(nsIHttpHeaderVisitor *aVisitor); - nsresult GetAllowPipelining(bool *aAllowPipelining); - nsresult SetAllowPipelining(bool aAllowPipelining); - nsresult GetAllowSTS(bool *aAllowSTS); -@@ -632,6 +637,8 @@ interface nsIHttpChannel : nsIChannel - nsresult GetResponseStatus(uint32_t *aResponseStatus); - nsresult GetResponseStatusText(nsACString *aResponseStatusText); - nsresult GetRequestSucceeded(bool *aRequestSucceeded); -+ nsresult GetIsMainDocumentChannel(bool *aIsMainDocumentChannel); -+ nsresult SetIsMainDocumentChannel(bool aIsMainDocumentChannel); - nsresult GetResponseHeader(const nsACString *header, nsACString *_retval); - nsresult SetResponseHeader(const nsACString *header, const nsACString *value, bool merge); - nsresult VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor); -@@ -639,11 +646,13 @@ interface nsIHttpChannel : nsIChannel - nsresult IsNoCacheResponse(bool *_retval); - nsresult IsPrivateResponse(bool *_retval); - nsresult RedirectTo(nsIURI *aNewURI); -+ nsresult GetSchedulingContextID(nsID *aSchedulingContextID); -+ nsresult SetSchedulingContextID(const nsID aSchedulingContextID); - } - - [ - object, -- uuid(26833ec7-4555-4f23-9281-3a12d4b76db1), -+ uuid(9eabaac6-cc7c-4ca1-9430-65f2daaa578f), - local - ] - interface nsIHttpChannelInternal : nsISupports -@@ -672,21 +681,26 @@ interface nsIHttpChannelInternal : nsISupports - nsresult SetAllowSpdy(bool aAllowSpdy); - nsresult GetResponseTimeoutEnabled(bool *aResponseTimeoutEnabled); - nsresult SetResponseTimeoutEnabled(bool aResponseTimeoutEnabled); -+ nsresult GetInitialRwin(uint32_t *aInitialRwin) ; -+ nsresult SetInitialRwin(uint32_t aInitialRwin); - nsresult GetApiRedirectToURI(nsIURI **aApiRedirectToURI); - nsresult GetAllowAltSvc(bool *aAllowAltSvc); - nsresult SetAllowAltSvc(bool aAllowAltSvc); -- nsresult AddRedirect(nsIPrincipal *aPrincipal); - nsresult GetLastModifiedTime(PRTime *aLastModifiedTime); -- nsresult ForceNoIntercept(); -+ nsresult ForceIntercepted(uint64_t aInterceptionID); -+ nsresult GetResponseSynthesized(bool *aResponseSynthesized); - nsresult GetCorsIncludeCredentials(bool *aCorsIncludeCredentials); - nsresult SetCorsIncludeCredentials(bool aCorsIncludeCredentials); - nsresult GetCorsMode(uint32_t *aCorsMode); - nsresult SetCorsMode(uint32_t aCorsMode); -+ nsresult GetRedirectMode(uint32_t *aRedirectMode); -+ nsresult SetRedirectMode(uint32_t aRedirectMode); - nsresult GetTopWindowURI(nsIURI **aTopWindowURI); - nsresult GetNetworkInterfaceId(nsACString *aNetworkInterfaceId); - nsresult SetNetworkInterfaceId(const nsACString *aNetworkInterfaceId); -- nsresult ContinueBeginConnect(); - nsresult GetProxyURI(nsIURI **aProxyURI); -+ nsresult SetCorsPreflightParameters(const void /*nsTArray*/ *unsafeHeaders, -+ bool withCredentials, nsIPrincipal *preflightPrincipal); - } - - [ -@@ -1392,57 +1406,32 @@ interface nsIDOMWindowCollection : nsISupports - - [ - object, -- uuid(8146f3fc-9fc1-47c5-85ef-95d686e4ca6d), -+ uuid(ab30b7cc-f7f9-4b9b-befb-7dbf6cf86d46), - local - ] - interface nsIDOMWindow : nsISupports - { -- nsresult GetWindow(nsIDOMWindow **aWindow); -- nsresult GetSelf(nsIDOMWindow **aSelf); - nsresult GetDocument(nsIDOMDocument **aDocument); - nsresult GetName(nsAString *aName); - nsresult SetName(const nsAString *aName); - nsresult GetLocation(nsIDOMLocation **aLocation); -- nsresult GetHistory(nsISupports **aHistory); -- nsresult GetLocationbar(nsISupports **aLocationbar); -- nsresult GetMenubar(nsISupports **aMenubar); -- nsresult GetPersonalbar(nsISupports **aPersonalbar); -- nsresult GetScrollbars(nsISupports **aScrollbars); -- nsresult GetStatusbar(nsISupports **aStatusbar); -- nsresult GetToolbar(nsISupports **aToolbar); -- nsresult GetStatus(nsAString *aStatus); -- nsresult SetStatus(const nsAString *aStatus); - nsresult Close(); - nsresult Stop(); - nsresult Focus(); - nsresult Blur(); - nsresult GetLength(uint32_t *aLength); -- nsresult GetScriptableTop(nsIDOMWindow **aTop); - nsresult GetRealTop(nsIDOMWindow **aTop); -- nsresult GetScriptableParent(nsIDOMWindow **aParent); - nsresult GetRealParent(nsIDOMWindow **aParent); -- nsresult GetScriptableOpener(JSContext* cx, int /* JS::MutableHandleValue */ aOpener); -- nsresult SetScriptableOpener(JSContext* cx, int /* JS::HandleValue */ aOpener); - nsresult GetOpener(nsIDOMWindow **aOpenerWindow); - nsresult SetOpener(nsIDOMWindow *aOpenerWindow); -- nsresult GetScriptableFrameElement(nsIDOMElement **aFrameElement); - nsresult GetRealFrameElement(nsIDOMElement **aFrameElement); - nsresult GetNavigator(nsIDOMNavigator **aNavigator); -- nsresult GetApplicationCache(nsIDOMOfflineResourceList **aApplicationCache); -- nsresult Alert(const nsAString *text); -- nsresult Confirm(const nsAString *text, bool *_retval); -- nsresult Prompt(const nsAString *aMessage, const nsAString *aInitial, nsAString *_retval); - nsresult Print(); -- nsresult ShowModalDialog(const nsAString *aURI, nsIVariant *aArgs, const nsAString *aOptions, uint8_t _argc, nsIVariant **_retval); -- nsresult PostMessageMoz(const long /*jsval*/ *message, const nsAString *targetOrigin, const /*JS::Value*/ void *transfer, JSContext *cx); -- nsresult Atob(const nsAString *aAsciiString, nsAString *_retval); -- nsresult Btoa(const nsAString *aBase64Data, nsAString *_retval); - nsresult GetSessionStorage(nsISupports **aSessionStorage); - nsresult GetLocalStorage(nsISupports **aLocalStorage); - nsresult GetIndexedDB(nsISupports **aIndexedDB); - nsresult GetSelection(nsISelection **_retval); - nsresult MatchMedia(const nsAString *media_query_list, nsISupports **_retval); -- nsresult GetScreen(nsIDOMScreen **aScreen); - nsresult GetInnerWidth(int32_t *aInnerWidth); - nsresult SetInnerWidth(int32_t aInnerWidth); - nsresult GetInnerHeight(int32_t *aInnerHeight); -@@ -1464,18 +1453,11 @@ interface nsIDOMWindow : nsISupports - nsresult SetOuterHeight(int32_t aOuterHeight); - nsresult GetComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval); - nsresult GetDefaultComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval); -- nsresult GetWindowRoot(nsIDOMEventTarget **aWindowRoot); - nsresult GetFrames(nsIDOMWindowCollection **aFrames); - nsresult GetTextZoom(float *aTextZoom); - nsresult SetTextZoom(float aTextZoom); - nsresult ScrollByLines(int32_t numLines); - nsresult ScrollByPages(int32_t numPages); -- nsresult SizeToContent(); -- nsresult GetContent(nsIDOMWindow **aContent); -- nsresult GetPrompter(nsIPrompt **aPrompter); -- nsresult GetClosed(bool *aClosed); -- nsresult GetCrypto(nsIDOMCrypto **aCrypto); -- nsresult GetControllers(nsIControllers **aControllers); - nsresult GetMozInnerScreenX(float *aMozInnerScreenX); - nsresult GetMozInnerScreenY(float *aMozInnerScreenY); - nsresult GetDevicePixelRatio(float *aDevicePixelRatio); -@@ -1486,25 +1468,9 @@ interface nsIDOMWindow : nsISupports - nsresult Back(); - nsresult Forward(); - nsresult Home(); -- nsresult MoveTo(int32_t xPos, int32_t yPos); -- nsresult MoveBy(int32_t xDif, int32_t yDif); -- nsresult ResizeTo(int32_t width, int32_t height); -- nsresult ResizeBy(int32_t widthDif, int32_t heightDif); - nsresult Open(const nsAString *url, const nsAString *name, const nsAString *options, nsIDOMWindow **_retval); -- nsresult OpenDialog(const nsAString *url, const nsAString *name, const nsAString *options, nsISupports *aExtraArgument, -- nsIDOMWindow **_retval); -- nsresult UpdateCommands(const nsAString *action, nsISelection *sel, int16_t reason); - nsresult Find(const nsAString *str, bool caseSensitive, bool backwards, bool wrapAround, bool wholeWord, - bool searchInFrames, bool showDialog, bool *_retval); -- nsresult GetMozPaintCount(uint64_t *aMozPaintCount); -- nsresult MozRequestAnimationFrame(nsIFrameRequestCallback *aCallback, int32_t *_retval); -- nsresult RequestAnimationFrame(void /*const JS::Value*/ *aCallback, JSContext* cx, int32_t *_retval); -- nsresult MozCancelAnimationFrame(int32_t aHandle); -- nsresult MozCancelRequestAnimationFrame(int32_t aHandle); -- nsresult CancelAnimationFrame(int32_t aHandle); -- nsresult GetMozAnimationStartTime(int64_t *aMozAnimationStartTime); -- nsresult GetConsole(JSContext *cx, jsval *aConsole); -- nsresult SetConsole(JSContext *cx, const jsval *aConsole); - } - - [ -@@ -2348,7 +2314,7 @@ interface nsIBaseWindow : nsISupports - - [ - object, -- uuid(0e92d522-53a5-4af6-9a24-4eccdcbf4f91), -+ uuid(3ade79d4-8cb9-4952-b18d-4f9b63ca0d31), - local - ] - interface nsIWebNavigation : nsISupports -@@ -2370,6 +2336,7 @@ interface nsIWebNavigation : nsISupports - const UINT LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10000; - const UINT LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20000; - const UINT LOAD_FLAGS_DISALLOW_INHERIT_OWNER = 0x40000; -+ const UINT LOAD_FLAGS_ERROR_LOAD_CHANGES_RV = 0x80000; - - nsresult GetCanGoBack(bool *aCanGoBack); - nsresult GetCanGoForward(bool *aCanGoForward); -@@ -2407,7 +2374,7 @@ interface nsIWebProgress : nsISupports - - [ - object, -- uuid(1bcfc611-8941-4c39-9e06-7116e564a1ce), -+ uuid(04dd3a01-a74e-44aa-8d49-2c30478fd7b8), - local - ] - interface nsIPrintSettings : nsISupports -@@ -2417,6 +2384,7 @@ interface nsIPrintSettings : nsISupports - nsresult SetPrintOptions(int32_t aType, bool aTurnOnOff); - nsresult GetPrintOptions(int32_t aType, bool *_retval); - nsresult GetPrintOptionsBits(int32_t *_retval); -+ nsresult SetPrintOptionsBits(int32_t bits); - nsresult GetEffectivePageSize(double *aWidth, double *aHeight); - nsresult Clone(nsIPrintSettings **_retval); - nsresult Assign(nsIPrintSettings *aPS); -@@ -2500,22 +2468,12 @@ interface nsIPrintSettings : nsISupports - nsresult SetPaperHeight(double aPaperHeight); - nsresult GetPaperSizeUnit(int16_t *aPaperSizeUnit); - nsresult SetPaperSizeUnit(int16_t aPaperSizeUnit); -- nsresult GetPlexName(PRUnichar **aPlexName); -- nsresult SetPlexName(const PRUnichar *aPlexName); -- nsresult GetColorspace(PRUnichar **aColorspace); -- nsresult SetColorspace(const PRUnichar *aColorspace); -- nsresult GetResolutionName(PRUnichar **aResolutionName); -- nsresult SetResolutionName(const PRUnichar aResolutionName); -- nsresult GetDownloadFonts(bool *aDownloadFonts); -- nsresult SetDownloadFonts(bool aDownloadFonts); - nsresult GetPrintReversed(bool *aPrintReversed); - nsresult SetPrintReversed(bool aPrintReversed); - nsresult GetPrintInColor(bool *aPrintInColor); - nsresult SetPrintInColor(bool aPrintInColor); - nsresult GetOrientation(int32_t *aOrientation); - nsresult SetOrientation(int32_t aOrientation); -- nsresult GetPrintCommand(PRUnichar **aPrintCommand); -- nsresult SetPrintCommand(const PRUnichar *aPrintCommand); - nsresult GetNumCopies(int32_t *aNumCopies); - nsresult SetNumCopies(int32_t aNumCopies); - nsresult GetPrinterName(PRUnichar **aPrinterName); -@@ -2599,7 +2557,7 @@ interface nsIScrollable : nsISupports - - [ - object, -- uuid(dfb5a307-7ecf-41dd-aee2-f1d623459c44), -+ uuid(2fa6884a-ae65-412a-9d4c-ce6e34544ba1), - local - ] - interface nsIFile : nsISupports -@@ -2625,6 +2583,7 @@ interface nsIFile : nsISupports - nsresult MoveTo(nsIFile *newParentDir, const nsAString *newName); - nsresult MoveToNative(nsIFile *newParentDir, const nsAString *newName); - nsresult RenameTo(nsIFile *newParentDir, const nsAString *newName); -+ nsresult RenameToNative(nsIFile *newParentDir, const nsACString *newName); - nsresult Remove(bool recursive); - nsresult GetPermissions(uint32_t *aPermissions); - nsresult SetPermissions(uint32_t pPermissions); -@@ -2673,6 +2632,8 @@ interface nsIFile : nsISupports - nsresult Launch(); - nsresult GetRelativeDescriptor(nsIFile *fromFile, nsACString *_retval); - nsresult SetRelativeDescriptor(nsIFile *fromFile, const nsACString *relativeDesc); -+ nsresult GetRelativePath(nsIFile *fromFile, nsACString *_retval); -+ nsresult SetRelativePath(nsIFile *fromFile, const nsACString *relativeDesc); - } - - [ -@@ -2745,7 +2706,7 @@ interface nsIDirectoryServiceProvider2 : nsIDirectoryServiceProvider - - [ - object, -- uuid(a7aad716-e72c-435d-82f1-7582dffae661), -+ uuid(a87210e6-7c8c-41f7-864d-df809015193e), - local - ] - interface nsIProtocolHandler : nsISupports -@@ -2770,6 +2731,7 @@ interface nsIProtocolHandler : nsISupports - const unsigned long URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM = (1<<16); - const unsigned long URI_SYNC_LOAD_IS_OK = (1<<17); - const unsigned long URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT = (1<<18); -+ const unsigned long URI_FETCHABLE_BY_ANYONE = (1 << 19); - - nsresult GetScheme(nsACString *aScheme); - nsresult GetDefaultPort(int32_t *aDefaultPort); -@@ -2793,6 +2755,20 @@ interface nsIExternalProtocolHandler : nsIProtocolHandler - - [ - object, -+ uuid(d13c21ca-7329-45a5-8912-9d2e2fef1231), -+ local -+] -+interface nsIIOServiceHook : nsISupports -+{ -+ nsresult NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel **_retval); -+ nsresult GetProtocolHandler(nsIProtocolHandler *aHandler, nsIProtocolHandler **_retval); -+ nsresult NewURI(const nsACString *aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval); -+ nsresult ProtocolHasFlags(nsIURI *aURI, uint32_t aFlag, bool *_retval); -+ nsresult URIChainHasFlags(nsIURI *aURI, uint32_t aFlags, bool *_retval); -+} -+ -+[ -+ object, - uuid(4286de5a-b2ea-446f-8f70-e2a461f42694), - local - ] -@@ -2821,28 +2797,7 @@ interface nsIIOService : nsISupports - nsresult GetAppOfflineState(uint32_t appId, int32_t *_retval); - nsresult AllowPort(int32_t aPort, const char *aScheme, bool *_retval); - nsresult ExtractScheme(const nsACString *urlString, nsACString *_retval); -- nsresult NewLoadInfo(nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, -- nsIDOMNode *aLoadingNode, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsILoadInfo **_retval); --} -- --[ -- object, -- uuid(ca68c485-9db3-4c12-82a6-4fab7948e2d5), -- local, --] --interface nsINetUtil : nsISupports --{ -- nsresult ParseContentType(const nsACString *aTypeHeader, nsACString *aCharset, -- bool *aHadCharset, nsACString *_retval); -- nsresult ProtocolHasFlags(nsIURI *aURI, uint32_t aFlag, bool *_retval); -- nsresult URIChainHasFlags(nsIURI *aURI, uint32_t aFlags, bool *_retval); -- nsresult ToImmutableURI(nsIURI *aURI, nsIURI **_retval); -- nsresult NewSimpleNestedURI(nsIURI *aURI, nsIURI **_retval); -- nsresult EscapeString(const nsACString *aString, uint32_t aEscapeType, nsACString *_retval); -- nsresult EscapeURL(const nsACString *aStr, uint32_t aFlags, nsACString *_retval); -- nsresult UnescapeString(const nsACString *aStr, uint32_t aFlags, nsACString *_retval); -- nsresult ExtractCharsetFromContentType(const nsACString *aTypeHeader, nsACString *aCharset, -- int32_t *aCharsetStart, int32_t *aCharsetEnd, bool *_retval); -+ nsresult SetHook(nsIIOServiceHook *aHook); - } - - [ -@@ -2909,7 +2864,7 @@ interface nsIDOMEventTarget : nsISupports - - [ - object, -- uuid(02d54f52-a1f5-4ad2-b560-36f14012935e), -+ uuid(63857daf-c084-4ea6-a8b9-6812e3176991), - local - ] - interface nsIDOMEvent : nsISupports -@@ -2939,11 +2894,12 @@ interface nsIDOMEvent : nsISupports - bool Deserialize(const /*IPC::Message*/ void *aMsg, void **aIter); - void SetOwner(void /*mozilla::dom::EventTarget*/ *aOwner); - void /*nsDOMEvent*/ *InternalDOMEvent(); -+ nsresult StopCrossProcessForwarding(); - } - - [ - object, -- uuid(1a75c351-d115-4d51-94df-731dd1723a1f), -+ uuid(a30a95ac-3b95-4251-88dc-8efa89ba9f9c), - local - ] - interface nsIDOMWindowUtils : nsISupports -@@ -2955,7 +2911,6 @@ interface nsIDOMWindowUtils : nsISupports - nsresult GetDocumentMetadata(const nsAString *aName, nsAString *_retval); - nsresult Redraw(uint32_t aCount, uint32_t *_retval); - nsresult UpdateLayerTree(); -- nsresult SetCSSViewport(float aWidthPx, float aHeightPx); - nsresult GetViewportInfo(uint32_t aDisplayWidth, uint32_t aDisplayHeight, double *aDefaultZoom, bool *aAllowZoom, - double *aMinZoom, double *aMaxZoom, uint32_t *aWidth, uint32_t *aHeight, bool *aAutoSize); - nsresult SetDisplayPortForElement(float aXPx, float aYPx, float aWidthPx, float aHeightPx, -@@ -3037,8 +2992,9 @@ interface nsIDOMWindowUtils : nsISupports - nsresult SendContentCommandEvent(const nsAString *aType, nsITransferable *aTransferable); - nsresult SendQueryContentEvent(uint32_t aType, uint32_t aOffset, uint32_t aLength, int32_t aX, int32_t aY, - uint32_t aAdditionalFlags, nsIQueryContentEventResult **_retval); -- nsresult RemoteFrameFullscreenChanged(nsIDOMElement *aFrameElement, const nsAString *aNewOrigin); -+ nsresult RemoteFrameFullscreenChanged(nsIDOMElement *aFrameElement); - nsresult RemoteFrameFullscreenReverted(); -+ nsresult HandleFullscreenRequests(bool *_retval); - nsresult ExitFullscreen(); - nsresult SendSelectionSetEvent(uint32_t aOffset, uint32_t aLength, uint32_t aAdditionalFlags, bool *_retval); - nsresult SelectAtPoint(float aX, float aY, uint32_t aSelectBehavior, bool *_retval); -@@ -3054,7 +3010,7 @@ interface nsIDOMWindowUtils : nsISupports - nsresult ResumeTimeouts(); - nsresult GetLayerManagerType(nsAString *aLayerManagerType); - nsresult GetLayerManagerRemote(bool *aLayerManagerRemote); -- nsresult GetSupportsHardwareH264Decoding(bool *aSupportsHardwareH264Decoding); -+ nsresult GetSupportsHardwareH264Decoding(nsAString *aSupportsHardwareH264Decoding); - nsresult StartFrameTimeRecording(uint32_t *startIndex); - nsresult StopFrameTimeRecording(uint32_t startIndex, uint32_t *frameCount, float **frameIntervals); - nsresult BeginTabSwitch(); -@@ -3066,10 +3022,13 @@ interface nsIDOMWindowUtils : nsISupports - nsresult AdvanceTimeAndRefresh(int64_t aMilliseconds); - nsresult RestoreNormalRefresh(); - nsresult GetIsTestControllingRefreshes(bool *aIsTestControllingRefreshes); -+ nsresult GetAsyncPanZoomEnabled(bool *aAsyncPanZoomEnabled); - nsresult SetAsyncScrollOffset(nsIDOMNode *aNode, int32_t aX, int32_t aY); -+ nsresult SetAsyncZoom(nsIDOMNode *aRootElement, float aValue); -+ nsresult FlushApzRepaints(bool *_retval); - nsresult ComputeAnimationDistance(nsIDOMElement *element, const nsAString *property, const nsAString *value1, - const nsAString *value2, double *_retval); -- nsresult WrapDOMFile(nsIFile *aFile, nsIDOMFile **_retval); -+ nsresult WrapDOMFile(nsIFile *aFile, nsISupports **_retval); - nsresult GetFocusedInputType(char **aFocusedInputType); - nsresult FindElementWithViewId(long /*nsViewID*/ aId, nsIDOMElement **_retval); - nsresult GetViewId(nsIDOMElement *aElement, long /*nsViewID*/ *_retval); -@@ -3081,6 +3040,7 @@ interface nsIDOMWindowUtils : nsISupports - nsresult GetFilePath(void /*JS::HandleValue*/ *aFile, JSContext *cx, nsAString *_retval); - nsresult GetFileReferences(const nsAString *aDatabaseName, int64_t aId, void /*JS::HandleValue*/ *aOptions, - int32_t *aRefCnt, int32_t *aDBRefCnt, int32_t *aSliceRefCnt, JSContext* cx, bool *_retval); -+ nsresult FlushPendingFileDeletions(); - nsresult IsIncrementalGCEnabled(JSContext *cx, bool *_retval); - nsresult StartPCCountProfiling(JSContext *cx); - nsresult StopPCCountProfiling(JSContext *cx); -@@ -3091,7 +3051,6 @@ interface nsIDOMWindowUtils : nsISupports - nsresult GetPaintingSuppressed(bool *aPaintingSuppressed); - nsresult GetPlugins(JSContext *cx, /*JS::Value*/ void *aPlugins); - nsresult SetScrollPositionClampingScrollPortSize(float aWidth, float aHeight); -- nsresult SetContentDocumentFixedPositionMargins(float aTop, float aRight, float aBottom, float aLeft); - nsresult DisableDialogs(); - nsresult EnableDialogs(); - nsresult AreDialogsEnabled(bool *_retval); -@@ -3106,9 +3065,8 @@ interface nsIDOMWindowUtils : nsISupports - nsresult IsNodeDisabledForEvents(nsIDOMNode *aNode, bool *_retval); - nsresult GetPaintFlashing(bool *aPaintFlashing); - nsresult SetPaintFlashing(bool aPaintFlashing); -- nsresult RunInStableState(nsIRunnable *runnable); -- nsresult RunBeforeNextEvent(nsIRunnable *runnable); -- nsresult GetOMTAStyle(nsIDOMElement *aElement, const nsAString *aProperty, nsAString *_retval); -+ nsresult GetOMTAStyle(nsIDOMElement *aElement, const nsAString *aProperty, -+ const nsAString *aPseudoElement, nsAString *_retval); - nsresult RequestCompositorProperty(const nsAString *aProperty, float *_retval); - nsresult SetHandlingUserInput(bool aHandlingInput, void /*nsIJSRAIIHelper*/ **_retval); - nsresult GetContentAPZTestData(JSContext *cx, int /*JS::MutableHandleValue*/ _retval); -@@ -3125,6 +3083,12 @@ interface nsIDOMWindowUtils : nsISupports - nsresult SetChromeMargin(int32_t aTop, int32_t aRight, int32_t aBottom, int32_t aLeft); - nsresult GetServiceWorkersTestingEnabled(bool *aServiceWorkersTestingEnabled); - nsresult SetServiceWorkersTestingEnabled(bool aServiceWorkersTestingEnabled); -+ nsresult GetFrameUniformityTestData(JSContext* cx, int /*JS::MutableHandleValue*/ *_retval); -+ nsresult EnterChaosMode(); -+ nsresult LeaveChaosMode(); -+ nsresult HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType, bool *_retval); -+ nsresult ForceUseCounterFlush(nsIDOMNode *aNode); -+ nsresult SetNextPaintSyncId(int32_t aSyncId); - } - - cpp_quote("#define CONTEXT_NONE 0x00") -@@ -3416,7 +3380,7 @@ interface nsIController : nsISupports - - [ - object, -- uuid(70f7e9ea-a9bf-48cc-ad9d-8acaeed29b68), -+ uuid(8e1bab9d-8815-4d2c-a24d-7aba5239dc22), - local - ] - interface nsIContent : nsISupports -@@ -3426,7 +3390,7 @@ interface nsIContent : nsISupports - - [ - object, -- uuid(0b78eabe-8b94-4ea1-9331-5d48e83ada95), -+ uuid(5f51e18c-9e0e-4dc0-9f08-7a326552ea11), - local - ] - interface nsIDocument : nsISupports -@@ -3739,7 +3703,7 @@ interface nsIContentViewer : nsISupports - - [ - object, -- uuid(c63e9d64-490d-48bf-8013-b5d8ee4dbc25), -+ uuid(e7570e5a-f1d6-452d-b4f8-b35fdc63aa03), - local - ] - interface nsIDocShellLoadInfo : nsISupports -@@ -3749,6 +3713,10 @@ interface nsIDocShellLoadInfo : nsISupports - - nsresult GetReferrer(nsIURI **aReferrer); - nsresult SetReferrer(nsIURI *aReferrer); -+ nsresult GetOriginalURI(nsIURI **aOriginalURI); -+ nsresult SetOriginalURI(nsIURI *aOriginalURI); -+ nsresult GetLoadReplace(bool *aLoadReplace); -+ nsresult SetLoadReplace(bool aLoadReplace); - nsresult GetOwner(nsISupports **aOwner); - nsresult SetOwner(nsISupports *aOwner); - nsresult GetInheritOwner(bool *aInheritOwner); -@@ -3780,7 +3748,7 @@ interface nsIDocShellLoadInfo : nsISupports - - [ - object, -- uuid(696b32a1-3cf1-4909-b501-474b25fc7954), -+ uuid(44aca825-0080-49f1-8407-df62183e5ec1), - local - ] - interface nsIDocShell : nsIDocShellTreeItem -@@ -3788,11 +3756,12 @@ interface nsIDocShell : nsIDocShellTreeItem - nsresult LoadURI(nsIURI *uri, nsIDocShellLoadInfo *loadInfo, uint32_t aLoadFlags, bool firstParty); - nsresult LoadStream(nsIInputStream *aStream, nsIURI *aURI, const nsACString *aContentType, - const nsACString *aContentCharset, nsIDocShellLoadInfo *aLoadInfo); -- nsresult InternalLoad(nsIURI *aURI, nsIURI *aReferrer, uint32_t aReferrerPolicy, nsISupports *aOwner, -- uint32_t aFlags, const PRUnichar *aWindowTarget, const char *aTypeHint, nsACString *aFileName, -- nsIInputStream *aPostDataStream, nsIInputStream *aHeadersStream, uint32_t aLoadFlags, -- nsISHEntry *aSHEntry, bool firstParty, const nsAString *aSrcdoc, nsIDocShell *aSourceDocShell, -- nsIURI *aBaseURI, nsIDocShell **aDocShell, nsIRequest **aRequest); -+ nsresult InternalLoad(nsIURI *aURI, nsIURI *aOriginalURI, bool aLoadReplace, nsIURI *aReferrer, -+ uint32_t aReferrerPolicy, nsISupports *aOwner, uint32_t aFlags, const PRUnichar *aWindowTarget, -+ const char *aTypeHint, nsACString *aFileName, nsIInputStream *aPostDataStream, -+ nsIInputStream *aHeadersStream, uint32_t aLoadFlags, nsISHEntry *aSHEntry, bool firstParty, -+ const nsAString *aSrcdoc, nsIDocShell *aSourceDocShell, nsIURI *aBaseURI, nsIDocShell **aDocShell, -+ nsIRequest **aRequest); - nsresult AddState(jsval *aData, const nsAString *aTitle, const nsAString *aURL, bool aReplace, JSContext *cx); - nsresult CreateLoadInfo(nsIDocShellLoadInfo **loadInfo); - nsresult PrepareForNewContentModel(); -@@ -3837,7 +3806,7 @@ interface nsIDocShell : nsIDocShellTreeItem - nsresult SetMarginWidth(int32_t aMarginWidth); - nsresult GetMarginHeight(int32_t *aMarginHeight); - nsresult SetMarginHeight(int32_t aMarginHeight); -- nsresult TabToTreeOwner(bool forward, bool *tookFocus); -+ nsresult TabToTreeOwner(bool forward, bool forDocumentNavigation, bool *_retval); - nsresult GetBusyFlags(uint32_t *aBusyFlags); - nsresult GetLoadType(uint32_t *aLoadType); - nsresult SetLoadType(uint32_t aLoadType); -@@ -3857,7 +3826,7 @@ interface nsIDocShell : nsIDocShellTreeItem - nsresult GetRestoringDocument(bool *aRestoringDocument); - nsresult GetUseErrorPages(bool *aUseErrorPages); - nsresult SetUseErrorPages(bool aUseErrorPages); -- nsresult DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL, nsIChannel *aFailedChannel); -+ nsresult DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL, nsIChannel *aFailedChannel, bool *_retval); - nsresult GetFailedChannel(nsIChannel **aFailedChannel); - nsresult GetPreviousTransIndex(int32_t *aPreviousTransIndex); - nsresult GetLoadedTransIndex(int32_t *aLoadedTransIndex); -@@ -3916,6 +3885,7 @@ interface nsIDocShell : nsIDocShellTreeItem - nsresult GetAppId(uint32_t *aAppId); - nsresult GetAppManifestURL(nsAString *aAppManifestURL); - nsresult GetSameTypeParentIgnoreBrowserAndAppBoundaries(nsIDocShell **_retval); -+ nsresult GetSameTypeRootTreeItemIgnoreBrowserAndAppBoundaries(nsIDocShell **_retval); - nsresult GetAsyncPanZoomEnabled(bool *aAsyncPanZoomEnabled); - nsresult GetSandboxFlags(uint32_t *aSandboxFlags); - nsresult SetSandboxFlags(uint32_t aSandboxFlags); -@@ -3928,6 +3898,8 @@ interface nsIDocShell : nsIDocShellTreeItem - bool PluginsAllowedInCurrentDoc(); - nsresult GetFullscreenAllowed(bool *aFullscreenAllowed); - nsresult SetFullscreenAllowed(bool allowed); -+ uint32_t OrientationLock(); -+ void SetOrientationLock(uint32_t orientationLock); - nsresult GetAffectPrivateSessionLifetime(bool *aAffectPrivateSessionLifetime); - nsresult SetAffectPrivateSessionLifetime(bool aAffectPrivateSessionLifetime); - nsresult GetMayEnableCharacterEncodingMenu(bool *aMayEnableCharacterEncodingMenu); -@@ -3953,7 +3925,6 @@ interface nsIDocShell : nsIDocShellTreeItem - nsresult SetDeviceSizeIsPageSize(bool aDeviceSizeIsPageSize); - void /* thiscall */ SetOpener(void /*nsITabParent*/ *aOpener); - void /* thiscall nsITabParent */ *GetOpener(); -- void /*mozilla::dom::URLSearchParams */ *GetURLSearchParams(); - void /* thiscall */ NotifyJSRunToCompletionStart(const char *aReason, const char16_t *functionName, - const char16_t *fileName, uint32_t lineNumber); - void /* thiscall */ NotifyJSRunToCompletionStop(); -@@ -3966,19 +3937,22 @@ interface nsIDocShell : nsIDocShellTreeItem - - [ - object, -- uuid(16fe5e3e-eadc-4312-9d44-b6bedd6b5474), -+ uuid(6d674c17-0fbc-4633-8f46-734e87ebf0c7), - local - ] - interface nsIMutationObserver : nsISupports - { -+ typedef struct {} nsAttrValue; -+ - void CharacterDataWillChange(nsIDocument *aDocument, nsIContent *aContent, - void /*CharacterDataChangeInfo*/ *aInfo); - void CharacterDataChanged(nsIDocument *aDocument, nsIContent *aContent, - void /*CharacterDataChangeInfo*/ *aInfo); - void AttributeWillChange(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, -- nsIAtom *aAttribute, int32_t aModType); -+ nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aNewValue); - void AttributeChanged(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, -- nsIAtom *aAttribute, int32_t aModType); -+ nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aNewValue); -+ void NativeAnonymousChildListChange(nsIDocument *aDocument, nsIContent *aContent, bool aIsRemove); - void AttributeSetToCurrentValue(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, - int32_t aNameSpaceID, nsIAtom *aAttribute); - void ContentAppended(nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aFirstNewContent, -@@ -4083,10 +4057,21 @@ interface nsIContentUtils : nsISupports - - [ - object, -+ uuid(5fe83b24-38b9-4901-a4a1-d1bd57d3fe18), -+ local -+] -+interface nsIAudioChannelAgentCallback : nsISupports -+{ -+ nsresult WindowVolumeChanged(float aVolume, bool aMuted); -+ nsresult WindowAudioCaptureChanged(); -+} -+ -+[ -+ object, - uuid(8f672000-bab9-4c60-aaaf-2673c4e2a4c6), - local - ] --interface nsIPluginInstance : nsISupports -+interface nsIPluginInstance : nsIAudioChannelAgentCallback - { - nsresult GetDOMElement(nsIDOMElement **aDOMElement); - } -@@ -4139,7 +4124,7 @@ interface nsIXMLHttpRequest : nsISupports - - [ - object, -- uuid(ba602ca6-dc7a-457e-a57a-ee5b343fd863), -+ uuid(b7ae2310-576e-11e5-a837-0800200c9a66), - local - ] - interface nsIScriptSecurityManager : nsISupports { -@@ -4149,7 +4134,7 @@ interface nsIScriptSecurityManager : nsISupports { - nsresult CheckLoadURIFromScript(JSContext *cx, nsIURI *uri); - nsresult CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, uint32_t flags); - nsresult CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString *uri, uint32_t flags); -- nsresult ScriptAllowed(JSObject *aGlobal); -+ bool ScriptAllowed(JSObject *aGlobal); - nsresult GetSystemPrincipal(nsIPrincipal **_retval); - nsresult GetSimpleCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval); - nsresult GetAppCodebasePrincipal(nsIURI *uri, uint32_t appId, bool inMozBrowser, nsIPrincipal **_retval); -@@ -4157,6 +4142,10 @@ interface nsIScriptSecurityManager : nsISupports { - nsresult GetDocShellCodebasePrincipal(nsIURI *uri, nsIDocShell *docShell, nsIPrincipal **_retval); - nsresult GetNoAppCodebasePrincipal(nsIURI *uri, nsIPrincipal **_retval); - nsresult GetCodebasePrincipal(nsIURI *uri, nsIPrincipal **_retval); -+ nsresult CreateCodebasePrincipal(nsIURI *uri, int /*JS::HandleValue*/ originAttributes, JSContext* cx, nsIPrincipal **_retval); -+ nsresult CreateCodebasePrincipalFromOrigin(const nsACString *origin, nsIPrincipal **_retval); -+ nsresult CreateNullPrincipal(int /*JS::HandleValue*/ originAttributes, JSContext *cx, nsIPrincipal **_retval); -+ nsresult CreateExpandedPrincipal(nsIPrincipal **aPrincipalArray, uint32_t aLength, nsIPrincipal **_retval); - nsresult CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, bool reportError); - nsresult GetChannelResultPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval); - nsresult GetChannelURIPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval); -diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c -index a5a1ffd..81dc211 100644 ---- a/dlls/mshtml/nsio.c -+++ b/dlls/mshtml/nsio.c -@@ -48,7 +48,6 @@ static const IID IID_nsWineURI = - {0x5088272e, 0x900b, 0x11da, {0xc6,0x87, 0x00,0x0f,0xea,0x57,0xf2,0x1a}}; - - static nsIIOService *nsio = NULL; --static nsINetUtil *net_util; - - static const char *request_method_strings[] = {"GET", "PUT", "POST"}; - -@@ -897,6 +896,15 @@ static nsresult NSAPI nsChannel_Open(nsIHttpChannel *iface, nsIInputStream **_re - return NS_ERROR_NOT_IMPLEMENTED; - } - -+static nsresult NSAPI nsChannel_Open2(nsIHttpChannel *iface, nsIInputStream **_retval) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ -+ FIXME("(%p)->(%p)\n", This, _retval); -+ -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static HTMLOuterWindow *get_window_from_load_group(nsChannel *This) - { - HTMLOuterWindow *window; -@@ -1163,6 +1171,13 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen - return nsres; - } - -+static nsresult NSAPI nsChannel_AsyncOpen2(nsIHttpChannel *iface, nsIStreamListener *aListener) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ FIXME("(%p)->(%p)\n", This, aListener); -+ return nsIHttpChannel_AsyncOpen(&This->nsIHttpChannel_iface, aListener, NULL); -+} -+ - static nsresult NSAPI nsChannel_GetContentDisposition(nsIHttpChannel *iface, UINT32 *aContentDisposition) - { - nsChannel *This = impl_from_nsIHttpChannel(iface); -@@ -1318,6 +1333,13 @@ static nsresult NSAPI nsChannel_SetRequestHeader(nsIHttpChannel *iface, - return set_channel_http_header(&This->request_headers, aHeader, aValue); - } - -+static nsresult NSAPI nsChannel_SetEmptyRequestHeader(nsIHttpChannel *iface, const nsACString *aHeader) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ FIXME("(%p)->(%s)\n", This, debugstr_nsacstr(aHeader)); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static nsresult NSAPI nsChannel_VisitRequestHeaders(nsIHttpChannel *iface, - nsIHttpHeaderVisitor *aVisitor) - { -@@ -1328,6 +1350,13 @@ static nsresult NSAPI nsChannel_VisitRequestHeaders(nsIHttpChannel *iface, - return NS_ERROR_NOT_IMPLEMENTED; - } - -+static nsresult NSAPI nsChannel_VisitNonDefaultRequestHeaders(nsIHttpChannel *iface, nsIHttpHeaderVisitor *aVisitor) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ FIXME("(%p)->(%p)\n", This, aVisitor); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static nsresult NSAPI nsChannel_GetAllowPipelining(nsIHttpChannel *iface, cpp_bool *aAllowPipelining) - { - nsChannel *This = impl_from_nsIHttpChannel(iface); -@@ -1419,6 +1448,20 @@ static nsresult NSAPI nsChannel_GetRequestSucceeded(nsIHttpChannel *iface, - return NS_OK; - } - -+static nsresult NSAPI nsChannel_GetIsMainDocumentChannel(nsIHttpChannel *iface, cpp_bool *aIsMainDocumentChannel) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ FIXME("(%p)->(%p)\n", This, aIsMainDocumentChannel); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ -+static nsresult NSAPI nsChannel_SetIsMainDocumentChannel(nsIHttpChannel *iface, cpp_bool aIsMainDocumentChannel) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ FIXME("(%p)->(%x)\n", This, aIsMainDocumentChannel); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static nsresult NSAPI nsChannel_GetResponseHeader(nsIHttpChannel *iface, - const nsACString *header, nsACString *_retval) - { -@@ -1491,6 +1534,24 @@ static nsresult NSAPI nsChannel_RedirectTo(nsIHttpChannel *iface, nsIURI *aNewUR - return NS_ERROR_NOT_IMPLEMENTED; - } - -+static nsresult NSAPI nsHttpChannel_GetSchedulingContextID(nsIHttpChannel *iface, nsIID *aSchedulingContextID) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ -+ FIXME("(%p)->(%p)\n", This, aSchedulingContextID); -+ -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ -+static nsresult NSAPI nsHttpChannel_SetSchedulingContextID(nsIHttpChannel *iface, const nsIID aSchedulingContextID) -+{ -+ nsChannel *This = impl_from_nsIHttpChannel(iface); -+ -+ FIXME("(%p)->(%s)\n", This, debugstr_guid(&aSchedulingContextID)); -+ -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static const nsIHttpChannelVtbl nsChannelVtbl = { - nsChannel_QueryInterface, - nsChannel_AddRef, -@@ -1520,7 +1581,9 @@ static const nsIHttpChannelVtbl nsChannelVtbl = { - nsChannel_GetContentLength, - nsChannel_SetContentLength, - nsChannel_Open, -+ nsChannel_Open2, - nsChannel_AsyncOpen, -+ nsChannel_AsyncOpen2, - nsChannel_GetContentDisposition, - nsChannel_SetContentDisposition, - nsChannel_GetContentDispositionFilename, -@@ -1536,7 +1599,9 @@ static const nsIHttpChannelVtbl nsChannelVtbl = { - nsChannel_SetReferrerWithPolicy, - nsChannel_GetRequestHeader, - nsChannel_SetRequestHeader, -+ nsChannel_SetEmptyRequestHeader, - nsChannel_VisitRequestHeaders, -+ nsChannel_VisitNonDefaultRequestHeaders, - nsChannel_GetAllowPipelining, - nsChannel_SetAllowPipelining, - nsChannel_GetAllowTLS, -@@ -1546,13 +1611,17 @@ static const nsIHttpChannelVtbl nsChannelVtbl = { - nsChannel_GetResponseStatus, - nsChannel_GetResponseStatusText, - nsChannel_GetRequestSucceeded, -+ nsChannel_GetIsMainDocumentChannel, -+ nsChannel_SetIsMainDocumentChannel, - nsChannel_GetResponseHeader, - nsChannel_SetResponseHeader, - nsChannel_VisitResponseHeaders, - nsChannel_IsNoStoreResponse, - nsChannel_IsNoCacheResponse, - nsChannel_IsPrivateResponse, -- nsChannel_RedirectTo -+ nsChannel_RedirectTo, -+ nsHttpChannel_GetSchedulingContextID, -+ nsHttpChannel_SetSchedulingContextID - }; - - static inline nsChannel *impl_from_nsIUploadChannel(nsIUploadChannel *iface) -@@ -1872,6 +1941,22 @@ static nsresult NSAPI nsHttpChannelInternal_SetResponseTimeoutEnabled(nsIHttpCha - return NS_ERROR_NOT_IMPLEMENTED; - } - -+static nsresult NSAPI nsHttpChannelInternal_GetInitialRwin(nsIHttpChannelInternal *iface, -+ UINT32 *aInitialRwin) -+{ -+ nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -+ FIXME("(%p)->(%p)\n", This, aInitialRwin); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ -+static nsresult NSAPI nsHttpChannelInternal_SetInitialRwin(nsIHttpChannelInternal *iface, -+ UINT32 aInitialRwin) -+{ -+ nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -+ FIXME("(%p)->(%x)\n", This, aInitialRwin); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static nsresult NSAPI nsHttpChannelInternal_GetApiRedirectToURI(nsIHttpChannelInternal *iface, nsIURI **aApiRedirectToURI) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -@@ -1893,24 +1978,24 @@ static nsresult NSAPI nsHttpChannelInternal_SetAllowAltSvc(nsIHttpChannelInterna - return NS_ERROR_NOT_IMPLEMENTED; - } - --static nsresult NSAPI nsHttpChannelInternal_AddRedirect(nsIHttpChannelInternal *iface, nsIPrincipal *aPrincipal) -+static nsresult NSAPI nsHttpChannelInternal_GetLastModifiedTime(nsIHttpChannelInternal *iface, PRTime *aLastModifiedTime) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -- FIXME("(%p)->(%p)\n", This, aPrincipal); -+ FIXME("(%p)->(%p)\n", This, aLastModifiedTime); - return NS_ERROR_NOT_IMPLEMENTED; - } - --static nsresult NSAPI nsHttpChannelInternal_GetLastModifiedTime(nsIHttpChannelInternal *iface, PRTime *aLastModifiedTime) -+static nsresult NSAPI nsHttpChannelInternal_ForceIntercepted(nsIHttpChannelInternal *iface, UINT64 aInterceptionID) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -- FIXME("(%p)->(%p)\n", This, aLastModifiedTime); -+ FIXME("(%p)->(%s)\n", This, wine_dbgstr_longlong(aInterceptionID)); - return NS_ERROR_NOT_IMPLEMENTED; - } - --static nsresult NSAPI nsHttpChannelInternal_ForceNoIntercept(nsIHttpChannelInternal *iface) -+static nsresult NSAPI nsHttpChannelInternal_GetResponseSynthesized(nsIHttpChannelInternal *iface, cpp_bool *ResponseSynthesized) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -- FIXME("(%p)\n", This); -+ FIXME("(%p, %p)\n", This, ResponseSynthesized); - return NS_ERROR_NOT_IMPLEMENTED; - } - -@@ -1944,6 +2029,20 @@ static nsresult NSAPI nsHttpChannelInternal_SetCorsMode(nsIHttpChannelInternal * - return NS_OK; - } - -+static nsresult NSAPI nsHttpChannelInternal_GetRedirectMode(nsIHttpChannelInternal *iface, UINT32 *aRedirectMode) -+{ -+ nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -+ FIXME("(%p)->(%p)\n", This, aRedirectMode); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ -+static nsresult NSAPI nsHttpChannelInternal_SetRedirectMode(nsIHttpChannelInternal *iface, UINT32 aRedirectMode) -+{ -+ nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -+ FIXME("(%p)->(%d)\n", This, aRedirectMode); -+ return NS_ERROR_NOT_IMPLEMENTED; -+} -+ - static nsresult NSAPI nsHttpChannelInternal_GetTopWindowURI(nsIHttpChannelInternal *iface, nsIURI **aTopWindowURI) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -@@ -1967,17 +2066,18 @@ static nsresult NSAPI nsHttpChannelInternal_SetNetworkInterfaceId(nsIHttpChannel - return NS_ERROR_NOT_IMPLEMENTED; - } - --static nsresult NSAPI nsHttpChannelInternal_ContinueBeginConnect(nsIHttpChannelInternal *iface) -+static nsresult NSAPI nsHttpChannelInternal_GetProxyURI(nsIHttpChannelInternal *iface, nsIURI **aProxyURI) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -- FIXME("(%p)\n", This); -+ FIXME("(%p)->(%p)\n", This, aProxyURI); - return NS_ERROR_NOT_IMPLEMENTED; - } - --static nsresult NSAPI nsHttpChannelInternal_GetProxyURI(nsIHttpChannelInternal *iface, nsIURI **aProxyURI) -+static nsresult NSAPI nsHttpChannelInternal_SetCorsPreflightParameters(nsIHttpChannelInternal *iface, -+ const void /*nsTArray*/ *unsafeHeaders, cpp_bool withCredentials, nsIPrincipal *preflightPrincipal) - { - nsChannel *This = impl_from_nsIHttpChannelInternal(iface); -- FIXME("(%p)->(%p)\n", This, aProxyURI); -+ FIXME("(%p %p %x %p)\n", This, unsafeHeaders, withCredentials, preflightPrincipal); - return NS_ERROR_NOT_IMPLEMENTED; - } - -@@ -2009,21 +2109,25 @@ static const nsIHttpChannelInternalVtbl nsHttpChannelInternalVtbl = { - nsHttpChannelInternal_SetAllowSpdy, - nsHttpChannelInternal_GetResponseTimeoutEnabled, - nsHttpChannelInternal_SetResponseTimeoutEnabled, -+ nsHttpChannelInternal_GetInitialRwin, -+ nsHttpChannelInternal_SetInitialRwin, - nsHttpChannelInternal_GetApiRedirectToURI, - nsHttpChannelInternal_GetAllowAltSvc, - nsHttpChannelInternal_SetAllowAltSvc, -- nsHttpChannelInternal_AddRedirect, - nsHttpChannelInternal_GetLastModifiedTime, -- nsHttpChannelInternal_ForceNoIntercept, -+ nsHttpChannelInternal_ForceIntercepted, -+ nsHttpChannelInternal_GetResponseSynthesized, - nsHttpChannelInternal_GetCorsIncludeCredentials, - nsHttpChannelInternal_SetCorsIncludeCredentials, - nsHttpChannelInternal_GetCorsMode, - nsHttpChannelInternal_SetCorsMode, -+ nsHttpChannelInternal_GetRedirectMode, -+ nsHttpChannelInternal_SetRedirectMode, - nsHttpChannelInternal_GetTopWindowURI, - nsHttpChannelInternal_GetNetworkInterfaceId, - nsHttpChannelInternal_SetNetworkInterfaceId, -- nsHttpChannelInternal_ContinueBeginConnect, -- nsHttpChannelInternal_GetProxyURI -+ nsHttpChannelInternal_GetProxyURI, -+ nsHttpChannelInternal_SetCorsPreflightParameters - }; - - -@@ -2711,6 +2815,15 @@ static nsresult NSAPI nsURI_GetAsciiSpec(nsIFileURL *iface, nsACString *aAsciiSp - return nsIFileURL_GetSpec(&This->nsIFileURL_iface, aAsciiSpec); - } - -+static nsresult NSAPI nsURI_GetAsciiHostPort(nsIFileURL *iface, nsACString *aAsciiHostPort) -+{ -+ nsWineURI *This = impl_from_nsIFileURL(iface); -+ -+ WARN("(%p)->(%p) FIXME: Use Uri_PUNYCODE_IDN_HOST flag\n", This, aAsciiHostPort); -+ -+ return nsIFileURL_GetAsciiHostPort(&This->nsIFileURL_iface, aAsciiHostPort); -+} -+ - static nsresult NSAPI nsURI_GetAsciiHost(nsIFileURL *iface, nsACString *aAsciiHost) - { - nsWineURI *This = impl_from_nsIFileURL(iface); -@@ -3123,6 +3236,7 @@ static const nsIFileURLVtbl nsFileURLVtbl = { - nsURI_Clone, - nsURI_Resolve, - nsURI_GetAsciiSpec, -+ nsURI_GetAsciiHostPort, - nsURI_GetAsciiHost, - nsURI_GetOriginCharset, - nsURL_GetRef, -@@ -3506,38 +3620,78 @@ static const nsIProtocolHandlerVtbl nsProtocolHandlerVtbl = { - nsProtocolHandler_AllowPort - }; - --static nsresult NSAPI nsIOService_QueryInterface(nsIIOService*,nsIIDRef,void**); -+static nsresult NSAPI nsIOServiceHook_QueryInterface(nsIIOServiceHook *iface, nsIIDRef riid, -+ void **result) -+{ -+ if(IsEqualGUID(&IID_nsISupports, riid)) { -+ TRACE("(IID_nsISupports %p)\n", result); -+ *result = iface; -+ }else if(IsEqualGUID(&IID_nsIIOServiceHook, riid)) { -+ TRACE("(IID_nsIIOServiceHook %p)\n", result); -+ *result = iface; -+ }else { -+ ERR("(%s %p)\n", debugstr_guid(riid), result); -+ *result = NULL; -+ return NS_NOINTERFACE; -+ } -+ -+ nsISupports_AddRef((nsISupports*)*result); -+ return NS_OK; -+} - --static nsrefcnt NSAPI nsIOService_AddRef(nsIIOService *iface) -+static nsrefcnt NSAPI nsIOServiceHook_AddRef(nsIIOServiceHook *iface) - { - return 2; - } - --static nsrefcnt NSAPI nsIOService_Release(nsIIOService *iface) -+static nsrefcnt NSAPI nsIOServiceHook_Release(nsIIOServiceHook *iface) - { - return 1; - } - --static nsresult NSAPI nsIOService_GetProtocolHandler(nsIIOService *iface, const char *aScheme, -- nsIProtocolHandler **_retval) -+static nsresult NSAPI nsIOServiceHook_NewChannel(nsIIOServiceHook *iface, nsIURI *aURI, -+ nsILoadInfo *aLoadInfo, nsIChannel **_retval) - { -- nsIExternalProtocolHandler *nsexthandler; -- nsIProtocolHandler *nshandler; -- nsProtocolHandler *ret; -+ nsWineURI *wine_uri; -+ nsChannel *ret; - nsresult nsres; - -- TRACE("(%s %p)\n", debugstr_a(aScheme), _retval); -+ TRACE("(%p %p %p)\n", aURI, aLoadInfo, _retval); - -- nsres = nsIIOService_GetProtocolHandler(nsio, aScheme, &nshandler); -+ nsres = nsIURI_QueryInterface(aURI, &IID_nsWineURI, (void**)&wine_uri); - if(NS_FAILED(nsres)) { -- WARN("GetProtocolHandler failed: %08x\n", nsres); -- return nsres; -+ TRACE("Could not get nsWineURI: %08x\n", nsres); -+ return NS_SUCCESS_DEFAULT_ACTION; - } - -- nsres = nsIProtocolHandler_QueryInterface(nshandler, &IID_nsIExternalProtocolHandler, -- (void**)&nsexthandler); -+ nsres = create_nschannel(wine_uri, &ret); -+ nsIFileURL_Release(&wine_uri->nsIFileURL_iface); -+ if(NS_FAILED(nsres)) -+ return nsres; -+ -+ nsIURI_AddRef(aURI); -+ ret->original_uri = aURI; -+ -+ if(aLoadInfo) -+ nsIHttpChannel_SetLoadInfo(&ret->nsIHttpChannel_iface, aLoadInfo); -+ -+ *_retval = (nsIChannel*)&ret->nsIHttpChannel_iface; -+ return NS_OK; -+} -+ -+static nsresult NSAPI nsIOServiceHook_GetProtocolHandler(nsIIOServiceHook *iface, nsIProtocolHandler *aHandler, -+ nsIProtocolHandler **_retval) -+{ -+ nsIExternalProtocolHandler *nsexthandler; -+ nsProtocolHandler *ret; -+ nsresult nsres; -+ -+ TRACE("(%p %p)\n", aHandler, _retval); -+ -+ nsres = nsIProtocolHandler_QueryInterface(aHandler, &IID_nsIExternalProtocolHandler, (void**)&nsexthandler); - if(NS_FAILED(nsres)) { -- *_retval = nshandler; -+ nsIProtocolHandler_AddRef(aHandler); -+ *_retval = aHandler; - return NS_OK; - } - -@@ -3549,20 +3703,15 @@ static nsresult NSAPI nsIOService_GetProtocolHandler(nsIIOService *iface, const - - ret->nsIProtocolHandler_iface.lpVtbl = &nsProtocolHandlerVtbl; - ret->ref = 1; -- ret->nshandler = nshandler; -- *_retval = &ret->nsIProtocolHandler_iface; -+ nsIProtocolHandler_AddRef(aHandler); -+ ret->nshandler = aHandler; -+ - -+ *_retval = &ret->nsIProtocolHandler_iface; - TRACE("return %p\n", *_retval); - return NS_OK; - } - --static nsresult NSAPI nsIOService_GetProtocolFlags(nsIIOService *iface, const char *aScheme, -- UINT32 *_retval) --{ -- TRACE("(%s %p)\n", debugstr_a(aScheme), _retval); -- return nsIIOService_GetProtocolFlags(nsio, aScheme, _retval); --} -- - static BOOL is_gecko_special_uri(const char *spec) - { - static const char *special_schemes[] = {"chrome:", "data:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"}; -@@ -3583,7 +3732,7 @@ static BOOL is_gecko_special_uri(const char *spec) - return FALSE; - } - --static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *aSpec, -+static nsresult NSAPI nsIOServiceHook_NewURI(nsIIOServiceHook *iface, const nsACString *aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) - { - nsWineURI *wine_uri, *base_wine_uri = NULL; -@@ -3600,7 +3749,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * - - nsACString_GetData(aSpec, &spec); - if(is_gecko_special_uri(spec)) -- return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); -+ return NS_SUCCESS_DEFAULT_ACTION; - - if(!strncmp(spec, "wine:", 5)) - spec += 5; -@@ -3643,7 +3792,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * - } - - if(FAILED(hres)) -- return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); -+ return NS_SUCCESS_DEFAULT_ACTION; - - nsres = create_nsuri(urlmon_uri, window, NULL, NULL, &wine_uri); - IUri_Release(urlmon_uri); -@@ -3656,192 +3805,6 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * - return nsres; - } - --static nsresult NSAPI nsIOService_NewFileURI(nsIIOService *iface, nsIFile *aFile, -- nsIURI **_retval) --{ -- TRACE("(%p %p)\n", aFile, _retval); -- return nsIIOService_NewFileURI(nsio, aFile, _retval); --} -- --static nsresult new_channel_from_uri(nsIURI *uri, nsILoadInfo *load_info, nsIChannel **_retval) --{ -- nsWineURI *wine_uri; -- nsChannel *ret; -- nsresult nsres; -- -- nsres = nsIURI_QueryInterface(uri, &IID_nsWineURI, (void**)&wine_uri); -- if(NS_FAILED(nsres)) { -- TRACE("Could not get nsWineURI: %08x\n", nsres); -- return nsIIOService_NewChannelFromURI(nsio, uri, _retval); -- } -- -- nsres = create_nschannel(wine_uri, &ret); -- nsIFileURL_Release(&wine_uri->nsIFileURL_iface); -- if(NS_FAILED(nsres)) -- return nsres; -- -- nsIURI_AddRef(uri); -- ret->original_uri = uri; -- -- if(load_info) -- nsIHttpChannel_SetLoadInfo(&ret->nsIHttpChannel_iface, load_info); -- -- *_retval = (nsIChannel*)&ret->nsIHttpChannel_iface; -- return NS_OK; --} -- --static nsresult NSAPI nsIOService_NewChannelFromURI2(nsIIOService *iface, nsIURI *aURI, -- nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, -- UINT32 aSecurityFlags, UINT32 aContentPolicyType, nsIChannel **_retval) --{ -- nsILoadInfo *load_info = NULL; -- nsresult nsres; -- -- TRACE("(%p %p %p %p %x %d %p)\n", aURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, -- aSecurityFlags, aContentPolicyType, _retval); -- -- if(aLoadingNode || aLoadingPrincipal) { -- nsres = nsIIOService_NewLoadInfo(nsio, aLoadingPrincipal, aTriggeringPrincipal, aLoadingNode, -- aSecurityFlags, aContentPolicyType, &load_info); -- assert(nsres == NS_OK); -- } -- -- nsres = new_channel_from_uri(aURI, load_info, _retval); -- if(load_info) -- nsISupports_Release(load_info); -- return nsres; --} -- --static nsresult NSAPI nsIOService_NewChannelFromURIWithLoadInfo(nsIIOService *iface, nsIURI *aURI, -- nsILoadInfo *aLoadInfo, nsIChannel **_retval) --{ -- TRACE("(%p %p %p)\n", aURI, aLoadInfo, _retval); -- return new_channel_from_uri(aURI, aLoadInfo, _retval); --} -- --static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI *aURI, -- nsIChannel **_retval) --{ -- TRACE("(%p %p)\n", aURI, _retval); -- return new_channel_from_uri(aURI, NULL, _retval); --} -- --static nsresult NSAPI nsIOService_NewChannel2(nsIIOService *iface, const nsACString *aSpec, -- const char *aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, -- nsIPrincipal *aTriggeringPrincipal, UINT32 aSecurityFlags, UINT32 aContentPolicyType, nsIChannel **_retval) --{ -- TRACE("(%s %s %p %p %p %p %x %d %p)\n", debugstr_nsacstr(aSpec), debugstr_a(aOriginCharset), aBaseURI, -- aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); -- return nsIIOService_NewChannel2(nsio, aSpec, aOriginCharset, aBaseURI, aLoadingNode, aLoadingPrincipal, -- aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); --} -- --static nsresult NSAPI nsIOService_NewChannel(nsIIOService *iface, const nsACString *aSpec, -- const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval) --{ -- TRACE("(%s %s %p %p)\n", debugstr_nsacstr(aSpec), debugstr_a(aOriginCharset), aBaseURI, _retval); -- return nsIIOService_NewChannel(nsio, aSpec, aOriginCharset, aBaseURI, _retval); --} -- --static nsresult NSAPI nsIOService_GetOffline(nsIIOService *iface, cpp_bool *aOffline) --{ -- TRACE("(%p)\n", aOffline); -- return nsIIOService_GetOffline(nsio, aOffline); --} -- --static nsresult NSAPI nsIOService_SetOffline(nsIIOService *iface, cpp_bool aOffline) --{ -- TRACE("(%x)\n", aOffline); -- return nsIIOService_SetOffline(nsio, aOffline); --} -- --static nsresult NSAPI nsIOService_GetConnectivity(nsIIOService *iface, cpp_bool *aConnectivity) --{ -- TRACE("(%p)\n", aConnectivity); -- return nsIIOService_GetConnectivity(nsio, aConnectivity); --} -- --static nsresult NSAPI nsIOService_SetAppOffline(nsIIOService *iface, UINT32 appId, INT32 state) --{ -- TRACE("(%d %x)\n", appId, state); -- return nsIIOService_SetAppOffline(nsio, appId, state); --} -- --static nsresult NSAPI nsIOService_IsAppOffline(nsIIOService *iface, UINT32 appId, cpp_bool *_retval) --{ -- TRACE("(%u %p)\n", appId, _retval); -- return nsIIOService_IsAppOffline(nsio, appId, _retval); --} -- --static nsresult NSAPI nsIOService_GetAppOfflineState(nsIIOService *iface, UINT32 appId, INT32 *_retval) --{ -- TRACE("(%d %p)\n", appId, _retval); -- return nsIIOService_GetAppOfflineState(nsio, appId, _retval); --} -- --static nsresult NSAPI nsIOService_AllowPort(nsIIOService *iface, LONG aPort, -- const char *aScheme, cpp_bool *_retval) --{ -- TRACE("(%d %s %p)\n", aPort, debugstr_a(aScheme), _retval); -- return nsIIOService_AllowPort(nsio, aPort, debugstr_a(aScheme), _retval); --} -- --static nsresult NSAPI nsIOService_ExtractScheme(nsIIOService *iface, const nsACString *urlString, -- nsACString * _retval) --{ -- TRACE("(%s %p)\n", debugstr_nsacstr(urlString), _retval); -- return nsIIOService_ExtractScheme(nsio, urlString, _retval); --} -- --static const nsIIOServiceVtbl nsIOServiceVtbl = { -- nsIOService_QueryInterface, -- nsIOService_AddRef, -- nsIOService_Release, -- nsIOService_GetProtocolHandler, -- nsIOService_GetProtocolFlags, -- nsIOService_NewURI, -- nsIOService_NewFileURI, -- nsIOService_NewChannelFromURI2, -- nsIOService_NewChannelFromURIWithLoadInfo, -- nsIOService_NewChannelFromURI, -- nsIOService_NewChannel2, -- nsIOService_NewChannel, -- nsIOService_GetOffline, -- nsIOService_SetOffline, -- nsIOService_GetConnectivity, -- nsIOService_SetAppOffline, -- nsIOService_IsAppOffline, -- nsIOService_GetAppOfflineState, -- nsIOService_AllowPort, -- nsIOService_ExtractScheme --}; -- --static nsIIOService nsIOService = { &nsIOServiceVtbl }; -- --static nsresult NSAPI nsNetUtil_QueryInterface(nsINetUtil *iface, nsIIDRef riid, -- void **result) --{ -- return nsIIOService_QueryInterface(&nsIOService, riid, result); --} -- --static nsrefcnt NSAPI nsNetUtil_AddRef(nsINetUtil *iface) --{ -- return 2; --} -- --static nsrefcnt NSAPI nsNetUtil_Release(nsINetUtil *iface) --{ -- return 1; --} -- --static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader, -- nsACString *aCharset, cpp_bool *aHadCharset, nsACString *aContentType) --{ -- TRACE("(%s %p %p %p)\n", debugstr_nsacstr(aTypeHeader), aCharset, aHadCharset, aContentType); -- -- return nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType); --} -- - static const char *debugstr_protocol_flags(UINT32 flags) - { - switch(flags) { -@@ -3866,169 +3829,43 @@ static const char *debugstr_protocol_flags(UINT32 flags) - X(URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM); - X(URI_SYNC_LOAD_IS_OK); - X(URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT); -+ X(URI_FETCHABLE_BY_ANYONE); - #undef X - default: - return wine_dbg_sprintf("%08x", flags); - } - } - --static nsresult NSAPI nsNetUtil_ProtocolHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) -+static nsresult NSAPI nsIOServiceHook_ProtocolHasFlags(nsIIOServiceHook *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) - { - TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); -- -- return nsINetUtil_ProtocolHasFlags(net_util, aURI, aFlags, _retval); -+ return NS_SUCCESS_DEFAULT_ACTION; - } - --static nsresult NSAPI nsNetUtil_URIChainHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) -+static nsresult NSAPI nsIOServiceHook_URIChainHasFlags(nsIIOServiceHook *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) - { - TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); - - if(aFlags == URI_DOES_NOT_RETURN_DATA) { - *_retval = FALSE; -- return NS_OK; -- } -- -- return nsINetUtil_URIChainHasFlags(net_util, aURI, aFlags, _retval); --} -- --static nsresult NSAPI nsNetUtil_ToImmutableURI(nsINetUtil *iface, nsIURI *aURI, nsIURI **_retval) --{ -- TRACE("(%p %p)\n", aURI, _retval); -- -- return nsINetUtil_ToImmutableURI(net_util, aURI, _retval); --} -- --static nsresult NSAPI nsNetUtil_NewSimpleNestedURI(nsINetUtil *iface, nsIURI *aURI, nsIURI **_retval) --{ -- TRACE("(%p %p)\n", aURI, _retval); -- -- return nsINetUtil_NewSimpleNestedURI(net_util, aURI, _retval); --} -- --static nsresult NSAPI nsNetUtil_EscapeString(nsINetUtil *iface, const nsACString *aString, -- UINT32 aEscapeType, nsACString *_retval) --{ -- TRACE("(%s %x %p)\n", debugstr_nsacstr(aString), aEscapeType, _retval); -- -- return nsINetUtil_EscapeString(net_util, aString, aEscapeType, _retval); --} -- --static nsresult NSAPI nsNetUtil_EscapeURL(nsINetUtil *iface, const nsACString *aStr, UINT32 aFlags, -- nsACString *_retval) --{ -- TRACE("(%s %08x %p)\n", debugstr_nsacstr(aStr), aFlags, _retval); -- -- return nsINetUtil_EscapeURL(net_util, aStr, aFlags, _retval); --} -- --static nsresult NSAPI nsNetUtil_UnescapeString(nsINetUtil *iface, const nsACString *aStr, -- UINT32 aFlags, nsACString *_retval) --{ -- TRACE("(%s %08x %p)\n", debugstr_nsacstr(aStr), aFlags, _retval); -- -- return nsINetUtil_UnescapeString(net_util, aStr, aFlags, _retval); --} -- --static nsresult NSAPI nsNetUtil_ExtractCharsetFromContentType(nsINetUtil *iface, const nsACString *aTypeHeader, -- nsACString *aCharset, LONG *aCharsetStart, LONG *aCharsetEnd, cpp_bool *_retval) --{ -- TRACE("(%s %p %p %p %p)\n", debugstr_nsacstr(aTypeHeader), aCharset, aCharsetStart, -- aCharsetEnd, _retval); -- -- return nsINetUtil_ExtractCharsetFromContentType(net_util, aTypeHeader, aCharset, aCharsetStart, aCharsetEnd, _retval); --} -- --static const nsINetUtilVtbl nsNetUtilVtbl = { -- nsNetUtil_QueryInterface, -- nsNetUtil_AddRef, -- nsNetUtil_Release, -- nsNetUtil_ParseContentType, -- nsNetUtil_ProtocolHasFlags, -- nsNetUtil_URIChainHasFlags, -- nsNetUtil_ToImmutableURI, -- nsNetUtil_NewSimpleNestedURI, -- nsNetUtil_EscapeString, -- nsNetUtil_EscapeURL, -- nsNetUtil_UnescapeString, -- nsNetUtil_ExtractCharsetFromContentType --}; -- --static nsINetUtil nsNetUtil = { &nsNetUtilVtbl }; -- --static nsresult NSAPI nsIOService_QueryInterface(nsIIOService *iface, nsIIDRef riid, -- void **result) --{ -- *result = NULL; -- -- if(IsEqualGUID(&IID_nsISupports, riid)) -- *result = &nsIOService; -- else if(IsEqualGUID(&IID_nsIIOService, riid)) -- *result = &nsIOService; -- else if(IsEqualGUID(&IID_nsINetUtil, riid)) -- *result = &nsNetUtil; -- -- if(*result) { -- nsISupports_AddRef((nsISupports*)*result); -- return NS_OK; -- } -- -- FIXME("(%s %p)\n", debugstr_guid(riid), result); -- return NS_NOINTERFACE; --} -- --static nsresult NSAPI nsIOServiceFactory_QueryInterface(nsIFactory *iface, nsIIDRef riid, -- void **result) --{ -- *result = NULL; -- -- if(IsEqualGUID(&IID_nsISupports, riid)) { -- TRACE("(IID_nsISupports %p)\n", result); -- *result = iface; -- }else if(IsEqualGUID(&IID_nsIFactory, riid)) { -- TRACE("(IID_nsIFactory %p)\n", result); -- *result = iface; -- } -- -- if(*result) { -- nsIFactory_AddRef(iface); -- return NS_OK; -+ return S_OK; - } - -- WARN("(%s %p)\n", debugstr_guid(riid), result); -- return NS_NOINTERFACE; --} -- --static nsrefcnt NSAPI nsIOServiceFactory_AddRef(nsIFactory *iface) --{ -- return 2; --} -- --static nsrefcnt NSAPI nsIOServiceFactory_Release(nsIFactory *iface) --{ -- return 1; --} -- --static nsresult NSAPI nsIOServiceFactory_CreateInstance(nsIFactory *iface, -- nsISupports *aOuter, const nsIID *iid, void **result) --{ -- return nsIIOService_QueryInterface(&nsIOService, iid, result); -+ return NS_SUCCESS_DEFAULT_ACTION; - } - --static nsresult NSAPI nsIOServiceFactory_LockFactory(nsIFactory *iface, cpp_bool lock) --{ -- WARN("(%x)\n", lock); -- return NS_OK; --} -- --static const nsIFactoryVtbl nsIOServiceFactoryVtbl = { -- nsIOServiceFactory_QueryInterface, -- nsIOServiceFactory_AddRef, -- nsIOServiceFactory_Release, -- nsIOServiceFactory_CreateInstance, -- nsIOServiceFactory_LockFactory -+static const nsIIOServiceHookVtbl nsIOServiceHookVtbl = { -+ nsIOServiceHook_QueryInterface, -+ nsIOServiceHook_AddRef, -+ nsIOServiceHook_Release, -+ nsIOServiceHook_NewChannel, -+ nsIOServiceHook_GetProtocolHandler, -+ nsIOServiceHook_NewURI, -+ nsIOServiceHook_ProtocolHasFlags, -+ nsIOServiceHook_URIChainHasFlags - }; - --static nsIFactory nsIOServiceFactory = { &nsIOServiceFactoryVtbl }; -+static nsIIOServiceHook nsIOServiceHook = { &nsIOServiceHookVtbl }; - - static BOOL translate_url(HTMLDocumentObj *doc, nsWineURI *uri) - { -@@ -4086,7 +3923,7 @@ nsresult on_start_uri_open(NSContainer *nscontainer, nsIURI *uri, cpp_bool *_ret - return NS_OK; - } - --void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *registrar) -+void init_nsio(nsIComponentManager *component_manager) - { - nsIFactory *old_factory = NULL; - nsresult nsres; -@@ -4105,31 +3942,12 @@ void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *re - return; - } - -- nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util); -- if(NS_FAILED(nsres)) { -- WARN("Could not get nsINetUtil interface: %08x\n", nsres); -- nsIIOService_Release(nsio); -- return; -- } -- -- nsres = nsIComponentRegistrar_UnregisterFactory(registrar, &NS_IOSERVICE_CID, old_factory); -- nsIFactory_Release(old_factory); -- if(NS_FAILED(nsres)) -- ERR("UnregisterFactory failed: %08x\n", nsres); -- -- nsres = nsIComponentRegistrar_RegisterFactory(registrar, &NS_IOSERVICE_CID, -- NS_IOSERVICE_CLASSNAME, NS_IOSERVICE_CONTRACTID, &nsIOServiceFactory); -- if(NS_FAILED(nsres)) -- ERR("RegisterFactory failed: %08x\n", nsres); -+ nsres = nsIIOService_SetHook(nsio, &nsIOServiceHook); -+ assert(nsres == NS_OK); - } - - void release_nsio(void) - { -- if(net_util) { -- nsINetUtil_Release(net_util); -- net_util = NULL; -- } -- - if(nsio) { - nsIIOService_Release(nsio); - nsio = NULL; --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0002-mshtml-Fix-some-prototypes.patch wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0002-mshtml-Fix-some-prototypes.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0002-mshtml-Fix-some-prototypes.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/0002-mshtml-Fix-some-prototypes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -From 0f20e0be16fd905bef6f4ff1f170a43601c49c69 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Wed, 6 Jan 2016 18:51:06 +0100 -Subject: mshtml: Fix some prototypes. - ---- - dlls/mshtml/mutation.c | 4 ++-- - dlls/mshtml/nsiface.idl | 6 +++--- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c -index a07c52d..22a3e61 100644 ---- a/dlls/mshtml/mutation.c -+++ b/dlls/mshtml/mutation.c -@@ -526,12 +526,12 @@ static void NSAPI nsDocumentObserver_CharacterDataChanged(nsIDocumentObserver *i - } - - static void NSAPI nsDocumentObserver_AttributeWillChange(nsIDocumentObserver *iface, nsIDocument *aDocument, -- nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) -+ void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) - { - } - - static void NSAPI nsDocumentObserver_AttributeChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, -- nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aNewValue) -+ void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType, const nsAttrValue *aOldValue) - { - } - -diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl -index 75e75e0..52ca1d84 100644 ---- a/dlls/mshtml/nsiface.idl -+++ b/dlls/mshtml/nsiface.idl -@@ -3948,10 +3948,10 @@ interface nsIMutationObserver : nsISupports - void /*CharacterDataChangeInfo*/ *aInfo); - void CharacterDataChanged(nsIDocument *aDocument, nsIContent *aContent, - void /*CharacterDataChangeInfo*/ *aInfo); -- void AttributeWillChange(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, -+ void AttributeWillChange(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, int32_t aNameSpaceID, - nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aNewValue); -- void AttributeChanged(nsIDocument *aDocument, nsIContent *aContent, int32_t aNameSpaceID, -- nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aNewValue); -+ void AttributeChanged(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, int32_t aNameSpaceID, -+ nsIAtom *aAttribute, int32_t aModType, const nsAttrValue *aOldValue); - void NativeAnonymousChildListChange(nsIDocument *aDocument, nsIContent *aContent, bool aIsRemove); - void AttributeSetToCurrentValue(nsIDocument *aDocument, /*mozilla::dom::Element*/ void *aElement, - int32_t aNameSpaceID, nsIAtom *aAttribute); --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/definition wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/mshtml-Wine_Gecko_2.44/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Update Wine-Gecko to 2.44-beta1 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/0001-msvideo.dll-Translate-16-bit-address-in-MCIWNDM_SETT.patch wine-staging-1.9.3~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/0001-msvideo.dll-Translate-16-bit-address-in-MCIWNDM_SETT.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/0001-msvideo.dll-Translate-16-bit-address-in-MCIWNDM_SETT.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/0001-msvideo.dll-Translate-16-bit-address-in-MCIWNDM_SETT.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,28 @@ +From 3e131a30d2f1b69de3c378b54f82f03f45bba6bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 6 Feb 2016 02:24:05 +0100 +Subject: msvideo.dll16: Translate 16 bit address in MCIWNDM_SETTIMEFORMATA + command. + +--- + dlls/msvideo.dll16/msvideo16.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/msvideo.dll16/msvideo16.c b/dlls/msvideo.dll16/msvideo16.c +index 1b715e4..f39b52d 100644 +--- a/dlls/msvideo.dll16/msvideo16.c ++++ b/dlls/msvideo.dll16/msvideo16.c +@@ -991,6 +991,10 @@ static LRESULT WINAPI MCIWndProc16(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp + lparam = (ULONG_PTR)MapSL(lparam); + break; + ++ case MCIWNDM_SETTIMEFORMATA: ++ lparam = (ULONG_PTR)MapSL(lparam); ++ break; ++ + default: + break; + } +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/definition wine-staging-1.9.3~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/msvideo-MCIWNDM_SETTIMEFORMATA/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Translate 16 bit address in MCIWNDM_SETTIMEFORMATA MCIWndProc16 command diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,17 +1,17 @@ -From 12b1d27763ce61ee38b3694e68c44a96d9b17102 Mon Sep 17 00:00:00 2001 +From 536b80a9145b26aa771b390ec29978dfa6f45344 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 20 Aug 2014 15:28:00 -0600 Subject: ntdll: Implement storing DOS attributes in NtCreateFile. --- - dlls/ntdll/file.c | 74 ++++++++++++++++++++++++++++---------------- + dlls/ntdll/file.c | 76 ++++++++++++++++++++++++++++---------------- dlls/ntdll/tests/directory.c | 24 ++++++-------- include/wine/port.h | 2 ++ libs/port/xattr.c | 20 ++++++++++++ - 4 files changed, 79 insertions(+), 41 deletions(-) + 4 files changed, 80 insertions(+), 42 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 3dfcbf8..13787ba 100644 +index 3146926..2a71613 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -219,6 +219,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr ) @@ -36,28 +36,30 @@ /************************************************************************** * FILE_CreateFile (internal) * Open a file. -@@ -230,6 +245,9 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT +@@ -230,6 +245,10 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT ULONG attributes, ULONG sharing, ULONG disposition, ULONG options, PVOID ea_buffer, ULONG ea_length ) { ++ static UNICODE_STRING empty_string; + OBJECT_ATTRIBUTES unix_attr; + data_size_t len; + struct object_attributes *objattr; ANSI_STRING unix_name; BOOL created = FALSE; -@@ -273,36 +291,34 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT +@@ -273,37 +292,34 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT io->u.Status = STATUS_SUCCESS; } - if (io->u.Status == STATUS_SUCCESS) + if (io->u.Status != STATUS_SUCCESS) { +- static UNICODE_STRING empty_string; - OBJECT_ATTRIBUTES unix_attr = *attr; - data_size_t len; - struct object_attributes *objattr; - -- unix_attr.ObjectName = NULL; /* we send the unix name instead */ +- unix_attr.ObjectName = &empty_string; /* we send the unix name instead */ - if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len ))) - { - RtlFreeAnsiString( &unix_name ); @@ -82,7 +84,7 @@ - SERVER_END_REQ; - RtlFreeHeap( GetProcessHeap(), 0, objattr ); + unix_attr = *attr; -+ unix_attr.ObjectName = NULL; /* we send the unix name instead */ ++ unix_attr.ObjectName = &empty_string; /* we send the unix name instead */ + if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len ))) + { RtlFreeAnsiString( &unix_name ); @@ -107,7 +109,7 @@ if (io->u.Status == STATUS_SUCCESS) { -@@ -324,6 +340,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT +@@ -325,6 +341,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT io->Information = FILE_OVERWRITTEN; break; } @@ -119,7 +121,7 @@ } else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES) { -@@ -331,6 +352,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT +@@ -332,6 +353,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" ); } @@ -218,5 +220,5 @@ +#endif +} -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/0001-ntdll-Return-STATUS_SUCCESS-from-NtQuerySystemInform.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/0001-ntdll-Return-STATUS_SUCCESS-from-NtQuerySystemInform.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/0001-ntdll-Return-STATUS_SUCCESS-from-NtQuerySystemInform.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/0001-ntdll-Return-STATUS_SUCCESS-from-NtQuerySystemInform.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 1b56ed8fa19d38ff6d17884da2b23ff38a3bd79c Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Wed, 6 Jan 2016 15:29:57 +0100 -Subject: ntdll: Return STATUS_SUCCESS from NtQuerySystemInformationEx. - ---- - dlls/ntdll/nt.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 9ee1923..1214978 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2180,7 +2180,8 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform - { - FIXME("(0x%08x,%p,%u,%p,%u,%p) stub\n", SystemInformationClass, Query, QueryLength, SystemInformation, - Length, ResultLength); -- return STATUS_NOT_IMPLEMENTED; -+ if (ResultLength) *ResultLength = 0; -+ return STATUS_SUCCESS; - } - - /****************************************************************************** --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-NtQuerySystemInformationEx/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From a6e5e1a95b0879808e629e6e2ba617c2e68d7608 Mon Sep 17 00:00:00 2001 +From 2ea2d12561993dba7a8b042bdac894c9967d0c85 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 16 Oct 2015 02:32:58 +0200 Subject: ntdll: Use wrapper functions for syscalls. @@ -81,7 +81,7 @@ { NTSTATUS status; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index f3c6aa2..cb552bd 100644 +index 04c8e26..e4b7069 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2210,7 +2210,8 @@ done: @@ -141,10 +141,10 @@ HARDERROR_RESPONSE_OPTION ResponseOption, PHARDERROR_RESPONSE Response ) { diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index d547591..28a0281 100644 +index 43b74b2..2e24079 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c -@@ -295,7 +295,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT +@@ -296,7 +296,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT * Success: 0. FileHandle and IoStatusBlock are updated. * Failure: An NTSTATUS error code describing the error. */ @@ -154,7 +154,7 @@ POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK io, ULONG sharing, ULONG options ) { -@@ -327,7 +328,8 @@ NTSTATUS WINAPI NtOpenFile( PHANDLE handle, ACCESS_MASK access, +@@ -328,7 +329,8 @@ NTSTATUS WINAPI NtOpenFile( PHANDLE handle, ACCESS_MASK access, * Success: 0. handle and io are updated. * Failure: An NTSTATUS error code describing the error. */ @@ -164,7 +164,7 @@ PIO_STATUS_BLOCK io, PLARGE_INTEGER alloc_size, ULONG attributes, ULONG sharing, ULONG disposition, ULONG options, PVOID ea_buffer, ULONG ea_length ) -@@ -791,7 +793,8 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL +@@ -792,7 +794,8 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL * The number of bytes read. * Failure: An NTSTATUS error code describing the error. */ @@ -174,7 +174,7 @@ PIO_APC_ROUTINE apc, void* apc_user, PIO_STATUS_BLOCK io_status, void* buffer, ULONG length, PLARGE_INTEGER offset, PULONG key) -@@ -1002,7 +1005,8 @@ err: +@@ -1003,7 +1006,8 @@ err: * NtReadFileScatter [NTDLL.@] * ZwReadFileScatter [NTDLL.@] */ @@ -184,7 +184,7 @@ PIO_STATUS_BLOCK io_status, FILE_SEGMENT_ELEMENT *segments, ULONG length, PLARGE_INTEGER offset, PULONG key ) { -@@ -1174,7 +1178,8 @@ static NTSTATUS set_pending_write( HANDLE device ) +@@ -1175,7 +1179,8 @@ static NTSTATUS set_pending_write( HANDLE device ) * The number of bytes written. * Failure: An NTSTATUS error code describing the error. */ @@ -194,7 +194,7 @@ PIO_APC_ROUTINE apc, void* apc_user, PIO_STATUS_BLOCK io_status, const void* buffer, ULONG length, -@@ -1408,7 +1413,8 @@ err: +@@ -1409,7 +1414,8 @@ err: * NtWriteFileGather [NTDLL.@] * ZwWriteFileGather [NTDLL.@] */ @@ -204,7 +204,7 @@ PIO_STATUS_BLOCK io_status, FILE_SEGMENT_ELEMENT *segments, ULONG length, PLARGE_INTEGER offset, PULONG key ) { -@@ -1597,7 +1603,8 @@ static void ignore_server_ioctl_struct_holes (ULONG code, const void *in_buffer, +@@ -1598,7 +1604,8 @@ static void ignore_server_ioctl_struct_holes (ULONG code, const void *in_buffer, * Success: 0. IoStatusBlock is updated. * Failure: An NTSTATUS error code describing the error. */ @@ -214,7 +214,7 @@ PIO_APC_ROUTINE apc, PVOID apc_context, PIO_STATUS_BLOCK io, ULONG code, PVOID in_buffer, ULONG in_size, -@@ -1661,7 +1668,8 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, +@@ -1662,7 +1669,8 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, * Success: 0. IoStatusBlock is updated. * Failure: An NTSTATUS error code describing the error. */ @@ -224,7 +224,7 @@ PVOID apc_context, PIO_STATUS_BLOCK io, ULONG code, PVOID in_buffer, ULONG in_size, PVOID out_buffer, ULONG out_size) { -@@ -1904,7 +1912,8 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb, +@@ -1905,7 +1913,8 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb, /****************************************************************************** * NtNotifyChangeDirectoryFile [NTDLL.@] */ @@ -234,7 +234,7 @@ void *apc_context, PIO_STATUS_BLOCK iosb, void *buffer, ULONG buffer_size, ULONG filter, BOOLEAN subtree ) { -@@ -1963,7 +1972,8 @@ NTSTATUS WINAPI NtNotifyChangeDirectoryFile( HANDLE handle, HANDLE event, PIO_AP +@@ -1964,7 +1973,8 @@ NTSTATUS WINAPI NtNotifyChangeDirectoryFile( HANDLE handle, HANDLE event, PIO_AP * Success: 0. IoStatusBlock is updated. * Failure: An NTSTATUS error code describing the error. */ @@ -244,7 +244,7 @@ IN HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, -@@ -2268,7 +2278,8 @@ static NTSTATUS fill_name_info( const ANSI_STRING *unix_name, FILE_NAME_INFORMAT +@@ -2269,7 +2279,8 @@ static NTSTATUS fill_name_info( const ANSI_STRING *unix_name, FILE_NAME_INFORMAT * Success: 0. IoStatusBlock and FileInformation are updated. * Failure: An NTSTATUS error code describing the error. */ @@ -254,7 +254,7 @@ PVOID ptr, LONG len, FILE_INFORMATION_CLASS class ) { static const size_t info_sizes[] = -@@ -2594,7 +2605,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, +@@ -2595,7 +2606,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, * Success: 0. io is updated. * Failure: An NTSTATUS error code describing the error. */ @@ -264,7 +264,7 @@ PVOID ptr, ULONG len, FILE_INFORMATION_CLASS class) { int fd, needs_close; -@@ -2891,7 +2903,8 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, +@@ -2892,7 +2904,8 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, /****************************************************************************** * NtQueryFullAttributesFile (NTDLL.@) */ @@ -274,7 +274,7 @@ FILE_NETWORK_OPEN_INFORMATION *info ) { ANSI_STRING unix_name; -@@ -2935,7 +2948,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, +@@ -2936,7 +2949,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, * NtQueryAttributesFile (NTDLL.@) * ZwQueryAttributesFile (NTDLL.@) */ @@ -284,7 +284,7 @@ { ANSI_STRING unix_name; NTSTATUS status; -@@ -3156,7 +3170,8 @@ static NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) +@@ -3157,7 +3171,8 @@ static NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) * Success: 0. io and buffer are updated. * Failure: An NTSTATUS error code describing the error. */ @@ -294,7 +294,7 @@ PVOID buffer, ULONG length, FS_INFORMATION_CLASS info_class ) { -@@ -3304,7 +3319,8 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io +@@ -3305,7 +3320,8 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io * Success: 0. Atrributes read into buffer * Failure: An NTSTATUS error code describing the error. */ @@ -304,7 +304,7 @@ BOOLEAN single_entry, PVOID ea_list, ULONG ea_list_len, PULONG ea_index, BOOLEAN restart ) { -@@ -3330,7 +3346,8 @@ NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer +@@ -3331,7 +3347,8 @@ NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer * Success: 0. Attributes are updated * Failure: An NTSTATUS error code describing the error. */ @@ -314,7 +314,7 @@ { FIXME("(%p,%p,%p,%d) stub\n", hFile, iosb, buffer, length); return STATUS_ACCESS_DENIED; -@@ -3350,7 +3367,8 @@ NTSTATUS WINAPI NtSetEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, +@@ -3351,7 +3368,8 @@ NTSTATUS WINAPI NtSetEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, * Success: 0. IoStatusBlock is updated. * Failure: An NTSTATUS error code describing the error. */ @@ -324,7 +324,7 @@ { NTSTATUS ret; HANDLE hEvent = NULL; -@@ -3392,7 +3410,8 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock +@@ -3393,7 +3411,8 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock * * */ @@ -334,7 +334,7 @@ PIO_APC_ROUTINE apc, void* apc_user, PIO_STATUS_BLOCK io_status, PLARGE_INTEGER offset, PLARGE_INTEGER count, ULONG* key, BOOLEAN dont_wait, -@@ -3464,7 +3483,8 @@ NTSTATUS WINAPI NtLockFile( HANDLE hFile, HANDLE lock_granted_event, +@@ -3465,7 +3484,8 @@ NTSTATUS WINAPI NtLockFile( HANDLE hFile, HANDLE lock_granted_event, * * */ @@ -344,7 +344,7 @@ PLARGE_INTEGER offset, PLARGE_INTEGER count, PULONG key ) { -@@ -3495,7 +3515,8 @@ NTSTATUS WINAPI NtUnlockFile( HANDLE hFile, PIO_STATUS_BLOCK io_status, +@@ -3496,7 +3516,8 @@ NTSTATUS WINAPI NtUnlockFile( HANDLE hFile, PIO_STATUS_BLOCK io_status, * * */ @@ -354,7 +354,7 @@ POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK iosb, ULONG sharing, ULONG dispo, ULONG options, ULONG pipe_type, ULONG read_mode, -@@ -3546,7 +3567,8 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, +@@ -3547,7 +3568,8 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, * * */ @@ -364,7 +364,7 @@ { NTSTATUS status; HANDLE hFile; -@@ -3566,7 +3588,8 @@ NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes ) +@@ -3567,7 +3589,8 @@ NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes ) * * */ @@ -374,7 +374,7 @@ { TRACE("%p %p %p\n", hFile, iosb, io_status ); -@@ -3587,7 +3610,8 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATU +@@ -3588,7 +3611,8 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATU * * */ @@ -384,7 +384,7 @@ { TRACE("%p %p\n", hFile, io_status ); -@@ -3620,7 +3644,8 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status ) +@@ -3621,7 +3645,8 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status ) * RETURNS * An NT status code */ @@ -395,7 +395,7 @@ ULONG CreateOptions, ULONG MailslotQuota, ULONG MaxMessageSize, PLARGE_INTEGER TimeOut) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 74feb97..e5ea736 100644 +index 5bcc03e..b08feeb 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3200,7 +3200,8 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) @@ -419,7 +419,7 @@ FIXME("(%p), stub!\n",DriverServiceName); return STATUS_NOT_IMPLEMENTED; diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 9ee1923..af78461 100644 +index 9b750e4..9b54be6 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -74,7 +74,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -632,7 +632,7 @@ ULONG Interval, KPROFILE_SOURCE Source) { -@@ -1676,7 +1697,8 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** +@@ -1838,7 +1859,8 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** * Length size of the structure * ResultLength Data written */ @@ -642,7 +642,7 @@ IN SYSTEM_INFORMATION_CLASS SystemInformationClass, OUT PVOID SystemInformation, IN ULONG Length, -@@ -2187,7 +2209,8 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform +@@ -2405,7 +2427,8 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform * NtSetSystemInformation [NTDLL.@] * ZwSetSystemInformation [NTDLL.@] */ @@ -652,7 +652,7 @@ { FIXME("(0x%08x,%p,0x%08x) stub\n",SystemInformationClass,SystemInformation,Length); return STATUS_SUCCESS; -@@ -2197,7 +2220,8 @@ NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS SystemInformatio +@@ -2415,7 +2438,8 @@ NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS SystemInformatio * NtCreatePagingFile [NTDLL.@] * ZwCreatePagingFile [NTDLL.@] */ @@ -662,7 +662,7 @@ PUNICODE_STRING PageFileName, PLARGE_INTEGER MinimumSize, PLARGE_INTEGER MaximumSize, -@@ -2212,7 +2236,8 @@ NTSTATUS WINAPI NtCreatePagingFile( +@@ -2430,7 +2454,8 @@ NTSTATUS WINAPI NtCreatePagingFile( * * writes a string to the nt-textmode screen eg. during startup */ @@ -672,7 +672,7 @@ { STRING stringA; NTSTATUS ret; -@@ -2229,7 +2254,8 @@ NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) +@@ -2447,7 +2472,8 @@ NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) * NtInitiatePowerAction [NTDLL.@] * */ @@ -682,7 +682,7 @@ IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, -@@ -2273,7 +2299,8 @@ static ULONG mhz_from_cpuinfo(void) +@@ -2491,7 +2517,8 @@ static ULONG mhz_from_cpuinfo(void) * NtPowerInformation [NTDLL.@] * */ @@ -692,7 +692,7 @@ IN POWER_INFORMATION_LEVEL InformationLevel, IN PVOID lpInputBuffer, IN ULONG nInputBufferSize, -@@ -2463,7 +2490,8 @@ NTSTATUS WINAPI NtPowerInformation( +@@ -2681,7 +2708,8 @@ NTSTATUS WINAPI NtPowerInformation( * NtShutdownSystem [NTDLL.@] * */ @@ -702,7 +702,7 @@ { FIXME("%d\n",Action); return STATUS_SUCCESS; -@@ -2472,7 +2500,8 @@ NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION Action) +@@ -2690,7 +2718,8 @@ NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION Action) /****************************************************************************** * NtAllocateLocallyUniqueId (NTDLL.@) */ @@ -712,7 +712,7 @@ { NTSTATUS status; -@@ -2530,7 +2559,8 @@ ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBi +@@ -2748,7 +2777,8 @@ ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBi * NtAccessCheckAndAuditAlarm (NTDLL.@) * ZwAccessCheckAndAuditAlarm (NTDLL.@) */ @@ -722,7 +722,7 @@ PUNICODE_STRING ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, ACCESS_MASK DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOLEAN ObjectCreation, PACCESS_MASK GrantedAccess, PBOOLEAN AccessStatus, PBOOLEAN GenerateOnClose) -@@ -2546,7 +2576,8 @@ NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING SubsystemName, HANDLE +@@ -2764,7 +2794,8 @@ NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING SubsystemName, HANDLE * NtSystemDebugControl (NTDLL.@) * ZwSystemDebugControl (NTDLL.@) */ @@ -733,10 +733,10 @@ { FIXME("(%d, %p, %d, %p, %d, %p), stub\n", command, inbuffer, inbuflength, outbuffer, outbuflength, retlength); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 6683daa..b71e427 100644 +index 5e4c39e..d0ed679 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -259,6 +259,23 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN; +@@ -260,6 +260,23 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN; "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ #endif @@ -761,7 +761,7 @@ #define HASH_STRING_ALGORITHM_X65599 1 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index 4fbb973..2cac6b1 100644 +index 7aa2fea..5d28684 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -50,7 +50,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -819,13 +819,13 @@ * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ --NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, +-NTSTATUS WINAPI NtOpenDirectoryObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenDirectoryObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenDirectoryObject)(PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes) ++NTSTATUS WINAPI SYSCALL(NtOpenDirectoryObject)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr) { NTSTATUS ret; -@@ -477,7 +483,8 @@ NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Desir + +@@ -467,7 +473,8 @@ NTSTATUS WINAPI NtOpenDirectoryObject( HANDLE *handle, ACCESS_MASK access, const * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ @@ -835,7 +835,7 @@ OBJECT_ATTRIBUTES *attr ) { NTSTATUS ret; -@@ -521,7 +528,8 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des +@@ -511,7 +518,8 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ @@ -845,17 +845,17 @@ ULONG size, BOOLEAN single_entry, BOOLEAN restart, PULONG context, PULONG ret_size) { -@@ -586,7 +594,8 @@ NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE handle, PDIRECTORY_BASIC_INFORMATI +@@ -576,7 +584,8 @@ NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE handle, PDIRECTORY_BASIC_INFORMATI * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ --NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess, +-NTSTATUS WINAPI NtOpenSymbolicLinkObject( HANDLE *handle, ACCESS_MASK access, +DEFINE_SYSCALL_ENTRYPOINT( NtOpenSymbolicLinkObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes) ++NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr) { NTSTATUS ret; -@@ -635,7 +644,8 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK +@@ -616,7 +625,8 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject( HANDLE *handle, ACCESS_MASK access, * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ @@ -865,7 +865,7 @@ POBJECT_ATTRIBUTES attr, PUNICODE_STRING TargetName) { NTSTATUS ret; -@@ -679,7 +689,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC +@@ -660,7 +670,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC * Success: ERROR_SUCCESS. * Failure: An NTSTATUS error code. */ @@ -875,7 +875,7 @@ { NTSTATUS ret; -@@ -707,7 +718,8 @@ NTSTATUS WINAPI NtQuerySymbolicLinkObject( HANDLE handle, PUNICODE_STRING target +@@ -688,7 +699,8 @@ NTSTATUS WINAPI NtQuerySymbolicLinkObject( HANDLE handle, PUNICODE_STRING target /****************************************************************************** * NtAllocateUuids [NTDLL.@] */ @@ -885,7 +885,7 @@ PULARGE_INTEGER Time, PULONG Range, PULONG Sequence) -@@ -729,7 +741,8 @@ NTSTATUS WINAPI NtAllocateUuids( +@@ -710,7 +722,8 @@ NTSTATUS WINAPI NtAllocateUuids( * Success: STATUS_SUCCESS. * Failure: An NTSTATUS error code. */ @@ -950,7 +950,7 @@ { NTSTATUS status; diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c -index 9223cb4..eec1db0 100644 +index bf786f4..2d17af6 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -49,7 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg); @@ -993,7 +993,7 @@ { NTSTATUS ret; -@@ -157,19 +161,22 @@ NTSTATUS WINAPI NtOpenKeyEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT +@@ -159,19 +163,22 @@ NTSTATUS WINAPI NtOpenKeyEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT * IN ACCESS_MASK access * IN POBJECT_ATTRIBUTES attr */ @@ -1019,7 +1019,7 @@ HANDLE transaction ) { return NtOpenKeyTransactedEx( retkey, access, attr, 0, transaction ); -@@ -191,7 +198,8 @@ NTSTATUS WINAPI RtlpNtOpenKey( PHANDLE retkey, ACCESS_MASK access, OBJECT_ATTRIB +@@ -193,7 +200,8 @@ NTSTATUS WINAPI RtlpNtOpenKey( PHANDLE retkey, ACCESS_MASK access, OBJECT_ATTRIB * NtDeleteKey [NTDLL.@] * ZwDeleteKey [NTDLL.@] */ @@ -1029,7 +1029,7 @@ { NTSTATUS ret; -@@ -220,7 +228,8 @@ NTSTATUS WINAPI RtlpNtMakeTemporaryKey( HANDLE hkey ) +@@ -222,7 +230,8 @@ NTSTATUS WINAPI RtlpNtMakeTemporaryKey( HANDLE hkey ) * NtDeleteValueKey [NTDLL.@] * ZwDeleteValueKey [NTDLL.@] */ @@ -1039,7 +1039,7 @@ { NTSTATUS ret; -@@ -364,7 +373,8 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i +@@ -366,7 +375,8 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i * NOTES * the name copied into the buffer is NOT 0-terminated */ @@ -1049,7 +1049,7 @@ void *info, DWORD length, DWORD *result_len ) { /* -1 means query key, so avoid it here */ -@@ -423,7 +433,8 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG +@@ -425,7 +435,8 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG * NtQueryKey [NTDLL.@] * ZwQueryKey [NTDLL.@] */ @@ -1059,7 +1059,7 @@ void *info, DWORD length, DWORD *result_len ) { return enumerate_key( handle, -1, info_class, info, length, result_len ); -@@ -478,7 +489,8 @@ static void copy_key_value_info( KEY_VALUE_INFORMATION_CLASS info_class, void *i +@@ -480,7 +491,8 @@ static void copy_key_value_info( KEY_VALUE_INFORMATION_CLASS info_class, void *i * NtEnumerateValueKey [NTDLL.@] * ZwEnumerateValueKey [NTDLL.@] */ @@ -1069,7 +1069,7 @@ KEY_VALUE_INFORMATION_CLASS info_class, void *info, DWORD length, DWORD *result_len ) { -@@ -526,7 +538,8 @@ NTSTATUS WINAPI NtEnumerateValueKey( HANDLE handle, ULONG index, +@@ -528,7 +540,8 @@ NTSTATUS WINAPI NtEnumerateValueKey( HANDLE handle, ULONG index, * NOTES * the name in the KeyValueInformation is never set */ @@ -1079,7 +1079,7 @@ KEY_VALUE_INFORMATION_CLASS info_class, void *info, DWORD length, DWORD *result_len ) { -@@ -628,7 +641,8 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de +@@ -630,7 +643,8 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de * NtFlushKey [NTDLL.@] * ZwFlushKey [NTDLL.@] */ @@ -1089,7 +1089,7 @@ { NTSTATUS ret; -@@ -648,7 +662,8 @@ NTSTATUS WINAPI NtFlushKey(HANDLE key) +@@ -650,7 +664,8 @@ NTSTATUS WINAPI NtFlushKey(HANDLE key) * NtLoadKey [NTDLL.@] * ZwLoadKey [NTDLL.@] */ @@ -1099,7 +1099,7 @@ { NTSTATUS ret; HANDLE hive; -@@ -681,7 +696,8 @@ NTSTATUS WINAPI NtLoadKey( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *fil +@@ -683,7 +698,8 @@ NTSTATUS WINAPI NtLoadKey( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *fil * NtNotifyChangeMultipleKeys [NTDLL.@] * ZwNotifyChangeMultipleKeys [NTDLL.@] */ @@ -1109,7 +1109,7 @@ HANDLE KeyHandle, ULONG Count, OBJECT_ATTRIBUTES *SubordinateObjects, -@@ -737,7 +753,8 @@ NTSTATUS WINAPI NtNotifyChangeMultipleKeys( +@@ -739,7 +755,8 @@ NTSTATUS WINAPI NtNotifyChangeMultipleKeys( * NtNotifyChangeKey [NTDLL.@] * ZwNotifyChangeKey [NTDLL.@] */ @@ -1119,7 +1119,7 @@ IN HANDLE KeyHandle, IN HANDLE Event, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, -@@ -759,7 +776,8 @@ NTSTATUS WINAPI NtNotifyChangeKey( +@@ -761,7 +778,8 @@ NTSTATUS WINAPI NtNotifyChangeKey( * ZwQueryMultipleValueKey */ @@ -1129,7 +1129,7 @@ HANDLE KeyHandle, PKEY_MULTIPLE_VALUE_INFORMATION ListOfValuesToQuery, ULONG NumberOfItems, -@@ -777,7 +795,8 @@ NTSTATUS WINAPI NtQueryMultipleValueKey( +@@ -779,7 +797,8 @@ NTSTATUS WINAPI NtQueryMultipleValueKey( * NtReplaceKey [NTDLL.@] * ZwReplaceKey [NTDLL.@] */ @@ -1139,7 +1139,7 @@ IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE Key, IN POBJECT_ATTRIBUTES ReplacedObjectAttributes) -@@ -790,7 +809,8 @@ NTSTATUS WINAPI NtReplaceKey( +@@ -792,7 +811,8 @@ NTSTATUS WINAPI NtReplaceKey( * NtRestoreKey [NTDLL.@] * ZwRestoreKey [NTDLL.@] */ @@ -1149,7 +1149,7 @@ HANDLE KeyHandle, HANDLE FileHandle, ULONG RestoreFlags) -@@ -803,7 +823,8 @@ NTSTATUS WINAPI NtRestoreKey( +@@ -805,7 +825,8 @@ NTSTATUS WINAPI NtRestoreKey( * NtSaveKey [NTDLL.@] * ZwSaveKey [NTDLL.@] */ @@ -1159,7 +1159,7 @@ { NTSTATUS ret; -@@ -823,7 +844,8 @@ NTSTATUS WINAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle) +@@ -825,7 +846,8 @@ NTSTATUS WINAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle) * NtSetInformationKey [NTDLL.@] * ZwSetInformationKey [NTDLL.@] */ @@ -1169,7 +1169,7 @@ IN HANDLE KeyHandle, IN const int KeyInformationClass, IN PVOID KeyInformation, -@@ -843,7 +865,8 @@ NTSTATUS WINAPI NtSetInformationKey( +@@ -845,7 +867,8 @@ NTSTATUS WINAPI NtSetInformationKey( * win95 does not care about count for REG_SZ and finds out the len by itself (js) * NT does definitely care (aj) */ @@ -1179,7 +1179,7 @@ ULONG type, const void *data, ULONG count ) { NTSTATUS ret; -@@ -882,7 +905,8 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDLE hkey, ULONG type, const void *data, +@@ -884,7 +907,8 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDLE hkey, ULONG type, const void *data, * NtUnloadKey [NTDLL.@] * ZwUnloadKey [NTDLL.@] */ @@ -1189,7 +1189,7 @@ { NTSTATUS ret; -@@ -1489,7 +1513,8 @@ NTSTATUS WINAPI RtlWriteRegistryValue( ULONG RelativeTo, PCWSTR path, PCWSTR nam +@@ -1491,7 +1515,8 @@ NTSTATUS WINAPI RtlWriteRegistryValue( ULONG RelativeTo, PCWSTR path, PCWSTR nam * unless there is some app which explicitly depends on that, there is * no good reason to reproduce that. */ @@ -1381,10 +1381,10 @@ NTSTATUS status = raise_exception( rec, context, first_chance ); if (status == STATUS_SUCCESS) NtSetContextThread( GetCurrentThread(), context ); diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c -index 47b27d3..91f1396 100644 +index aa58442..45bac3e 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c -@@ -157,7 +157,8 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a +@@ -171,7 +171,8 @@ NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) /****************************************************************************** * NtCreateSemaphore (NTDLL.@) */ @@ -1394,17 +1394,17 @@ IN ACCESS_MASK access, IN const OBJECT_ATTRIBUTES *attr OPTIONAL, IN LONG InitialCount, -@@ -190,7 +191,8 @@ NTSTATUS WINAPI NtCreateSemaphore( OUT PHANDLE SemaphoreHandle, +@@ -204,7 +205,8 @@ NTSTATUS WINAPI NtCreateSemaphore( OUT PHANDLE SemaphoreHandle, /****************************************************************************** * NtOpenSemaphore (NTDLL.@) */ --NTSTATUS WINAPI NtOpenSemaphore( OUT PHANDLE SemaphoreHandle, +-NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenSemaphore, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenSemaphore)( OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES *attr ) ++NTSTATUS WINAPI SYSCALL(NtOpenSemaphore)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { -@@ -215,7 +217,8 @@ NTSTATUS WINAPI NtOpenSemaphore( OUT PHANDLE SemaphoreHandle, + NTSTATUS ret; + +@@ -227,7 +229,8 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC /****************************************************************************** * NtQuerySemaphore (NTDLL.@) */ @@ -1414,7 +1414,7 @@ void *info, ULONG len, ULONG *ret_len ) { NTSTATUS ret; -@@ -247,7 +250,8 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla +@@ -259,7 +262,8 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla /****************************************************************************** * NtReleaseSemaphore (NTDLL.@) */ @@ -1424,7 +1424,7 @@ { NTSTATUS ret; SERVER_START_REQ( release_semaphore ) -@@ -271,7 +275,8 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, PULONG previous +@@ -283,7 +287,8 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, PULONG previous * NtCreateEvent (NTDLL.@) * ZwCreateEvent (NTDLL.@) */ @@ -1434,17 +1434,17 @@ const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN InitialState) { NTSTATUS ret; -@@ -299,7 +304,8 @@ NTSTATUS WINAPI NtCreateEvent( PHANDLE EventHandle, ACCESS_MASK DesiredAccess, +@@ -311,7 +316,8 @@ NTSTATUS WINAPI NtCreateEvent( PHANDLE EventHandle, ACCESS_MASK DesiredAccess, * NtOpenEvent (NTDLL.@) * ZwOpenEvent (NTDLL.@) */ --NTSTATUS WINAPI NtOpenEvent( +-NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenEvent, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenEvent)( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN const OBJECT_ATTRIBUTES *attr ) -@@ -327,7 +333,8 @@ NTSTATUS WINAPI NtOpenEvent( ++NTSTATUS WINAPI SYSCALL(NtOpenEvent)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) + { + NTSTATUS ret; + +@@ -336,7 +342,8 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT * NtSetEvent (NTDLL.@) * ZwSetEvent (NTDLL.@) */ @@ -1454,7 +1454,7 @@ { NTSTATUS ret; -@@ -346,7 +353,8 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) +@@ -355,7 +362,8 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) /****************************************************************************** * NtResetEvent (NTDLL.@) */ @@ -1464,7 +1464,7 @@ { NTSTATUS ret; -@@ -369,7 +377,8 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) +@@ -378,7 +386,8 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) * FIXME * same as NtResetEvent ??? */ @@ -1474,7 +1474,7 @@ { return NtResetEvent( handle, NULL ); } -@@ -380,7 +389,8 @@ NTSTATUS WINAPI NtClearEvent ( HANDLE handle ) +@@ -389,7 +398,8 @@ NTSTATUS WINAPI NtClearEvent ( HANDLE handle ) * FIXME * PulseCount */ @@ -1484,7 +1484,7 @@ { NTSTATUS ret; -@@ -400,7 +410,8 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, PULONG PulseCount ) +@@ -409,7 +419,8 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, PULONG PulseCount ) /****************************************************************************** * NtQueryEvent (NTDLL.@) */ @@ -1494,7 +1494,7 @@ void *info, ULONG len, ULONG *ret_len ) { NTSTATUS ret; -@@ -438,7 +449,8 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, +@@ -447,7 +458,8 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, * NtCreateMutant [NTDLL.@] * ZwCreateMutant [NTDLL.@] */ @@ -1504,17 +1504,17 @@ IN ACCESS_MASK access, IN const OBJECT_ATTRIBUTES* attr OPTIONAL, IN BOOLEAN InitialOwner) -@@ -467,7 +479,8 @@ NTSTATUS WINAPI NtCreateMutant(OUT HANDLE* MutantHandle, +@@ -476,7 +488,8 @@ NTSTATUS WINAPI NtCreateMutant(OUT HANDLE* MutantHandle, * NtOpenMutant [NTDLL.@] * ZwOpenMutant [NTDLL.@] */ --NTSTATUS WINAPI NtOpenMutant(OUT HANDLE* MutantHandle, +-NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenMutant, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenMutant)(OUT HANDLE* MutantHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES* attr ) ++NTSTATUS WINAPI SYSCALL(NtOpenMutant)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { -@@ -493,7 +506,8 @@ NTSTATUS WINAPI NtOpenMutant(OUT HANDLE* MutantHandle, + NTSTATUS status; + +@@ -500,7 +513,8 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A * NtReleaseMutant [NTDLL.@] * ZwReleaseMutant [NTDLL.@] */ @@ -1524,7 +1524,7 @@ { NTSTATUS status; -@@ -511,7 +525,8 @@ NTSTATUS WINAPI NtReleaseMutant( IN HANDLE handle, OUT PLONG prev_count OPTIONAL +@@ -518,7 +532,8 @@ NTSTATUS WINAPI NtReleaseMutant( IN HANDLE handle, OUT PLONG prev_count OPTIONAL * NtQueryMutant [NTDLL.@] * ZwQueryMutant [NTDLL.@] */ @@ -1534,7 +1534,7 @@ IN MUTANT_INFORMATION_CLASS MutantInformationClass, OUT PVOID MutantInformation, IN ULONG MutantInformationLength, -@@ -530,7 +545,8 @@ NTSTATUS WINAPI NtQueryMutant(IN HANDLE handle, +@@ -537,7 +552,8 @@ NTSTATUS WINAPI NtQueryMutant(IN HANDLE handle, * NtCreateJobObject [NTDLL.@] * ZwCreateJobObject [NTDLL.@] */ @@ -1544,17 +1544,17 @@ { NTSTATUS ret; data_size_t len; -@@ -555,7 +571,8 @@ NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJ +@@ -562,7 +578,8 @@ NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJ * NtOpenJobObject [NTDLL.@] * ZwOpenJobObject [NTDLL.@] */ --NTSTATUS WINAPI NtOpenJobObject( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +-NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenJobObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenJobObject)( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) ++NTSTATUS WINAPI SYSCALL(NtOpenJobObject)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - FIXME( "stub: %p %x %s\n", handle, access, attr ? debugstr_us(attr->ObjectName) : "" ); - return STATUS_NOT_IMPLEMENTED; -@@ -565,7 +582,8 @@ NTSTATUS WINAPI NtOpenJobObject( PHANDLE handle, ACCESS_MASK access, const OBJEC + NTSTATUS ret; + +@@ -586,7 +603,8 @@ NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJEC * NtTerminateJobObject [NTDLL.@] * ZwTerminateJobObject [NTDLL.@] */ @@ -1564,7 +1564,7 @@ { NTSTATUS ret; -@@ -586,7 +604,8 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) +@@ -607,7 +625,8 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) * NtQueryInformationJobObject [NTDLL.@] * ZwQueryInformationJobObject [NTDLL.@] */ @@ -1574,7 +1574,7 @@ ULONG len, PULONG ret_len ) { FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); -@@ -629,7 +648,8 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c +@@ -650,7 +669,8 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c * NtSetInformationJobObject [NTDLL.@] * ZwSetInformationJobObject [NTDLL.@] */ @@ -1584,7 +1584,7 @@ { NTSTATUS status = STATUS_NOT_IMPLEMENTED; JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit; -@@ -694,7 +714,8 @@ NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS cla +@@ -715,7 +735,8 @@ NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS cla * NtIsProcessInJob [NTDLL.@] * ZwIsProcessInJob [NTDLL.@] */ @@ -1594,7 +1594,7 @@ { NTSTATUS status; -@@ -715,7 +736,8 @@ NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job ) +@@ -736,7 +757,8 @@ NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job ) * NtAssignProcessToJobObject [NTDLL.@] * ZwAssignProcessToJobObject [NTDLL.@] */ @@ -1604,7 +1604,7 @@ { NTSTATUS status; -@@ -740,7 +762,8 @@ NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process ) +@@ -761,7 +783,8 @@ NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process ) * NtCreateTimer [NTDLL.@] * ZwCreateTimer [NTDLL.@] */ @@ -1614,17 +1614,17 @@ IN ACCESS_MASK access, IN const OBJECT_ATTRIBUTES *attr OPTIONAL, IN TIMER_TYPE timer_type) -@@ -773,7 +796,8 @@ NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, +@@ -794,7 +817,8 @@ NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, * NtOpenTimer [NTDLL.@] * ZwOpenTimer [NTDLL.@] */ --NTSTATUS WINAPI NtOpenTimer(OUT PHANDLE handle, +-NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenTimer, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenTimer)(OUT PHANDLE handle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES* attr ) ++NTSTATUS WINAPI SYSCALL(NtOpenTimer)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { -@@ -799,7 +823,8 @@ NTSTATUS WINAPI NtOpenTimer(OUT PHANDLE handle, + NTSTATUS status; + +@@ -818,7 +842,8 @@ NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT * NtSetTimer [NTDLL.@] * ZwSetTimer [NTDLL.@] */ @@ -1634,7 +1634,7 @@ IN const LARGE_INTEGER* when, IN PTIMER_APC_ROUTINE callback, IN PVOID callback_arg, -@@ -833,7 +858,8 @@ NTSTATUS WINAPI NtSetTimer(IN HANDLE handle, +@@ -852,7 +877,8 @@ NTSTATUS WINAPI NtSetTimer(IN HANDLE handle, * NtCancelTimer [NTDLL.@] * ZwCancelTimer [NTDLL.@] */ @@ -1644,7 +1644,7 @@ { NTSTATUS status; -@@ -867,7 +893,8 @@ NTSTATUS WINAPI NtCancelTimer(IN HANDLE handle, OUT BOOLEAN* state) +@@ -886,7 +912,8 @@ NTSTATUS WINAPI NtCancelTimer(IN HANDLE handle, OUT BOOLEAN* state) * STATUS_ACCESS_DENIED, if TimerHandle does not have TIMER_QUERY_STATE access * to the timer. */ @@ -1654,7 +1654,7 @@ HANDLE TimerHandle, TIMER_INFORMATION_CLASS TimerInformationClass, PVOID TimerInformation, -@@ -918,7 +945,8 @@ NTSTATUS WINAPI NtQueryTimer( +@@ -937,7 +964,8 @@ NTSTATUS WINAPI NtQueryTimer( /****************************************************************************** * NtQueryTimerResolution [NTDLL.@] */ @@ -1664,7 +1664,7 @@ OUT ULONG* max_resolution, OUT ULONG* current_resolution) { -@@ -931,7 +959,8 @@ NTSTATUS WINAPI NtQueryTimerResolution(OUT ULONG* min_resolution, +@@ -950,7 +978,8 @@ NTSTATUS WINAPI NtQueryTimerResolution(OUT ULONG* min_resolution, /****************************************************************************** * NtSetTimerResolution [NTDLL.@] */ @@ -1674,7 +1674,7 @@ IN BOOLEAN set_resolution, OUT ULONG* current_resolution ) { -@@ -964,7 +993,8 @@ static NTSTATUS wait_objects( DWORD count, const HANDLE *handles, +@@ -983,7 +1012,8 @@ static NTSTATUS wait_objects( DWORD count, const HANDLE *handles, /****************************************************************** * NtWaitForMultipleObjects (NTDLL.@) */ @@ -1684,7 +1684,7 @@ BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { -@@ -975,7 +1005,8 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, +@@ -994,7 +1024,8 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, /****************************************************************** * NtWaitForSingleObject (NTDLL.@) */ @@ -1694,7 +1694,7 @@ { return wait_objects( 1, &handle, FALSE, alertable, timeout ); } -@@ -984,7 +1015,8 @@ NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LA +@@ -1003,7 +1034,8 @@ NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LA /****************************************************************** * NtSignalAndWaitForSingleObject (NTDLL.@) */ @@ -1704,7 +1704,7 @@ BOOLEAN alertable, const LARGE_INTEGER *timeout ) { select_op_t select_op; -@@ -1003,7 +1035,8 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE hSignalObject, HANDLE hWa +@@ -1022,7 +1054,8 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE hSignalObject, HANDLE hWa /****************************************************************** * NtYieldExecution (NTDLL.@) */ @@ -1714,7 +1714,7 @@ { #ifdef HAVE_SCHED_YIELD sched_yield(); -@@ -1017,7 +1050,8 @@ NTSTATUS WINAPI NtYieldExecution(void) +@@ -1036,7 +1069,8 @@ NTSTATUS WINAPI NtYieldExecution(void) /****************************************************************** * NtDelayExecution (NTDLL.@) */ @@ -1724,7 +1724,7 @@ { /* if alertable, we need to query the server */ if (alertable) -@@ -1060,7 +1094,8 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou +@@ -1079,7 +1113,8 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou /****************************************************************************** * NtCreateKeyedEvent (NTDLL.@) */ @@ -1734,7 +1734,7 @@ const OBJECT_ATTRIBUTES *attr, ULONG flags ) { NTSTATUS ret; -@@ -1085,7 +1120,8 @@ NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access, +@@ -1104,7 +1139,8 @@ NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access, /****************************************************************************** * NtOpenKeyedEvent (NTDLL.@) */ @@ -1742,9 +1742,9 @@ +DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyedEvent, 3 ); +NTSTATUS WINAPI SYSCALL(NtOpenKeyedEvent)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { - DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0; NTSTATUS ret; -@@ -1108,7 +1144,8 @@ NTSTATUS WINAPI NtOpenKeyedEvent( HANDLE *handle, ACCESS_MASK access, const OBJE + +@@ -1127,7 +1163,8 @@ NTSTATUS WINAPI NtOpenKeyedEvent( HANDLE *handle, ACCESS_MASK access, const OBJE /****************************************************************************** * NtWaitForKeyedEvent (NTDLL.@) */ @@ -1754,7 +1754,7 @@ BOOLEAN alertable, const LARGE_INTEGER *timeout ) { select_op_t select_op; -@@ -1125,7 +1162,8 @@ NTSTATUS WINAPI NtWaitForKeyedEvent( HANDLE handle, const void *key, +@@ -1144,7 +1181,8 @@ NTSTATUS WINAPI NtWaitForKeyedEvent( HANDLE handle, const void *key, /****************************************************************************** * NtReleaseKeyedEvent (NTDLL.@) */ @@ -1764,7 +1764,7 @@ BOOLEAN alertable, const LARGE_INTEGER *timeout ) { select_op_t select_op; -@@ -1152,7 +1190,8 @@ NTSTATUS WINAPI NtReleaseKeyedEvent( HANDLE handle, const void *key, +@@ -1171,7 +1209,8 @@ NTSTATUS WINAPI NtReleaseKeyedEvent( HANDLE handle, const void *key, * NumberOfConcurrentThreads [I] desired number of concurrent active worker threads * */ @@ -1774,7 +1774,7 @@ POBJECT_ATTRIBUTES attr, ULONG NumberOfConcurrentThreads ) { NTSTATUS status; -@@ -1193,7 +1232,8 @@ NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK Desire +@@ -1212,7 +1251,8 @@ NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK Desire * Status [I] operation status * NumberOfBytesTransferred [I] number of bytes transferred */ @@ -1784,7 +1784,7 @@ ULONG_PTR CompletionValue, NTSTATUS Status, SIZE_T NumberOfBytesTransferred ) { -@@ -1229,7 +1269,8 @@ NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKe +@@ -1248,7 +1288,8 @@ NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKe * WaitTime [I] optional wait time in NTDLL format * */ @@ -1794,17 +1794,17 @@ PULONG_PTR CompletionValue, PIO_STATUS_BLOCK iosb, PLARGE_INTEGER WaitTime ) { -@@ -1272,7 +1313,8 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE CompletionPort, PULONG_PTR Completi +@@ -1291,7 +1332,8 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE CompletionPort, PULONG_PTR Completi * ObjectAttributes [I] completion object name * */ --NTSTATUS WINAPI NtOpenIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess, +-NTSTATUS WINAPI NtOpenIoCompletion( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +DEFINE_SYSCALL_ENTRYPOINT( NtOpenIoCompletion, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenIoCompletion)( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes ) ++NTSTATUS WINAPI SYSCALL(NtOpenIoCompletion)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { NTSTATUS status; -@@ -1309,7 +1351,8 @@ NTSTATUS WINAPI NtOpenIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredA + +@@ -1326,7 +1368,8 @@ NTSTATUS WINAPI NtOpenIoCompletion( HANDLE *handle, ACCESS_MASK access, const OB * RequiredLength [O] required buffer length * */ @@ -1815,7 +1815,7 @@ { NTSTATUS status; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 1455eb1..8215d5a 100644 +index 0b68185..7d9d2d7 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -599,7 +599,8 @@ ULONG WINAPI RtlGetNtGlobalFlags(void) @@ -1898,7 +1898,7 @@ { NTSTATUS ret; DWORD dummy, i; -@@ -823,7 +831,8 @@ static inline unsigned int get_server_context_flags( DWORD flags ) +@@ -825,7 +833,8 @@ static inline unsigned int get_server_context_flags( DWORD flags ) * NtGetContextThread (NTDLL.@) * ZwGetContextThread (NTDLL.@) */ @@ -1908,7 +1908,7 @@ { NTSTATUS ret; DWORD dummy, i; -@@ -912,7 +921,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) +@@ -914,7 +923,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) * NtQueryInformationThread (NTDLL.@) * ZwQueryInformationThread (NTDLL.@) */ @@ -1918,7 +1918,7 @@ void *data, ULONG length, ULONG *ret_len ) { NTSTATUS status; -@@ -1156,7 +1166,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, +@@ -1158,7 +1168,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, * NtSetInformationThread (NTDLL.@) * ZwSetInformationThread (NTDLL.@) */ @@ -1928,7 +1928,7 @@ LPCVOID data, ULONG length ) { NTSTATUS status; -@@ -1315,7 +1326,8 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, +@@ -1317,7 +1328,8 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, * Return the processor, on which the thread is running * */ @@ -1983,7 +1983,7 @@ struct timeval tv; time_t tm_t; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index f4ca487..4819a17 100644 +index c57524a..a65d206 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1857,7 +1857,8 @@ void virtual_set_large_address_space(void) @@ -2065,8 +2065,8 @@ +NTSTATUS WINAPI SYSCALL(NtOpenSection)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { NTSTATUS ret; - DWORD len = attr->ObjectName->Length; -@@ -2519,7 +2527,8 @@ NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ + +@@ -2520,7 +2528,8 @@ NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ * NtMapViewOfSection (NTDLL.@) * ZwMapViewOfSection (NTDLL.@) */ @@ -2076,7 +2076,7 @@ SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, SECTION_INHERIT inherit, ULONG alloc_type, ULONG protect ) { -@@ -2717,7 +2726,8 @@ done: +@@ -2718,7 +2727,8 @@ done: * NtUnmapViewOfSection (NTDLL.@) * ZwUnmapViewOfSection (NTDLL.@) */ @@ -2086,7 +2086,7 @@ { struct file_view *view; NTSTATUS status = STATUS_NOT_MAPPED_VIEW; -@@ -2753,7 +2763,8 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) +@@ -2754,7 +2764,8 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) * NtFlushVirtualMemory (NTDLL.@) * ZwFlushVirtualMemory (NTDLL.@) */ @@ -2096,7 +2096,7 @@ SIZE_T *size_ptr, ULONG unknown ) { struct file_view *view; -@@ -2801,7 +2812,8 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr, +@@ -2802,7 +2813,8 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr, * NtGetWriteWatch (NTDLL.@) * ZwGetWriteWatch (NTDLL.@) */ @@ -2106,7 +2106,7 @@ ULONG_PTR *count, ULONG *granularity ) { struct file_view *view; -@@ -2849,7 +2861,8 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T +@@ -2850,7 +2862,8 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T * NtResetWriteWatch (NTDLL.@) * ZwResetWriteWatch (NTDLL.@) */ @@ -2116,7 +2116,7 @@ { struct file_view *view; NTSTATUS status = STATUS_SUCCESS; -@@ -2878,7 +2891,8 @@ NTSTATUS WINAPI NtResetWriteWatch( HANDLE process, PVOID base, SIZE_T size ) +@@ -2879,7 +2892,8 @@ NTSTATUS WINAPI NtResetWriteWatch( HANDLE process, PVOID base, SIZE_T size ) * NtReadVirtualMemory (NTDLL.@) * ZwReadVirtualMemory (NTDLL.@) */ @@ -2126,7 +2126,7 @@ SIZE_T size, SIZE_T *bytes_read ) { NTSTATUS status; -@@ -2908,7 +2922,8 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf +@@ -2909,7 +2923,8 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf * NtWriteVirtualMemory (NTDLL.@) * ZwWriteVirtualMemory (NTDLL.@) */ @@ -2136,7 +2136,7 @@ SIZE_T size, SIZE_T *bytes_written ) { NTSTATUS status; -@@ -2938,7 +2953,8 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu +@@ -2939,7 +2954,8 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu * NtAreMappedFilesTheSame (NTDLL.@) * ZwAreMappedFilesTheSame (NTDLL.@) */ @@ -2147,5 +2147,5 @@ struct file_view *view1, *view2; struct stat st1, st2; -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-SystemRoot_Symlink/0001-ntdll-Add-special-handling-for-SystemRoot-to-satisfy.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-SystemRoot_Symlink/0001-ntdll-Add-special-handling-for-SystemRoot-to-satisfy.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ntdll-SystemRoot_Symlink/0001-ntdll-Add-special-handling-for-SystemRoot-to-satisfy.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ntdll-SystemRoot_Symlink/0001-ntdll-Add-special-handling-for-SystemRoot-to-satisfy.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,15 +1,15 @@ -From fc9e2809d5ace76166250a4af312f167c7d40af7 Mon Sep 17 00:00:00 2001 +From c3a457db84cd6c95bbce802329840befdbe9057f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 17 Aug 2015 06:17:33 +0200 Subject: ntdll: Add special handling for \SystemRoot to satisfy MSYS2 case-insensitive system check. --- - dlls/ntdll/om.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) + dlls/ntdll/om.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index c28a82a..ef17b1d 100644 +index a45de9c..0c3f69e 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -39,6 +39,7 @@ @@ -20,24 +20,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); -@@ -623,7 +624,9 @@ DEFINE_SYSCALL_ENTRYPOINT( NtOpenSymbolicLinkObject, 3 ); - NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes) +@@ -615,6 +616,7 @@ DEFINE_SYSCALL_ENTRYPOINT( NtOpenSymbolicLinkObject, 3 ); + NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr) { + static const WCHAR SystemRootW[] = {'\\','S','y','s','t','e','m','R','o','o','t'}; NTSTATUS ret; -+ - TRACE("(%p,0x%08x,%s)\n",LinkHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes)); - if (!LinkHandle) return STATUS_ACCESS_VIOLATION; -@@ -638,6 +641,16 @@ NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)(OUT PHANDLE LinkHandle, IN ACC - return STATUS_OBJECT_PATH_SYNTAX_BAD; - } + TRACE("(%p,0x%08x,%s)\n", handle, access, debugstr_ObjectAttributes(attr)); +@@ -622,6 +624,16 @@ NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)( HANDLE *handle, ACCESS_MASK a + if (!handle) return STATUS_ACCESS_VIOLATION; + if ((ret = validate_open_object_attributes( attr ))) return ret; + /* MSYS2 tries to open \\SYSTEMROOT to check for case-insensitive systems */ -+ if (!DesiredAccess && !ObjectAttributes->RootDirectory && -+ ObjectAttributes->ObjectName->Length == sizeof(SystemRootW) && -+ !memicmpW( ObjectAttributes->ObjectName->Buffer, SystemRootW, ++ if (!access && !attr->RootDirectory && ++ attr->ObjectName->Length == sizeof(SystemRootW) && ++ !memicmpW( attr->ObjectName->Buffer, SystemRootW, + sizeof(SystemRootW)/sizeof(WCHAR) )) + { + TRACE( "returning STATUS_ACCESS_DENIED\n" ); @@ -46,7 +44,7 @@ + SERVER_START_REQ(open_symlink) { - req->access = DesiredAccess; + req->access = access; -- -2.6.1 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0001-ole32-tests-Add-a-bunch-of-tests-for-HGLOBAL-based-I.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0001-ole32-tests-Add-a-bunch-of-tests-for-HGLOBAL-based-I.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0001-ole32-tests-Add-a-bunch-of-tests-for-HGLOBAL-based-I.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0001-ole32-tests-Add-a-bunch-of-tests-for-HGLOBAL-based-I.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,279 @@ +From 267315dd040ccfa527f8ba48038a268236ca1d29 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 2 Feb 2016 12:49:16 +0800 +Subject: ole32/tests: Add a bunch of tests for HGLOBAL based IStream::Clone. + +--- + dlls/ole32/tests/hglobalstream.c | 244 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 244 insertions(+) + +diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c +index e20d81b..0dc3c52 100644 +--- a/dlls/ole32/tests/hglobalstream.c ++++ b/dlls/ole32/tests/hglobalstream.c +@@ -2,6 +2,7 @@ + * Stream on HGLOBAL Tests + * + * Copyright 2006 Robert Shearman (for CodeWeavers) ++ * Copyright 2016 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -508,11 +509,254 @@ static void test_freed_hglobal(void) + IStream_Release(pStream); + } + ++static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos) ++{ ++ HRESULT hr; ++ STATSTG stat; ++ LARGE_INTEGER offset; ++ ULARGE_INTEGER newpos; ++ ++ *hmem = 0; ++ *size = *pos = -1; ++ ++ hr = GetHGlobalFromStream(stream, hmem); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ memset(&stat, 0x55, sizeof(stat)); ++ hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ok(stat.type == STGTY_STREAM, "unexpected %#x\n", stat.type); ++ ok(!stat.pwcsName, "unexpected %p\n", stat.pwcsName); ++ ok(IsEqualIID(&stat.clsid, &GUID_NULL), "unexpected %s\n", wine_dbgstr_guid(&stat.clsid)); ++ ok(!stat.cbSize.HighPart, "unexpected %#x\n", stat.cbSize.HighPart); ++ *size = stat.cbSize.LowPart; ++ ++ offset.QuadPart = 0; ++ hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, &newpos); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ok(!newpos.HighPart, "unexpected %#x\n", newpos.HighPart); ++ *pos = newpos.LowPart; ++} ++ ++static void test_IStream_Clone(void) ++{ ++ static const char hello[] = "Hello World!"; ++ char buf[32]; ++ HRESULT hr; ++ IStream *stream, *clone; ++ HGLOBAL orig_hmem, hmem, hmem_clone; ++ ULARGE_INTEGER newsize; ++ LARGE_INTEGER offset; ++ int size, pos, ret; ++ ++ /* test simple case for Clone */ ++ orig_hmem = GlobalAlloc(GMEM_MOVEABLE, 0); ++ ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); ++ hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem == orig_hmem, "handles should match\n"); ++ ok(size == 0, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ hr = IStream_Clone(stream, &clone); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ hr = IStream_Write(stream, hello, sizeof(hello), NULL); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++ ok(size == 13, "unexpected %d\n", size); ++ ok(pos == 13, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 13, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ buf[0] = 0; ++ hr = IStream_Read(clone, buf, sizeof(buf), NULL); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++todo_wine ++ ok(!strcmp(buf, hello), "wrong stream contents\n"); ++ ++ newsize.QuadPart = 0x8000; ++ hr = IStream_SetSize(stream, newsize); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++ ok(hmem == orig_hmem, "unexpected %p\n", hmem); ++ ok(size == 0x8000, "unexpected %#x\n", size); ++ ok(pos == 13, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++todo_wine ++ ok(pos == 13, "unexpected %d\n", pos); ++ ++ IStream_Release(clone); ++ IStream_Release(stream); ++ ++ /* exploit GMEM_FIXED forced move for the same base streams */ ++ orig_hmem = GlobalAlloc(GMEM_FIXED, 1); ++ ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); ++ hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ hr = IStream_Clone(stream, &clone); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++ ok(size == 1, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++ ok(size == 1, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ newsize.QuadPart = 0x8000; ++ hr = IStream_SetSize(stream, newsize); ++todo_wine ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++todo_wine ++ ok(hmem != orig_hmem, "unexpected %p\n", hmem); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ IStream_Release(stream); ++ IStream_Release(clone); ++ ++ /* exploit GMEM_FIXED forced move for different base streams */ ++ orig_hmem = GlobalAlloc(GMEM_FIXED, 1); ++ ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); ++ hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &clone); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++ ok(size == 1, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++ ok(size == 1, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ newsize.QuadPart = 0x8000; ++ hr = IStream_SetSize(stream, newsize); ++todo_wine ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++todo_wine ++ ok(hmem != orig_hmem, "unexpected %p\n", hmem); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++todo_wine ++ ok(hmem_clone != hmem, "handles should not match\n"); ++ ok(size == 1, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ IStream_Release(stream); ++ /* releasing clone leads to test termination under windows ++ IStream_Release(clone); ++ */ ++ ++ /* test Release for a being cloned stream */ ++ hr = CreateStreamOnHGlobal(0, TRUE, &stream); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ hr = IStream_Clone(stream, &clone); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(stream, &hmem, &size, &pos); ++ ok(hmem != 0, "unexpected %p\n", hmem); ++ ok(size == 0, "unexpected %d\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++ ok(size == 0, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ ret = IStream_Release(stream); ++ ok(ret == 0, "unexpected %d\n", ret); ++ ++ newsize.QuadPart = 0x8000; ++ hr = IStream_SetSize(clone, newsize); ++todo_wine ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++ ok(pos == 0, "unexpected %d\n", pos); ++ ++ hr = IStream_Write(clone, hello, sizeof(hello), NULL); ++todo_wine ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++todo_wine ++ ok(pos == 13, "unexpected %d\n", pos); ++ ++ offset.QuadPart = 0; ++ hr = IStream_Seek(clone, offset, STREAM_SEEK_SET, NULL); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++ ++ buf[0] = 0; ++ hr = IStream_Read(clone, buf, sizeof(buf), NULL); ++ ok(hr == S_OK, "unexpected %#x\n", hr); ++todo_wine ++ ok(!strcmp(buf, hello), "wrong stream contents\n"); ++ ++ stream_info(clone, &hmem_clone, &size, &pos); ++ ok(hmem_clone == hmem, "handles should match\n"); ++todo_wine ++ ok(size == 0x8000, "unexpected %#x\n", size); ++todo_wine ++ ok(pos == 32, "unexpected %d\n", pos); ++ ++ ret = IStream_Release(clone); ++ ok(ret == 0, "unexpected %d\n", ret); ++} ++ + START_TEST(hglobalstream) + { + HRESULT hr; + IStream *pStream; + ++ test_IStream_Clone(); ++ + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok_ole_success(hr, "CreateStreamOnHGlobal"); + +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0002-ole32-Add-a-check-for-hglobal-pointer-to-GetHGlobalF.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0002-ole32-Add-a-check-for-hglobal-pointer-to-GetHGlobalF.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0002-ole32-Add-a-check-for-hglobal-pointer-to-GetHGlobalF.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0002-ole32-Add-a-check-for-hglobal-pointer-to-GetHGlobalF.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,47 @@ +From a26bfabac3940176f412896241ffab5c7f92baaa Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 2 Feb 2016 12:53:47 +0800 +Subject: ole32: Add a check for hglobal pointer to GetHGlobalFromStream. + +--- + dlls/ole32/hglobalstream.c | 4 ++-- + dlls/ole32/tests/hglobalstream.c | 6 ++++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index 655e380..b86de56 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -621,10 +621,10 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal) + { + HGLOBALStreamImpl* pStream; + +- if (pstm == NULL) ++ if (!pstm || !phglobal) + return E_INVALIDARG; + +- pStream = (HGLOBALStreamImpl*) pstm; ++ pStream = impl_from_IStream(pstm); + + /* + * Verify that the stream object was created with CreateStreamOnHGlobal. +diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c +index 0dc3c52..0453e54 100644 +--- a/dlls/ole32/tests/hglobalstream.c ++++ b/dlls/ole32/tests/hglobalstream.c +@@ -555,6 +555,12 @@ static void test_IStream_Clone(void) + hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); + ok(hr == S_OK, "unexpected %#x\n", hr); + ++ hr = GetHGlobalFromStream(stream, NULL); ++ ok(hr == E_INVALIDARG, "unexpected %#x\n", hr); ++ ++ hr = GetHGlobalFromStream(NULL, &hmem); ++ ok(hr == E_INVALIDARG, "unexpected %#x\n", hr); ++ + stream_info(stream, &hmem, &size, &pos); + ok(hmem == orig_hmem, "handles should match\n"); + ok(size == 0, "unexpected %d\n", size); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0003-ole32-Add-a-wrapper-for-memory-block-managed-by-HGLO.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0003-ole32-Add-a-wrapper-for-memory-block-managed-by-HGLO.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0003-ole32-Add-a-wrapper-for-memory-block-managed-by-HGLO.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0003-ole32-Add-a-wrapper-for-memory-block-managed-by-HGLO.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,422 @@ +From 3c9954c3838d7504fad0213ade7363747e7a6805 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 2 Feb 2016 13:03:58 +0800 +Subject: ole32: Add a wrapper for memory block managed by HGLOBAL based + IStream. + +Based on a suggestion of Sebastian Lackner . +--- + dlls/ole32/hglobalstream.c | 202 +++++++++++++++++++++++++++------------ + dlls/ole32/tests/hglobalstream.c | 12 --- + 2 files changed, 140 insertions(+), 74 deletions(-) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index b86de56..5eb6320 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -5,6 +5,7 @@ + * for streams contained supported by an HGLOBAL pointer. + * + * Copyright 1999 Francis Beaudet ++ * Copyright 2016 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -42,7 +43,96 @@ + + #include "wine/debug.h" + +-WINE_DEFAULT_DEBUG_CHANNEL(storage); ++WINE_DEFAULT_DEBUG_CHANNEL(hglobalstream); ++ ++struct handle_wrapper ++{ ++ LONG ref; ++ HGLOBAL hglobal; ++ ULONG size; ++ BOOL delete_on_release; ++ CRITICAL_SECTION lock; ++}; ++ ++static void handle_addref(struct handle_wrapper *handle) ++{ ++ InterlockedIncrement(&handle->ref); ++} ++ ++static void handle_release(struct handle_wrapper *handle) ++{ ++ ULONG ref = InterlockedDecrement(&handle->ref); ++ ++ if (!ref) ++ { ++ if (handle->delete_on_release) ++ { ++ GlobalFree(handle->hglobal); ++ handle->hglobal = NULL; ++ } ++ ++ DeleteCriticalSection(&handle->lock); ++ HeapFree(GetProcessHeap(), 0, handle); ++ } ++} ++ ++static void *handle_lock(struct handle_wrapper *handle) ++{ ++ return GlobalLock(handle->hglobal); ++} ++ ++static void handle_unlock(struct handle_wrapper *handle) ++{ ++ GlobalUnlock(handle->hglobal); ++} ++ ++static HGLOBAL handle_gethglobal(struct handle_wrapper *handle) ++{ ++ return handle->hglobal; ++} ++ ++static HRESULT handle_setsize(struct handle_wrapper *handle, ULONG size) ++{ ++ HRESULT hr = S_OK; ++ ++ EnterCriticalSection(&handle->lock); ++ ++ if (handle->size != size) ++ { ++ HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, 0); ++ if (hglobal) ++ { ++ handle->hglobal = hglobal; ++ handle->size = size; ++ } ++ else ++ hr = E_OUTOFMEMORY; ++ } ++ ++ LeaveCriticalSection(&handle->lock); ++ return hr; ++} ++ ++static ULONG handle_getsize(struct handle_wrapper *handle) ++{ ++ return handle->size; ++} ++ ++static struct handle_wrapper *handle_create(HGLOBAL hglobal, BOOL delete_on_release) ++{ ++ struct handle_wrapper *handle; ++ ++ handle = HeapAlloc(GetProcessHeap(), 0, sizeof(*handle)); ++ if (handle) ++ { ++ handle->ref = 1; ++ handle->hglobal = hglobal; ++ handle->size = GlobalSize(hglobal); ++ handle->delete_on_release = delete_on_release; ++ InitializeCriticalSection(&handle->lock); ++ } ++ return handle; ++} + + /**************************************************************************** + * HGLOBALStreamImpl definition. +@@ -55,14 +145,7 @@ typedef struct + IStream IStream_iface; + LONG ref; + +- /* support for the stream */ +- HGLOBAL supportHandle; +- +- /* if TRUE the HGLOBAL is destroyed when the stream is finally released */ +- BOOL deleteOnRelease; +- +- /* size of the stream */ +- ULARGE_INTEGER streamSize; ++ struct handle_wrapper *handle; + + /* current position of the cursor */ + ULARGE_INTEGER currentPosition; +@@ -114,12 +197,7 @@ static ULONG WINAPI HGLOBALStreamImpl_Release( + + if (!ref) + { +- if (This->deleteOnRelease) +- { +- GlobalFree(This->supportHandle); +- This->supportHandle = NULL; +- } +- ++ handle_release(This->handle); + HeapFree(GetProcessHeap(), 0, This); + } + +@@ -161,15 +239,15 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( + * Using the known size of the stream, calculate the number of bytes + * to read from the block chain + */ +- bytesToReadFromBuffer = min( This->streamSize.u.LowPart - This->currentPosition.u.LowPart, cb); ++ bytesToReadFromBuffer = min( handle_getsize(This->handle) - This->currentPosition.u.LowPart, cb); + + /* + * Lock the buffer in position and copy the data. + */ +- supportBuffer = GlobalLock(This->supportHandle); ++ supportBuffer = handle_lock(This->handle); + if (!supportBuffer) + { +- WARN("read from invalid hglobal %p\n", This->supportHandle); ++ WARN("read from invalid hglobal %p\n", handle_gethglobal(This->handle)); + *pcbRead = 0; + return S_OK; + } +@@ -189,7 +267,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( + /* + * Cleanup + */ +- GlobalUnlock(This->supportHandle); ++ handle_unlock(This->handle); + + /* + * Always returns S_OK even if the end of the stream is reached before the +@@ -241,7 +319,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( + /* + * Verify if we need to grow the stream + */ +- if (newSize.u.LowPart > This->streamSize.u.LowPart) ++ if (newSize.u.LowPart > handle_getsize(This->handle)) + { + /* grow stream */ + HRESULT hr = IStream_SetSize(iface, newSize); +@@ -255,10 +333,10 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( + /* + * Lock the buffer in position and copy the data. + */ +- supportBuffer = GlobalLock(This->supportHandle); ++ supportBuffer = handle_lock(This->handle); + if (!supportBuffer) + { +- WARN("write to invalid hglobal %p\n", This->supportHandle); ++ WARN("write to invalid hglobal %p\n", handle_gethglobal(This->handle)); + return S_OK; + } + +@@ -272,7 +350,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( + /* + * Cleanup + */ +- GlobalUnlock(This->supportHandle); ++ handle_unlock(This->handle); + + out: + /* +@@ -318,7 +396,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Seek( + case STREAM_SEEK_CUR: + break; + case STREAM_SEEK_END: +- newPosition = This->streamSize; ++ newPosition.QuadPart = handle_getsize(This->handle); + break; + default: + hr = STG_E_SEEKERROR; +@@ -363,29 +441,13 @@ static HRESULT WINAPI HGLOBALStreamImpl_SetSize( + ULARGE_INTEGER libNewSize) /* [in] */ + { + HGLOBALStreamImpl* This = impl_from_IStream(iface); +- HGLOBAL supportHandle; + + TRACE("(%p, %d)\n", iface, libNewSize.u.LowPart); + + /* + * HighPart is ignored as shown in tests + */ +- +- if (This->streamSize.u.LowPart == libNewSize.u.LowPart) +- return S_OK; +- +- /* +- * Re allocate the HGlobal to fit the new size of the stream. +- */ +- supportHandle = GlobalReAlloc(This->supportHandle, libNewSize.u.LowPart, 0); +- +- if (supportHandle == 0) +- return E_OUTOFMEMORY; +- +- This->supportHandle = supportHandle; +- This->streamSize.u.LowPart = libNewSize.u.LowPart; +- +- return S_OK; ++ return handle_setsize(This->handle, libNewSize.u.LowPart); + } + + /*** +@@ -533,24 +595,49 @@ static HRESULT WINAPI HGLOBALStreamImpl_Stat( + + pstatstg->pwcsName = NULL; + pstatstg->type = STGTY_STREAM; +- pstatstg->cbSize = This->streamSize; ++ pstatstg->cbSize.QuadPart = handle_getsize(This->handle); + + return S_OK; + } + ++static const IStreamVtbl HGLOBALStreamImplVtbl; ++ ++static HGLOBALStreamImpl *HGLOBALStreamImpl_Create(void) ++{ ++ HGLOBALStreamImpl *This; ++ ++ This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); ++ if (This) ++ { ++ This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; ++ This->ref = 1; ++ } ++ return This; ++} ++ + static HRESULT WINAPI HGLOBALStreamImpl_Clone( + IStream* iface, + IStream** ppstm) /* [out] */ + { + HGLOBALStreamImpl* This = impl_from_IStream(iface); ++ HGLOBALStreamImpl* clone; + ULARGE_INTEGER dummy; + LARGE_INTEGER offset; +- HRESULT hr; + +- TRACE(" Cloning %p (deleteOnRelease=%d seek position=%ld)\n",iface,This->deleteOnRelease,(long)This->currentPosition.QuadPart); +- hr = CreateStreamOnHGlobal(This->supportHandle, FALSE, ppstm); +- if(FAILED(hr)) +- return hr; ++ if (!ppstm) return E_INVALIDARG; ++ ++ *ppstm = NULL; ++ ++ TRACE(" Cloning %p (seek position=%d)\n", iface, This->currentPosition.u.LowPart); ++ ++ clone = HGLOBALStreamImpl_Create(); ++ if (!clone) return E_OUTOFMEMORY; ++ ++ *ppstm = &clone->IStream_iface; ++ ++ handle_addref(This->handle); ++ clone->handle = This->handle; ++ + offset.QuadPart = (LONGLONG)This->currentPosition.QuadPart; + IStream_Seek(*ppstm, offset, STREAM_SEEK_SET, &dummy); + return S_OK; +@@ -587,28 +674,19 @@ HRESULT WINAPI CreateStreamOnHGlobal( + if (!ppstm) + return E_INVALIDARG; + +- This = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); ++ This = HGLOBALStreamImpl_Create(); + if (!This) return E_OUTOFMEMORY; + +- This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; +- This->ref = 1; +- +- /* initialize the support */ +- This->supportHandle = hGlobal; +- This->deleteOnRelease = fDeleteOnRelease; +- + /* allocate a handle if one is not supplied */ +- if (!This->supportHandle) +- This->supportHandle = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE, 0); ++ if (!hGlobal) ++ hGlobal = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE, 0); ++ ++ This->handle = handle_create(hGlobal, fDeleteOnRelease); + + /* start at the beginning */ + This->currentPosition.u.HighPart = 0; + This->currentPosition.u.LowPart = 0; + +- /* initialize the size of the stream to the size of the handle */ +- This->streamSize.u.HighPart = 0; +- This->streamSize.u.LowPart = GlobalSize(This->supportHandle); +- + *ppstm = &This->IStream_iface; + + return S_OK; +@@ -630,7 +708,7 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal) + * Verify that the stream object was created with CreateStreamOnHGlobal. + */ + if (pStream->IStream_iface.lpVtbl == &HGLOBALStreamImplVtbl) +- *phglobal = pStream->supportHandle; ++ *phglobal = handle_gethglobal(pStream->handle); + else + { + *phglobal = 0; +diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c +index 0453e54..afda4e6 100644 +--- a/dlls/ole32/tests/hglobalstream.c ++++ b/dlls/ole32/tests/hglobalstream.c +@@ -579,14 +579,12 @@ static void test_IStream_Clone(void) + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 13, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + buf[0] = 0; + hr = IStream_Read(clone, buf, sizeof(buf), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); +-todo_wine + ok(!strcmp(buf, hello), "wrong stream contents\n"); + + newsize.QuadPart = 0x8000; +@@ -601,9 +599,7 @@ todo_wine + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); +-todo_wine + ok(pos == 13, "unexpected %d\n", pos); + + IStream_Release(clone); +@@ -715,24 +711,19 @@ todo_wine + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(clone, newsize); +-todo_wine + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + hr = IStream_Write(clone, hello, sizeof(hello), NULL); +-todo_wine + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); +-todo_wine + ok(pos == 13, "unexpected %d\n", pos); + + offset.QuadPart = 0; +@@ -742,14 +733,11 @@ todo_wine + buf[0] = 0; + hr = IStream_Read(clone, buf, sizeof(buf), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); +-todo_wine + ok(!strcmp(buf, hello), "wrong stream contents\n"); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); +-todo_wine + ok(pos == 32, "unexpected %d\n", pos); + + ret = IStream_Release(clone); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0004-ole32-Set-DebugInfo-Spare-0-for-handle_wrapper-lock.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0004-ole32-Set-DebugInfo-Spare-0-for-handle_wrapper-lock.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0004-ole32-Set-DebugInfo-Spare-0-for-handle_wrapper-lock.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0004-ole32-Set-DebugInfo-Spare-0-for-handle_wrapper-lock.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,32 @@ +From e6b772e0000dac0c50a8070b46413352e9c86174 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 6 Feb 2016 03:26:10 +0100 +Subject: ole32: Set DebugInfo->Spare[0] for handle_wrapper lock. + +--- + dlls/ole32/hglobalstream.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index 5eb6320..8b7e960 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -71,6 +71,7 @@ static void handle_release(struct handle_wrapper *handle) + handle->hglobal = NULL; + } + ++ handle->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&handle->lock); + HeapFree(GetProcessHeap(), 0, handle); + } +@@ -130,6 +131,7 @@ static struct handle_wrapper *handle_create(HGLOBAL hglobal, BOOL delete_on_rele + handle->size = GlobalSize(hglobal); + handle->delete_on_release = delete_on_release; + InitializeCriticalSection(&handle->lock); ++ handle->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": handle_wrapper.lock"); + } + return handle; + } +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,72 @@ +From b7849b3a81d2e55ccfc3d61a8a14bbacf878438b Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 2 Feb 2016 15:35:59 +0800 +Subject: ole32: Allow moving a being reallocated block of memory managed by + HGLOBAL based IStream. + +--- + dlls/ole32/hglobalstream.c | 2 +- + dlls/ole32/tests/hglobalstream.c | 8 -------- + 2 files changed, 1 insertion(+), 9 deletions(-) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index 8b7e960..3e7f67b 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -100,7 +100,7 @@ static HRESULT handle_setsize(struct handle_wrapper *handle, ULONG size) + + if (handle->size != size) + { +- HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, 0); ++ HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, GMEM_MOVEABLE); + if (hglobal) + { + handle->hglobal = hglobal; +diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c +index afda4e6..9aa3b6c 100644 +--- a/dlls/ole32/tests/hglobalstream.c ++++ b/dlls/ole32/tests/hglobalstream.c +@@ -626,20 +626,16 @@ static void test_IStream_Clone(void) + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(stream, newsize); +-todo_wine + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); +-todo_wine + ok(hmem != orig_hmem, "unexpected %p\n", hmem); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + +@@ -667,19 +663,15 @@ todo_wine + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(stream, newsize); +-todo_wine + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); +-todo_wine + ok(hmem != orig_hmem, "unexpected %p\n", hmem); +-todo_wine + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); +-todo_wine + ok(hmem_clone != hmem, "handles should not match\n"); + ok(size == 1, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0006-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Rea.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0006-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Rea.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0006-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Rea.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0006-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Rea.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,115 @@ +From f5c31437019892510e36f603cbde72d9204a4155 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 6 Feb 2016 03:50:55 +0100 +Subject: ole32: Improve thread-safety of HGLOBALStreamImpl_Read. + +--- + dlls/ole32/hglobalstream.c | 83 ++++++++++++++++++---------------------------- + 1 file changed, 32 insertions(+), 51 deletions(-) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index 3e7f67b..27ac706 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -87,6 +87,34 @@ static void handle_unlock(struct handle_wrapper *handle) + GlobalUnlock(handle->hglobal); + } + ++static ULONG handle_read(struct handle_wrapper *handle, ULONG *pos, void *dest, ULONG len) ++{ ++ void *source; ++ ++ EnterCriticalSection(&handle->lock); ++ ++ if (*pos < handle->size) ++ len = min(handle->size - *pos, len); ++ else ++ len = 0; ++ ++ source = GlobalLock(handle->hglobal); ++ if (source) ++ { ++ memcpy(dest, (char *)source + *pos, len); ++ *pos += len; ++ GlobalUnlock(handle->hglobal); ++ } ++ else ++ { ++ WARN("read from invalid hglobal %p\n", handle->hglobal); ++ len = 0; ++ } ++ ++ LeaveCriticalSection(&handle->lock); ++ return len; ++} ++ + static HGLOBAL handle_gethglobal(struct handle_wrapper *handle) + { + return handle->hglobal; +@@ -222,59 +250,12 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( + ULONG* pcbRead) /* [out] */ + { + HGLOBALStreamImpl* This = impl_from_IStream(iface); ++ ULONG num_bytes; + +- void* supportBuffer; +- ULONG bytesReadBuffer; +- ULONG bytesToReadFromBuffer; +- +- TRACE("(%p, %p, %d, %p)\n", iface, +- pv, cb, pcbRead); +- +- /* +- * If the caller is not interested in the number of bytes read, +- * we use another buffer to avoid "if" statements in the code. +- */ +- if (pcbRead==0) +- pcbRead = &bytesReadBuffer; +- +- /* +- * Using the known size of the stream, calculate the number of bytes +- * to read from the block chain +- */ +- bytesToReadFromBuffer = min( handle_getsize(This->handle) - This->currentPosition.u.LowPart, cb); +- +- /* +- * Lock the buffer in position and copy the data. +- */ +- supportBuffer = handle_lock(This->handle); +- if (!supportBuffer) +- { +- WARN("read from invalid hglobal %p\n", handle_gethglobal(This->handle)); +- *pcbRead = 0; +- return S_OK; +- } +- +- memcpy(pv, (char *) supportBuffer+This->currentPosition.u.LowPart, bytesToReadFromBuffer); +- +- /* +- * Move the current position to the new position +- */ +- This->currentPosition.u.LowPart+=bytesToReadFromBuffer; +- +- /* +- * Return the number of bytes read. +- */ +- *pcbRead = bytesToReadFromBuffer; +- +- /* +- * Cleanup +- */ +- handle_unlock(This->handle); ++ TRACE("(%p, %p, %d, %p)\n", iface, pv, cb, pcbRead); + +- /* +- * Always returns S_OK even if the end of the stream is reached before the +- * buffer is filled +- */ ++ num_bytes = handle_read(This->handle, &This->currentPosition.u.LowPart, pv, cb); ++ if (pcbRead) *pcbRead = num_bytes; + + return S_OK; + } +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0007-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Wri.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0007-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Wri.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/0007-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Wri.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/0007-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Wri.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,158 @@ +From 8656639654762bd3151593fe00a0c47080a085d8 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 6 Feb 2016 04:09:45 +0100 +Subject: ole32: Improve thread-safety of HGLOBALStreamImpl_Write. + +--- + dlls/ole32/hglobalstream.c | 117 ++++++++++++++++++--------------------------- + 1 file changed, 46 insertions(+), 71 deletions(-) + +diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c +index 27ac706..2c08710 100644 +--- a/dlls/ole32/hglobalstream.c ++++ b/dlls/ole32/hglobalstream.c +@@ -77,16 +77,6 @@ static void handle_release(struct handle_wrapper *handle) + } + } + +-static void *handle_lock(struct handle_wrapper *handle) +-{ +- return GlobalLock(handle->hglobal); +-} +- +-static void handle_unlock(struct handle_wrapper *handle) +-{ +- GlobalUnlock(handle->hglobal); +-} +- + static ULONG handle_read(struct handle_wrapper *handle, ULONG *pos, void *dest, ULONG len) + { + void *source; +@@ -115,6 +105,48 @@ static ULONG handle_read(struct handle_wrapper *handle, ULONG *pos, void *dest, + return len; + } + ++static ULONG handle_write(struct handle_wrapper *handle, ULONG *pos, const void *source, ULONG len) ++{ ++ void *dest; ++ ++ if (!len) ++ return 0; ++ ++ EnterCriticalSection(&handle->lock); ++ ++ if (*pos + len > handle->size) ++ { ++ HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, *pos + len, GMEM_MOVEABLE); ++ if (hglobal) ++ { ++ handle->hglobal = hglobal; ++ handle->size = *pos + len; ++ } ++ else ++ { ++ len = 0; ++ goto done; ++ } ++ } ++ ++ dest = GlobalLock(handle->hglobal); ++ if (dest) ++ { ++ memcpy((char *)dest + *pos, source, len); ++ *pos += len; ++ GlobalUnlock(handle->hglobal); ++ } ++ else ++ { ++ WARN("write to invalid hglobal %p\n", handle->hglobal); ++ /* len = 0; */ ++ } ++ ++done: ++ LeaveCriticalSection(&handle->lock); ++ return len; ++} ++ + static HGLOBAL handle_gethglobal(struct handle_wrapper *handle) + { + return handle->hglobal; +@@ -277,71 +309,14 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( + ULONG* pcbWritten) /* [out] */ + { + HGLOBALStreamImpl* This = impl_from_IStream(iface); +- +- void* supportBuffer; +- ULARGE_INTEGER newSize; +- ULONG bytesWritten = 0; ++ ULONG num_bytes; + + TRACE("(%p, %p, %d, %p)\n", iface, pv, cb, pcbWritten); + +- /* +- * If the caller is not interested in the number of bytes written, +- * we use another buffer to avoid "if" statements in the code. +- */ +- if (pcbWritten == 0) +- pcbWritten = &bytesWritten; +- +- if (cb == 0) +- goto out; +- +- *pcbWritten = 0; +- +- newSize.u.HighPart = 0; +- newSize.u.LowPart = This->currentPosition.u.LowPart + cb; +- +- /* +- * Verify if we need to grow the stream +- */ +- if (newSize.u.LowPart > handle_getsize(This->handle)) +- { +- /* grow stream */ +- HRESULT hr = IStream_SetSize(iface, newSize); +- if (FAILED(hr)) +- { +- ERR("IStream_SetSize failed with error 0x%08x\n", hr); +- return hr; +- } +- } +- +- /* +- * Lock the buffer in position and copy the data. +- */ +- supportBuffer = handle_lock(This->handle); +- if (!supportBuffer) +- { +- WARN("write to invalid hglobal %p\n", handle_gethglobal(This->handle)); +- return S_OK; +- } +- +- memcpy((char *) supportBuffer+This->currentPosition.u.LowPart, pv, cb); +- +- /* +- * Move the current position to the new position +- */ +- This->currentPosition.u.LowPart+=cb; +- +- /* +- * Cleanup +- */ +- handle_unlock(This->handle); +- +-out: +- /* +- * Return the number of bytes read. +- */ +- *pcbWritten = cb; ++ num_bytes = handle_write(This->handle, &This->currentPosition.u.LowPart, pv, cb); ++ if (pcbWritten) *pcbWritten = num_bytes; + +- return S_OK; ++ return (num_bytes < cb) ? E_OUTOFMEMORY : S_OK; + } + + /*** +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ole32-HGLOBALStream/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ole32-HGLOBALStream/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Implement proper refcounting and locking for HGLOBAL based IStream diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/0001-oleaut32-Implement-semi-stub-for-CreateTypeLib.patch wine-staging-1.9.3~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/0001-oleaut32-Implement-semi-stub-for-CreateTypeLib.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/0001-oleaut32-Implement-semi-stub-for-CreateTypeLib.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/0001-oleaut32-Implement-semi-stub-for-CreateTypeLib.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,43 @@ +From c82a7265f3a5fa9114c7881fba3047aae960340a Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 2 Sep 2015 13:09:34 +1000 +Subject: oleaut32: Implement semi-stub for CreateTypeLib. + +--- + dlls/oleaut32/typelib.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c +index 2a24b79..4066d03 100644 +--- a/dlls/oleaut32/typelib.c ++++ b/dlls/oleaut32/typelib.c +@@ -424,11 +424,21 @@ HRESULT WINAPI QueryPathOfRegTypeLib( REFGUID guid, WORD wMaj, WORD wMin, LCID l + * Success: S_OK + * Failure: Status + */ +-HRESULT WINAPI CreateTypeLib( +- SYSKIND syskind, LPCOLESTR szFile, ICreateTypeLib** ppctlib +-) { +- FIXME("(%d,%s,%p), stub!\n",syskind,debugstr_w(szFile),ppctlib); +- return E_FAIL; ++HRESULT WINAPI CreateTypeLib(SYSKIND syskind, LPCOLESTR file, ICreateTypeLib **ctlib) ++{ ++ ICreateTypeLib2 *typelib2; ++ HRESULT hres; ++ ++ FIXME("(%d, %s, %p): forwarding to CreateTypeLib2\n", syskind, debugstr_w(file), ctlib); ++ ++ hres = CreateTypeLib2(syskind, file, &typelib2); ++ if(SUCCEEDED(hres)) ++ { ++ hres = ICreateTypeLib2_QueryInterface(typelib2, &IID_ICreateTypeLib, (void **)&ctlib); ++ ICreateTypeLib2_Release(typelib2); ++ } ++ ++ return hres; + } + + /****************************************************************************** +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/definition wine-staging-1.9.3~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/oleaut32-CreateTypeLib/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [!8780] Forward CreateTypeLib to CreateTypeLib2 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,304 +0,0 @@ -From 2db7b6af860b34134a0a1177fd5628f8cc6506cc Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 22 Jan 2016 17:40:43 +0800 -Subject: include: Make stdole32.idl a public component. - -This makes it possible to import stdole32.tlb from other .idl files. ---- - dlls/stdole32.tlb/std_ole_v1.idl | 119 +------------------------------- - include/Makefile.in | 1 + - include/stdole32.idl | 143 +++++++++++++++++++++++++++++++++++++++ - 3 files changed, 145 insertions(+), 118 deletions(-) - create mode 100644 include/stdole32.idl - -diff --git a/dlls/stdole32.tlb/std_ole_v1.idl b/dlls/stdole32.tlb/std_ole_v1.idl -index 359a810..de053e9 100644 ---- a/dlls/stdole32.tlb/std_ole_v1.idl -+++ b/dlls/stdole32.tlb/std_ole_v1.idl -@@ -20,121 +20,4 @@ - - #pragma makedep regtypelib - --[ -- uuid(00020430-0000-0000-C000-000000000046), -- restricted, -- version(1.0), -- helpstring("OLE Automation") --] --library stdole --{ -- /* typedefs aren't stored in the type library. -- These type names are known by the type compiler so it -- doesn't really matter what we define them as. */ -- -- typedef void *VARIANT; -- typedef wchar_t *BSTR; -- typedef unsigned long SCODE; -- typedef unsigned long HRESULT; -- -- typedef struct GUID { -- unsigned long Data1; -- unsigned short Data2; -- unsigned short Data3; -- unsigned char Data4[ 8 ]; -- } GUID; -- -- typedef struct DISPPARAMS { -- VARIANT *rgvarg; -- long *rgdispidNamedArgs; -- unsigned int cArgs; -- unsigned int cNamedArgs; -- } DISPPARAMS; -- -- typedef struct EXCEPINFO { -- unsigned short wCode; -- unsigned short wReserved; -- BSTR bstrSource; -- BSTR bstrDescription; -- BSTR bstrHelpFile; -- unsigned long dwHelpContext; -- void *pvReserved; -- void *pfnDeferredFillIn; -- SCODE scode; -- } EXCEPINFO; -- -- [ -- odl, -- uuid(00000000-0000-0000-C000-000000000046) -- ] -- interface IUnknown -- { -- [restricted] -- HRESULT QueryInterface( -- [in] GUID *riid, -- [out] void **ppvObj); -- -- [restricted] -- unsigned long AddRef(); -- -- [restricted] -- unsigned long Release(); -- } -- -- [ -- odl, -- uuid(00020400-0000-0000-C000-000000000046) -- ] -- interface IDispatch : IUnknown -- { -- [restricted] -- HRESULT GetTypeInfoCount( -- [out] unsigned int *pctinfo); -- -- [restricted] -- HRESULT GetTypeInfo( -- [in] unsigned int itinfo, -- [in] unsigned long lcid, -- [out] void **pptinfo); -- -- [restricted] -- HRESULT GetIDsOfNames( -- [in] GUID *riid, -- [in] char **rgszNames, -- [in] unsigned int cNames, -- [in] unsigned long lcid, -- [out] long *rgdispid); -- -- [restricted] -- HRESULT Invoke( -- [in] long dispidMember, -- [in] GUID *riid, -- [in] unsigned long lcid, -- [in] unsigned short wFlags, -- [in] DISPPARAMS *pdispparams, -- [out] VARIANT *pvarResult, -- [out] EXCEPINFO *pexcepinfo, -- [out] unsigned int *puArgErr); -- -- } -- -- [ -- odl, -- uuid(00020404-0000-0000-C000-000000000046) -- ] -- interface IEnumVARIANT : IUnknown -- { -- HRESULT Next( -- [in] unsigned long celt, -- [in] VARIANT *rgvar, -- [out] unsigned long *pceltFetched); -- -- HRESULT Skip( -- [in] unsigned long celt); -- -- HRESULT Reset(); -- -- HRESULT Clone( -- [out] IEnumVARIANT **ppenum); -- } --}; -+#include "stdole32.idl" -diff --git a/include/Makefile.in b/include/Makefile.in -index 129ff6d..c15544a 100644 ---- a/include/Makefile.in -+++ b/include/Makefile.in -@@ -140,6 +140,7 @@ IDL_SRCS = \ - shtypes.idl \ - srcrst.idl \ - stdole2.idl \ -+ stdole32.idl \ - strmif.idl \ - structuredquerycondition.idl \ - taskschd.idl \ -diff --git a/include/stdole32.idl b/include/stdole32.idl -new file mode 100644 -index 0000000..107cee8 ---- /dev/null -+++ b/include/stdole32.idl -@@ -0,0 +1,143 @@ -+/* -+ * Copyright (C) 2003 Robert Shearman -+ * 2005 Huw Davies -+ * -+ * 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 -+ * -+ */ -+ -+#if 0 -+#pragma makedep install -+#pragma makedep typelib -+#endif -+ -+[ -+ uuid(00020430-0000-0000-C000-000000000046), -+ restricted, -+ version(1.0), -+ helpstring("OLE Automation") -+] -+library stdole -+{ -+ /* typedefs aren't stored in the type library. -+ These type names are known by the type compiler so it -+ doesn't really matter what we define them as. */ -+ -+ typedef void *VARIANT; -+ typedef wchar_t *BSTR; -+ typedef unsigned long SCODE; -+ typedef unsigned long HRESULT; -+ -+ typedef struct GUID { -+ unsigned long Data1; -+ unsigned short Data2; -+ unsigned short Data3; -+ unsigned char Data4[ 8 ]; -+ } GUID; -+ -+ typedef struct DISPPARAMS { -+ VARIANT *rgvarg; -+ long *rgdispidNamedArgs; -+ unsigned int cArgs; -+ unsigned int cNamedArgs; -+ } DISPPARAMS; -+ -+ typedef struct EXCEPINFO { -+ unsigned short wCode; -+ unsigned short wReserved; -+ BSTR bstrSource; -+ BSTR bstrDescription; -+ BSTR bstrHelpFile; -+ unsigned long dwHelpContext; -+ void *pvReserved; -+ void *pfnDeferredFillIn; -+ SCODE scode; -+ } EXCEPINFO; -+ -+ [ -+ odl, -+ uuid(00000000-0000-0000-C000-000000000046) -+ ] -+ interface IUnknown -+ { -+ [restricted] -+ HRESULT QueryInterface( -+ [in] GUID *riid, -+ [out] void **ppvObj); -+ -+ [restricted] -+ unsigned long AddRef(); -+ -+ [restricted] -+ unsigned long Release(); -+ } -+ -+ [ -+ odl, -+ uuid(00020400-0000-0000-C000-000000000046) -+ ] -+ interface IDispatch : IUnknown -+ { -+ [restricted] -+ HRESULT GetTypeInfoCount( -+ [out] unsigned int *pctinfo); -+ -+ [restricted] -+ HRESULT GetTypeInfo( -+ [in] unsigned int itinfo, -+ [in] unsigned long lcid, -+ [out] void **pptinfo); -+ -+ [restricted] -+ HRESULT GetIDsOfNames( -+ [in] GUID *riid, -+ [in] char **rgszNames, -+ [in] unsigned int cNames, -+ [in] unsigned long lcid, -+ [out] long *rgdispid); -+ -+ [restricted] -+ HRESULT Invoke( -+ [in] long dispidMember, -+ [in] GUID *riid, -+ [in] unsigned long lcid, -+ [in] unsigned short wFlags, -+ [in] DISPPARAMS *pdispparams, -+ [out] VARIANT *pvarResult, -+ [out] EXCEPINFO *pexcepinfo, -+ [out] unsigned int *puArgErr); -+ -+ } -+ -+ [ -+ odl, -+ uuid(00020404-0000-0000-C000-000000000046) -+ ] -+ interface IEnumVARIANT : IUnknown -+ { -+ HRESULT Next( -+ [in] unsigned long celt, -+ [in] VARIANT *rgvar, -+ [out] unsigned long *pceltFetched); -+ -+ HRESULT Skip( -+ [in] unsigned long celt); -+ -+ HRESULT Reset(); -+ -+ HRESULT Clone( -+ [out] IEnumVARIANT **ppenum); -+ } -+}; --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/0002-olepro32-Add-typelib-resource.patch wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/0002-olepro32-Add-typelib-resource.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/0002-olepro32-Add-typelib-resource.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/0002-olepro32-Add-typelib-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,291 +0,0 @@ -From 389f6141334056d3d91f004ea6b3e02f25cbea29 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 22 Jan 2016 18:20:29 +0800 -Subject: olepro32: Add typelib resource. - -Based on a patch by Alistair Leslie-Hughes. ---- - dlls/olepro32/Makefile.in | 2 + - dlls/olepro32/olepro.idl | 259 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 261 insertions(+) - create mode 100644 dlls/olepro32/olepro.idl - -diff --git a/dlls/olepro32/Makefile.in b/dlls/olepro32/Makefile.in -index a6163d1..032fdbd 100644 ---- a/dlls/olepro32/Makefile.in -+++ b/dlls/olepro32/Makefile.in -@@ -4,4 +4,6 @@ IMPORTS = oleaut32 - - C_SRCS = olepro32stubs.c - -+IDL_SRCS = olepro.idl -+ - RC_SRCS = version.rc -diff --git a/dlls/olepro32/olepro.idl b/dlls/olepro32/olepro.idl -new file mode 100644 -index 0000000..5b2fb3e ---- /dev/null -+++ b/dlls/olepro32/olepro.idl -@@ -0,0 +1,259 @@ -+/* -+ * Copyright (C) 2003 Robert Shearman -+ * 2005 Huw Davies -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#pragma makedep regtypelib -+ -+import "oaidl.idl"; -+ -+#include -+ -+[ -+ uuid(bef6e001-a874-101a-8bba-00aa00300cab), -+ version(2.0), -+ helpstring("Standard OLE Types") -+] -+library StdType -+{ -+#if 0 /* FIXME */ -+ importlib("stdole32.tlb"); -+#endif -+ -+ /* typedefs aren't stored in the type library. -+ These type names are known by the type compiler so it -+ doesn't really matter what we define them as. */ -+ typedef short VARIANT_BOOL; -+ typedef long BSTR; -+ typedef double CURRENCY; -+ typedef unsigned long HRESULT; -+ typedef void *VARIANT; -+ typedef unsigned long SCODE; -+ -+ typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB), public] -+ unsigned long OLE_COLOR; -+ -+ typedef [uuid(66504302-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_XPOS_PIXELS; -+ -+ typedef [uuid(66504303-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_YPOS_PIXELS; -+ -+ typedef [uuid(66504304-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_XSIZE_PIXELS; -+ -+ typedef [uuid(66504305-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_YSIZE_PIXELS; -+ -+ typedef [uuid(66504306-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_XPOS_HIMETRIC; -+ -+ typedef [uuid(66504307-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_YPOS_HIMETRIC; -+ -+ typedef [uuid(66504308-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_XSIZE_HIMETRIC; -+ -+ typedef [uuid(66504309-BE0F-101A-8BBB-00AA00300CAB), public] -+ long OLE_YSIZE_HIMETRIC; -+ -+ typedef [uuid(BF030640-9069-101B-AE2D-08002B2EC713), public] -+ float OLE_XPOS_CONTAINER; -+ -+ typedef [uuid(BF030641-9069-101B-AE2D-08002B2EC713), public] -+ float OLE_YPOS_CONTAINER; -+ -+ typedef [uuid(BF030642-9069-101B-AE2D-08002B2EC713), public] -+ float OLE_XSIZE_CONTAINER; -+ -+ typedef [uuid(BF030643-9069-101B-AE2D-08002B2EC713), public] -+ float OLE_YSIZE_CONTAINER; -+ -+ typedef [uuid(66504313-BE0F-101A-8BBB-00AA00300CAB), public] -+ int OLE_HANDLE; -+ -+ typedef [uuid(6650430B-BE0F-101A-8BBB-00AA00300CAB), public] -+ VARIANT_BOOL OLE_OPTEXCLUSIVE; -+ -+ typedef [uuid(BF030644-9069-101B-AE2D-08002B2EC713), public] -+ VARIANT_BOOL OLE_CANCELBOOL; -+ -+ typedef [uuid(BF030645-9069-101B-AE2D-08002B2EC713), public] -+ VARIANT_BOOL OLE_ENABLEDEFAULTBOOL; -+ -+ [uuid(6650430A-BE0F-101A-8BBB-00AA00300CAB)] -+ enum OLE_TRISTATE -+ { -+ Unchecked = 0, -+ Checked = 1, -+ Gray = 2 -+ }; -+ -+ typedef [uuid(6650430D-BE0F-101A-8BBB-00AA00300CAB), public] -+ BSTR FONTNAME; -+ -+ typedef [uuid(6650430E-BE0F-101A-8BBB-00AA00300CAB), public] -+ CURRENCY FONTSIZE; -+ -+ typedef [uuid(6650430F-BE0F-101A-8BBB-00AA00300CAB), public] -+ VARIANT_BOOL FONTBOLD; -+ -+ typedef [uuid(66504310-BE0F-101A-8BBB-00AA00300CAB), public] -+ VARIANT_BOOL FONTITALIC; -+ -+ typedef [uuid(66504311-BE0F-101A-8BBB-00AA00300CAB), public] -+ VARIANT_BOOL FONTUNDERSCORE; -+ -+ typedef [uuid(66504312-BE0F-101A-8BBB-00AA00300CAB), public] -+ VARIANT_BOOL FONTSTRIKETHROUGH; -+ -+ [ -+ odl, -+ uuid(BEF6E002-A874-101A-8BBA-00AA00300CAB), -+ helpstring("Font Object"), -+ hidden -+ ] -+ interface IFont : IUnknown -+ { -+ [propget] HRESULT Name([out, retval] BSTR *pname); -+ [propput] HRESULT Name([in] BSTR pname); -+ [propget] HRESULT Size([out, retval] CURRENCY *psize); -+ [propput] HRESULT Size([in] CURRENCY psize); -+ [propget] HRESULT Bold([out, retval] VARIANT_BOOL *pbold); -+ [propput] HRESULT Bold([in] VARIANT_BOOL pbold); -+ [propget] HRESULT Italic([out, retval] VARIANT_BOOL *pitalic); -+ [propput] HRESULT Italic([in] VARIANT_BOOL pitalic); -+ [propget] HRESULT Underline([out, retval] VARIANT_BOOL *punderline); -+ [propput] HRESULT Underline([in] VARIANT_BOOL punderline); -+ [propget] HRESULT Strikethrough([out, retval] VARIANT_BOOL *pstrikethrough); -+ [propput] HRESULT Strikethrough([in] VARIANT_BOOL pstrikethrough); -+ [propget] HRESULT Weight([out, retval] short *pweight); -+ [propput] HRESULT Weight([in] short pweight); -+ [propget] HRESULT Charset([out, retval] short *pcharset); -+ [propput] HRESULT Charset([in] short pcharset); -+ [propget] HRESULT hFont([out, retval] OLE_HANDLE *phfont); -+ HRESULT Clone([out] IFont **ppfont); -+ HRESULT IsEqual([in] IFont *pfontOther); -+ HRESULT SetRatio([in] long cyLogical, [in] long cyHimetric); -+ HRESULT AddRefHfont([in] OLE_HANDLE hFont); -+ HRESULT ReleaseHfont([in] OLE_HANDLE hFont); -+ }; -+ -+ [ -+ odl, -+ uuid(BEF6E003-A874-101A-8BBA-00AA00300CAB) -+ ] -+ dispinterface Font -+ { -+ properties: -+ [id(DISPID_FONT_NAME)] BSTR Name; -+ [id(DISPID_FONT_SIZE)] CURRENCY Size; -+ [id(DISPID_FONT_BOLD)] VARIANT_BOOL Bold; -+ [id(DISPID_FONT_ITALIC)] VARIANT_BOOL Italic; -+ [id(DISPID_FONT_UNDER)] VARIANT_BOOL Underline; -+ [id(DISPID_FONT_STRIKE)] VARIANT_BOOL Strikethrough; -+ [id(DISPID_FONT_WEIGHT)] short Weight; -+ [id(DISPID_FONT_CHARSET)] short Charset; -+ methods: -+ } -+ -+ typedef [public] Font IFontDisp; -+ -+ [ -+ uuid(0BE35203-8F91-11CE-9DE3-00AA004BB851) -+ ] -+ coclass StdFont -+ { -+ [default] dispinterface Font; -+ interface IFont; -+ }; -+ -+ [ -+ odl, -+ uuid(7BF80980-BF32-101A-8BBB-00AA00300CAB), -+ helpstring("Picture Object"), -+ hidden -+ ] -+ interface IPicture : IUnknown -+ { -+ [propget] HRESULT Handle([out, retval] OLE_HANDLE *phandle); -+ [propget] HRESULT hPal([out, retval] OLE_HANDLE *phpal); -+ [propget] HRESULT Type([out, retval] short *ptype); -+ [propget] HRESULT Width([out, retval] OLE_XSIZE_HIMETRIC *pwidth); -+ [propget] HRESULT Height([out, retval] OLE_YSIZE_HIMETRIC *pheight); -+ HRESULT Render([in] int hdc, -+ [in] long x, -+ [in] long y, -+ [in] long cx, -+ [in] long cy, -+ [in] OLE_XPOS_HIMETRIC xSrc, -+ [in] OLE_YPOS_HIMETRIC ySrc, -+ [in] OLE_XSIZE_HIMETRIC cxSrc, -+ [in] OLE_YSIZE_HIMETRIC cySrc, -+ [in] void *prcWBounds); -+ -+ [propput] HRESULT hPal([in] OLE_HANDLE phpal); -+ [propget] HRESULT CurDC([out, retval] int *phdcOut); -+ HRESULT SelectPicture([in] int hdcIn, -+ [out] int *phdcOut, -+ [out] OLE_HANDLE *phbmpOut); -+ [propget] HRESULT KeepOriginalFormat([out, retval] VARIANT_BOOL *pfkeep); -+ [propput] HRESULT KeepOriginalFormat([in] VARIANT_BOOL pfkeep); -+ HRESULT PictureChanged(); -+ HRESULT SaveAsFile([in] void *pstm, -+ [in] VARIANT_BOOL fSaveMemCopy, -+ [out] long *pcbSize); -+ [propget] HRESULT Attributes([out, retval] long *pdwAttr); -+ HRESULT SetHdc([in] OLE_HANDLE hdc); -+ }; -+ -+ [ -+ uuid(7BF80981-BF32-101A-8BBB-00AA00300CAB) -+ ] -+ dispinterface Picture -+ { -+ properties: -+ [id(DISPID_PICT_HANDLE), readonly] OLE_HANDLE Handle; -+ [id(DISPID_PICT_HPAL)] OLE_HANDLE hPal; -+ [id(DISPID_PICT_TYPE), readonly] short Type; -+ [id(DISPID_PICT_WIDTH), readonly] OLE_XSIZE_HIMETRIC Width; -+ [id(DISPID_PICT_HEIGHT), readonly] OLE_YSIZE_HIMETRIC Height; -+ methods: -+ [id(DISPID_PICT_RENDER)] -+ void Render(int hdc, -+ long x, -+ long y, -+ long cx, -+ long cy, -+ OLE_XPOS_HIMETRIC xSrc, -+ OLE_YPOS_HIMETRIC ySrc, -+ OLE_XSIZE_HIMETRIC cxSrc, -+ OLE_YSIZE_HIMETRIC cySrc, -+ void *prcWBounds); -+ }; -+ -+ typedef [public] Picture IPictureDisp; -+ -+ [ -+ uuid(0BE35204-8F91-11CE-9DE3-00AA004BB851) -+ ] -+ coclass StdPicture -+ { -+ [default] dispinterface Picture; -+ interface IPicture; -+ }; -+} --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/definition wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/olepro32-Typelib/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/olepro32-Typelib/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [14617] Add Standard OLE Types typelib to olepro32.dll diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/patchinstall.sh wine-staging-1.9.3~ubuntu12.04.1/patches/patchinstall.sh --- wine-staging-1.9.2~ubuntu12.04.1/patches/patchinstall.sh 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/patchinstall.sh 2016-02-08 20:07:32.000000000 +0000 @@ -51,13 +51,13 @@ # Get the upstream commit sha upstream_commit() { - echo "e5132e5a91208253e67c0eff709ab5c96d79b790" + echo "c266d373deb417abef4883f59daa5d517b77e76c" } # Show version information version() { - echo "Wine Staging 1.9.3 (unreleased)" + echo "Wine Staging 1.9.3" echo "Copyright (C) 2014-2016 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" @@ -91,6 +91,9 @@ enable_amstream_GetMultiMediaStream="$1" enable_api_ms_win_Stub_DLLs="$1" enable_authz_Stub_Functions="$1" + enable_avifil32_AVIFile_Proxies="$1" + enable_avifil32_IGetFrame_fnSetFormat="$1" + enable_avifile_dll16_AVIStreamGetFrame="$1" enable_browseui_Progress_Dialog="$1" enable_combase_RoApi="$1" enable_combase_WindowsString="$1" @@ -121,9 +124,11 @@ enable_d3dx9_36_Texture_Align="$1" enable_d3dx9_36_UpdateSkinnedMesh="$1" enable_dbghelp_Debug_Symbols="$1" + enable_ddraw_Device_Caps="$1" enable_ddraw_EnumSurfaces="$1" enable_ddraw_IDirect3DTexture2_Load="$1" enable_ddraw_Rendering_Targets="$1" + enable_ddraw_Revert_Surface_Init="$1" enable_ddraw_Write_Vtable="$1" enable_ddraw_ZBufferBitDepths="$1" enable_ddraw_d3d_execute_buffer="$1" @@ -132,6 +137,7 @@ enable_dsound_EAX="$1" enable_dsound_Fast_Mixer="$1" enable_dsound_Revert_Cleanup="$1" + enable_dxdiagn_Display_Information="$1" enable_dxdiagn_Enumerate_DirectSound="$1" enable_dxdiagn_GetChildContainer_Leaf_Nodes="$1" enable_dxgi_MakeWindowAssociation="$1" @@ -154,10 +160,10 @@ enable_iphlpapi_System_Ping="$1" enable_iphlpapi_TCP_Table="$1" enable_kernel32_COMSPEC="$1" - enable_kernel32_Codepage_Conversion="$1" enable_kernel32_CompareString_Length="$1" enable_kernel32_CopyFileEx="$1" enable_kernel32_Cwd_Startup_Info="$1" + enable_kernel32_FindFirstFile="$1" enable_kernel32_FreeUserPhysicalPages="$1" enable_kernel32_GetCurrentPackageFamilyName="$1" enable_kernel32_GetFinalPathNameByHandle="$1" @@ -166,25 +172,28 @@ enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" enable_kernel32_Profile="$1" + enable_kernel32_QT_Environment_Variables="$1" enable_kernel32_SetFileCompletionNotificationModes="$1" enable_kernel32_SetFileInformationByHandle="$1" enable_kernel32_TimezoneInformation_Registry="$1" enable_kernel32_VerifyVersionInfo="$1" + enable_kernel32_VirtualProtect="$1" enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_makedep_PARENTSPEC="$1" enable_mfplat_MFTRegister="$1" enable_mmdevapi_AEV_Stubs="$1" + enable_mmsystem_dll16_Fix_Argument_Order="$1" enable_mountmgr_DosDevices="$1" enable_mpr_WNetGetUniversalNameW="$1" enable_mscoree_CorValidateImage="$1" enable_mshtml_HTMLLocation_put_hash="$1" - enable_mshtml_Wine_Gecko_2_44="$1" enable_msidb_Implementation="$1" enable_msvcr120__SetWinRTOutOfMemoryExceptionCallback="$1" enable_msvcr120_strof="$1" enable_msvcrt_Math_Precision="$1" enable_msvcrt_StdHandle_RefCount="$1" + enable_msvideo_MCIWNDM_SETTIMEFORMATA="$1" enable_ntdll_APC_Performance="$1" enable_ntdll_APC_Start_Process="$1" enable_ntdll_Activation_Context="$1" @@ -210,7 +219,6 @@ enable_ntdll_Loader_Machine_Type="$1" enable_ntdll_NtQueryEaFile="$1" enable_ntdll_NtQuerySection="$1" - enable_ntdll_NtQuerySystemInformationEx="$1" enable_ntdll_NtSetLdtEntries="$1" enable_ntdll_Pipe_SpecialCharacters="$1" enable_ntdll_ProcessQuotaLimits="$1" @@ -240,11 +248,13 @@ enable_nvcuvid_CUDA_Video_Support="$1" enable_nvencodeapi_Video_Encoder="$1" enable_ole32_CoGetApartmentType="$1" + enable_ole32_HGLOBALStream="$1" + enable_oleaut32_CreateTypeLib="$1" enable_oleaut32_TKIND_COCLASS="$1" enable_oleaut32_x86_64_Marshaller="$1" - enable_olepro32_Typelib="$1" enable_openal32_EFX_Extension="$1" enable_opengl32_Revert_Disable_Ext="$1" + enable_quartz_AsyncReader="$1" enable_quartz_MediaSeeking_Positions="$1" enable_rasapi32_RasEnumDevicesA="$1" enable_riched20_IText_Interface="$1" @@ -252,11 +262,11 @@ enable_rpcrt4_RpcBindingServerFromClient="$1" enable_secur32_ANSI_NTLM_Credentials="$1" enable_server_ClipCursor="$1" - enable_server_Coverity="$1" enable_server_CreateProcess_ACLs="$1" enable_server_Desktop_Refcount="$1" enable_server_FileEndOfFileInformation="$1" enable_server_File_Permissions="$1" + enable_server_Fix_Leak="$1" enable_server_Inherited_ACLs="$1" enable_server_Key_State="$1" enable_server_Map_EXDEV_Error="$1" @@ -297,6 +307,9 @@ enable_shlwapi_AssocGetPerceivedType="$1" enable_shlwapi_SHMapHandle="$1" enable_shlwapi_UrlCombine="$1" + enable_stdole32_idl_Typelib="$1" + enable_stdole32_tlb_SLTG_Typelib="$1" + enable_taskmgr_Memory_Usage="$1" enable_ucrtbase_Functions="$1" enable_user32_DeferWindowPos="$1" enable_user32_Dialog_Paint_Event="$1" @@ -304,15 +317,13 @@ enable_user32_GetSystemMetrics="$1" enable_user32_Invalidate_Key_State="$1" enable_user32_ListBox_Size="$1" - enable_user32_MOUSEHOOKSTRUCTEX="$1" enable_user32_Mouse_Message_Hwnd="$1" enable_user32_Refresh_MDI_Menus="$1" enable_user32_ScrollWindowEx="$1" - enable_user32_SetCaretPos="$1" enable_user32_SetCoalescableTimer="$1" - enable_user32_WM_CAPTURECHANGE="$1" enable_user32_WM_MDICALCCHILDSCROLL="$1" enable_user32_WndProc="$1" + enable_uxtheme_CloseThemeData="$1" enable_uxtheme_GTK_Theming="$1" enable_vcomp_Atomic_I8="$1" enable_version_VerQueryValue="$1" @@ -332,12 +343,11 @@ enable_wined3d_CSMT_Main="$1" enable_wined3d_DXTn="$1" enable_wined3d_Geforce_425M="$1" - enable_wined3d_Invalid_Render_States="$1" enable_wined3d_MESA_GPU_Info="$1" - enable_wined3d_Multisampling="$1" enable_wined3d_Revert_PixelFormat="$1" enable_wined3d_UnhandledBlendFactor="$1" enable_wined3d_resource_check_usage="$1" + enable_wined3d_resource_map="$1" enable_wined3d_surface_cpu_blt="$1" enable_wined3d_wined3d_swapchain_present="$1" enable_winedevice_Fix_Relocation="$1" @@ -367,6 +377,7 @@ enable_ws2_32_WSACleanup="$1" enable_ws2_32_WriteWatches="$1" enable_ws2_32_getaddrinfo="$1" + enable_ws2_32_getsockopt="$1" enable_wtsapi32_EnumerateProcesses="$1" enable_wusa_MSU_Package_Installer="$1" } @@ -411,6 +422,15 @@ authz-Stub_Functions) enable_authz_Stub_Functions="$2" ;; + avifil32-AVIFile_Proxies) + enable_avifil32_AVIFile_Proxies="$2" + ;; + avifil32-IGetFrame_fnSetFormat) + enable_avifil32_IGetFrame_fnSetFormat="$2" + ;; + avifile.dll16-AVIStreamGetFrame) + enable_avifile_dll16_AVIStreamGetFrame="$2" + ;; browseui-Progress_Dialog) enable_browseui_Progress_Dialog="$2" ;; @@ -504,6 +524,9 @@ dbghelp-Debug_Symbols) enable_dbghelp_Debug_Symbols="$2" ;; + ddraw-Device_Caps) + enable_ddraw_Device_Caps="$2" + ;; ddraw-EnumSurfaces) enable_ddraw_EnumSurfaces="$2" ;; @@ -513,6 +536,9 @@ ddraw-Rendering_Targets) enable_ddraw_Rendering_Targets="$2" ;; + ddraw-Revert_Surface_Init) + enable_ddraw_Revert_Surface_Init="$2" + ;; ddraw-Write_Vtable) enable_ddraw_Write_Vtable="$2" ;; @@ -537,6 +563,9 @@ dsound-Revert_Cleanup) enable_dsound_Revert_Cleanup="$2" ;; + dxdiagn-Display_Information) + enable_dxdiagn_Display_Information="$2" + ;; dxdiagn-Enumerate_DirectSound) enable_dxdiagn_Enumerate_DirectSound="$2" ;; @@ -603,9 +632,6 @@ kernel32-COMSPEC) enable_kernel32_COMSPEC="$2" ;; - kernel32-Codepage_Conversion) - enable_kernel32_Codepage_Conversion="$2" - ;; kernel32-CompareString_Length) enable_kernel32_CompareString_Length="$2" ;; @@ -615,6 +641,9 @@ kernel32-Cwd_Startup_Info) enable_kernel32_Cwd_Startup_Info="$2" ;; + kernel32-FindFirstFile) + enable_kernel32_FindFirstFile="$2" + ;; kernel32-FreeUserPhysicalPages) enable_kernel32_FreeUserPhysicalPages="$2" ;; @@ -639,6 +668,9 @@ kernel32-Profile) enable_kernel32_Profile="$2" ;; + kernel32-QT_Environment_Variables) + enable_kernel32_QT_Environment_Variables="$2" + ;; kernel32-SetFileCompletionNotificationModes) enable_kernel32_SetFileCompletionNotificationModes="$2" ;; @@ -651,6 +683,9 @@ kernel32-VerifyVersionInfo) enable_kernel32_VerifyVersionInfo="$2" ;; + kernel32-VirtualProtect) + enable_kernel32_VirtualProtect="$2" + ;; libs-Debug_Channel) enable_libs_Debug_Channel="$2" ;; @@ -666,6 +701,9 @@ mmdevapi-AEV_Stubs) enable_mmdevapi_AEV_Stubs="$2" ;; + mmsystem.dll16-Fix_Argument_Order) + enable_mmsystem_dll16_Fix_Argument_Order="$2" + ;; mountmgr-DosDevices) enable_mountmgr_DosDevices="$2" ;; @@ -678,9 +716,6 @@ mshtml-HTMLLocation_put_hash) enable_mshtml_HTMLLocation_put_hash="$2" ;; - mshtml-Wine_Gecko_2.44) - enable_mshtml_Wine_Gecko_2_44="$2" - ;; msidb-Implementation) enable_msidb_Implementation="$2" ;; @@ -696,6 +731,9 @@ msvcrt-StdHandle_RefCount) enable_msvcrt_StdHandle_RefCount="$2" ;; + msvideo-MCIWNDM_SETTIMEFORMATA) + enable_msvideo_MCIWNDM_SETTIMEFORMATA="$2" + ;; ntdll-APC_Performance) enable_ntdll_APC_Performance="$2" ;; @@ -771,9 +809,6 @@ ntdll-NtQuerySection) enable_ntdll_NtQuerySection="$2" ;; - ntdll-NtQuerySystemInformationEx) - enable_ntdll_NtQuerySystemInformationEx="$2" - ;; ntdll-NtSetLdtEntries) enable_ntdll_NtSetLdtEntries="$2" ;; @@ -861,21 +896,27 @@ ole32-CoGetApartmentType) enable_ole32_CoGetApartmentType="$2" ;; + ole32-HGLOBALStream) + enable_ole32_HGLOBALStream="$2" + ;; + oleaut32-CreateTypeLib) + enable_oleaut32_CreateTypeLib="$2" + ;; oleaut32-TKIND_COCLASS) enable_oleaut32_TKIND_COCLASS="$2" ;; oleaut32-x86_64_Marshaller) enable_oleaut32_x86_64_Marshaller="$2" ;; - olepro32-Typelib) - enable_olepro32_Typelib="$2" - ;; openal32-EFX_Extension) enable_openal32_EFX_Extension="$2" ;; opengl32-Revert_Disable_Ext) enable_opengl32_Revert_Disable_Ext="$2" ;; + quartz-AsyncReader) + enable_quartz_AsyncReader="$2" + ;; quartz-MediaSeeking_Positions) enable_quartz_MediaSeeking_Positions="$2" ;; @@ -897,9 +938,6 @@ server-ClipCursor) enable_server_ClipCursor="$2" ;; - server-Coverity) - enable_server_Coverity="$2" - ;; server-CreateProcess_ACLs) enable_server_CreateProcess_ACLs="$2" ;; @@ -912,6 +950,9 @@ server-File_Permissions) enable_server_File_Permissions="$2" ;; + server-Fix_Leak) + enable_server_Fix_Leak="$2" + ;; server-Inherited_ACLs) enable_server_Inherited_ACLs="$2" ;; @@ -1032,6 +1073,15 @@ shlwapi-UrlCombine) enable_shlwapi_UrlCombine="$2" ;; + stdole32.idl-Typelib) + enable_stdole32_idl_Typelib="$2" + ;; + stdole32.tlb-SLTG_Typelib) + enable_stdole32_tlb_SLTG_Typelib="$2" + ;; + taskmgr-Memory_Usage) + enable_taskmgr_Memory_Usage="$2" + ;; ucrtbase-Functions) enable_ucrtbase_Functions="$2" ;; @@ -1053,9 +1103,6 @@ user32-ListBox_Size) enable_user32_ListBox_Size="$2" ;; - user32-MOUSEHOOKSTRUCTEX) - enable_user32_MOUSEHOOKSTRUCTEX="$2" - ;; user32-Mouse_Message_Hwnd) enable_user32_Mouse_Message_Hwnd="$2" ;; @@ -1065,21 +1112,18 @@ user32-ScrollWindowEx) enable_user32_ScrollWindowEx="$2" ;; - user32-SetCaretPos) - enable_user32_SetCaretPos="$2" - ;; user32-SetCoalescableTimer) enable_user32_SetCoalescableTimer="$2" ;; - user32-WM_CAPTURECHANGE) - enable_user32_WM_CAPTURECHANGE="$2" - ;; user32-WM_MDICALCCHILDSCROLL) enable_user32_WM_MDICALCCHILDSCROLL="$2" ;; user32-WndProc) enable_user32_WndProc="$2" ;; + uxtheme-CloseThemeData) + enable_uxtheme_CloseThemeData="$2" + ;; uxtheme-GTK_Theming) enable_uxtheme_GTK_Theming="$2" ;; @@ -1137,15 +1181,9 @@ wined3d-Geforce_425M) enable_wined3d_Geforce_425M="$2" ;; - wined3d-Invalid_Render_States) - enable_wined3d_Invalid_Render_States="$2" - ;; wined3d-MESA_GPU_Info) enable_wined3d_MESA_GPU_Info="$2" ;; - wined3d-Multisampling) - enable_wined3d_Multisampling="$2" - ;; wined3d-Revert_PixelFormat) enable_wined3d_Revert_PixelFormat="$2" ;; @@ -1155,6 +1193,9 @@ wined3d-resource_check_usage) enable_wined3d_resource_check_usage="$2" ;; + wined3d-resource_map) + enable_wined3d_resource_map="$2" + ;; wined3d-surface_cpu_blt) enable_wined3d_surface_cpu_blt="$2" ;; @@ -1242,6 +1283,9 @@ ws2_32-getaddrinfo) enable_ws2_32_getaddrinfo="$2" ;; + ws2_32-getsockopt) + enable_ws2_32_getsockopt="$2" + ;; wtsapi32-EnumerateProcesses) enable_wtsapi32_EnumerateProcesses="$2" ;; @@ -1751,9 +1795,6 @@ if test "$enable_winecfg_Libraries" -gt 1; then abort "Patchset winecfg-Libraries disabled, but category-stable depends on that." fi - if test "$enable_wined3d_Multisampling" -gt 1; then - abort "Patchset wined3d-Multisampling disabled, but category-stable depends on that." - fi if test "$enable_wined3d_Revert_PixelFormat" -gt 1; then abort "Patchset wined3d-Revert_PixelFormat disabled, but category-stable depends on that." fi @@ -1842,7 +1883,6 @@ enable_wine_inf_ProfileList_UserSID=1 enable_wineboot_HKEY_DYN_DATA=1 enable_winecfg_Libraries=1 - enable_wined3d_Multisampling=1 enable_wined3d_Revert_PixelFormat=1 enable_wined3d_UnhandledBlendFactor=1 enable_wined3d_resource_check_usage=1 @@ -1903,9 +1943,13 @@ if test "$enable_wined3d_DXTn" -gt 1; then abort "Patchset wined3d-DXTn disabled, but wined3d-CSMT_Helper depends on that." fi + if test "$enable_wined3d_resource_map" -gt 1; then + abort "Patchset wined3d-resource_map disabled, but wined3d-CSMT_Helper depends on that." + fi enable_makedep_PARENTSPEC=1 enable_ntdll_DllRedirects=1 enable_wined3d_DXTn=1 + enable_wined3d_resource_map=1 fi if test "$enable_uxtheme_GTK_Theming" -eq 1; then @@ -1915,6 +1959,13 @@ enable_ntdll_DllRedirects=1 fi +if test "$enable_stdole32_tlb_SLTG_Typelib" -eq 1; then + if test "$enable_widl_SLTG_Typelib_Support" -gt 1; then + abort "Patchset widl-SLTG_Typelib_Support disabled, but stdole32.tlb-SLTG_Typelib depends on that." + fi + enable_widl_SLTG_Typelib_Support=1 +fi + if test "$enable_shell32_SHFileOperation_Win9x" -eq 1; then if test "$enable_shell32_Progress_Dialog" -gt 1; then abort "Patchset shell32-Progress_Dialog disabled, but shell32-SHFileOperation_Win9x depends on that." @@ -2156,6 +2207,13 @@ enable_dsound_Revert_Cleanup=1 fi +if test "$enable_ddraw_IDirect3DTexture2_Load" -eq 1; then + if test "$enable_wined3d_resource_map" -gt 1; then + abort "Patchset wined3d-resource_map disabled, but ddraw-IDirect3DTexture2_Load depends on that." + fi + enable_wined3d_resource_map=1 +fi + if test "$enable_d3dx9_33_Share_Source" -eq 1; then if test "$enable_d3dx9_36_D3DXStubs" -gt 1; then abort "Patchset d3dx9_36-D3DXStubs disabled, but d3dx9_33-Share_Source depends on that." @@ -2649,6 +2707,9 @@ patch_apply api-ms-win-Stub_DLLs/0029-ext-ms-win-rtcore-ntuser-sysparams-l1-1-0-Add-dll.patch patch_apply api-ms-win-Stub_DLLs/0030-ext-ms-win-kernel32-package-current-l1-1-0-Add-dll.patch patch_apply api-ms-win-Stub_DLLs/0031-shcore-Add-SetProcessDpiAwareness-stub.patch + patch_apply api-ms-win-Stub_DLLs/0032-shcore-Implement-stub-for-GetDpiForMonitor.patch + patch_apply api-ms-win-Stub_DLLs/0033-kernelbase-Add-stub-for-QuirkIsEnabled3.patch + patch_apply api-ms-win-Stub_DLLs/0034-shcore-Add-stub-for-GetProcessDpiAwareness.patch ( echo '+ { "Michael Müller", "api-ms-win-core-com-l1-1-1: Add dll.", 1 },'; echo '+ { "Michael Müller", "kernelbase: Add dll and add stub for QuirkIsEnabled.", 1 },'; @@ -2681,6 +2742,9 @@ echo '+ { "Michael Müller", "ext-ms-win-rtcore-ntuser-sysparams-l1-1-0: Add dll.", 1 },'; echo '+ { "Michael Müller", "ext-ms-win-kernel32-package-current-l1-1-0: Add dll.", 1 },'; echo '+ { "Sebastian Lackner", "shcore: Add SetProcessDpiAwareness stub.", 1 },'; + echo '+ { "Sebastian Lackner", "shcore: Implement stub for GetDpiForMonitor.", 1 },'; + echo '+ { "Michael Müller", "kernelbase: Add stub for QuirkIsEnabled3.", 1 },'; + echo '+ { "Sebastian Lackner", "shcore: Add stub for GetProcessDpiAwareness.", 1 },'; ) >> "$patchlist" fi @@ -2696,6 +2760,48 @@ ) >> "$patchlist" fi +# Patchset avifil32-AVIFile_Proxies +# | +# | This patchset fixes the following Wine bugs: +# | * [#38564] Add support for AVIFile interface proxies +# | +# | Modified files: +# | * dlls/avifil32/Makefile.in, dlls/avifil32/avifil32.idl, dlls/avifil32/avifile_ifaces.idl, +# | dlls/avifil32/avifile_private.h, dlls/avifil32/factory.c +# | +if test "$enable_avifil32_AVIFile_Proxies" -eq 1; then + patch_apply avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch + ( + echo '+ { "Dmitry Timoshkov", "avifil32: Add support for AVIFile interface proxies.", 2 },'; + ) >> "$patchlist" +fi + +# Patchset avifil32-IGetFrame_fnSetFormat +# | +# | Modified files: +# | * dlls/avifil32/getframe.c +# | +if test "$enable_avifil32_IGetFrame_fnSetFormat" -eq 1; then + patch_apply avifil32-IGetFrame_fnSetFormat/0001-avifil32-Correctly-handle-compressed-frames-when-des.patch + ( + echo '+ { "Michael Müller", "avifil32: Correctly handle compressed frames when desired format is specified.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset avifile.dll16-AVIStreamGetFrame +# | +# | Modified files: +# | * dlls/avifile.dll16/Makefile.in, dlls/avifile.dll16/avifile.dll16.spec, dlls/avifile.dll16/main.c +# | +if test "$enable_avifile_dll16_AVIStreamGetFrame" -eq 1; then + patch_apply avifile.dll16-AVIStreamGetFrame/0001-avifile-Correctly-convert-result-of-AVIStreamGetFram.patch + patch_apply avifile.dll16-AVIStreamGetFrame/0002-avifile-Convert-between-AVISTREAMINFO-16-bit-and-AVI.patch + ( + echo '+ { "Michael Müller", "avifile.dll16: Correctly convert result of AVIStreamGetFrame to a segptr.", 1 },'; + echo '+ { "Michael Müller", "avifile.dll16: Convert between AVISTREAMINFO (16 bit) and AVISTREAMINFOA.", 1 },'; + ) >> "$patchlist" +fi + # Patchset browseui-Progress_Dialog # | # | Modified files: @@ -3168,6 +3274,18 @@ ) >> "$patchlist" fi +# Patchset ddraw-Device_Caps +# | +# | Modified files: +# | * dlls/ddraw/ddraw.c, dlls/ddraw/tests/ddraw7.c +# | +if test "$enable_ddraw_Device_Caps" -eq 1; then + patch_apply ddraw-Device_Caps/0001-ddraw-Don-t-set-HWTRANSFORMANDLIGHT-flag-on-d3d7-RGB.patch + ( + echo '+ { "Michael Müller", "ddraw: Don'\''t set HWTRANSFORMANDLIGHT flag on d3d7 RGB device.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-EnumSurfaces # | # | This patchset fixes the following Wine bugs: @@ -3187,8 +3305,24 @@ ) >> "$patchlist" fi +# Patchset wined3d-resource_map +# | +# | Modified files: +# | * dlls/d3d11/device.c, dlls/d3d11/texture.c, dlls/d3d8/surface.c, dlls/d3d8/volume.c, dlls/d3d9/surface.c, +# | dlls/d3d9/volume.c, dlls/ddraw/surface.c, dlls/wined3d/resource.c, dlls/wined3d/wined3d.spec, include/wine/wined3d.h +# | +if test "$enable_wined3d_resource_map" -eq 1; then + patch_apply wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Rename wined3d_resource_(un)map to wined3d_resource_sub_resource_(un)map.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-IDirect3DTexture2_Load # | +# | This patchset has the following (direct or indirect) dependencies: +# | * wined3d-resource_map +# | # | Modified files: # | * dlls/ddraw/surface.c, dlls/ddraw/tests/d3d.c, dlls/ddraw/tests/ddraw2.c # | @@ -3216,6 +3350,23 @@ ) >> "$patchlist" fi +# Patchset ddraw-Revert_Surface_Init +# | +# | This patchset fixes the following Wine bugs: +# | * [#40094] Revert patches to move mip-level dimensions fixup (causes regressions in multiple games) +# | +# | Modified files: +# | * dlls/ddraw/surface.c, dlls/wined3d/surface.c, dlls/wined3d/wined3d.spec, include/wine/wined3d.h +# | +if test "$enable_ddraw_Revert_Surface_Init" -eq 1; then + patch_apply ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch + patch_apply ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch + ( + echo '+ { "Sebastian Lackner", "Revert \"ddraw: Use wined3d_texture_get_sub_resource() in ddraw_surface7_Flip().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"ddraw: Move the mip-level dimensions fix-up from ddraw_surface_init() to ddraw_surface_create().\".", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-Write_Vtable # | # | This patchset fixes the following Wine bugs: @@ -3373,6 +3524,21 @@ ) >> "$patchlist" fi +# Patchset dxdiagn-Display_Information +# | +# | This patchset fixes the following Wine bugs: +# | * [#34686] Return additional properties for display devices in dxdiagn +# | +# | Modified files: +# | * dlls/dxdiagn/provider.c, dlls/dxdiagn/tests/container.c +# | +if test "$enable_dxdiagn_Display_Information" -eq 1; then + patch_apply dxdiagn-Display_Information/0001-dxdiagn-Add-several-more-fields-for-DisplayDevices.patch + ( + echo '+ { "Michael Müller", "dxdiagn: Add several more fields for DisplayDevices.", 1 },'; + ) >> "$patchlist" +fi + # Patchset dxdiagn-Enumerate_DirectSound # | # | This patchset fixes the following Wine bugs: @@ -3749,18 +3915,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-Codepage_Conversion -# | -# | Modified files: -# | * dlls/kernel32/locale.c, dlls/kernel32/tests/codepage.c -# | -if test "$enable_kernel32_Codepage_Conversion" -eq 1; then - patch_apply kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch - ( - echo '+ { "Alex Henrie", "kernel32: Set error if dstlen < 0 in codepage conversion functions.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-CompareString_Length # | # | This patchset fixes the following Wine bugs: @@ -3864,6 +4018,23 @@ ) >> "$patchlist" fi +# Patchset kernel32-FindFirstFile +# | +# | This patchset fixes the following Wine bugs: +# | * [#22635] Strip invalid characters from mask in FindFirstFileExW +# | +# | Modified files: +# | * dlls/kernel32/file.c, dlls/kernel32/tests/file.c +# | +if test "$enable_kernel32_FindFirstFile" -eq 1; then + patch_apply kernel32-FindFirstFile/0001-kernel32-Strip-invalid-characters-from-mask-in-FindF.patch + patch_apply kernel32-FindFirstFile/0002-kernel32-tests-Add-tests-for-FindFirstFileA-with-inv.patch + ( + echo '+ { "Michael Müller", "kernel32: Strip invalid characters from mask in FindFirstFileExW.", 1 },'; + echo '+ { "Michael Müller", "kernel32/tests: Add tests for FindFirstFileA with invalid characters.", 1 },'; + ) >> "$patchlist" +fi + # Patchset kernel32-LocaleNameToLCID # | # | This patchset fixes the following Wine bugs: @@ -4005,6 +4176,18 @@ ) >> "$patchlist" fi +# Patchset kernel32-QT_Environment_Variables +# | +# | Modified files: +# | * dlls/kernel32/process.c +# | +if test "$enable_kernel32_QT_Environment_Variables" -eq 1; then + patch_apply kernel32-QT_Environment_Variables/0001-kernel32-Do-not-inherit-QT_-environment-variables-to.patch + ( + echo '+ { "Sebastian Lackner", "kernel32: Do not inherit QT_* environment variables to Windows environment.", 1 },'; + ) >> "$patchlist" +fi + # Patchset kernel32-SetFileCompletionNotificationModes # | # | This patchset fixes the following Wine bugs: @@ -4049,6 +4232,18 @@ ) >> "$patchlist" fi +# Patchset kernel32-VirtualProtect +# | +# | Modified files: +# | * dlls/kernel32/virtual.c +# | +if test "$enable_kernel32_VirtualProtect" -eq 1; then + patch_apply kernel32-VirtualProtect/0001-kernel32-Allow-to-pass-NULL-as-old-protection-in-Vir.patch + ( + echo '+ { "Michael Müller", "kernel32: Allow to pass NULL as old protection in VirtualProtect for Win9X.", 1 },'; + ) >> "$patchlist" +fi + # Patchset libs-Debug_Channel # | # | Modified files: @@ -4131,6 +4326,18 @@ ) >> "$patchlist" fi +# Patchset mmsystem.dll16-Fix_Argument_Order +# | +# | Modified files: +# | * dlls/mmsystem.dll16/mmsystem.c +# | +if test "$enable_mmsystem_dll16_Fix_Argument_Order" -eq 1; then + patch_apply mmsystem.dll16-Fix_Argument_Order/0001-mmsystem.dll16-Fix-argument-order-in-GlobalAlloc16-c.patch + ( + echo '+ { "Sebastian Lackner", "mmsystem.dll16: Fix argument order in GlobalAlloc16 call.", 1 },'; + ) >> "$patchlist" +fi + # Patchset mountmgr-DosDevices # | # | This patchset fixes the following Wine bugs: @@ -4191,21 +4398,6 @@ ) >> "$patchlist" fi -# Patchset mshtml-Wine_Gecko_2.44 -# | -# | Modified files: -# | * dlls/appwiz.cpl/addons.c, dlls/mshtml/mshtml_private.h, dlls/mshtml/mutation.c, dlls/mshtml/nsembed.c, -# | dlls/mshtml/nsiface.idl, dlls/mshtml/nsio.c -# | -if test "$enable_mshtml_Wine_Gecko_2_44" -eq 1; then - patch_apply mshtml-Wine_Gecko_2.44/0001-mshtml-Wine-Gecko-2.44-release.patch - patch_apply mshtml-Wine_Gecko_2.44/0002-mshtml-Fix-some-prototypes.patch - ( - echo '+ { "Jacek Caban", "mshtml: Wine Gecko 2.44 release.", 1 },'; - echo '+ { "Sebastian Lackner", "mshtml: Fix some prototypes.", 1 },'; - ) >> "$patchlist" -fi - # Patchset msidb-Implementation # | # | Modified files: @@ -4301,6 +4493,18 @@ ) >> "$patchlist" fi +# Patchset msvideo-MCIWNDM_SETTIMEFORMATA +# | +# | Modified files: +# | * dlls/msvideo.dll16/msvideo16.c +# | +if test "$enable_msvideo_MCIWNDM_SETTIMEFORMATA" -eq 1; then + patch_apply msvideo-MCIWNDM_SETTIMEFORMATA/0001-msvideo.dll-Translate-16-bit-address-in-MCIWNDM_SETT.patch + ( + echo '+ { "Michael Müller", "msvideo.dll16: Translate 16 bit address in MCIWNDM_SETTIMEFORMATA command.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-APC_Performance # | # | Modified files: @@ -4718,18 +4922,6 @@ ) >> "$patchlist" fi -# Patchset ntdll-NtQuerySystemInformationEx -# | -# | Modified files: -# | * dlls/ntdll/nt.c -# | -if test "$enable_ntdll_NtQuerySystemInformationEx" -eq 1; then - patch_apply ntdll-NtQuerySystemInformationEx/0001-ntdll-Return-STATUS_SUCCESS-from-NtQuerySystemInform.patch - ( - echo '+ { "Sebastian Lackner", "ntdll: Return STATUS_SUCCESS from NtQuerySystemInformationEx.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-NtSetLdtEntries # | # | This patchset fixes the following Wine bugs: @@ -5201,6 +5393,45 @@ ) >> "$patchlist" fi +# Patchset ole32-HGLOBALStream +# | +# | Modified files: +# | * dlls/ole32/hglobalstream.c, dlls/ole32/tests/hglobalstream.c +# | +if test "$enable_ole32_HGLOBALStream" -eq 1; then + patch_apply ole32-HGLOBALStream/0001-ole32-tests-Add-a-bunch-of-tests-for-HGLOBAL-based-I.patch + patch_apply ole32-HGLOBALStream/0002-ole32-Add-a-check-for-hglobal-pointer-to-GetHGlobalF.patch + patch_apply ole32-HGLOBALStream/0003-ole32-Add-a-wrapper-for-memory-block-managed-by-HGLO.patch + patch_apply ole32-HGLOBALStream/0004-ole32-Set-DebugInfo-Spare-0-for-handle_wrapper-lock.patch + patch_apply ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch + patch_apply ole32-HGLOBALStream/0006-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Rea.patch + patch_apply ole32-HGLOBALStream/0007-ole32-Improve-thread-safety-of-HGLOBALStreamImpl_Wri.patch + ( + echo '+ { "Dmitry Timoshkov", "ole32/tests: Add a bunch of tests for HGLOBAL based IStream::Clone.", 1 },'; + echo '+ { "Dmitry Timoshkov", "ole32: Add a check for hglobal pointer to GetHGlobalFromStream.", 1 },'; + echo '+ { "Dmitry Timoshkov", "ole32: Add a wrapper for memory block managed by HGLOBAL based IStream.", 1 },'; + echo '+ { "Sebastian Lackner", "ole32: Set DebugInfo->Spare[0] for handle_wrapper lock.", 1 },'; + echo '+ { "Dmitry Timoshkov", "ole32: Allow moving a being reallocated block of memory managed by HGLOBAL based IStream.", 1 },'; + echo '+ { "Sebastian Lackner", "ole32: Improve thread-safety of HGLOBALStreamImpl_Read.", 1 },'; + echo '+ { "Sebastian Lackner", "ole32: Improve thread-safety of HGLOBALStreamImpl_Write.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset oleaut32-CreateTypeLib +# | +# | This patchset fixes the following Wine bugs: +# | * [#8780] Forward CreateTypeLib to CreateTypeLib2 +# | +# | Modified files: +# | * dlls/oleaut32/typelib.c +# | +if test "$enable_oleaut32_CreateTypeLib" -eq 1; then + patch_apply oleaut32-CreateTypeLib/0001-oleaut32-Implement-semi-stub-for-CreateTypeLib.patch + ( + echo '+ { "Alistair Leslie-Hughes", "oleaut32: Implement semi-stub for CreateTypeLib.", 1 },'; + ) >> "$patchlist" +fi + # Patchset oleaut32-TKIND_COCLASS # | # | This patchset fixes the following Wine bugs: @@ -5241,24 +5472,6 @@ ) >> "$patchlist" fi -# Patchset olepro32-Typelib -# | -# | This patchset fixes the following Wine bugs: -# | * [#14617] Add Standard OLE Types typelib to olepro32.dll -# | -# | Modified files: -# | * dlls/olepro32/Makefile.in, dlls/olepro32/olepro.idl, dlls/stdole32.tlb/std_ole_v1.idl, include/Makefile.in, -# | include/stdole32.idl -# | -if test "$enable_olepro32_Typelib" -eq 1; then - patch_apply olepro32-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch - patch_apply olepro32-Typelib/0002-olepro32-Add-typelib-resource.patch - ( - echo '+ { "Dmitry Timoshkov", "include: Make stdole32.idl a public component.", 1 },'; - echo '+ { "Dmitry Timoshkov", "olepro32: Add typelib resource.", 1 },'; - ) >> "$patchlist" -fi - # Patchset openal32-EFX_Extension # | # | This patchset fixes the following Wine bugs: @@ -5286,6 +5499,20 @@ ) >> "$patchlist" fi +# Patchset quartz-AsyncReader +# | +# | Modified files: +# | * dlls/quartz/filesource.c, dlls/quartz/regsvr.c +# | +if test "$enable_quartz_AsyncReader" -eq 1; then + patch_apply quartz-AsyncReader/0001-quartz-AsyncReader-should-return-NULL-as-media-subty.patch + patch_apply quartz-AsyncReader/0002-quartz-Recognize-mpeg2-program-streams.patch + ( + echo '+ { "Michael Müller", "quartz: AsyncReader should return NULL as media subtype for unknown formats instead of failing.", 1 },'; + echo '+ { "Michael Müller", "quartz: Recognize mpeg2 program streams.", 1 },'; + ) >> "$patchlist" +fi + # Patchset quartz-MediaSeeking_Positions # | # | Modified files: @@ -5393,20 +5620,6 @@ ) >> "$patchlist" fi -# Patchset server-Coverity -# | -# | Modified files: -# | * server/directory.c, server/registry.c -# | -if test "$enable_server_Coverity" -eq 1; then - patch_apply server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch - patch_apply server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch - ( - echo '+ { "Sebastian Lackner", "server: Add missing check for objattr variable in load_registry wineserver call (Coverity).", 1 },'; - echo '+ { "Sebastian Lackner", "server: Avoid invalid memory access if creation of namespace fails in create_directory (Coverity).", 1 },'; - ) >> "$patchlist" -fi - # Patchset server-FileEndOfFileInformation # | # | Modified files: @@ -5421,6 +5634,18 @@ ) >> "$patchlist" fi +# Patchset server-Fix_Leak +# | +# | Modified files: +# | * server/object.c +# | +if test "$enable_server_Fix_Leak" -eq 1; then + patch_apply server-Fix_Leak/0001-server-Fix-newly-introduced-memory-leak-of-object-na.patch + ( + echo '+ { "Sebastian Lackner", "server: Fix newly introduced memory leak of object name structure.", 1 },'; + ) >> "$patchlist" +fi + # Patchset server-Stored_ACLs # | # | This patchset has the following (direct or indirect) dependencies: @@ -5535,13 +5760,11 @@ # | * rpcrt4-Pipe_Transport, server-Desktop_Refcount, kernel32-Named_Pipe # | # | Modified files: -# | * server/named_pipe.c, server/object.c +# | * dlls/ntdll/tests/om.c, server/named_pipe.c, server/object.c # | if test "$enable_server_Pipe_ObjectName" -eq 1; then - patch_apply server-Pipe_ObjectName/0001-server-Link-named-pipes-to-their-device.patch - patch_apply server-Pipe_ObjectName/0002-server-Store-a-reference-to-the-parent-object-for-pi.patch + patch_apply server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch ( - echo '+ { "Sebastian Lackner", "server: Link named pipes to their device.", 1 },'; echo '+ { "Sebastian Lackner", "server: Store a reference to the parent object for pipe servers.", 2 },'; ) >> "$patchlist" fi @@ -6026,6 +6249,118 @@ ) >> "$patchlist" fi +# Patchset stdole32.idl-Typelib +# | +# | Modified files: +# | * dlls/stdole32.tlb/std_ole_v1.idl, include/Makefile.in, include/stdole32.idl +# | +if test "$enable_stdole32_idl_Typelib" -eq 1; then + patch_apply stdole32.idl-Typelib/0001-include-Make-stdole32.idl-a-public-component.patch + ( + echo '+ { "Dmitry Timoshkov", "include: Make stdole32.idl a public component.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset widl-SLTG_Typelib_Support +# | +# | Modified files: +# | * dlls/oleaut32/typelib.c, dlls/oleaut32/typelib.h, tools/widl/Makefile.in, tools/widl/typelib.c, tools/widl/typelib.h, +# | tools/widl/widl.c, tools/widl/widl.h, tools/widl/write_sltg.c +# | +if test "$enable_widl_SLTG_Typelib_Support" -eq 1; then + patch_apply widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch + patch_apply widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch + patch_apply widl-SLTG_Typelib_Support/0003-widl-Properly-align-name-table-entries.patch + patch_apply widl-SLTG_Typelib_Support/0004-widl-More-accurately-report-variable-descriptions-da.patch + patch_apply widl-SLTG_Typelib_Support/0005-widl-Calculate-size-of-instance-for-structures.patch + patch_apply widl-SLTG_Typelib_Support/0006-widl-Write-correct-typekind-to-the-SLTG-typeinfo-blo.patch + patch_apply widl-SLTG_Typelib_Support/0007-widl-Write-SLTG-blocks-according-to-the-index-order.patch + patch_apply widl-SLTG_Typelib_Support/0008-widl-Write-correct-syskind-by-SLTG-typelib-generator.patch + patch_apply widl-SLTG_Typelib_Support/0009-widl-Add-support-for-VT_VOID-and-VT_VARIANT-to-SLTG-.patch + patch_apply widl-SLTG_Typelib_Support/0010-widl-Add-support-for-VT_USERDEFINED-to-SLTG-typelib-.patch + patch_apply widl-SLTG_Typelib_Support/0011-widl-Factor-out-SLTG-tail-initialization.patch + patch_apply widl-SLTG_Typelib_Support/0012-widl-Add-support-for-recursive-type-references-to-SL.patch + patch_apply widl-SLTG_Typelib_Support/0013-widl-Add-support-for-interfaces-to-SLTG-typelib-gene.patch + patch_apply widl-SLTG_Typelib_Support/0014-widl-Add-support-for-inherited-interfaces-to-SLTG-ty.patch + patch_apply widl-SLTG_Typelib_Support/0015-widl-Make-automatic-dispid-generation-scheme-better-.patch + patch_apply widl-SLTG_Typelib_Support/0016-widl-Create-library-block-index-right-after-the-Comp.patch + patch_apply widl-SLTG_Typelib_Support/0017-widl-Fix-generation-of-resources-containing-an-old-t.patch + patch_apply widl-SLTG_Typelib_Support/0018-widl-Add-oldtlb-switch-in-usage-message.patch + patch_apply widl-SLTG_Typelib_Support/0019-widl-Avoid-relying-on-side-effects-when-marking-func.patch + patch_apply widl-SLTG_Typelib_Support/0020-widl-Set-the-lowest-bit-in-the-param-name-to-indicat.patch + patch_apply widl-SLTG_Typelib_Support/0021-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch + patch_apply widl-SLTG_Typelib_Support/0022-widl-Add-support-for-function-parameter-flags-to-SLT.patch + patch_apply widl-SLTG_Typelib_Support/0023-oleaut32-Implement-decoding-of-SLTG-help-strings.patch + patch_apply widl-SLTG_Typelib_Support/0024-oleaut32-Add-support-for-decoding-SLTG-function-help.patch + patch_apply widl-SLTG_Typelib_Support/0025-oleaut32-Add-support-for-decoding-SLTG-variable-help.patch + patch_apply widl-SLTG_Typelib_Support/0026-widl-Minor-cosmetic-clean-up.patch + ( + echo '+ { "Dmitry Timoshkov", "widl: Add initial implementation of SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for structures.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Properly align name table entries.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: More accurately report variable descriptions data size.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Calculate size of instance for structures.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Write correct typekind to the SLTG typeinfo block.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Write SLTG blocks according to the index order.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Write correct syskind by SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for VT_VOID and VT_VARIANT to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for VT_USERDEFINED to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Factor out SLTG tail initialization.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for recursive type references to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for interfaces to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for inherited interfaces to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Make automatic dispid generation scheme better match what midl does.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Create library block index right after the CompObj one.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Fix generation of resources containing an old typelib.", 1 },'; + echo '+ { "Sebastian Lackner", "widl: Add --oldtlb switch in usage message.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Avoid relying on side effects when marking function index as the last one.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Set the lowest bit in the param name to indicate whether type description follows the name.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Fix logic for deciding whether type description follows the name.", 2 },'; + echo '+ { "Dmitry Timoshkov", "widl: Add support for function parameter flags to SLTG typelib generator.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Implement decoding of SLTG help strings.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Add support for decoding SLTG function help strings.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Add support for decoding SLTG variable help strings.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Minor/cosmetic clean up.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset stdole32.tlb-SLTG_Typelib +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * widl-SLTG_Typelib_Support +# | +# | This patchset fixes the following Wine bugs: +# | * [#3689] Compile stdole32.tlb in SLTG typelib format +# | +# | Modified files: +# | * dlls/stdole32.tlb/Makefile.in +# | +if test "$enable_stdole32_tlb_SLTG_Typelib" -eq 1; then + patch_apply stdole32.tlb-SLTG_Typelib/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch + ( + echo '+ { "Sebastian Lackner", "stdole32.tlb: Compile typelib with --oldtlb.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset taskmgr-Memory_Usage +# | +# | Modified files: +# | * configure.ac, dlls/ntdll/nt.c, dlls/ntdll/virtual.c, programs/taskmgr/font.bmp, programs/taskmgr/graph.c, +# | programs/taskmgr/resource.h, programs/taskmgr/taskmgr.c, programs/taskmgr/taskmgr.rc +# | +if test "$enable_taskmgr_Memory_Usage" -eq 1; then + patch_apply taskmgr-Memory_Usage/0001-ntdll-Use-sysinfo-to-report-correct-number-of-physic.patch + patch_apply taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch + patch_apply taskmgr-Memory_Usage/0003-taskmgr-Use-system-font-instead-of-special-bitmap-fo.patch + patch_apply taskmgr-Memory_Usage/0004-taskmgr-Use-different-units-depending-on-memory-usag.patch + ( + echo '+ { "Michael Müller", "ntdll: Use sysinfo to report correct number of physical pages.", 1 },'; + echo '+ { "Michael Müller", "ntdll: Report system information SystemPerformanceInformation info class.", 1 },'; + echo '+ { "Michael Müller", "taskmgr: Use system font instead of special bitmap font.", 1 },'; + echo '+ { "Michael Müller", "taskmgr: Use different units depending on memory usage.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ucrtbase-Functions # | # | Modified files: @@ -6128,21 +6463,6 @@ ) >> "$patchlist" fi -# Patchset user32-MOUSEHOOKSTRUCTEX -# | -# | This patchset fixes the following Wine bugs: -# | * [#38314] Pass MOUSEHOOKSTRUCTEX struct to mouse hook callback -# | -# | Modified files: -# | * dlls/user32/message.c -# | -if test "$enable_user32_MOUSEHOOKSTRUCTEX" -eq 1; then - patch_apply user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch - ( - echo '+ { "Kira Backes", "user32: Add MOUSEHOOKSTRUCTEX to fix mouse wheel support for JA2 1.13 and other apps which use it.", 1 },'; - ) >> "$patchlist" -fi - # Patchset user32-Mouse_Message_Hwnd # | # | This patchset fixes the following Wine bugs: @@ -6189,18 +6509,6 @@ ) >> "$patchlist" fi -# Patchset user32-SetCaretPos -# | -# | Modified files: -# | * dlls/user32/caret.c, server/protocol.def, server/queue.c -# | -if test "$enable_user32_SetCaretPos" -eq 1; then - patch_apply user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch - ( - echo '+ { "Anton Baskanov", "user32: Set correct caret state in the server in SetCaretPos.", 5 },'; - ) >> "$patchlist" -fi - # Patchset user32-SetCoalescableTimer # | # | This patchset fixes the following Wine bugs: @@ -6216,21 +6524,6 @@ ) >> "$patchlist" fi -# Patchset user32-WM_CAPTURECHANGE -# | -# | This patchset fixes the following Wine bugs: -# | * [#13683] Also send WM_CAPTURECHANGE when capture has not changed -# | -# | Modified files: -# | * dlls/comctl32/toolbar.c, dlls/comctl32/trackbar.c, dlls/user32/button.c, dlls/user32/input.c, dlls/user32/tests/msg.c -# | -if test "$enable_user32_WM_CAPTURECHANGE" -eq 1; then - patch_apply user32-WM_CAPTURECHANGE/0001-user32-Also-send-WM_CAPTURECHANGE-when-capture-has-n.patch - ( - echo '+ { "Christopher Thielen", "user32: Also send WM_CAPTURECHANGE when capture has not changed.", 1 },'; - ) >> "$patchlist" -fi - # Patchset user32-WM_MDICALCCHILDSCROLL # | # | Modified files: @@ -6258,6 +6551,21 @@ ) >> "$patchlist" fi +# Patchset uxtheme-CloseThemeData +# | +# | This patchset fixes the following Wine bugs: +# | * [#29862] Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData +# | +# | Modified files: +# | * dlls/uxtheme/system.c, dlls/uxtheme/tests/system.c +# | +if test "$enable_uxtheme_CloseThemeData" -eq 1; then + patch_apply uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch + ( + echo '+ { "Louis Lenders", "uxtheme: Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData.", 1 },'; + ) >> "$patchlist" +fi + # Patchset uxtheme-GTK_Theming # | # | This patchset has the following (direct or indirect) dependencies: @@ -6277,6 +6585,9 @@ patch_apply uxtheme-GTK_Theming/0004-uxthemegtk-Correctly-render-buttons-with-GTK-3.14.0.patch patch_apply uxtheme-GTK_Theming/0005-uxthemegtk-Print-class-name-before-calling-vtable-fu.patch patch_apply uxtheme-GTK_Theming/0006-uxthemegtk-Reset-FPU-flags-before-calling-GTK3-funct.patch + patch_apply uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch + patch_apply uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch + patch_apply uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch ( echo '+ { "Michael Müller", "uxthemegtk: Add configure check and stub dll.", 1 },'; echo '+ { "Ivan Akulinchev", "uxthemegtk: Initial implementation.", 1 },'; @@ -6284,6 +6595,9 @@ echo '+ { "Sebastian Lackner", "uxthemegtk: Correctly render buttons with GTK >= 3.14.0.", 1 },'; echo '+ { "Michael Müller", "uxthemegtk: Print class name before calling vtable functions.", 1 },'; echo '+ { "Michael Müller", "uxthemegtk: Reset FPU flags before calling GTK3 functions.", 1 },'; + echo '+ { "Sebastian Lackner", "uxthemegtk: Add export for OpenThemeDataEx.", 1 },'; + echo '+ { "Sebastian Lackner", "uxthemegtk: Fix some incorrect error codes.", 1 },'; + echo '+ { "Sebastian Lackner", "uxthemegtk: Validate theme handles before accessing private data.", 1 },'; ) >> "$patchlist" fi @@ -6343,62 +6657,6 @@ ) >> "$patchlist" fi -# Patchset widl-SLTG_Typelib_Support -# | -# | This patchset fixes the following Wine bugs: -# | * [#3689] Compile stdole32.tlb in SLTG typelib format -# | -# | Modified files: -# | * dlls/oleaut32/typelib.c, dlls/stdole32.tlb/Makefile.in, tools/widl/Makefile.in, tools/widl/typelib.c, -# | tools/widl/typelib.h, tools/widl/widl.c, tools/widl/widl.h, tools/widl/write_sltg.c -# | -if test "$enable_widl_SLTG_Typelib_Support" -eq 1; then - patch_apply widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch - patch_apply widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch - patch_apply widl-SLTG_Typelib_Support/0003-widl-Properly-align-name-table-entries.patch - patch_apply widl-SLTG_Typelib_Support/0004-widl-More-accurately-report-variable-descriptions-da.patch - patch_apply widl-SLTG_Typelib_Support/0005-widl-Calculate-size-of-instance-for-structures.patch - patch_apply widl-SLTG_Typelib_Support/0006-widl-Write-correct-typekind-to-the-SLTG-typeinfo-blo.patch - patch_apply widl-SLTG_Typelib_Support/0007-widl-Write-SLTG-blocks-according-to-the-index-order.patch - patch_apply widl-SLTG_Typelib_Support/0008-widl-Write-correct-syskind-by-SLTG-typelib-generator.patch - patch_apply widl-SLTG_Typelib_Support/0009-widl-Add-support-for-VT_VOID-and-VT_VARIANT-to-SLTG-.patch - patch_apply widl-SLTG_Typelib_Support/0010-widl-Add-support-for-VT_USERDEFINED-to-SLTG-typelib-.patch - patch_apply widl-SLTG_Typelib_Support/0011-widl-Factor-out-SLTG-tail-initialization.patch - patch_apply widl-SLTG_Typelib_Support/0012-widl-Add-support-for-recursive-type-references-to-SL.patch - patch_apply widl-SLTG_Typelib_Support/0013-widl-Add-support-for-interfaces-to-SLTG-typelib-gene.patch - patch_apply widl-SLTG_Typelib_Support/0014-widl-Add-support-for-inherited-interfaces-to-SLTG-ty.patch - patch_apply widl-SLTG_Typelib_Support/0015-widl-Make-automatic-dispid-generation-scheme-better-.patch - patch_apply widl-SLTG_Typelib_Support/0016-widl-Create-library-block-index-right-after-the-Comp.patch - patch_apply widl-SLTG_Typelib_Support/0017-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch - patch_apply widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch - patch_apply widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch - patch_apply widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch - patch_apply widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch - ( - echo '+ { "Dmitry Timoshkov", "widl: Add initial implementation of SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for structures.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Properly align name table entries.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: More accurately report variable descriptions data size.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Calculate size of instance for structures.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Write correct typekind to the SLTG typeinfo block.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Write SLTG blocks according to the index order.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Write correct syskind by SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for VT_VOID and VT_VARIANT to SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for VT_USERDEFINED to SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Factor out SLTG tail initialization.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for recursive type references to SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for interfaces to SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Add support for inherited interfaces to SLTG typelib generator.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Make automatic dispid generation scheme better match what midl does.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Create library block index right after the CompObj one.", 1 },'; - echo '+ { "Dmitry Timoshkov", "oleaut32: Fix logic for deciding whether type description follows the name.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Fix generation of resources containing an old typelib.", 1 },'; - echo '+ { "Sebastian Lackner", "widl: Add --oldtlb switch in usage message.", 1 },'; - echo '+ { "Sebastian Lackner", "stdole32.tlb: Compile typelib with --oldtlb.", 1 },'; - echo '+ { "Dmitry Timoshkov", "widl: Avoid relying on side effects when marking function index as the last one.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wine.inf-Performance # | # | This patchset fixes the following Wine bugs: @@ -6513,18 +6771,15 @@ # Patchset wined3d-CSMT_Helper # | # | This patchset has the following (direct or indirect) dependencies: -# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn +# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d- +# | resource_map # | # | Modified files: -# | * configure.ac, dlls/d3d11/device.c, dlls/d3d11/texture.c, dlls/d3d8/surface.c, dlls/d3d8/volume.c, dlls/d3d9/surface.c, -# | dlls/d3d9/volume.c, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc, dlls/wined3d/resource.c, -# | dlls/wined3d/wined3d.spec, include/wine/wined3d.h +# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc # | if test "$enable_wined3d_CSMT_Helper" -eq 1; then - patch_apply wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch patch_apply wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch ( - echo '+ { "Sebastian Lackner", "wined3d: Rename wined3d_resource_(un)map to wined3d_resource_sub_resource_(un)map.", 1 },'; echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },'; ) >> "$patchlist" fi @@ -6544,21 +6799,6 @@ ) >> "$patchlist" fi -# Patchset wined3d-Invalid_Render_States -# | -# | This patchset fixes the following Wine bugs: -# | * [#33988] Ignore invalid render states in wined3d_device_set_render_state -# | -# | Modified files: -# | * dlls/wined3d/device.c -# | -if test "$enable_wined3d_Invalid_Render_States" -eq 1; then - patch_apply wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch - ( - echo '+ { "Józef Kucia", "wined3d: Ignore invalid render states.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-MESA_GPU_Info # | # | This patchset has the following (direct or indirect) dependencies: @@ -6574,21 +6814,6 @@ ) >> "$patchlist" fi -# Patchset wined3d-Multisampling -# | -# | This patchset fixes the following Wine bugs: -# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. -# | -# | Modified files: -# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Multisampling" -eq 1; then - patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch - ( - echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-Revert_PixelFormat # | # | Modified files: @@ -6670,7 +6895,7 @@ # | # | This patchset has the following (direct or indirect) dependencies: # | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d- -# | CSMT_Helper +# | resource_map, wined3d-CSMT_Helper # | # | This patchset fixes the following Wine bugs: # | * [#11674] Support for CSMT (command stream) to increase graphic performance @@ -6773,87 +6998,86 @@ patch_apply wined3d-CSMT_Main/0086-wined3d-Put-this-into-the-query-poll-patch.patch patch_apply wined3d-CSMT_Main/0087-wined3d-Send-update_surface-commands-through-the-CS.patch patch_apply wined3d-CSMT_Main/0088-wined3d-Send-texture-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0089-wined3d-Send-surface-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0090-wined3d-Send-update_texture-calls-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0091-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch - patch_apply wined3d-CSMT_Main/0092-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch - patch_apply wined3d-CSMT_Main/0093-wined3d-Handle-evit_managed_resources-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0094-wined3d-Introduce-resource-fencing.patch - patch_apply wined3d-CSMT_Main/0095-wined3d-Fence-update_texture-and-update_surface-call.patch - patch_apply wined3d-CSMT_Main/0096-wined3d-Dirtify-resources-on-unmap.patch - patch_apply wined3d-CSMT_Main/0097-wined3d-Fence-texture-reads-in-draws.patch - patch_apply wined3d-CSMT_Main/0098-wined3d-Fence-render-targets-and-depth-stencils.patch - patch_apply wined3d-CSMT_Main/0099-wined3d-Fence-blit-operations.patch - patch_apply wined3d-CSMT_Main/0100-wined3d-Fence-color_fill-operations.patch - patch_apply wined3d-CSMT_Main/0101-wined3d-Fence-clear-calls.patch - patch_apply wined3d-CSMT_Main/0102-wined3d-Fence-present-calls.patch - patch_apply wined3d-CSMT_Main/0103-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch - patch_apply wined3d-CSMT_Main/0104-wined3d-Dirtify-changed-textures-through-the-command.patch - patch_apply wined3d-CSMT_Main/0105-wined3d-Wrap-GL-BOs-in-a-structure.patch - patch_apply wined3d-CSMT_Main/0106-wined3d-Separate-resource-map-and-draw-buffers.patch - patch_apply wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch - patch_apply wined3d-CSMT_Main/0108-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch - patch_apply wined3d-CSMT_Main/0109-wined3d-Unset-some-objects-in-state_init_default.patch - patch_apply wined3d-CSMT_Main/0110-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch - patch_apply wined3d-CSMT_Main/0111-wined3d-Use-double-buffered-buffers-for-multithreade.patch - patch_apply wined3d-CSMT_Main/0112-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0113-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch - patch_apply wined3d-CSMT_Main/0114-wined3d-Accelerate-DISCARD-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0115-wined3d-Accelerate-READONLY-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0116-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0117-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0118-wined3d-Send-buffer-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0119-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch - patch_apply wined3d-CSMT_Main/0120-wined3d-Separate-GL-buffer-discard-control-from-igno.patch - patch_apply wined3d-CSMT_Main/0121-wined3d-Create-buffers-before-mapping-them.patch - patch_apply wined3d-CSMT_Main/0122-wined3d-Destroy-views-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0123-wined3d-Remove-another-glFinish.patch - patch_apply wined3d-CSMT_Main/0124-wined3d-Destroy-vertex-declarations-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0125-wined3d-Destroy-shaders-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0126-wined3d-Create-VBOs-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0127-wined3d-Clean-up-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0128-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0129-wined3d-Clean-up-volume-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0130-wined3d-Clean-up-surfaces-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0131-wined3d-Clean-up-texture-resources-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch - patch_apply wined3d-CSMT_Main/0133-wined3d-Unload-resources-through-the-CS-in-device_re.patch - patch_apply wined3d-CSMT_Main/0134-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch - patch_apply wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch - patch_apply wined3d-CSMT_Main/0136-wined3d-Create-dummy-textures-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0137-wined3d-Create-the-initial-context-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0138-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch - patch_apply wined3d-CSMT_Main/0139-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch - patch_apply wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch - patch_apply wined3d-CSMT_Main/0141-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch - patch_apply wined3d-CSMT_Main/0142-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch - patch_apply wined3d-CSMT_Main/0143-wined3d-Use-an-event-to-block-the-worker-thread-when.patch - patch_apply wined3d-CSMT_Main/0144-wined3d-Fence-preload-operations.patch - patch_apply wined3d-CSMT_Main/0145-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0146-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0147-wined3d-Completely-reset-the-state-on-reset.patch - patch_apply wined3d-CSMT_Main/0148-wined3d-Send-getdc-and-releasedc-through-the-command.patch - patch_apply wined3d-CSMT_Main/0149-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch - patch_apply wined3d-CSMT_Main/0150-wined3d-Wait-only-for-the-buffer-to-be-idle.patch - patch_apply wined3d-CSMT_Main/0151-wined3d-Add-a-comment-about-worker-thread-lag.patch - patch_apply wined3d-CSMT_Main/0152-wined3d-Remove-the-texture-destroy-glFinish.patch - patch_apply wined3d-CSMT_Main/0153-wined3d-Move-FBO-destruction-into-the-worker-thread.patch - patch_apply wined3d-CSMT_Main/0154-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch - patch_apply wined3d-CSMT_Main/0155-Winex11-complain-about-glfinish.patch - patch_apply wined3d-CSMT_Main/0156-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch - patch_apply wined3d-CSMT_Main/0157-wined3d-Remove-the-device_reset-CS-sync-fixme.patch - patch_apply wined3d-CSMT_Main/0158-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch - patch_apply wined3d-CSMT_Main/0159-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch - patch_apply wined3d-CSMT_Main/0160-wined3d-Don-t-sync-on-redundant-discard-calls.patch - patch_apply wined3d-CSMT_Main/0161-wined3d-Don-t-discard-new-buffers.patch - patch_apply wined3d-CSMT_Main/0162-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch - patch_apply wined3d-CSMT_Main/0163-wined3d-Render-target-lock-hack.patch - patch_apply wined3d-CSMT_Main/0164-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch - patch_apply wined3d-CSMT_Main/0165-wined3d-Only-discard-buffers-that-are-in-use.patch - patch_apply wined3d-CSMT_Main/0166-wined3d-Destroy-samplers-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0167-wined3d-Hack-to-reject-unsupported-color-fills.patch - patch_apply wined3d-CSMT_Main/0168-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch - patch_apply wined3d-CSMT_Main/0169-wined3d-Send-update_sub_resource-calls-through-the-c.patch + patch_apply wined3d-CSMT_Main/0089-wined3d-Send-update_texture-calls-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0090-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch + patch_apply wined3d-CSMT_Main/0091-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch + patch_apply wined3d-CSMT_Main/0092-wined3d-Handle-evit_managed_resources-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0093-wined3d-Introduce-resource-fencing.patch + patch_apply wined3d-CSMT_Main/0094-wined3d-Fence-update_texture-and-update_surface-call.patch + patch_apply wined3d-CSMT_Main/0095-wined3d-Dirtify-resources-on-unmap.patch + patch_apply wined3d-CSMT_Main/0096-wined3d-Fence-texture-reads-in-draws.patch + patch_apply wined3d-CSMT_Main/0097-wined3d-Fence-render-targets-and-depth-stencils.patch + patch_apply wined3d-CSMT_Main/0098-wined3d-Fence-blit-operations.patch + patch_apply wined3d-CSMT_Main/0099-wined3d-Fence-color_fill-operations.patch + patch_apply wined3d-CSMT_Main/0100-wined3d-Fence-clear-calls.patch + patch_apply wined3d-CSMT_Main/0101-wined3d-Fence-present-calls.patch + patch_apply wined3d-CSMT_Main/0102-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch + patch_apply wined3d-CSMT_Main/0103-wined3d-Dirtify-changed-textures-through-the-command.patch + patch_apply wined3d-CSMT_Main/0104-wined3d-Wrap-GL-BOs-in-a-structure.patch + patch_apply wined3d-CSMT_Main/0105-wined3d-Separate-resource-map-and-draw-buffers.patch + patch_apply wined3d-CSMT_Main/0106-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch + patch_apply wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch + patch_apply wined3d-CSMT_Main/0108-wined3d-Unset-some-objects-in-state_init_default.patch + patch_apply wined3d-CSMT_Main/0109-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch + patch_apply wined3d-CSMT_Main/0110-wined3d-Use-double-buffered-buffers-for-multithreade.patch + patch_apply wined3d-CSMT_Main/0111-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0112-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch + patch_apply wined3d-CSMT_Main/0113-wined3d-Accelerate-DISCARD-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0114-wined3d-Accelerate-READONLY-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0115-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0116-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0117-wined3d-Send-buffer-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0118-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch + patch_apply wined3d-CSMT_Main/0119-wined3d-Separate-GL-buffer-discard-control-from-igno.patch + patch_apply wined3d-CSMT_Main/0120-wined3d-Create-buffers-before-mapping-them.patch + patch_apply wined3d-CSMT_Main/0121-wined3d-Destroy-views-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0122-wined3d-Remove-another-glFinish.patch + patch_apply wined3d-CSMT_Main/0123-wined3d-Destroy-vertex-declarations-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0124-wined3d-Destroy-shaders-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0125-wined3d-Create-VBOs-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0126-wined3d-Clean-up-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0127-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0128-wined3d-Clean-up-volume-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0129-wined3d-Clean-up-surfaces-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0130-wined3d-Clean-up-texture-resources-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0131-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch + patch_apply wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-device_re.patch + patch_apply wined3d-CSMT_Main/0133-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch + patch_apply wined3d-CSMT_Main/0134-wined3d-Remove-software-cursor-support.patch + patch_apply wined3d-CSMT_Main/0135-wined3d-Create-dummy-textures-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0136-wined3d-Create-the-initial-context-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0137-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch + patch_apply wined3d-CSMT_Main/0138-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch + patch_apply wined3d-CSMT_Main/0139-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch + patch_apply wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch + patch_apply wined3d-CSMT_Main/0141-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch + patch_apply wined3d-CSMT_Main/0142-wined3d-Use-an-event-to-block-the-worker-thread-when.patch + patch_apply wined3d-CSMT_Main/0143-wined3d-Fence-preload-operations.patch + patch_apply wined3d-CSMT_Main/0144-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0145-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0146-wined3d-Completely-reset-the-state-on-reset.patch + patch_apply wined3d-CSMT_Main/0147-wined3d-Send-getdc-and-releasedc-through-the-command.patch + patch_apply wined3d-CSMT_Main/0148-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch + patch_apply wined3d-CSMT_Main/0149-wined3d-Wait-only-for-the-buffer-to-be-idle.patch + patch_apply wined3d-CSMT_Main/0150-wined3d-Add-a-comment-about-worker-thread-lag.patch + patch_apply wined3d-CSMT_Main/0151-wined3d-Remove-the-texture-destroy-glFinish.patch + patch_apply wined3d-CSMT_Main/0152-wined3d-Move-FBO-destruction-into-the-worker-thread.patch + patch_apply wined3d-CSMT_Main/0153-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch + patch_apply wined3d-CSMT_Main/0154-Winex11-complain-about-glfinish.patch + patch_apply wined3d-CSMT_Main/0155-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch + patch_apply wined3d-CSMT_Main/0156-wined3d-Remove-the-device_reset-CS-sync-fixme.patch + patch_apply wined3d-CSMT_Main/0157-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch + patch_apply wined3d-CSMT_Main/0158-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch + patch_apply wined3d-CSMT_Main/0159-wined3d-Don-t-sync-on-redundant-discard-calls.patch + patch_apply wined3d-CSMT_Main/0160-wined3d-Don-t-discard-new-buffers.patch + patch_apply wined3d-CSMT_Main/0161-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch + patch_apply wined3d-CSMT_Main/0162-wined3d-Render-target-lock-hack.patch + patch_apply wined3d-CSMT_Main/0163-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch + patch_apply wined3d-CSMT_Main/0164-wined3d-Only-discard-buffers-that-are-in-use.patch + patch_apply wined3d-CSMT_Main/0165-wined3d-Destroy-samplers-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0166-wined3d-Hack-to-reject-unsupported-color-fills.patch + patch_apply wined3d-CSMT_Main/0167-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch + patch_apply wined3d-CSMT_Main/0168-wined3d-Send-update_sub_resource-calls-through-the-c.patch patch_apply wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch patch_apply wined3d-CSMT_Main/9999-IfDefined.patch ( @@ -6945,7 +7169,6 @@ echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Send update_surface commands through the CS.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Send texture preloads through the CS.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Send surface preloads through the CS.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Get rid of the surface_upload_data glFinish.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t lock the src volume in device_update_volume.", 1 },'; @@ -7430,6 +7653,21 @@ ) >> "$patchlist" fi +# Patchset ws2_32-getsockopt +# | +# | This patchset fixes the following Wine bugs: +# | * [#8606] Divide values returned by SO_RCVBUF and SO_SNDBUF getsockopt options by two +# | +# | Modified files: +# | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c +# | +if test "$enable_ws2_32_getsockopt" -eq 1; then + patch_apply ws2_32-getsockopt/0001-ws2_32-Divide-values-returned-by-SO_RCVBUF-and-SO_SN.patch + ( + echo '+ { "Sebastian Lackner", "ws2_32: Divide values returned by SO_RCVBUF and SO_SNDBUF getsockopt options by two.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wtsapi32-EnumerateProcesses # | # | This patchset fixes the following Wine bugs: diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch wine-staging-1.9.3~ubuntu12.04.1/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 8794d625750d35293adecbedc32cc02257817b05 Mon Sep 17 00:00:00 2001 +From 8e79e9494a7d4c9173066772b09afa26e643ef33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 20 Jul 2014 22:22:14 +0200 Subject: wined3d: allow changing strict drawing through an exported function @@ -9,23 +9,23 @@ 2 files changed, 7 insertions(+) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 7a77003..5519a48 100644 +index 49041bb..8c253cd 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec -@@ -219,6 +219,8 @@ +@@ -222,6 +222,8 @@ @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) +@ cdecl wined3d_strictdrawing_set(long) + - @ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long) - @ cdecl wined3d_surface_decref(ptr) - @ cdecl wined3d_surface_from_resource(ptr) + @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) + @ cdecl wined3d_surface_get_parent(ptr) + @ cdecl wined3d_surface_get_pitch(ptr) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 758ba43..7ccd3a1 100644 +index 0543d97..78cc3a2 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -505,6 +505,11 @@ void wined3d_unregister_window(HWND window) +@@ -515,6 +515,11 @@ void wined3d_unregister_window(HWND window) wined3d_wndproc_mutex_unlock(); } @@ -38,5 +38,5 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { -- -2.1.3 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/0001-quartz-AsyncReader-should-return-NULL-as-media-subty.patch wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/0001-quartz-AsyncReader-should-return-NULL-as-media-subty.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/0001-quartz-AsyncReader-should-return-NULL-as-media-subty.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/0001-quartz-AsyncReader-should-return-NULL-as-media-subty.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,29 @@ +From db3178f4292558456596cc31766480638d8a0f3a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 7 Feb 2016 01:30:22 +0100 +Subject: quartz: AsyncReader should return NULL as media subtype for unknown + formats instead of failing. + +--- + dlls/quartz/filesource.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c +index 33ac442..a62db2c 100644 +--- a/dlls/quartz/filesource.c ++++ b/dlls/quartz/filesource.c +@@ -652,8 +652,9 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi + hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype, NULL); + if (FAILED(hr)) + { +- CoTaskMemFree(This->pmt); +- This->pmt = NULL; ++ memcpy(&This->pmt->majortype, &MEDIATYPE_Stream, sizeof(GUID)); ++ memcpy(&This->pmt->subtype, &MEDIASUBTYPE_NULL, sizeof(GUID)); ++ hr = S_OK; + } + } + else +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/0002-quartz-Recognize-mpeg2-program-streams.patch wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/0002-quartz-Recognize-mpeg2-program-streams.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/0002-quartz-Recognize-mpeg2-program-streams.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/0002-quartz-Recognize-mpeg2-program-streams.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,28 @@ +From 6db27add885e521e7b42829ade2f7de74abdd619 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 7 Feb 2016 01:32:04 +0100 +Subject: quartz: Recognize mpeg2 program streams. + +--- + dlls/quartz/regsvr.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c +index b0f1e9a..196e064 100644 +--- a/dlls/quartz/regsvr.c ++++ b/dlls/quartz/regsvr.c +@@ -818,6 +818,11 @@ static struct regsvr_mediatype_parsing const mediatype_parsing_list[] = { + "0, 10, FFFFFF00000080808080, 494433000000000000", + NULL } + }, ++ { &MEDIATYPE_Stream, ++ &MEDIASUBTYPE_MPEG2_PROGRAM, ++ { "0, 5, FFFFFFFFC0, 000001BA40", ++ NULL } ++ }, + { &MEDIATYPE_Stream, + &MEDIASUBTYPE_QTMovie, + { "4, 4, , 6d646174", +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/definition wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/quartz-AsyncReader/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/quartz-AsyncReader/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Improve detection of MPEG2 streams diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From b2fec3a86116deb45df5c8f3f6ac07434d3d34a7 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 23 Jan 2016 20:23:04 +0100 -Subject: server: Add missing check for objattr variable in load_registry - wineserver call (Coverity). - ---- - server/registry.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/server/registry.c b/server/registry.c -index 5723824..a35765c 100644 ---- a/server/registry.c -+++ b/server/registry.c -@@ -2187,6 +2187,8 @@ DECL_HANDLER(load_registry) - const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); - -+ if (!objattr) return; -+ - if (!thread_single_check_privilege( current, &SeRestorePrivilege )) - { - set_error( STATUS_PRIVILEGE_NOT_HELD ); --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 4e690407c338be1553e6c2c18977364152477339 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 23 Jan 2016 20:23:48 +0100 -Subject: server: Avoid invalid memory access if creation of namespace fails in - create_directory (Coverity). - ---- - server/directory.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/server/directory.c b/server/directory.c -index de049ef..937ab89 100644 ---- a/server/directory.c -+++ b/server/directory.c -@@ -192,7 +192,7 @@ static struct directory *create_directory( struct directory *root, const struct - if (!(dir->entries = create_namespace( hash_size ))) - { - release_object( dir ); -- dir = NULL; -+ return NULL; - } - if (sd) default_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | - DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION ); --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From a04ff4bba9832fd787972911fb391558f129870c Mon Sep 17 00:00:00 2001 +From bb902548f15deec4dc9d9eaaf6e78b4cbdb01f87 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 4 Dec 2015 10:36:47 +0100 Subject: server: Introduce a new alloc_handle object callback. (v2) @@ -42,258 +42,258 @@ 34 files changed, 73 insertions(+), 3 deletions(-) diff --git a/server/async.c b/server/async.c -index d2da976..b00d2cc 100644 +index 64aa27a..bc74173 100644 --- a/server/async.c +++ b/server/async.c -@@ -66,6 +66,7 @@ static const struct object_ops async_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -68,6 +68,7 @@ static const struct object_ops async_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ async_destroy /* destroy */ }; -@@ -99,6 +100,7 @@ static const struct object_ops async_queue_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -103,6 +104,7 @@ static const struct object_ops async_queue_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ async_queue_destroy /* destroy */ }; diff --git a/server/atom.c b/server/atom.c -index 0ed4ed5..1f694bc 100644 +index 3ff7540..7bebf13 100644 --- a/server/atom.c +++ b/server/atom.c -@@ -88,6 +88,7 @@ static const struct object_ops atom_table_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -90,6 +90,7 @@ static const struct object_ops atom_table_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ atom_table_destroy /* destroy */ }; diff --git a/server/change.c b/server/change.c -index 59d1819..4f36179 100644 +index 36a1997..6da2f63 100644 --- a/server/change.c +++ b/server/change.c -@@ -167,6 +167,7 @@ static const struct object_ops dir_ops = - dir_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -169,6 +169,7 @@ static const struct object_ops dir_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ dir_destroy /* destroy */ }; diff --git a/server/clipboard.c b/server/clipboard.c -index 2f56c72..1f988bc 100644 +index 7b92706..fa3aa51 100644 --- a/server/clipboard.c +++ b/server/clipboard.c -@@ -66,6 +66,7 @@ static const struct object_ops clipboard_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -68,6 +68,7 @@ static const struct object_ops clipboard_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/completion.c b/server/completion.c -index 77c72cc..97d2102 100644 +index 759c6e2..bca0963 100644 --- a/server/completion.c +++ b/server/completion.c -@@ -73,6 +73,7 @@ static const struct object_ops completion_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -75,6 +75,7 @@ static const struct object_ops completion_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ completion_destroy /* destroy */ }; diff --git a/server/console.c b/server/console.c -index a57b2fe..264b45f 100644 +index 0d98b78..37e413c 100644 --- a/server/console.c +++ b/server/console.c -@@ -85,6 +85,7 @@ static const struct object_ops console_input_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -87,6 +87,7 @@ static const struct object_ops console_input_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ console_input_destroy /* destroy */ }; -@@ -117,6 +118,7 @@ static const struct object_ops console_input_events_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -121,6 +122,7 @@ static const struct object_ops console_input_events_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ console_input_events_destroy /* destroy */ }; -@@ -169,6 +171,7 @@ static const struct object_ops screen_buffer_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -175,6 +177,7 @@ static const struct object_ops screen_buffer_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ screen_buffer_destroy /* destroy */ }; diff --git a/server/debugger.c b/server/debugger.c -index 374f2ad..5e9e6bf 100644 +index 2eb794a..a2c07ba 100644 --- a/server/debugger.c +++ b/server/debugger.c -@@ -82,6 +82,7 @@ static const struct object_ops debug_event_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -84,6 +84,7 @@ static const struct object_ops debug_event_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ debug_event_destroy /* destroy */ }; -@@ -106,6 +107,7 @@ static const struct object_ops debug_ctx_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -110,6 +111,7 @@ static const struct object_ops debug_ctx_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ debug_ctx_destroy /* destroy */ }; diff --git a/server/device.c b/server/device.c -index fb91c02..e207ba8 100644 +index a8f6f5d..4fdf7ad 100644 --- a/server/device.c +++ b/server/device.c -@@ -79,6 +79,7 @@ static const struct object_ops irp_call_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -81,6 +81,7 @@ static const struct object_ops irp_call_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ irp_call_destroy /* destroy */ }; -@@ -113,6 +114,7 @@ static const struct object_ops device_manager_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -117,6 +118,7 @@ static const struct object_ops device_manager_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_manager_destroy /* destroy */ }; -@@ -152,6 +154,7 @@ static const struct object_ops device_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -158,6 +160,7 @@ static const struct object_ops device_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ device_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_destroy /* destroy */ }; -@@ -198,6 +201,7 @@ static const struct object_ops device_file_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -206,6 +209,7 @@ static const struct object_ops device_file_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ device_file_close_handle, /* close_handle */ device_file_destroy /* destroy */ }; diff --git a/server/directory.c b/server/directory.c -index e0cf75e..da98fb0 100644 +index 45683b9..445c35c 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -65,6 +65,7 @@ static const struct object_ops object_type_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -67,6 +67,7 @@ static const struct object_ops object_type_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; -@@ -98,6 +99,7 @@ static const struct object_ops directory_ops = - default_set_sd, /* set_sd */ - directory_lookup_name, /* lookup_name */ +@@ -102,6 +103,7 @@ static const struct object_ops directory_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ directory_destroy /* destroy */ }; diff --git a/server/event.c b/server/event.c -index 4d3c562..9c09694 100644 +index c9a0ebb..36ea8fd 100644 --- a/server/event.c +++ b/server/event.c -@@ -66,6 +66,7 @@ static const struct object_ops event_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -68,6 +68,7 @@ static const struct object_ops event_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; -@@ -97,6 +98,7 @@ static const struct object_ops keyed_event_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -101,6 +102,7 @@ static const struct object_ops keyed_event_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/fd.c b/server/fd.c -index e3fe292..3e6373a 100644 +index 28f5346..c64132c 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -210,6 +210,7 @@ static const struct object_ops fd_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -212,6 +212,7 @@ static const struct object_ops fd_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ fd_destroy /* destroy */ }; -@@ -247,6 +248,7 @@ static const struct object_ops device_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -251,6 +252,7 @@ static const struct object_ops device_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_destroy /* destroy */ }; -@@ -283,6 +285,7 @@ static const struct object_ops inode_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -289,6 +291,7 @@ static const struct object_ops inode_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ inode_destroy /* destroy */ }; -@@ -321,6 +324,7 @@ static const struct object_ops file_lock_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -329,6 +332,7 @@ static const struct object_ops file_lock_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/file.c b/server/file.c -index a07ca16..c9c47a4 100644 +index 15fd411..e6f3fc2 100644 --- a/server/file.c +++ b/server/file.c -@@ -92,6 +92,7 @@ static const struct object_ops file_ops = - file_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -94,6 +94,7 @@ static const struct object_ops file_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ file_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ file_destroy /* destroy */ }; diff --git a/server/handle.c b/server/handle.c -index 5043ff7..64db8fc 100644 +index f440f9f..eb83a3b 100644 --- a/server/handle.c +++ b/server/handle.c -@@ -131,6 +131,7 @@ static const struct object_ops handle_table_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -133,6 +133,7 @@ static const struct object_ops handle_table_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ handle_table_destroy /* destroy */ }; -@@ -229,7 +230,7 @@ static int grow_handle_table( struct handle_table *table ) +@@ -232,7 +233,7 @@ static int grow_handle_table( struct handle_table *table ) } /* allocate the first free entry in the handle table */ @@ -302,7 +302,7 @@ { struct handle_entry *entry = table->entries + table->free; int i; -@@ -245,6 +246,10 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned +@@ -248,6 +249,10 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned table->free = i + 1; entry->ptr = grab_object_for_handle( obj ); entry->access = access; @@ -313,7 +313,7 @@ return index_to_handle(i); } -@@ -369,7 +374,11 @@ struct handle_table *copy_handle_table( struct process *process, struct process +@@ -372,7 +377,11 @@ struct handle_table *copy_handle_table( struct process *process, struct process for (i = 0; i <= table->last; i++, ptr++) { if (!ptr->ptr) continue; @@ -327,110 +327,110 @@ } } diff --git a/server/hook.c b/server/hook.c -index a8e6ab9..c005cae 100644 +index 3a0e4b4..dc653b8 100644 --- a/server/hook.c +++ b/server/hook.c -@@ -89,6 +89,7 @@ static const struct object_ops hook_table_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -91,6 +91,7 @@ static const struct object_ops hook_table_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ hook_table_destroy /* destroy */ }; diff --git a/server/mailslot.c b/server/mailslot.c -index 97ea3f6..5075a1a 100644 +index a0fa6e2..bff0208 100644 --- a/server/mailslot.c +++ b/server/mailslot.c -@@ -86,6 +86,7 @@ static const struct object_ops mailslot_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -89,6 +89,7 @@ static const struct object_ops mailslot_ops = + mailslot_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ mailslot_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mailslot_destroy /* destroy */ }; -@@ -139,6 +140,7 @@ static const struct object_ops mail_writer_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -144,6 +145,7 @@ static const struct object_ops mail_writer_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mail_writer_destroy /* destroy */ }; -@@ -193,6 +195,7 @@ static const struct object_ops mailslot_device_ops = - default_set_sd, /* set_sd */ - mailslot_device_lookup_name, /* lookup_name */ +@@ -200,6 +202,7 @@ static const struct object_ops mailslot_device_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ mailslot_device_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mailslot_device_destroy /* destroy */ }; diff --git a/server/mapping.c b/server/mapping.c -index 16e7c1c..fd31df2 100644 +index 4384cec..fc6404f 100644 --- a/server/mapping.c +++ b/server/mapping.c -@@ -92,6 +92,7 @@ static const struct object_ops mapping_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -94,6 +94,7 @@ static const struct object_ops mapping_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mapping_destroy /* destroy */ }; diff --git a/server/mutex.c b/server/mutex.c -index 910fbca..6e23770 100644 +index ca0da59..3598ac9 100644 --- a/server/mutex.c +++ b/server/mutex.c -@@ -69,6 +69,7 @@ static const struct object_ops mutex_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -71,6 +71,7 @@ static const struct object_ops mutex_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ mutex_destroy /* destroy */ }; diff --git a/server/named_pipe.c b/server/named_pipe.c -index 8d5753a..f48ead9 100644 +index 1e4169d..ade9165 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -132,6 +132,7 @@ static const struct object_ops named_pipe_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -135,6 +135,7 @@ static const struct object_ops named_pipe_ops = + named_pipe_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ named_pipe_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ named_pipe_destroy /* destroy */ }; -@@ -161,6 +162,7 @@ static const struct object_ops pipe_server_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -166,6 +167,7 @@ static const struct object_ops pipe_server_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ pipe_server_destroy /* destroy */ }; -@@ -203,6 +205,7 @@ static const struct object_ops pipe_client_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -210,6 +212,7 @@ static const struct object_ops pipe_client_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ pipe_client_destroy /* destroy */ }; -@@ -249,6 +252,7 @@ static const struct object_ops named_pipe_device_ops = - default_set_sd, /* set_sd */ - named_pipe_device_lookup_name, /* lookup_name */ +@@ -258,6 +261,7 @@ static const struct object_ops named_pipe_device_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ named_pipe_device_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ named_pipe_device_destroy /* destroy */ }; diff --git a/server/object.c b/server/object.c -index 31883bd..3ccaa4c 100644 +index b8be122..8310067 100644 --- a/server/object.c +++ b/server/object.c -@@ -548,6 +548,10 @@ struct object *no_open_file( struct object *obj, unsigned int access, unsigned i +@@ -563,6 +563,10 @@ struct object *no_open_file( struct object *obj, unsigned int access, unsigned i return NULL; } @@ -442,10 +442,10 @@ { return 1; /* ok to close */ diff --git a/server/object.h b/server/object.h -index b59811f..06ee321 100644 +index c4bc40b..16bf089 100644 --- a/server/object.h +++ b/server/object.h -@@ -86,8 +86,10 @@ struct object_ops +@@ -90,8 +90,10 @@ struct object_ops /* open a file object to access this object */ struct object *(*open_file)(struct object *, unsigned int access, unsigned int sharing, unsigned int options); @@ -457,8 +457,8 @@ /* destroy on refcount == 0 */ void (*destroy)(struct object *); }; -@@ -145,6 +147,7 @@ extern int set_sd_defaults_from_token( struct object *obj, const struct security - extern struct object *no_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attributes ); +@@ -161,6 +163,7 @@ extern int no_link_name( struct object *obj, struct object_name *name, struct ob + extern void default_unlink_name( struct object *obj, struct object_name *name ); extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); +extern void no_alloc_handle( struct object *obj, struct process *process, obj_handle_t handle ); @@ -466,221 +466,221 @@ extern void no_destroy( struct object *obj ); #ifdef DEBUG_OBJECTS diff --git a/server/process.c b/server/process.c -index e00b429..bc86c24 100644 +index c9bcabb..cc9c01c 100644 --- a/server/process.c +++ b/server/process.c -@@ -82,6 +82,7 @@ static const struct object_ops process_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -84,6 +84,7 @@ static const struct object_ops process_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ process_destroy /* destroy */ }; -@@ -130,6 +131,7 @@ static const struct object_ops startup_info_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -134,6 +135,7 @@ static const struct object_ops startup_info_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ startup_info_destroy /* destroy */ }; -@@ -171,6 +173,7 @@ static const struct object_ops job_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -177,6 +179,7 @@ static const struct object_ops job_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ job_close_handle, /* close_handle */ job_destroy /* destroy */ }; diff --git a/server/queue.c b/server/queue.c -index 3099e12..bdc740d 100644 +index f82060f..e097f5b 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -179,6 +179,7 @@ static const struct object_ops msg_queue_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -181,6 +181,7 @@ static const struct object_ops msg_queue_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ msg_queue_destroy /* destroy */ }; -@@ -212,6 +213,7 @@ static const struct object_ops thread_input_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -216,6 +217,7 @@ static const struct object_ops thread_input_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ thread_input_destroy /* destroy */ }; diff --git a/server/registry.c b/server/registry.c -index a3c1390..2db56c3 100644 +index 5ca2a52..e38d6bb 100644 --- a/server/registry.c +++ b/server/registry.c -@@ -167,6 +167,7 @@ static const struct object_ops key_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -169,6 +169,7 @@ static const struct object_ops key_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ key_close_handle, /* close_handle */ key_destroy /* destroy */ }; diff --git a/server/request.c b/server/request.c -index f78026a..bd01179 100644 +index dfa4485..122de96 100644 --- a/server/request.c +++ b/server/request.c -@@ -103,6 +103,7 @@ static const struct object_ops master_socket_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -107,6 +107,7 @@ static const struct object_ops master_socket_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ master_socket_destroy /* destroy */ }; diff --git a/server/semaphore.c b/server/semaphore.c -index d87325c..aaf2d65 100644 +index c77bd58..9c06ce4 100644 --- a/server/semaphore.c +++ b/server/semaphore.c -@@ -66,6 +66,7 @@ static const struct object_ops semaphore_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -68,6 +68,7 @@ static const struct object_ops semaphore_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/serial.c b/server/serial.c -index 164a4b1..cc9c3bc 100644 +index 03d726a..46949a3 100644 --- a/server/serial.c +++ b/server/serial.c -@@ -101,6 +101,7 @@ static const struct object_ops serial_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -106,6 +106,7 @@ static const struct object_ops serial_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ serial_destroy /* destroy */ }; diff --git a/server/signal.c b/server/signal.c -index 5e4fe33..308f494 100644 +index c20e154..8c05c5f 100644 --- a/server/signal.c +++ b/server/signal.c -@@ -75,6 +75,7 @@ static const struct object_ops handler_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -77,6 +77,7 @@ static const struct object_ops handler_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ handler_destroy /* destroy */ }; diff --git a/server/snapshot.c b/server/snapshot.c -index dd00bd1..b827c6f 100644 +index 3566b89..a0cf32e 100644 --- a/server/snapshot.c +++ b/server/snapshot.c -@@ -69,6 +69,7 @@ static const struct object_ops snapshot_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -71,6 +71,7 @@ static const struct object_ops snapshot_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ snapshot_destroy /* destroy */ }; diff --git a/server/sock.c b/server/sock.c -index 1767dea..57d3d93 100644 +index dc10d2a..a11964f 100644 --- a/server/sock.c +++ b/server/sock.c -@@ -154,6 +154,7 @@ static const struct object_ops sock_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -156,6 +156,7 @@ static const struct object_ops sock_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ sock_destroy /* destroy */ }; -@@ -996,6 +997,7 @@ static const struct object_ops ifchange_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -1000,6 +1001,7 @@ static const struct object_ops ifchange_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ ifchange_destroy /* destroy */ }; diff --git a/server/symlink.c b/server/symlink.c -index 2330fde..1107639 100644 +index bd09d34..6607e47 100644 --- a/server/symlink.c +++ b/server/symlink.c -@@ -68,6 +68,7 @@ static const struct object_ops symlink_ops = - default_set_sd, /* set_sd */ - symlink_lookup_name, /* lookup_name */ +@@ -70,6 +70,7 @@ static const struct object_ops symlink_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ symlink_destroy /* destroy */ }; diff --git a/server/thread.c b/server/thread.c -index bad2231..9407938 100644 +index ca02a8a..71b4d7b 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -118,6 +118,7 @@ static const struct object_ops thread_apc_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -120,6 +120,7 @@ static const struct object_ops thread_apc_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ thread_apc_destroy /* destroy */ }; -@@ -147,6 +148,7 @@ static const struct object_ops thread_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -151,6 +152,7 @@ static const struct object_ops thread_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ destroy_thread /* destroy */ }; diff --git a/server/timer.c b/server/timer.c -index 9c293f2..9957ee3 100644 +index 0d81d90..966d65d 100644 --- a/server/timer.c +++ b/server/timer.c -@@ -73,6 +73,7 @@ static const struct object_ops timer_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -75,6 +75,7 @@ static const struct object_ops timer_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ timer_destroy /* destroy */ }; diff --git a/server/token.c b/server/token.c -index 42cfb3d..893d58f 100644 +index ca12813..e13d03a 100644 --- a/server/token.c +++ b/server/token.c -@@ -159,6 +159,7 @@ static const struct object_ops token_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -161,6 +161,7 @@ static const struct object_ops token_ops = + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ token_destroy /* destroy */ }; diff --git a/server/winstation.c b/server/winstation.c -index 5016184..c4e55e3 100644 +index 9dc348d..17c312a 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -71,6 +71,7 @@ static const struct object_ops winstation_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -73,6 +73,7 @@ static const struct object_ops winstation_ops = + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ winstation_close_handle, /* close_handle */ winstation_destroy /* destroy */ }; -@@ -92,6 +93,7 @@ static const struct object_ops desktop_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -96,6 +97,7 @@ static const struct object_ops desktop_ops = + desktop_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ desktop_close_handle, /* close_handle */ desktop_destroy /* destroy */ }; -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From dd59d5fa25b8a20842e565d656c2b0f7833dae6c Mon Sep 17 00:00:00 2001 +From 02981c79c3ad972000fd3f397371f284ce9fade6 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 4 Dec 2015 01:22:29 +0100 Subject: server: Track desktop handle count more correctly. @@ -54,10 +54,10 @@ } diff --git a/server/handle.c b/server/handle.c -index 64db8fc..63dbf4e 100644 +index eb83a3b..38f38d5 100644 --- a/server/handle.c +++ b/server/handle.c -@@ -487,7 +487,7 @@ obj_handle_t find_inherited_handle( struct process *process, const struct object +@@ -490,7 +490,7 @@ obj_handle_t find_inherited_handle( struct process *process, const struct object /* enumerate handles of a given type */ /* this is needed for window stations and desktops */ obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops, @@ -66,7 +66,7 @@ { struct handle_table *table = process->handles; unsigned int i; -@@ -500,6 +500,7 @@ obj_handle_t enumerate_handles( struct process *process, const struct object_ops +@@ -503,6 +503,7 @@ obj_handle_t enumerate_handles( struct process *process, const struct object_ops if (!entry->ptr) continue; if (entry->ptr->ops != ops) continue; *index = i + 1; @@ -75,11 +75,11 @@ } return 0; diff --git a/server/handle.h b/server/handle.h -index 821c4ef..583a25a 100644 +index f1deb79..1347836 100644 --- a/server/handle.h +++ b/server/handle.h -@@ -48,7 +48,7 @@ extern obj_handle_t open_object( const struct namespace *namespace, const struct - const struct object_ops *ops, unsigned int access, unsigned int attr ); +@@ -49,7 +49,7 @@ extern obj_handle_t open_object( struct process *process, obj_handle_t parent, u + unsigned int attr ); extern obj_handle_t find_inherited_handle( struct process *process, const struct object_ops *ops ); extern obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops, - unsigned int *index ); @@ -88,10 +88,10 @@ extern struct handle_table *alloc_handle_table( struct process *process, int count ); extern struct handle_table *copy_handle_table( struct process *process, struct process *parent ); diff --git a/server/process.c b/server/process.c -index bc86c24..77771e5 100644 +index cc9c01c..b43e1f8 100644 --- a/server/process.c +++ b/server/process.c -@@ -832,7 +832,6 @@ static void process_killed( struct process *process ) +@@ -838,7 +838,6 @@ static void process_killed( struct process *process ) assert( list_empty( &process->thread_list )); process->end_time = current_time; @@ -100,28 +100,28 @@ process->desktop = 0; close_process_handles( process ); diff --git a/server/winstation.c b/server/winstation.c -index c4e55e3..78bd24c 100644 +index 17c312a..46ade3b 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -51,6 +51,7 @@ static void winstation_destroy( struct object *obj ); - static unsigned int winstation_map_access( struct object *obj, unsigned int access ); +@@ -51,6 +51,7 @@ static unsigned int winstation_map_access( struct object *obj, unsigned int acce static void desktop_dump( struct object *obj, int verbose ); static struct object_type *desktop_get_type( struct object *obj ); + static int desktop_link_name( struct object *obj, struct object_name *name, struct object *parent ); +static void desktop_alloc_handle( struct object *obj, struct process *process, obj_handle_t handle ); static int desktop_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void desktop_destroy( struct object *obj ); static unsigned int desktop_map_access( struct object *obj, unsigned int access ); -@@ -93,7 +94,7 @@ static const struct object_ops desktop_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ +@@ -97,7 +98,7 @@ static const struct object_ops desktop_ops = + desktop_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ - no_alloc_handle, /* alloc_handle */ + desktop_alloc_handle, /* alloc_handle */ desktop_close_handle, /* close_handle */ desktop_destroy /* destroy */ }; -@@ -261,14 +262,54 @@ static struct object_type *desktop_get_type( struct object *obj ) - return get_object_type( &str ); +@@ -253,14 +254,54 @@ static int desktop_link_name( struct object *obj, struct object_name *name, stru + return 1; } +static void close_desktop_timeout( void *private ) @@ -175,7 +175,7 @@ return 1; } -@@ -276,6 +317,7 @@ static void desktop_destroy( struct object *obj ) +@@ -268,6 +309,7 @@ static void desktop_destroy( struct object *obj ) { struct desktop *desktop = (struct desktop *)obj; @@ -183,7 +183,7 @@ free_hotkeys( desktop, 0 ); if (desktop->top_window) destroy_window( desktop->top_window ); if (desktop->msg_window) destroy_window( desktop->msg_window ); -@@ -302,40 +344,6 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access ) +@@ -294,40 +336,6 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access ) return get_desktop_obj( thread->process, thread->desktop, access ); } @@ -224,7 +224,7 @@ /* set the process default desktop handle */ void set_process_default_desktop( struct process *process, struct desktop *desktop, obj_handle_t handle ) -@@ -352,12 +360,6 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt +@@ -344,12 +352,6 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) if (!thread->desktop) thread->desktop = handle; @@ -237,7 +237,7 @@ if (old_desktop) release_object( old_desktop ); } -@@ -407,8 +409,8 @@ done: +@@ -399,8 +401,8 @@ done: void close_process_desktop( struct process *process ) { struct desktop *desktop; @@ -249,5 +249,5 @@ remove_desktop_user( desktop ); release_object( desktop ); -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Fix_Leak/0001-server-Fix-newly-introduced-memory-leak-of-object-na.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Fix_Leak/0001-server-Fix-newly-introduced-memory-leak-of-object-na.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Fix_Leak/0001-server-Fix-newly-introduced-memory-leak-of-object-na.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Fix_Leak/0001-server-Fix-newly-introduced-memory-leak-of-object-na.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,24 @@ +From 3d1d0332cc94bdac774643e1adfe987c534e088b Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 5 Feb 2016 19:07:42 +0100 +Subject: server: Fix newly introduced memory leak of object name structure. + +--- + server/object.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/server/object.c b/server/object.c +index c8098ca..b8be122 100644 +--- a/server/object.c ++++ b/server/object.c +@@ -222,6 +222,7 @@ void *create_object( struct object *parent, const struct object_ops *ops, const + if (!obj->ops->link_name( obj, name_ptr, parent )) + { + free_object( obj ); ++ free( name_ptr ); + return NULL; + } + name_ptr->obj = obj; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From f06a13e553d543e7b49c805b9292611ab1c68371 Mon Sep 17 00:00:00 2001 +From 2380d7451dc978cdab3ebcbeb75272c9147d0f68 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 25 Jun 2014 11:49:12 -0600 Subject: server: Add default security descriptor ownership for processes. @@ -11,10 +11,10 @@ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 466100d..ca4a8ad 100644 +index 498d19a..c09b097 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -4253,11 +4253,15 @@ static void test_acls(void) +@@ -4303,11 +4303,15 @@ static void test_acls(void) static void test_GetSecurityInfo(void) { @@ -30,7 +30,7 @@ ACL_SIZE_INFORMATION acl_size; PSECURITY_DESCRIPTOR pSD; ACCESS_ALLOWED_ACE *ace; -@@ -4382,6 +4386,37 @@ static void test_GetSecurityInfo(void) +@@ -4434,6 +4438,37 @@ static void test_GetSecurityInfo(void) } LocalFree(pSD); CloseHandle(obj); @@ -69,7 +69,7 @@ static void test_GetSidSubAuthority(void) diff --git a/server/process.c b/server/process.c -index 26f8924..1047c25 100644 +index d51c884..14e36b0 100644 --- a/server/process.c +++ b/server/process.c @@ -62,6 +62,7 @@ static int shutdown_stage; /* current stage in the shutdown process */ @@ -88,8 +88,8 @@ + process_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ - no_open_file, /* open_file */ -@@ -642,6 +643,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access + no_link_name, /* link_name */ +@@ -664,6 +665,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } @@ -120,7 +120,7 @@ { struct process *process = get_fd_user( fd ); diff --git a/server/security.h b/server/security.h -index 855f2e7..01bf637 100644 +index 925a85b..bdb7d42 100644 --- a/server/security.h +++ b/server/security.h @@ -47,6 +47,7 @@ extern const PSID security_local_user_sid; @@ -132,7 +132,7 @@ /* token functions */ diff --git a/server/token.c b/server/token.c -index cb81eec..914dfba 100644 +index ca12813..d66c39a 100644 --- a/server/token.c +++ b/server/token.c @@ -91,6 +91,13 @@ static const struct /* same fields as struct SID */ @@ -158,5 +158,5 @@ static luid_t prev_luid_value = { 1000, 0 }; -- -2.3.5 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Link-named-pipes-to-their-device.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Link-named-pipes-to-their-device.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Link-named-pipes-to-their-device.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Link-named-pipes-to-their-device.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 8ff87be88de81b45327a9fc0eeacbc357544be20 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 17 Aug 2015 01:10:10 +0200 -Subject: server: Link named pipes to their device. - ---- - server/named_pipe.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/server/named_pipe.c b/server/named_pipe.c -index 53bec02..0ce3e59 100644 ---- a/server/named_pipe.c -+++ b/server/named_pipe.c -@@ -743,7 +743,7 @@ static struct named_pipe *create_named_pipe( struct directory *root, const struc - else - { - struct named_pipe_device *dev = (struct named_pipe_device *)obj; -- if ((pipe = create_object( dev->pipes, &named_pipe_ops, &new_name, NULL ))) -+ if ((pipe = create_object( dev->pipes, &named_pipe_ops, &new_name, &dev->obj ))) - clear_error(); - } - --- -2.5.0 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,193 @@ +From dea19bf17349a7c1c2398a44e15587dae8fbce44 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 17 Aug 2015 01:11:47 +0200 +Subject: server: Store a reference to the parent object for pipe servers. (v2) + +--- + dlls/ntdll/tests/om.c | 3 --- + server/named_pipe.c | 45 +++++++++++++++++++++++++++++++++++++-------- + server/object.c | 18 ++++++++++++------ + 3 files changed, 49 insertions(+), 17 deletions(-) + +diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c +index 3d0487c..84507de 100644 +--- a/dlls/ntdll/tests/om.c ++++ b/dlls/ntdll/tests/om.c +@@ -1401,14 +1401,11 @@ static void test_query_object(void) + status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len ); + ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status ); + str = (UNICODE_STRING *)buffer; +- todo_wine + ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len ); + str = (UNICODE_STRING *)buffer; + expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR); +- todo_wine + ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */ + "unexpected len %u\n", len ); +- todo_wine + ok( len > sizeof(UNICODE_STRING) + sizeof("\\test_pipe") * sizeof(WCHAR), + "name too short %s\n", wine_dbgstr_w(str->Buffer) ); + trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); +diff --git a/server/named_pipe.c b/server/named_pipe.c +index ffa9e32..c92a117 100644 +--- a/server/named_pipe.c ++++ b/server/named_pipe.c +@@ -148,6 +148,8 @@ static const struct object_ops named_pipe_ops = + /* server end functions */ + static void pipe_server_dump( struct object *obj, int verbose ); + static struct fd *pipe_server_get_fd( struct object *obj ); ++static int pipe_server_link_name( struct object *obj, struct object_name *name, struct object *parent ); ++static void pipe_server_unlink_name( struct object *obj, struct object_name *name ); + static int pipe_server_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); + static void pipe_server_destroy( struct object *obj); + static obj_handle_t pipe_server_flush( struct fd *fd, const async_data_t *async, int blocking ); +@@ -170,8 +172,8 @@ static const struct object_ops pipe_server_ops = + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + no_lookup_name, /* lookup_name */ +- no_link_name, /* link_name */ +- NULL, /* unlink_name */ ++ pipe_server_link_name, /* link_name */ ++ pipe_server_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ + pipe_server_close_handle, /* close_handle */ +@@ -196,6 +198,8 @@ static const struct fd_ops pipe_server_fd_ops = + static void pipe_client_dump( struct object *obj, int verbose ); + static int pipe_client_signaled( struct object *obj, struct wait_queue_entry *entry ); + static struct fd *pipe_client_get_fd( struct object *obj ); ++static int pipe_client_link_name( struct object *obj, struct object_name *name, struct object *parent ); ++static void pipe_client_unlink_name( struct object *obj, struct object_name *name ); + static int pipe_client_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); + static void pipe_client_destroy( struct object *obj ); + static obj_handle_t pipe_client_flush( struct fd *fd, const async_data_t *async, int blocking ); +@@ -216,8 +220,8 @@ static const struct object_ops pipe_client_ops = + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + no_lookup_name, /* lookup_name */ +- no_link_name, /* link_name */ +- NULL, /* unlink_name */ ++ pipe_client_link_name, /* link_name */ ++ pipe_client_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_alloc_handle, /* alloc_handle */ + pipe_client_close_handle, /* close_handle */ +@@ -399,6 +403,17 @@ static void do_disconnect( struct pipe_server *server ) + server->fd = NULL; + } + ++static int pipe_server_link_name( struct object *obj, struct object_name *name, struct object *parent ) ++{ ++ assert( parent->ops == &named_pipe_ops ); ++ name->parent = grab_object( parent ); ++ return 1; ++} ++ ++static void pipe_server_unlink_name( struct object *obj, struct object_name *name ) ++{ ++} ++ + static int pipe_server_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) + { + #ifdef __linux__ +@@ -442,6 +457,17 @@ static void pipe_server_destroy( struct object *obj) + release_object( server->pipe ); + } + ++static int pipe_client_link_name( struct object *obj, struct object_name *name, struct object *parent ) ++{ ++ assert( parent->ops == &named_pipe_ops ); ++ name->parent = grab_object( parent ); ++ return 1; ++} ++ ++static void pipe_client_unlink_name( struct object *obj, struct object_name *name ) ++{ ++} ++ + static int pipe_client_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) + { + #ifdef __linux__ +@@ -768,9 +794,10 @@ static struct pipe_server *get_pipe_server_obj( struct process *process, + static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned int options, + unsigned int pipe_flags ) + { ++ static const struct unicode_str str = { NULL, 0 }; + struct pipe_server *server; + +- server = alloc_object( &pipe_server_ops ); ++ server = create_object( &pipe->obj, &pipe_server_ops, &str ); + if (!server) + return NULL; + +@@ -792,11 +819,13 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned + return server; + } + +-static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int pipe_flags ) ++static struct pipe_client *create_pipe_client( struct named_pipe *pipe, unsigned int flags, ++ unsigned int pipe_flags ) + { ++ static const struct unicode_str str = { NULL, 0 }; + struct pipe_client *client; + +- client = alloc_object( &pipe_client_ops ); ++ client = create_object( &pipe->obj, &pipe_client_ops, &str ); + if (!client) + return NULL; + +@@ -896,7 +925,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc + return NULL; + } + +- if ((client = create_pipe_client( options, pipe->flags ))) ++ if ((client = create_pipe_client( pipe, options, pipe->flags ))) + { + type = ((pipe->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE) && is_messagemode_supported()) ? + SOCK_SEQPACKET : SOCK_STREAM; +diff --git a/server/object.c b/server/object.c +index d4217c0..ef99334 100644 +--- a/server/object.c ++++ b/server/object.c +@@ -162,7 +162,7 @@ WCHAR *get_object_full_name( struct object *obj, data_size_t *ret_len ) + while (ptr && ptr->name) + { + struct object_name *name = ptr->name; +- len += name->len + sizeof(WCHAR); ++ if (name->len) len += name->len + sizeof(WCHAR); + ptr = name->parent; + } + if (!len) return NULL; +@@ -172,9 +172,12 @@ WCHAR *get_object_full_name( struct object *obj, data_size_t *ret_len ) + while (obj && obj->name) + { + struct object_name *name = obj->name; +- memcpy( ret + len - name->len, name->name, name->len ); +- len -= name->len + sizeof(WCHAR); +- memcpy( ret + len, &backslash, sizeof(WCHAR) ); ++ if (name->len) ++ { ++ memcpy( ret + len - name->len, name->name, name->len ); ++ len -= name->len + sizeof(WCHAR); ++ memcpy( ret + len, &backslash, sizeof(WCHAR) ); ++ } + obj = name->parent; + } + return (WCHAR *)ret; +@@ -269,8 +272,11 @@ static void dump_name( struct object *obj ) + + if (!name) return; + if (name->parent) dump_name( name->parent ); +- fputs( "\\\\", stderr ); +- dump_strW( name->name, name->len / sizeof(WCHAR), stderr, "[]" ); ++ if (name->len) ++ { ++ fputs( "\\\\", stderr ); ++ dump_strW( name->name, name->len / sizeof(WCHAR), stderr, "[]" ); ++ } + } + + /* dump the name of an object to stderr */ +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0002-server-Store-a-reference-to-the-parent-object-for-pi.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0002-server-Store-a-reference-to-the-parent-object-for-pi.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Pipe_ObjectName/0002-server-Store-a-reference-to-the-parent-object-for-pi.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Pipe_ObjectName/0002-server-Store-a-reference-to-the-parent-object-for-pi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -From 3a5501c1595dd32c25c9df6acb377aa92037b49f Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 17 Aug 2015 01:11:47 +0200 -Subject: server: Store a reference to the parent object for pipe servers. (v2) - ---- - server/named_pipe.c | 11 +++++++---- - server/object.c | 31 ++++++++++++++++++++++--------- - 2 files changed, 29 insertions(+), 13 deletions(-) - -diff --git a/server/named_pipe.c b/server/named_pipe.c -index 49b3f62..36a5c78 100644 ---- a/server/named_pipe.c -+++ b/server/named_pipe.c -@@ -765,9 +765,10 @@ static struct pipe_server *get_pipe_server_obj( struct process *process, - static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned int options, - unsigned int pipe_flags ) - { -+ static const struct unicode_str str = { NULL, 0 }; - struct pipe_server *server; - -- server = alloc_object( &pipe_server_ops ); -+ server = create_object( NULL, &pipe_server_ops, &str, &pipe->obj ); - if (!server) - return NULL; - -@@ -789,11 +790,13 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned - return server; - } - --static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int pipe_flags ) -+static struct pipe_client *create_pipe_client( struct named_pipe *pipe, unsigned int flags, -+ unsigned int pipe_flags ) - { -+ static const struct unicode_str str = { NULL, 0 }; - struct pipe_client *client; - -- client = alloc_object( &pipe_client_ops ); -+ client = create_object( NULL, &pipe_client_ops, &str, &pipe->obj ); - if (!client) - return NULL; - -@@ -879,7 +882,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc - return NULL; - } - -- if ((client = create_pipe_client( options, pipe->flags ))) -+ if ((client = create_pipe_client( pipe, options, pipe->flags ))) - { - type = ((pipe->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE) && is_messagemode_supported()) ? - SOCK_SEQPACKET : SOCK_STREAM; -diff --git a/server/object.c b/server/object.c -index a1b1184..fd24722 100644 ---- a/server/object.c -+++ b/server/object.c -@@ -55,6 +55,7 @@ struct namespace - struct list names[1]; /* array of hash entry lists */ - }; - -+static struct list dummy_namespace = LIST_INIT(dummy_namespace); - - #ifdef DEBUG_OBJECTS - static struct list object_list = LIST_INIT(object_list); -@@ -157,9 +158,15 @@ static void free_name( struct object *obj ) - static void set_object_name( struct namespace *namespace, - struct object *obj, struct object_name *ptr ) - { -- int hash = get_name_hash( namespace, ptr->name, ptr->len ); -- -- list_add_head( &namespace->names[hash], &ptr->entry ); -+ if (namespace) -+ { -+ int hash = get_name_hash( namespace, ptr->name, ptr->len ); -+ list_add_head( &namespace->names[hash], &ptr->entry ); -+ } -+ else -+ { -+ list_add_tail( &dummy_namespace, &ptr->entry ); -+ } - ptr->obj = obj; - obj->name = ptr; - } -@@ -184,7 +191,7 @@ WCHAR *get_object_full_name( struct object *obj, data_size_t *ret_len ) - while (ptr && ptr->name) - { - struct object_name *name = ptr->name; -- len += name->len + sizeof(WCHAR); -+ if (name->len) len += name->len + sizeof(WCHAR); - ptr = name->parent; - } - if (!len) return NULL; -@@ -194,9 +201,12 @@ WCHAR *get_object_full_name( struct object *obj, data_size_t *ret_len ) - while (obj && obj->name) - { - struct object_name *name = obj->name; -- memcpy( ret + len - name->len, name->name, name->len ); -- len -= name->len + sizeof(WCHAR); -- memcpy( ret + len, &backslash, sizeof(WCHAR) ); -+ if (name->len) -+ { -+ memcpy( ret + len - name->len, name->name, name->len ); -+ len -= name->len + sizeof(WCHAR); -+ memcpy( ret + len, &backslash, sizeof(WCHAR) ); -+ } - obj = name->parent; - } - return (WCHAR *)ret; -@@ -276,8 +286,11 @@ static void dump_name( struct object *obj ) - - if (!name) return; - if (name->parent) dump_name( name->parent ); -- fputs( "\\\\", stderr ); -- dump_strW( name->name, name->len / sizeof(WCHAR), stderr, "[]" ); -+ if (name->len) -+ { -+ fputs( "\\\\", stderr ); -+ dump_strW( name->name, name->len / sizeof(WCHAR), stderr, "[]" ); -+ } - } - - /* dump the name of an object to stderr */ --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From cc8a09773c259881d21c67f3b99b07208bee2cbe Mon Sep 17 00:00:00 2001 +From 0d5c923e97bebd777846bfb736319646f248e01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Mar 2015 01:22:34 +0100 Subject: server: Implement support for global and local shared memory blocks @@ -20,13 +20,13 @@ 12 files changed, 215 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 539944e..493246c 100644 +index 6e24ac3..7fe8189 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -99,6 +99,7 @@ extern int server_get_unix_fd( HANDLE handle, unsigned int access, int *unix_fd, - extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; +@@ -100,6 +100,7 @@ extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, data_size_t *ret_len ) DECLSPEC_HIDDEN; + extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; +extern void *server_get_shared_memory( HANDLE thread ) DECLSPEC_HIDDEN; /* module handling */ @@ -114,7 +114,7 @@ ntdll_get_thread_data()->wow64_redir = is_wow64; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 9f8e909..c91b27a 100644 +index 08275dd..ce19a34 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -376,6 +376,7 @@ void terminate_thread( int status ) @@ -158,7 +158,7 @@ /* macros for server requests */ diff --git a/include/winternl.h b/include/winternl.h -index 3494c00..b733f78 100644 +index 51320f2..5d0aa54 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -366,7 +366,7 @@ typedef struct _TEB @@ -171,7 +171,7 @@ ULONG ImpersonationLocale; /* f98/1788 */ ULONG IsImpersonating; /* f9c/178c */ diff --git a/server/fd.c b/server/fd.c -index e3fe292..00731d1 100644 +index 559a737..603cef4 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2481,6 +2481,33 @@ DECL_HANDLER(write) @@ -240,7 +240,7 @@ return 0; } diff --git a/server/mapping.c b/server/mapping.c -index 16e7c1c..c180ae5 100644 +index f66f326..75fda15 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -29,8 +29,32 @@ @@ -341,7 +341,7 @@ static int create_temp_file( file_pos_t size ) { diff --git a/server/protocol.def b/server/protocol.def -index ea5bd61..8ce9973 100644 +index a5a45eb..7c61b76 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -69,6 +69,15 @@ struct request_max_size @@ -360,7 +360,7 @@ /* debug event data */ typedef union -@@ -1204,6 +1213,12 @@ enum server_fd_type +@@ -1200,6 +1209,12 @@ enum server_fd_type }; @@ -419,5 +419,5 @@ struct thread_snapshot -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0004-server-Temporarily-store-the-full-security-descripto.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0004-server-Temporarily-store-the-full-security-descripto.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0004-server-Temporarily-store-the-full-security-descripto.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0004-server-Temporarily-store-the-full-security-descripto.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,21 +1,21 @@ -From e3abe63e7f3f1c3543e9bafb4b06ac41b4f4273f Mon Sep 17 00:00:00 2001 +From 04bdbb48453d5575e42d6dc5b9caa89a141167c1 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 30 Mar 2015 12:50:21 +0200 Subject: server: Temporarily store the full security descriptor for file objects. --- - dlls/advapi32/tests/security.c | 15 +++---- + dlls/advapi32/tests/security.c | 16 +++----- server/change.c | 8 +++- server/file.c | 88 ++++++++++++++++++++++++++++-------------- server/file.h | 3 +- - 4 files changed, 74 insertions(+), 40 deletions(-) + 4 files changed, 74 insertions(+), 41 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index eb9e816..77a1fcf 100644 +index f34831d..b149ea4 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3318,7 +3318,6 @@ static void test_CreateDirectoryA(void) +@@ -3350,7 +3350,6 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); ok(bret, "GetAclInformation failed\n"); @@ -23,7 +23,7 @@ ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", acl_size.AceCount); LocalFree(pSD); -@@ -3394,7 +3393,6 @@ static void test_CreateDirectoryA(void) +@@ -3426,7 +3425,6 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); ok(bret, "GetAclInformation failed\n"); @@ -31,7 +31,7 @@ ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", acl_size.AceCount); LocalFree(pSD); -@@ -3540,7 +3538,6 @@ static void test_CreateDirectoryA(void) +@@ -3572,7 +3570,6 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); ok(bret, "GetAclInformation failed\n"); @@ -39,12 +39,13 @@ ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", acl_size.AceCount); LocalFree(pSD); -@@ -4517,22 +4514,22 @@ static void test_GetSecurityInfo(void) +@@ -4552,23 +4549,22 @@ static void test_GetSecurityInfo(void) bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); -- todo_wine ok(bret, "Current User ACE != Current User SID.\n"); -+ ok(bret, "Current User ACE != Current User SID.\n"); +- todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", +- debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ++ ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -57,8 +58,8 @@ bret = pGetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); -- todo_wine ok(bret, "Administators Group ACE != Administators Group SID.\n"); -+ ok(bret, "Administators Group ACE != Administators Group SID.\n"); +- todo_wine ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ++ ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -95,7 +96,7 @@ return &dir->obj; diff --git a/server/file.c b/server/file.c -index 5d1466b..7c5e02b 100644 +index a684a77..fb78559 100644 --- a/server/file.c +++ b/server/file.c @@ -173,7 +173,8 @@ struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, unsigne @@ -227,7 +228,7 @@ } static struct object *file_open_file( struct object *obj, unsigned int access, -@@ -741,7 +768,10 @@ DECL_HANDLER(create_file) +@@ -737,7 +764,10 @@ DECL_HANDLER(create_file) if ((file = create_file( root_fd, name, name_len, req->access, req->sharing, req->create, req->options, req->attrs, sd ))) { @@ -254,5 +255,5 @@ /* completion */ -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0006-server-Convert-return-of-file-security-masks-with-ge.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0006-server-Convert-return-of-file-security-masks-with-ge.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0006-server-Convert-return-of-file-security-masks-with-ge.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0006-server-Convert-return-of-file-security-masks-with-ge.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 5c19cb0685dd47e7eb36dce9729200b79da61b11 Mon Sep 17 00:00:00 2001 +From 93fd1bb452f2d64ee0827b3d53221040cdb4b6b5 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:05:32 -0600 Subject: server: Convert return of file security masks with generic access @@ -10,11 +10,11 @@ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index f7ae089..0013c3c 100644 +index b149ea4..f4238c7 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -4501,8 +4501,8 @@ static void test_GetSecurityInfo(void) - ok(bret, "Current User ACE != Current User SID.\n"); +@@ -4552,8 +4552,8 @@ static void test_GetSecurityInfo(void) + ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - todo_wine ok(ace->Mask == 0x1f01ff, @@ -24,8 +24,8 @@ } if (acl_size.AceCount > 1) { -@@ -4512,7 +4512,7 @@ static void test_GetSecurityInfo(void) - ok(bret, "Administators Group ACE != Administators Group SID.\n"); +@@ -4563,7 +4563,7 @@ static void test_GetSecurityInfo(void) + ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - todo_wine ok(ace->Mask == 0x1f01ff, @@ -34,10 +34,10 @@ } LocalFree(pSD); diff --git a/server/file.c b/server/file.c -index ed7ddfc..6663927 100644 +index 55551bc..703479f 100644 --- a/server/file.c +++ b/server/file.c -@@ -466,6 +466,26 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID +@@ -479,6 +479,26 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID return sd; } @@ -64,7 +64,7 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid ) { -@@ -608,6 +628,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, +@@ -621,6 +641,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, current->process->token ); if (new_sd) { @@ -75,5 +75,5 @@ { owner = sd_get_owner( new_sd ); -- -2.3.5 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0007-server-Retrieve-file-security-attributes-with-extend.patch wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0007-server-Retrieve-file-security-attributes-with-extend.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/server-Stored_ACLs/0007-server-Retrieve-file-security-attributes-with-extend.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/server-Stored_ACLs/0007-server-Retrieve-file-security-attributes-with-extend.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,19 +1,19 @@ -From ea6969acf3f5e79a39bb461f78b4f0785a2b8843 Mon Sep 17 00:00:00 2001 +From 212dc266153f4c782ad4855720cc5b377f35c0ad Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:01:35 -0600 Subject: server: Retrieve file security attributes with extended file attributes. (try 7) --- - dlls/advapi32/tests/security.c | 15 +++++++-------- + dlls/advapi32/tests/security.c | 19 +++++++++---------- server/file.c | 30 +++++++++++++++++++++++++++--- - 2 files changed, 34 insertions(+), 11 deletions(-) + 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 0013c3c..945542e 100644 +index f4238c7..79a9df4 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3264,7 +3264,7 @@ static void test_CreateDirectoryA(void) +@@ -3303,7 +3303,7 @@ static void test_CreateDirectoryA(void) } ok(!error, "GetNamedSecurityInfo failed with error %d\n", error); test_inherited_dacl(pDacl, admin_sid, user_sid, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, @@ -22,12 +22,14 @@ LocalFree(pSD); /* Test inheritance of ACLs in CreateFile without security descriptor */ -@@ -3719,19 +3719,18 @@ static void test_GetNamedSecurityInfoA(void) +@@ -3758,21 +3758,20 @@ static void test_GetNamedSecurityInfoA(void) bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); -- todo_wine ok(bret, "Current User ACE != Current User SID.\n"); -+ ok(bret, "Current User ACE != Current User SID.\n"); +- todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", +- debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ++ ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", ++ debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%x != 0x1f01ff)\n", @@ -41,12 +43,14 @@ ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret || broken(!bret) /* win2k */, -- "Administators Group ACE != Administators Group SID.\n"); -+ ok(bret || broken(!bret) /* win2k */, "Administators Group ACE != Administators Group SID.\n"); +- "Administators Group ACE (%s) != Administators Group SID (%s).\n", +- debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ++ ok(bret || broken(!bret) /* win2k */, "Administators Group ACE (%s) != Administators Group SID (%s).\n", ++ debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff || broken(ace->Mask == GENERIC_ALL) /* win2k */, -@@ -3758,8 +3757,8 @@ static void test_GetNamedSecurityInfoA(void) +@@ -3799,8 +3798,8 @@ static void test_GetNamedSecurityInfoA(void) { bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get ACE.\n"); @@ -58,10 +62,10 @@ LocalFree(pSD); diff --git a/server/file.c b/server/file.c -index 6663927..8bcf6ee 100644 +index 703479f..78eef58 100644 --- a/server/file.c +++ b/server/file.c -@@ -486,6 +486,29 @@ static void convert_generic_sd( struct security_descriptor *sd ) +@@ -499,6 +499,29 @@ static void convert_generic_sd( struct security_descriptor *sd ) } } @@ -91,7 +95,7 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid ) { -@@ -501,9 +524,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode +@@ -514,9 +537,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode (st.st_uid == *uid)) return obj->sd; @@ -106,5 +110,5 @@ *mode = st.st_mode; -- -2.3.5 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,18 +1,18 @@ -From d9a2ea5065ced402ffe4551d7d863450310c1978 Mon Sep 17 00:00:00 2001 +From e86e14d9db9067fa0312470ac1c8363171e57837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 15 Aug 2015 21:09:22 +0200 Subject: shell32: Set SFGAO_HASSUBFOLDER correctly for unixfs. --- - dlls/shell32/shfldr_unixfs.c | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) + dlls/shell32/shfldr_unixfs.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c -index b3b0214..dbc71f2 100644 +index be1ba81..481ee06 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -1143,8 +1143,10 @@ static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT ci - SFGAO_HASPROPSHEET|SFGAO_DROPTARGET|SFGAO_FILESYSTEM; + SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSTEM; lstrcpyA(szAbsolutePath, This->m_pszPath); pszRelativePath = szAbsolutePath + lstrlenA(szAbsolutePath); - for (i=0; i +Date: Fri, 22 Jan 2016 17:40:43 +0800 +Subject: include: Make stdole32.idl a public component. + +This makes it possible to import stdole32.tlb from other .idl files. +--- + dlls/stdole32.tlb/std_ole_v1.idl | 119 +------------------------------- + include/Makefile.in | 1 + + include/stdole32.idl | 143 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 145 insertions(+), 118 deletions(-) + create mode 100644 include/stdole32.idl + +diff --git a/dlls/stdole32.tlb/std_ole_v1.idl b/dlls/stdole32.tlb/std_ole_v1.idl +index 359a810..de053e9 100644 +--- a/dlls/stdole32.tlb/std_ole_v1.idl ++++ b/dlls/stdole32.tlb/std_ole_v1.idl +@@ -20,121 +20,4 @@ + + #pragma makedep regtypelib + +-[ +- uuid(00020430-0000-0000-C000-000000000046), +- restricted, +- version(1.0), +- helpstring("OLE Automation") +-] +-library stdole +-{ +- /* typedefs aren't stored in the type library. +- These type names are known by the type compiler so it +- doesn't really matter what we define them as. */ +- +- typedef void *VARIANT; +- typedef wchar_t *BSTR; +- typedef unsigned long SCODE; +- typedef unsigned long HRESULT; +- +- typedef struct GUID { +- unsigned long Data1; +- unsigned short Data2; +- unsigned short Data3; +- unsigned char Data4[ 8 ]; +- } GUID; +- +- typedef struct DISPPARAMS { +- VARIANT *rgvarg; +- long *rgdispidNamedArgs; +- unsigned int cArgs; +- unsigned int cNamedArgs; +- } DISPPARAMS; +- +- typedef struct EXCEPINFO { +- unsigned short wCode; +- unsigned short wReserved; +- BSTR bstrSource; +- BSTR bstrDescription; +- BSTR bstrHelpFile; +- unsigned long dwHelpContext; +- void *pvReserved; +- void *pfnDeferredFillIn; +- SCODE scode; +- } EXCEPINFO; +- +- [ +- odl, +- uuid(00000000-0000-0000-C000-000000000046) +- ] +- interface IUnknown +- { +- [restricted] +- HRESULT QueryInterface( +- [in] GUID *riid, +- [out] void **ppvObj); +- +- [restricted] +- unsigned long AddRef(); +- +- [restricted] +- unsigned long Release(); +- } +- +- [ +- odl, +- uuid(00020400-0000-0000-C000-000000000046) +- ] +- interface IDispatch : IUnknown +- { +- [restricted] +- HRESULT GetTypeInfoCount( +- [out] unsigned int *pctinfo); +- +- [restricted] +- HRESULT GetTypeInfo( +- [in] unsigned int itinfo, +- [in] unsigned long lcid, +- [out] void **pptinfo); +- +- [restricted] +- HRESULT GetIDsOfNames( +- [in] GUID *riid, +- [in] char **rgszNames, +- [in] unsigned int cNames, +- [in] unsigned long lcid, +- [out] long *rgdispid); +- +- [restricted] +- HRESULT Invoke( +- [in] long dispidMember, +- [in] GUID *riid, +- [in] unsigned long lcid, +- [in] unsigned short wFlags, +- [in] DISPPARAMS *pdispparams, +- [out] VARIANT *pvarResult, +- [out] EXCEPINFO *pexcepinfo, +- [out] unsigned int *puArgErr); +- +- } +- +- [ +- odl, +- uuid(00020404-0000-0000-C000-000000000046) +- ] +- interface IEnumVARIANT : IUnknown +- { +- HRESULT Next( +- [in] unsigned long celt, +- [in] VARIANT *rgvar, +- [out] unsigned long *pceltFetched); +- +- HRESULT Skip( +- [in] unsigned long celt); +- +- HRESULT Reset(); +- +- HRESULT Clone( +- [out] IEnumVARIANT **ppenum); +- } +-}; ++#include "stdole32.idl" +diff --git a/include/Makefile.in b/include/Makefile.in +index 129ff6d..c15544a 100644 +--- a/include/Makefile.in ++++ b/include/Makefile.in +@@ -140,6 +140,7 @@ IDL_SRCS = \ + shtypes.idl \ + srcrst.idl \ + stdole2.idl \ ++ stdole32.idl \ + strmif.idl \ + structuredquerycondition.idl \ + taskschd.idl \ +diff --git a/include/stdole32.idl b/include/stdole32.idl +new file mode 100644 +index 0000000..107cee8 +--- /dev/null ++++ b/include/stdole32.idl +@@ -0,0 +1,143 @@ ++/* ++ * Copyright (C) 2003 Robert Shearman ++ * 2005 Huw Davies ++ * ++ * 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 ++ * ++ */ ++ ++#if 0 ++#pragma makedep install ++#pragma makedep typelib ++#endif ++ ++[ ++ uuid(00020430-0000-0000-C000-000000000046), ++ restricted, ++ version(1.0), ++ helpstring("OLE Automation") ++] ++library stdole ++{ ++ /* typedefs aren't stored in the type library. ++ These type names are known by the type compiler so it ++ doesn't really matter what we define them as. */ ++ ++ typedef void *VARIANT; ++ typedef wchar_t *BSTR; ++ typedef unsigned long SCODE; ++ typedef unsigned long HRESULT; ++ ++ typedef struct GUID { ++ unsigned long Data1; ++ unsigned short Data2; ++ unsigned short Data3; ++ unsigned char Data4[ 8 ]; ++ } GUID; ++ ++ typedef struct DISPPARAMS { ++ VARIANT *rgvarg; ++ long *rgdispidNamedArgs; ++ unsigned int cArgs; ++ unsigned int cNamedArgs; ++ } DISPPARAMS; ++ ++ typedef struct EXCEPINFO { ++ unsigned short wCode; ++ unsigned short wReserved; ++ BSTR bstrSource; ++ BSTR bstrDescription; ++ BSTR bstrHelpFile; ++ unsigned long dwHelpContext; ++ void *pvReserved; ++ void *pfnDeferredFillIn; ++ SCODE scode; ++ } EXCEPINFO; ++ ++ [ ++ odl, ++ uuid(00000000-0000-0000-C000-000000000046) ++ ] ++ interface IUnknown ++ { ++ [restricted] ++ HRESULT QueryInterface( ++ [in] GUID *riid, ++ [out] void **ppvObj); ++ ++ [restricted] ++ unsigned long AddRef(); ++ ++ [restricted] ++ unsigned long Release(); ++ } ++ ++ [ ++ odl, ++ uuid(00020400-0000-0000-C000-000000000046) ++ ] ++ interface IDispatch : IUnknown ++ { ++ [restricted] ++ HRESULT GetTypeInfoCount( ++ [out] unsigned int *pctinfo); ++ ++ [restricted] ++ HRESULT GetTypeInfo( ++ [in] unsigned int itinfo, ++ [in] unsigned long lcid, ++ [out] void **pptinfo); ++ ++ [restricted] ++ HRESULT GetIDsOfNames( ++ [in] GUID *riid, ++ [in] char **rgszNames, ++ [in] unsigned int cNames, ++ [in] unsigned long lcid, ++ [out] long *rgdispid); ++ ++ [restricted] ++ HRESULT Invoke( ++ [in] long dispidMember, ++ [in] GUID *riid, ++ [in] unsigned long lcid, ++ [in] unsigned short wFlags, ++ [in] DISPPARAMS *pdispparams, ++ [out] VARIANT *pvarResult, ++ [out] EXCEPINFO *pexcepinfo, ++ [out] unsigned int *puArgErr); ++ ++ } ++ ++ [ ++ odl, ++ uuid(00020404-0000-0000-C000-000000000046) ++ ] ++ interface IEnumVARIANT : IUnknown ++ { ++ HRESULT Next( ++ [in] unsigned long celt, ++ [in] VARIANT *rgvar, ++ [out] unsigned long *pceltFetched); ++ ++ HRESULT Skip( ++ [in] unsigned long celt); ++ ++ HRESULT Reset(); ++ ++ HRESULT Clone( ++ [out] IEnumVARIANT **ppenum); ++ } ++}; +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch wine-staging-1.9.3~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,22 @@ +From a004652281da81bace202bed4fe451f1d60f83f0 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Thu, 21 Jan 2016 02:53:22 +0100 +Subject: stdole32.tlb: Compile typelib with --oldtlb. + +--- + dlls/stdole32.tlb/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/stdole32.tlb/Makefile.in b/dlls/stdole32.tlb/Makefile.in +index 6422325..226235a 100644 +--- a/dlls/stdole32.tlb/Makefile.in ++++ b/dlls/stdole32.tlb/Makefile.in +@@ -1,4 +1,5 @@ + MODULE = stdole32.tlb ++EXTRAIDLFLAGS = --oldtlb + + RC_SRCS = rsrc.rc + IDL_SRCS = std_ole_v1.idl +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/definition wine-staging-1.9.3~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/stdole32.tlb-SLTG_Typelib/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,2 @@ +Fixes: [3689] Compile stdole32.tlb in SLTG typelib format +Depends: widl-SLTG_Typelib_Support diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0001-ntdll-Use-sysinfo-to-report-correct-number-of-physic.patch wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0001-ntdll-Use-sysinfo-to-report-correct-number-of-physic.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0001-ntdll-Use-sysinfo-to-report-correct-number-of-physic.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0001-ntdll-Use-sysinfo-to-report-correct-number-of-physic.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,62 @@ +From cfc7a0a240df174882997f8b69d37848543e12dd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Wed, 27 Jan 2016 04:54:15 +0100 +Subject: ntdll: Use sysinfo to report correct number of physical pages. + +--- + configure.ac | 1 + + dlls/ntdll/virtual.c | 14 ++++++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 59fc4fa..3909cd5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -502,6 +502,7 @@ AC_CHECK_HEADERS(\ + sys/statvfs.h \ + sys/strtio.h \ + sys/syscall.h \ ++ sys/sysinfo.h \ + sys/tihdr.h \ + sys/time.h \ + sys/timeout.h \ +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index f4ca487..b9a59fc 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -38,6 +38,9 @@ + #ifdef HAVE_SYS_MMAN_H + # include + #endif ++#ifdef HAVE_SYS_SYSINFO_H ++# include ++#endif + #ifdef HAVE_VALGRIND_VALGRIND_H + # include + #endif +@@ -1356,11 +1359,22 @@ void virtual_init_threading(void) + */ + void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) + { ++#ifdef HAVE_SYS_SYSINFO_H ++ struct sysinfo sinfo; ++#endif ++ + info->unknown = 0; + info->KeMaximumIncrement = 0; /* FIXME */ + info->PageSize = page_size; + info->MmLowestPhysicalPage = 1; + info->MmHighestPhysicalPage = 0x7fffffff / page_size; ++#ifdef HAVE_SYS_SYSINFO_H ++ if (!sysinfo(&sinfo)) ++ { ++ ULONG64 total = (ULONG64)sinfo.totalram * sinfo.mem_unit; ++ info->MmHighestPhysicalPage = max(1, total / page_size); ++ } ++#endif + info->MmNumberOfPhysicalPages = info->MmHighestPhysicalPage - info->MmLowestPhysicalPage; + info->AllocationGranularity = get_mask(0) + 1; + info->LowestUserAddress = (void *)0x10000; +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,58 @@ +From 67f11502fdf5bdabbc786efe99ce4e681683ba31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 28 Jan 2016 06:43:00 +0100 +Subject: ntdll: Report system information SystemPerformanceInformation info + class. + +--- + dlls/ntdll/nt.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c +index 9ee1923..947b410 100644 +--- a/dlls/ntdll/nt.c ++++ b/dlls/ntdll/nt.c +@@ -30,6 +30,9 @@ + #ifdef HAVE_SYS_SYSCTL_H + # include + #endif ++#ifdef HAVE_SYS_SYSINFO_H ++# include ++#endif + #ifdef HAVE_MACHINE_CPU_H + # include + #endif +@@ -1718,6 +1721,9 @@ NTSTATUS WINAPI NtQuerySystemInformation( + SYSTEM_PERFORMANCE_INFORMATION spi; + static BOOL fixme_written = FALSE; + FILE *fp; ++ #ifdef HAVE_SYS_SYSINFO_H ++ struct sysinfo sinfo; ++ #endif + + memset(&spi, 0 , sizeof(spi)); + len = sizeof(spi); +@@ -1739,6 +1745,20 @@ NTSTATUS WINAPI NtQuerySystemInformation( + spi.IdleTime.QuadPart = ++idle; + } + ++ #ifdef HAVE_SYS_SYSINFO_H ++ if (!sysinfo(&sinfo)) ++ { ++ ULONG64 freemem = (ULONG64)sinfo.freeram * sinfo.mem_unit; ++ ULONG64 totalram = (ULONG64)sinfo.totalram * sinfo.mem_unit; ++ ULONG64 totalswap = (ULONG64)sinfo.totalswap * sinfo.mem_unit; ++ ULONG64 freeswap = (ULONG64)sinfo.freeswap * sinfo.mem_unit; ++ ++ spi.AvailablePages = freemem / page_size; ++ spi.TotalCommittedPages = (totalram + totalswap - freemem - freeswap) / page_size; ++ spi.TotalCommitLimit = (totalram + totalswap) / page_size; ++ } ++ #endif ++ + if (Length >= len) + { + if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0003-taskmgr-Use-system-font-instead-of-special-bitmap-fo.patch wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0003-taskmgr-Use-system-font-instead-of-special-bitmap-fo.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0003-taskmgr-Use-system-font-instead-of-special-bitmap-fo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0003-taskmgr-Use-system-font-instead-of-special-bitmap-fo.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,139 @@ +From 54f6838211778a8f2527640d3c5a411f56d5cd98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Wed, 27 Jan 2016 04:55:09 +0100 +Subject: taskmgr: Use system font instead of special bitmap font. + +--- + programs/taskmgr/font.bmp | Bin 646 -> 0 bytes + programs/taskmgr/graph.c | 14 ++++++++++++-- + programs/taskmgr/resource.h | 1 - + programs/taskmgr/taskmgr.c | 29 ----------------------------- + programs/taskmgr/taskmgr.rc | 3 --- + 5 files changed, 12 insertions(+), 35 deletions(-) + delete mode 100644 programs/taskmgr/font.bmp + +diff --git a/programs/taskmgr/font.bmp b/programs/taskmgr/font.bmp +deleted file mode 100644 +index c1f8410c93273f4bc7013014561c35ef84faa182..0000000000000000000000000000000000000000 +GIT binary patch +literal 0 +HcmV?d00001 + +literal 646 +zcma)(!4U#62u0EH6fcfdSci9eun5QVo~(m&sz_(+`>@G4J060-haZBlxj#Nf3wh&j +z*b_Tr2Rq@-E}XxvX+aFPn4z{T33x(lt${jNLv39ZVf;klYOQWo0y8!j?qiD3aA3(K +zIq{C$VS%n9(V2QTr);{O_DntBpT=8p%%lCvw&%ZnE9Lyb=%2T9J{pLZxOXEEt2{0S +rj&qR`_imbB3(wY5`TKp;OQ!n~kRUw=3;lV4-TOj~_w9QN#T)VkBip4W + +diff --git a/programs/taskmgr/graph.c b/programs/taskmgr/graph.c +index 4098675..df4f922 100644 +--- a/programs/taskmgr/graph.c ++++ b/programs/taskmgr/graph.c +@@ -44,6 +44,7 @@ static void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) + RECT rcClient; + RECT rcBarLeft; + RECT rcBarRight; ++ RECT rcText; + WCHAR Text[256]; + ULONG CpuUsage; + ULONG CpuKernelUsage; +@@ -97,7 +98,11 @@ static void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) + * Draw the font text onto the graph + * The bottom 20 pixels are reserved for the text + */ +- Font_DrawText(hDC, Text, ((rcClient.right - rcClient.left) - 32) / 2, rcClient.bottom - 11 - 5); ++ CopyRect(&rcText, &rcClient); ++ rcText.top = rcText.bottom - 19; ++ ++ SetTextColor(hDC, BRIGHT_GREEN); ++ DrawTextW(hDC, Text, -1, &rcText, DT_CENTER); + + /* + * Now we have to draw the graph +@@ -224,6 +229,7 @@ static void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) + RECT rcClient; + RECT rcBarLeft; + RECT rcBarRight; ++ RECT rcText; + WCHAR Text[256]; + ULONGLONG CommitChargeTotal; + ULONGLONG CommitChargeLimit; +@@ -258,7 +264,11 @@ static void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) + * Draw the font text onto the graph + * The bottom 20 pixels are reserved for the text + */ +- Font_DrawText(hDC, Text, ((rcClient.right - rcClient.left) - (strlenW(Text) * 8)) / 2, rcClient.bottom - 11 - 5); ++ CopyRect(&rcText, &rcClient); ++ rcText.top = rcText.bottom - 19; ++ ++ SetTextColor(hDC, BRIGHT_GREEN); ++ DrawTextW(hDC, Text, -1, &rcText, DT_CENTER); + + /* + * Now we have to draw the graph +diff --git a/programs/taskmgr/resource.h b/programs/taskmgr/resource.h +index add873d..cbd2448 100644 +--- a/programs/taskmgr/resource.h ++++ b/programs/taskmgr/resource.h +@@ -35,7 +35,6 @@ + #define IDR_PROCESS_PAGE_CONTEXT 144 + #define IDB_TRAYMASK 150 + #define IDB_TRAYICON 153 +-#define IDB_FONT 154 + #define IDD_DEBUG_CHANNELS_DIALOG 155 + #define IDC_DEBUG_CHANNELS_LIST 156 + +diff --git a/programs/taskmgr/taskmgr.c b/programs/taskmgr/taskmgr.c +index 80dc81c..b0f2e78 100644 +--- a/programs/taskmgr/taskmgr.c ++++ b/programs/taskmgr/taskmgr.c +@@ -80,35 +80,6 @@ static void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLef + FillSolidRect2(hDC, x, y + cy, cx, -1, clrBottomRight); + } + +-void Font_DrawText(HDC hDC, LPWSTR lpwszText, int x, int y) +-{ +- HDC hFontDC; +- HBITMAP hFontBitmap; +- HBITMAP hOldBitmap; +- int i; +- +- hFontDC = CreateCompatibleDC(hDC); +- hFontBitmap = LoadBitmapW(hInst, MAKEINTRESOURCEW(IDB_FONT)); +- hOldBitmap = SelectObject(hFontDC, hFontBitmap); +- +- for (i = 0; lpwszText[i]; i++) { +- if ((lpwszText[i] >= '0') && (lpwszText[i] <= '9')) { +- BitBlt(hDC, x + (i * 8), y, 8, 11, hFontDC, (lpwszText[i] - '0') * 8, 0, SRCCOPY); +- } +- else if (lpwszText[i] == 'K') +- { +- BitBlt(hDC, x + (i * 8), y, 8, 11, hFontDC, 80, 0, SRCCOPY); +- } +- else if (lpwszText[i] == '%') +- { +- BitBlt(hDC, x + (i * 8), y, 8, 11, hFontDC, 88, 0, SRCCOPY); +- } +- } +- SelectObject(hFontDC, hOldBitmap); +- DeleteObject(hFontBitmap); +- DeleteDC(hFontDC); +-} +- + static BOOL OnCreate(HWND hWnd) + { + HMENU hMenu; +diff --git a/programs/taskmgr/taskmgr.rc b/programs/taskmgr/taskmgr.rc +index e6742a7..ffd0699 100644 +--- a/programs/taskmgr/taskmgr.rc ++++ b/programs/taskmgr/taskmgr.rc +@@ -609,6 +609,3 @@ IDB_TRAYMASK BITMAP traymask.bmp + + /* @makedep: trayicon.bmp */ + IDB_TRAYICON BITMAP trayicon.bmp +- +-/* @makedep: font.bmp */ +-IDB_FONT BITMAP font.bmp +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0004-taskmgr-Use-different-units-depending-on-memory-usag.patch wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0004-taskmgr-Use-different-units-depending-on-memory-usag.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0004-taskmgr-Use-different-units-depending-on-memory-usag.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/taskmgr-Memory_Usage/0004-taskmgr-Use-different-units-depending-on-memory-usag.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,45 @@ +From 6b3fbb9c89a49f1ae936cc7db666f9ee09069463 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Wed, 27 Jan 2016 05:03:26 +0100 +Subject: taskmgr: Use different units depending on memory usage. + +--- + programs/taskmgr/graph.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/programs/taskmgr/graph.c b/programs/taskmgr/graph.c +index df4f922..7f1d09c 100644 +--- a/programs/taskmgr/graph.c ++++ b/programs/taskmgr/graph.c +@@ -240,8 +240,10 @@ static void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) + /* Top bars that are "unused", i.e. are dark green, representing free memory */ + int i; + +- static const WCHAR wszFormat[] = {'%','d','K',0}; +- ++ static const WCHAR wszFormatKB[] = {'%','u',' ','K','B',0}; ++ static const WCHAR wszFormatMB[] = {'%','u',' ','M','B',0}; ++ static const WCHAR wszFormatGB[] = {'%','.','1','f',' ','G','B',0}; ++ + /* + * Get the client area rectangle + */ +@@ -258,8 +260,13 @@ static void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) + CommitChargeTotal = (ULONGLONG)PerfDataGetCommitChargeTotalK(); + CommitChargeLimit = (ULONGLONG)PerfDataGetCommitChargeLimitK(); + +- sprintfW(Text, wszFormat, (int)CommitChargeTotal); +- ++ if (CommitChargeTotal > 1048576) ++ sprintfW(Text, wszFormatGB, (float)CommitChargeTotal / 1048576); ++ else if (CommitChargeTotal > 1024) ++ sprintfW(Text, wszFormatMB, (DWORD)CommitChargeTotal / 1024); ++ else ++ sprintfW(Text, wszFormatKB, (DWORD)CommitChargeTotal); ++ + /* + * Draw the font text onto the graph + * The bottom 20 pixels are reserved for the text +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch wine-staging-1.9.3~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From f3a55ca22853088d82f30711f9616b22b20bd228 Mon Sep 17 00:00:00 2001 -From: Kira Backes -Date: Tue, 22 Dec 2015 16:34:41 +0100 -Subject: user32: Add MOUSEHOOKSTRUCTEX to fix mouse wheel support for JA2 1.13 - and other apps which use it - -- Fixes out-of-bounds access for programs which cast to MOUSEHOOKSTRUCTEX (instead of just MOUSEHOOKSTRUCT) on mouse hooks -- Enables mouse wheel support for those programs -- Fixes Bug 38314 (and maybe others?) - -Signed-off-by: Kira Backes -Signed-off-by: Sebastian Lackner ---- - dlls/user32/message.c | 26 +++++++++++++++++--------- - 1 file changed, 17 insertions(+), 9 deletions(-) - -diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index 96e7f2e..b96418f 100644 ---- a/dlls/user32/message.c -+++ b/dlls/user32/message.c -@@ -2488,8 +2488,12 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H - INT hittest; - EVENTMSG event; - GUITHREADINFO info; -- MOUSEHOOKSTRUCT hook; - BOOL eatMsg; -+ struct /* MOUSEHOOKSTRUCTEX */ -+ { -+ MOUSEHOOKSTRUCT hook; -+ DWORD mouseData; -+ } hook; - - /* find the window to dispatch this mouse message to */ - -@@ -2584,17 +2588,21 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H - - /* message is accepted now (but may still get dropped) */ - -- hook.pt = msg->pt; -- hook.hwnd = msg->hwnd; -- hook.wHitTestCode = hittest; -- hook.dwExtraInfo = extra_info; -+ hook.hook.pt = msg->pt; -+ hook.hook.hwnd = msg->hwnd; -+ hook.hook.wHitTestCode = hittest; -+ hook.hook.dwExtraInfo = extra_info; -+ /* the correct mouseData for the events WM_XBUTTONDOWN, WM_XBUTTONUP, WM_XBUTTONDBLCLK, -+ * WM_NCXBUTTONDOWN, WM_NCXBUTTONUP, and WM_NCXBUTTONDBLCLK is not yet implemented */ -+ hook.mouseData = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0); - if (HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, - message, (LPARAM)&hook, TRUE )) - { -- hook.pt = msg->pt; -- hook.hwnd = msg->hwnd; -- hook.wHitTestCode = hittest; -- hook.dwExtraInfo = extra_info; -+ hook.hook.pt = msg->pt; -+ hook.hook.hwnd = msg->hwnd; -+ hook.hook.wHitTestCode = hittest; -+ hook.hook.dwExtraInfo = extra_info; -+ hook.mouseData = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0); - HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE ); - accept_hardware_message( hw_id, TRUE ); - return FALSE; --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/definition wine-staging-1.9.3~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-MOUSEHOOKSTRUCTEX/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38314] Pass MOUSEHOOKSTRUCTEX struct to mouse hook callback diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch wine-staging-1.9.3~ubuntu12.04.1/patches/user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -From 64b178a05599e08ff0ceb28e6455bedd58487ff1 Mon Sep 17 00:00:00 2001 -From: Anton Baskanov -Date: Thu, 31 Dec 2015 17:39:02 +0100 -Subject: user32: Set correct caret state in the server in SetCaretPos. (try 5) - -Signed-off-by: Anton Baskanov -Signed-off-by: Sebastian Lackner ---- - dlls/user32/caret.c | 8 ++++---- - server/protocol.def | 6 +++++- - server/queue.c | 8 ++++++-- - 3 files changed, 15 insertions(+), 7 deletions(-) - -diff --git a/dlls/user32/caret.c b/dlls/user32/caret.c -index 53bb5b4..734377a 100644 ---- a/dlls/user32/caret.c -+++ b/dlls/user32/caret.c -@@ -86,7 +86,7 @@ static void CALLBACK CARET_Callback( HWND hwnd, UINT msg, UINT_PTR id, DWORD cti - req->x = 0; - req->y = 0; - req->hide = 0; -- req->state = -1; /* toggle current state */ -+ req->state = CARET_STATE_TOGGLE; - if ((ret = !wine_server_call( req ))) - { - hwnd = wine_server_ptr_handle( reply->full_handle ); -@@ -256,7 +256,7 @@ BOOL WINAPI SetCaretPos( INT x, INT y ) - req->x = x; - req->y = y; - req->hide = 0; -- req->state = 1; -+ req->state = CARET_STATE_ON_IF_POS_CHANGED; - if ((ret = !wine_server_call_err( req ))) - { - hwnd = wine_server_ptr_handle( reply->full_handle ); -@@ -300,7 +300,7 @@ BOOL WINAPI HideCaret( HWND hwnd ) - req->x = 0; - req->y = 0; - req->hide = 1; -- req->state = 0; -+ req->state = CARET_STATE_OFF; - if ((ret = !wine_server_call_err( req ))) - { - hwnd = wine_server_ptr_handle( reply->full_handle ); -@@ -339,7 +339,7 @@ BOOL WINAPI ShowCaret( HWND hwnd ) - req->x = 0; - req->y = 0; - req->hide = -1; -- req->state = 1; -+ req->state = CARET_STATE_ON; - if ((ret = !wine_server_call_err( req ))) - { - hwnd = wine_server_ptr_handle( reply->full_handle ); -diff --git a/server/protocol.def b/server/protocol.def -index ea5bd61..ad702fe 100644 ---- a/server/protocol.def -+++ b/server/protocol.def -@@ -2978,7 +2978,7 @@ enum coords_relative - int x; /* caret x position */ - int y; /* caret y position */ - int hide; /* increment for hide count (can be negative to show it) */ -- int state; /* caret state (1=on, 0=off, -1=toggle current state) */ -+ int state; /* caret state (see below) */ - @REPLY - user_handle_t full_handle; /* handle to the current caret window */ - rectangle_t old_rect; /* previous caret rectangle */ -@@ -2988,6 +2988,10 @@ enum coords_relative - #define SET_CARET_POS 0x01 /* set the caret position from x,y */ - #define SET_CARET_HIDE 0x02 /* increment the caret hide count */ - #define SET_CARET_STATE 0x04 /* set the caret on/off state */ -+#define CARET_STATE_OFF 0 /* off */ -+#define CARET_STATE_ON 1 /* on */ -+#define CARET_STATE_TOGGLE -1 /* toggle current state */ -+#define CARET_STATE_ON_IF_POS_CHANGED -2 /* on if the position differs, unchanged otherwise */ - - - /* Set a window hook */ -diff --git a/server/queue.c b/server/queue.c -index 3099e12..25260e4 100644 ---- a/server/queue.c -+++ b/server/queue.c -@@ -3039,8 +3039,12 @@ DECL_HANDLER(set_caret_info) - } - if (req->flags & SET_CARET_STATE) - { -- if (req->state == -1) input->caret_state = !input->caret_state; -- else input->caret_state = !!req->state; -+ if (req->state == CARET_STATE_TOGGLE) -+ input->caret_state = !input->caret_state; -+ else if (req->state != CARET_STATE_ON_IF_POS_CHANGED) -+ input->caret_state = (req->state != CARET_STATE_OFF); -+ else if (req->x != reply->old_rect.left || req->y != reply->old_rect.top) -+ input->caret_state = 1; - } - } - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-SetCaretPos/definition wine-staging-1.9.3~ubuntu12.04.1/patches/user32-SetCaretPos/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-SetCaretPos/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-SetCaretPos/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Avoid corruption of caret when SetCaretPos() is called diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/0001-user32-Also-send-WM_CAPTURECHANGE-when-capture-has-n.patch wine-staging-1.9.3~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/0001-user32-Also-send-WM_CAPTURECHANGE-when-capture-has-n.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/0001-user32-Also-send-WM_CAPTURECHANGE-when-capture-has-n.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/0001-user32-Also-send-WM_CAPTURECHANGE-when-capture-has-n.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -From 5bfd73ad3ec48deae92927e8116fce81ac31cf66 Mon Sep 17 00:00:00 2001 -From: Christopher Thielen -Date: Mon, 23 Nov 2015 21:48:26 -0800 -Subject: user32: Also send WM_CAPTURECHANGE when capture has not changed. - -Fixes https://bugs.winehq.org/show_bug.cgi?id=13683 - -A window may be notified with WM_CAPTURECHANGED about itself -gaining mouse capture if it calls SetCapture() twice. - -Signed-off-by: Christopher Thielen -Signed-off-by: Sebastian Lackner ---- - dlls/comctl32/toolbar.c | 1 + - dlls/comctl32/trackbar.c | 1 + - dlls/user32/button.c | 1 + - dlls/user32/input.c | 2 +- - dlls/user32/tests/msg.c | 27 +++++++++++++++++++++++++++ - 5 files changed, 31 insertions(+), 1 deletion(-) - -diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c -index 890c18e..3251682 100644 ---- a/dlls/comctl32/toolbar.c -+++ b/dlls/comctl32/toolbar.c -@@ -6807,6 +6807,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) - return TOOLBAR_MouseLeave (infoPtr); - - case WM_CAPTURECHANGED: -+ if (lParam == (LPARAM)hwnd) return 0; - return TOOLBAR_CaptureChanged(infoPtr); - - case WM_NCACTIVATE: -diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c -index 6d092a3..4d19a70 100644 ---- a/dlls/comctl32/trackbar.c -+++ b/dlls/comctl32/trackbar.c -@@ -1976,6 +1976,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) - - - case WM_CAPTURECHANGED: -+ if (lParam == (LPARAM)hwnd) return 0; - return TRACKBAR_CaptureChanged (infoPtr); - - case WM_CREATE: -diff --git a/dlls/user32/button.c b/dlls/user32/button.c -index 890d154..2fee3c8 100644 ---- a/dlls/user32/button.c -+++ b/dlls/user32/button.c -@@ -364,6 +364,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, - - case WM_CAPTURECHANGED: - TRACE("WM_CAPTURECHANGED %p\n", hWnd); -+ if (lParam == (LPARAM)hWnd) break; - state = get_button_state( hWnd ); - if (state & BUTTON_BTNPRESSED) - { -diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 40e35a9..63fae67 100644 ---- a/dlls/user32/input.c -+++ b/dlls/user32/input.c -@@ -108,7 +108,7 @@ BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) - { - USER_Driver->pSetCapture( hwnd, gui_flags ); - -- if (previous && previous != hwnd) -+ if (previous) - SendMessageW( previous, WM_CAPTURECHANGED, 0, (LPARAM)hwnd ); - - if (prev_ret) *prev_ret = previous; -diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c -index b90f8d0..151b77a 100644 ---- a/dlls/user32/tests/msg.c -+++ b/dlls/user32/tests/msg.c -@@ -14906,6 +14906,32 @@ else - flush_sequence(); - } - -+static const struct message DoubleSetCaptureSeq[] = -+{ -+ { WM_CAPTURECHANGED, sent }, -+ { 0 } -+}; -+ -+static void test_DoubleSetCapture(void) -+{ -+ HWND hwnd; -+ -+ hwnd = CreateWindowExA(0, "TestWindowClass", "Test DoubleSetCapture", -+ WS_OVERLAPPEDWINDOW | WS_VISIBLE, -+ 100, 100, 200, 200, 0, 0, 0, NULL); -+ ok(hwnd != 0, "Failed to create overlapped window\n"); -+ -+ ShowWindow( hwnd, SW_SHOW ); -+ flush_sequence(); -+ -+ SetCapture(hwnd); -+ ok_sequence(WmEmptySeq, "SetCapture(hwnd) empty sequence", FALSE); -+ SetCapture(hwnd); -+ ok_sequence(DoubleSetCaptureSeq, "SetCapture(hwnd) twice", FALSE); -+ -+ DestroyWindow(hwnd); -+} -+ - static void init_funcs(void) - { - HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); -@@ -15045,6 +15071,7 @@ START_TEST(msg) - test_layered_window(); - test_TrackPopupMenu(); - test_TrackPopupMenuEmpty(); -+ test_DoubleSetCapture(); - /* keep it the last test, under Windows it tends to break the tests - * which rely on active/foreground windows being correct. - */ --- -2.6.2 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/definition wine-staging-1.9.3~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/user32-WM_CAPTURECHANGE/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [13683] Also send WM_CAPTURECHANGE when capture has not changed diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,40 @@ +From ab3d3417ca146b9a72b395b082b4aae628c39d7c Mon Sep 17 00:00:00 2001 +From: Louis Lenders +Date: Wed, 27 Jan 2016 07:29:50 +0100 +Subject: uxtheme: Do not crash when INVALID_HANDLE_VALUE is passed to + CloseThemeData. + +--- + dlls/uxtheme/system.c | 2 +- + dlls/uxtheme/tests/system.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c +index 8947587..7d07680 100644 +--- a/dlls/uxtheme/system.c ++++ b/dlls/uxtheme/system.c +@@ -746,7 +746,7 @@ void WINAPI SetThemeAppProperties(DWORD dwFlags) + HRESULT WINAPI CloseThemeData(HTHEME hTheme) + { + TRACE("(%p)\n", hTheme); +- if(!hTheme) ++ if(!hTheme || hTheme == INVALID_HANDLE_VALUE) + return E_HANDLE; + return MSSTYLES_CloseThemeClass(hTheme); + } +diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c +index 49eba64..4aeedbc 100644 +--- a/dlls/uxtheme/tests/system.c ++++ b/dlls/uxtheme/tests/system.c +@@ -541,6 +541,8 @@ static void test_CloseThemeData(void) + + hRes = pCloseThemeData(NULL); + ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes); ++ hRes = pCloseThemeData(INVALID_HANDLE_VALUE); ++ ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes); + } + + START_TEST(system) +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-CloseThemeData/definition wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-CloseThemeData/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-CloseThemeData/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-CloseThemeData/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [29862] Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,59 @@ +From e82e7adedc71f3a2cb3f8a4c7af5ffbfaad48885 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 27 Jan 2016 08:20:28 +0100 +Subject: uxthemegtk: Add export for OpenThemeDataEx. + +--- + dlls/uxtheme-gtk/uxtheme-gtk.spec | 2 +- + dlls/uxtheme-gtk/uxtheme.c | 9 +++++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/dlls/uxtheme-gtk/uxtheme-gtk.spec b/dlls/uxtheme-gtk/uxtheme-gtk.spec +index 4acc0fa..c4a619a 100644 +--- a/dlls/uxtheme-gtk/uxtheme-gtk.spec ++++ b/dlls/uxtheme-gtk/uxtheme-gtk.spec +@@ -38,7 +38,7 @@ + 46 stub -noname ClassicAdjustWindowRectEx + 48 stub -noname GetThemeParseErrorInfo + 60 stub -noname CreateThemeDataFromObjects +-61 stub OpenThemeDataEx ++61 stdcall OpenThemeDataEx(ptr wstr long) + 62 stub -noname ServerClearStockObjects + 63 stub -noname MarkSelection + +diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c +index b520f6f..15fc231 100644 +--- a/dlls/uxtheme-gtk/uxtheme.c ++++ b/dlls/uxtheme-gtk/uxtheme.c +@@ -501,14 +501,14 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd) + return TRUE; /* Always enabled */ + } + +-HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist) ++HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags) + { + WCHAR *start, *tok, buf[CLASSLIST_MAXLEN]; + uxgtk_theme_t *theme; + WORD fpu_flags; + int i; + +- TRACE("(%p, %s)\n", hwnd, debugstr_w(classlist)); ++ TRACE("(%p, %s, %x)\n", hwnd, debugstr_w(classlist), flags); + + if (libgtk3 == NULL) + { +@@ -562,6 +562,11 @@ found: + return theme; + } + ++HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist) ++{ ++ return OpenThemeDataEx(hwnd, classlist, 0); ++} ++ + void WINAPI SetThemeAppProperties(DWORD flags) + { + TRACE("(%u)\n", flags); +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,43 @@ +From 60dd76b04fa8aad2200f91660d0277a1c403dbab Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 27 Jan 2016 08:16:10 +0100 +Subject: uxthemegtk: Fix some incorrect error codes. + +--- + dlls/uxtheme-gtk/uxtheme.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c +index ab369f5..631c4da 100644 +--- a/dlls/uxtheme-gtk/uxtheme.c ++++ b/dlls/uxtheme-gtk/uxtheme.c +@@ -519,7 +519,7 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags) + /* comctl32.dll likes to send NULL */ + if (classlist == NULL) + { +- SetLastError(ERROR_INVALID_PARAMETER); ++ SetLastError(E_POINTER); + return NULL; + } + +@@ -578,7 +578,7 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR sub_app_name, + FIXME("(%p, %s, %s)\n", hwnd, debugstr_w(sub_app_name), + debugstr_w(sub_id_list)); + +- return E_NOTIMPL; ++ return S_OK; + } + + HRESULT WINAPI GetThemeBool(HTHEME htheme, int part_id, int state_id, +@@ -1145,7 +1145,7 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id) + + if (theme == NULL || theme->vtable == NULL) + { +- SetLastError(ERROR_INVALID_HANDLE); ++ SetLastError(E_HANDLE); + return FALSE; + } + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,192 @@ +From f5278dc9cd67771aace50ba14bce51626719ac7c Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 27 Jan 2016 08:53:14 +0100 +Subject: uxthemegtk: Validate theme handles before accessing private data. + +--- + dlls/uxtheme-gtk/uxtheme.c | 47 +++++++++++++++++++++++++++++++++---------- + dlls/uxtheme-gtk/uxthemegtk.h | 2 +- + 2 files changed, 37 insertions(+), 12 deletions(-) + +diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c +index 631c4da..aeaeb06 100644 +--- a/dlls/uxtheme-gtk/uxtheme.c ++++ b/dlls/uxtheme-gtk/uxtheme.c +@@ -3,6 +3,7 @@ + * + * Copyright (C) 2015 Ivan Akulinchev + * Copyright (C) 2015 Michael Müller ++ * Copyright (C) 2016 Sebastian Lackner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -36,6 +37,7 @@ + #include "vfwmsgs.h" + #include "shlobj.h" + ++#include "wine/exception.h" + #include "wine/debug.h" + + #include "uxthemegtk.h" +@@ -129,6 +131,7 @@ MAKE_FUNCPTR(gtk_widget_style_get); + MAKE_FUNCPTR(gtk_window_new); + #undef MAKE_FUNCPTR + ++#define HTHEME_MAGIC 0x4b544758 + #define NUM_SYS_COLORS (COLOR_MENUBAR + 1) + #define MENU_HEIGHT 20 + #define CLASSLIST_MAXLEN 128 +@@ -265,6 +268,26 @@ error: + return FALSE; + } + ++static uxgtk_theme_t *impl_from_HTHEME(HTHEME htheme) ++{ ++ uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; ++ if (!htheme || htheme == INVALID_HANDLE_VALUE) return NULL; ++ __TRY ++ { ++ if (theme->magic != HTHEME_MAGIC) theme = NULL; ++ } ++ __EXCEPT_PAGE_FAULT ++ { ++ theme = NULL; ++ } ++ __ENDTRY ++ ++ if (!theme) ++ FIXME("Theme handle %p is invalid\n", htheme); ++ ++ return theme; ++} ++ + static void process_attach(void) + { + static const WCHAR themes_subdir[] = {'\\','T','h','e','m','e','s','\\', 'g','t','k','3',0}; +@@ -347,6 +370,7 @@ static BOOL is_fake_theme(const WCHAR *path) + + void uxgtk_theme_init(uxgtk_theme_t *theme, const uxgtk_theme_vtable_t *vtable) + { ++ theme->magic = HTHEME_MAGIC; + theme->vtable = vtable; + theme->window = pgtk_window_new(GTK_WINDOW_TOPLEVEL); + theme->layout = pgtk_fixed_new(); +@@ -404,7 +428,7 @@ static void paint_cairo_surface(cairo_surface_t *surface, HDC target_hdc, + + HRESULT WINAPI CloseThemeData(HTHEME htheme) + { +- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; ++ uxgtk_theme_t *theme; + WORD fpu_flags; + + TRACE("(%p)\n", htheme); +@@ -412,7 +436,7 @@ HRESULT WINAPI CloseThemeData(HTHEME htheme) + if (libgtk3 == NULL) + return E_NOTIMPL; + +- if (theme == NULL) ++ if (!(theme = impl_from_HTHEME(htheme))) + return E_HANDLE; + + /* Destroy the toplevel widget */ +@@ -420,6 +444,7 @@ HRESULT WINAPI CloseThemeData(HTHEME htheme) + pgtk_widget_destroy(theme->window); + set_fpu_flags(fpu_flags); + ++ theme->magic = 0; + HeapFree(GetProcessHeap(), 0, theme); + return S_OK; + } +@@ -592,17 +617,17 @@ HRESULT WINAPI GetThemeBool(HTHEME htheme, int part_id, int state_id, + HRESULT WINAPI GetThemeColor(HTHEME htheme, int part_id, int state_id, + int prop_id, COLORREF *color) + { +- HRESULT hr; + GdkRGBA rgba = {0, 0, 0, 0}; +- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; ++ uxgtk_theme_t *theme; + WORD fpu_flags; ++ HRESULT hr; + + TRACE("(%p, %d, %d, %d, %p)\n", htheme, part_id, state_id, prop_id, color); + + if (libgtk3 == NULL) + return E_NOTIMPL; + +- if (theme == NULL || theme->vtable == NULL) ++ if (!(theme = impl_from_HTHEME(htheme))) + return E_HANDLE; + + if (theme->vtable->get_color == NULL) +@@ -895,8 +920,8 @@ HRESULT WINAPI DrawThemeBackground(HTHEME htheme, HDC hdc, int part_id, int stat + HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int state_id, + LPCRECT rect, const DTBGOPTS *options) + { +- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; + cairo_surface_t *surface; ++ uxgtk_theme_t *theme; + int width, height; + WORD fpu_flags; + cairo_t *cr; +@@ -907,7 +932,7 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st + if (libgtk3 == NULL) + return E_NOTIMPL; + +- if (theme == NULL || theme->vtable == NULL) ++ if (!(theme = impl_from_HTHEME(htheme))) + return E_HANDLE; + + if (theme->vtable->draw_background == NULL) +@@ -1064,7 +1089,7 @@ HRESULT WINAPI GetThemeBackgroundRegion(HTHEME htheme, HDC hdc, int part_id, int + HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_id, + RECT *rect, THEMESIZE type, SIZE *size) + { +- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; ++ uxgtk_theme_t *theme; + HRESULT result; + WORD fpu_flags; + +@@ -1073,7 +1098,7 @@ HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_i + if (libgtk3 == NULL) + return E_NOTIMPL; + +- if (theme == NULL || theme->vtable == NULL) ++ if (!(theme = impl_from_HTHEME(htheme))) + return E_HANDLE; + + if (theme->vtable->get_part_size == NULL) +@@ -1131,7 +1156,7 @@ BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME htheme, int part_id, in + + BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id) + { +- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme; ++ uxgtk_theme_t *theme; + WORD fpu_flags; + BOOL result; + +@@ -1143,7 +1168,7 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id) + return FALSE; + } + +- if (theme == NULL || theme->vtable == NULL) ++ if (!(theme = impl_from_HTHEME(htheme))) + { + SetLastError(E_HANDLE); + return FALSE; +diff --git a/dlls/uxtheme-gtk/uxthemegtk.h b/dlls/uxtheme-gtk/uxthemegtk.h +index 79037fb..185366b 100644 +--- a/dlls/uxtheme-gtk/uxthemegtk.h ++++ b/dlls/uxtheme-gtk/uxthemegtk.h +@@ -44,8 +44,8 @@ struct _uxgtk_theme_vtable + + struct _uxgtk_theme + { ++ DWORD magic; + const uxgtk_theme_vtable_t *vtable; +- + GtkWidget *window; + GtkWidget *layout; + }; +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0002-widl-Add-support-for-structures.patch 2016-02-08 20:07:32.000000000 +0000 @@ -682,7 +682,7 @@ assert(block->next == NULL); /* library block */ -+ chat("library_block_start = %#x\n", output_buffer_pos); ++ chat("library_block_start = %#lx\n", (SIZE_T)output_buffer_pos); *library_block_start = output_buffer_pos; + chat("sltg_write_header: writing library block %d: %d bytes\n", i, block->length); put_data(block->data, block->length); @@ -739,7 +739,7 @@ sltg_write_typeinfo(typelib); name_table_offset = (int *)(output_buffer + output_buffer_pos); -+ chat("name_table_offset = %#x\n", output_buffer_pos); ++ chat("name_table_offset = %#lx\n", (SIZE_T)output_buffer_pos); put_data(&library_block_start, sizeof(library_block_start)); sltg_write_helpstrings(typelib); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -From 80f3b9c3935baba1bbf2ba730a30f9364105ace8 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Wed, 20 Jan 2016 14:04:08 +0800 -Subject: oleaut32: Fix logic for deciding whether type description follows the - name. - -This makes it possible to load an SLTG typelib generated by widl. ---- - dlls/oleaut32/typelib.c | 28 ++++++++-------------------- - 1 file changed, 8 insertions(+), 20 deletions(-) - -diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c -index 0a83b79..e5d8708 100644 ---- a/dlls/oleaut32/typelib.c -+++ b/dlls/oleaut32/typelib.c -@@ -4216,35 +4216,23 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, - for(param = 0; param < pFuncDesc->funcdesc.cParams; param++) { - char *paramName = pNameTable + *pArg; - BOOL HaveOffs; -- /* If arg type follows then paramName points to the 2nd -- letter of the name, else the next WORD is an offset to -- the arg type and paramName points to the first letter. -- So let's take one char off paramName and see if we're -- pointing at an alpha-numeric char. However if *pArg is -- 0xffff or 0xfffe then the param has no name, the former -- meaning that the next WORD is the type, the latter -- meaning that the next WORD is an offset to the type. */ -- -- HaveOffs = FALSE; -- if(*pArg == 0xffff) -- paramName = NULL; -- else if(*pArg == 0xfffe) { -- paramName = NULL; -- HaveOffs = TRUE; -- } -- else if(paramName[-1] && !isalnum(paramName[-1])) -- HaveOffs = TRUE; -+ -+ TRACE_(typelib)("param %d: paramName %s, pArg %p, *pArg %#x\n", -+ param, debugstr_a(paramName), pArg, *pArg); - - pArg++; - -+ if (*pArg & 0xff00 || (WORD*)(pBlk + *pArg) < pArg) -+ HaveOffs = FALSE; /* type follows */ -+ else -+ HaveOffs = TRUE; -+ - if(HaveOffs) { /* the next word is an offset to type */ - pType = (WORD*)(pBlk + *pArg); - SLTG_DoElem(pType, pBlk, - &pFuncDesc->funcdesc.lprgelemdescParam[param], ref_lookup); - pArg++; - } else { -- if(paramName) -- paramName--; - pArg = SLTG_DoElem(pArg, pBlk, - &pFuncDesc->funcdesc.lprgelemdescParam[param], ref_lookup); - } --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-widl-Fix-generation-of-resources-containing-an-old-t.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-widl-Fix-generation-of-resources-containing-an-old-t.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-widl-Fix-generation-of-resources-containing-an-old-t.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0017-widl-Fix-generation-of-resources-containing-an-old-t.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,69 @@ +From 901d73cf56c406816555912ab2f089d80bba49db Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 20 Jan 2016 14:26:48 +0800 +Subject: widl: Fix generation of resources containing an old typelib. + +--- + tools/widl/typelib.c | 2 +- + tools/widl/widl.c | 5 +++-- + tools/widl/widl.h | 1 + + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c +index aa3305c..3de8691 100644 +--- a/tools/widl/typelib.c ++++ b/tools/widl/typelib.c +@@ -249,7 +249,7 @@ void end_typelib(void) + { + if (!typelib) return; + +- if (do_typelib == 2) ++ if (do_old_typelib) + create_sltg_typelib(typelib); + else + create_msft_typelib(typelib); +diff --git a/tools/widl/widl.c b/tools/widl/widl.c +index 1180e65..afeea39 100644 +--- a/tools/widl/widl.c ++++ b/tools/widl/widl.c +@@ -103,6 +103,7 @@ int do_everything = 1; + static int preprocess_only = 0; + int do_header = 0; + int do_typelib = 0; ++int do_old_typelib = 0; + int do_proxies = 0; + int do_client = 0; + int do_server = 0; +@@ -308,6 +309,7 @@ static void set_everything(int x) + { + do_header = x; + do_typelib = x; ++ do_old_typelib = x; + do_proxies = x; + do_client = x; + do_server = x; +@@ -682,8 +684,7 @@ int main(int argc,char *argv[]) + do_typelib = 1; + break; + case OLD_TYPELIB_OPTION: +- do_everything = 0; +- do_typelib = 2; ++ do_old_typelib = 1; + break; + case 'T': + typelib_name = xstrdup(optarg); +diff --git a/tools/widl/widl.h b/tools/widl/widl.h +index 09e7871..90b6366 100644 +--- a/tools/widl/widl.h ++++ b/tools/widl/widl.h +@@ -38,6 +38,7 @@ extern int pedantic; + extern int do_everything; + extern int do_header; + extern int do_typelib; ++extern int do_old_typelib; + extern int do_proxies; + extern int do_client; + extern int do_server; +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Add-oldtlb-switch-in-usage-message.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Add-oldtlb-switch-in-usage-message.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Add-oldtlb-switch-in-usage-message.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Add-oldtlb-switch-in-usage-message.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,24 @@ +From 3f9d49c152b1116b2349ad9cc9acf98da017f39a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Thu, 21 Jan 2016 02:51:56 +0100 +Subject: widl: Add --oldtlb switch in usage message. + +--- + tools/widl/widl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/widl/widl.c b/tools/widl/widl.c +index afeea39..c90b806 100644 +--- a/tools/widl/widl.c ++++ b/tools/widl/widl.c +@@ -65,6 +65,7 @@ static const char usage[] = + " -m32, -m64 Set the kind of typelib to build (Win32 or Win64)\n" + " -N Do not preprocess input\n" + " --oldnames Use old naming conventions\n" ++" --oldtlb Use old typelib (SLTG) format\n" + " -o, --output=NAME Set the output file name\n" + " -Otype Type of stubs to generate (-Os, -Oi, -Oif)\n" + " -p Generate proxy\n" +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From 901d73cf56c406816555912ab2f089d80bba49db Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Wed, 20 Jan 2016 14:26:48 +0800 -Subject: widl: Fix generation of resources containing an old typelib. - ---- - tools/widl/typelib.c | 2 +- - tools/widl/widl.c | 5 +++-- - tools/widl/widl.h | 1 + - 3 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c -index aa3305c..3de8691 100644 ---- a/tools/widl/typelib.c -+++ b/tools/widl/typelib.c -@@ -249,7 +249,7 @@ void end_typelib(void) - { - if (!typelib) return; - -- if (do_typelib == 2) -+ if (do_old_typelib) - create_sltg_typelib(typelib); - else - create_msft_typelib(typelib); -diff --git a/tools/widl/widl.c b/tools/widl/widl.c -index 1180e65..afeea39 100644 ---- a/tools/widl/widl.c -+++ b/tools/widl/widl.c -@@ -103,6 +103,7 @@ int do_everything = 1; - static int preprocess_only = 0; - int do_header = 0; - int do_typelib = 0; -+int do_old_typelib = 0; - int do_proxies = 0; - int do_client = 0; - int do_server = 0; -@@ -308,6 +309,7 @@ static void set_everything(int x) - { - do_header = x; - do_typelib = x; -+ do_old_typelib = x; - do_proxies = x; - do_client = x; - do_server = x; -@@ -682,8 +684,7 @@ int main(int argc,char *argv[]) - do_typelib = 1; - break; - case OLD_TYPELIB_OPTION: -- do_everything = 0; -- do_typelib = 2; -+ do_old_typelib = 1; - break; - case 'T': - typelib_name = xstrdup(optarg); -diff --git a/tools/widl/widl.h b/tools/widl/widl.h -index 09e7871..90b6366 100644 ---- a/tools/widl/widl.h -+++ b/tools/widl/widl.h -@@ -38,6 +38,7 @@ extern int pedantic; - extern int do_everything; - extern int do_header; - extern int do_typelib; -+extern int do_old_typelib; - extern int do_proxies; - extern int do_client; - extern int do_server; --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From 3f9d49c152b1116b2349ad9cc9acf98da017f39a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Thu, 21 Jan 2016 02:51:56 +0100 -Subject: widl: Add --oldtlb switch in usage message. - ---- - tools/widl/widl.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/widl/widl.c b/tools/widl/widl.c -index afeea39..c90b806 100644 ---- a/tools/widl/widl.c -+++ b/tools/widl/widl.c -@@ -65,6 +65,7 @@ static const char usage[] = - " -m32, -m64 Set the kind of typelib to build (Win32 or Win64)\n" - " -N Do not preprocess input\n" - " --oldnames Use old naming conventions\n" -+" --oldtlb Use old typelib (SLTG) format\n" - " -o, --output=NAME Set the output file name\n" - " -Otype Type of stubs to generate (-Os, -Oi, -Oif)\n" - " -p Generate proxy\n" --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Avoid-relying-on-side-effects-when-marking-func.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Avoid-relying-on-side-effects-when-marking-func.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Avoid-relying-on-side-effects-when-marking-func.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0019-widl-Avoid-relying-on-side-effects-when-marking-func.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,33 @@ +From 2404f4a367d658dc2b54f89381e6038a1bb68660 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 22 Jan 2016 11:52:22 +0800 +Subject: widl: Avoid relying on side effects when marking function index as + the last one. + +--- + tools/widl/write_sltg.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c +index bf2ba5f..acfc039 100644 +--- a/tools/widl/write_sltg.c ++++ b/tools/widl/write_sltg.c +@@ -1465,11 +1465,12 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) + + STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(iface)) + { +- if (i == func_count - 1) i |= 0x80000000; ++ int idx = inherited_func_count + i; ++ ++ if (i == func_count - 1) idx |= 0x80000000; + + base_offset += add_func_desc(typelib, &data, stmt_func->u.var, +- inherited_func_count + i, +- dispid++, base_offset, &hrefmap); ++ idx, dispid + i, base_offset, &hrefmap); + i++; + } + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -From a004652281da81bace202bed4fe451f1d60f83f0 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Thu, 21 Jan 2016 02:53:22 +0100 -Subject: stdole32.tlb: Compile typelib with --oldtlb. - ---- - dlls/stdole32.tlb/Makefile.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/stdole32.tlb/Makefile.in b/dlls/stdole32.tlb/Makefile.in -index 6422325..226235a 100644 ---- a/dlls/stdole32.tlb/Makefile.in -+++ b/dlls/stdole32.tlb/Makefile.in -@@ -1,4 +1,5 @@ - MODULE = stdole32.tlb -+EXTRAIDLFLAGS = --oldtlb - - RC_SRCS = rsrc.rc - IDL_SRCS = std_ole_v1.idl --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-widl-Set-the-lowest-bit-in-the-param-name-to-indicat.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-widl-Set-the-lowest-bit-in-the-param-name-to-indicat.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-widl-Set-the-lowest-bit-in-the-param-name-to-indicat.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0020-widl-Set-the-lowest-bit-in-the-param-name-to-indicat.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,45 @@ +From f52df44c1930e62fa9096f24ba8b1b84765c0e34 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 25 Jan 2016 15:05:03 +0800 +Subject: widl: Set the lowest bit in the param name to indicate whether type + description follows the name. + +It looks like the lowest bit in the param name offset actually indicates +whether type description follows the name, and since the name offsets are +always aligned that makes sense. + +This makes oleview.exe from PSDK running under Windows7 correctly show mix +of different very complex and relatively simple type descriptions generated +by widl's SLTG generator. +--- + tools/widl/write_sltg.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c +index acfc039..2ec1770 100644 +--- a/tools/widl/write_sltg.c ++++ b/tools/widl/write_sltg.c +@@ -1307,7 +1307,6 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v + short name, type_offset; + + name = base_offset != -1 ? add_name(typelib, arg->name) : -1; +- append_data(data, &name, sizeof(name)); + + if (arg_data[i].size > sizeof(short)) + { +@@ -1315,8 +1314,12 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v + arg_offset += arg_data[i].size; + } + else ++ { ++ name |= 1; + type_offset = *(short *)arg_data[i].data; ++ } + ++ append_data(data, &name, sizeof(name)); + append_data(data, &type_offset, sizeof(type_offset)); + + if (base_offset != -1) +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-oleaut32-Fix-logic-for-deciding-whether-type-descrip.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,63 @@ +From ed5f6c45666a220fd9f2532d0ab55bc9e4e7054c Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 20 Jan 2016 14:04:08 +0800 +Subject: oleaut32: Fix logic for deciding whether type description follows the + name (v2). + +This makes it possible to load an SLTG typelib generated by widl. + +It looks like the lowest bit actually indicates whether type description +follows the name, and since the name offsets are always aligned that makes +sense. +--- + dlls/oleaut32/typelib.c | 17 ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c +index 0a83b79..d8d8ec8 100644 +--- a/dlls/oleaut32/typelib.c ++++ b/dlls/oleaut32/typelib.c +@@ -4214,7 +4214,7 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, + pArg = (WORD*)(pBlk + pFunc->arg_off); + + for(param = 0; param < pFuncDesc->funcdesc.cParams; param++) { +- char *paramName = pNameTable + *pArg; ++ char *paramName = pNameTable + (*pArg & ~1); + BOOL HaveOffs; + /* If arg type follows then paramName points to the 2nd + letter of the name, else the next WORD is an offset to +@@ -4225,26 +4225,21 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, + meaning that the next WORD is the type, the latter + meaning that the next WORD is an offset to the type. */ + +- HaveOffs = FALSE; +- if(*pArg == 0xffff) ++ if(*pArg == 0xffff || *pArg == 0xfffe) + paramName = NULL; +- else if(*pArg == 0xfffe) { +- paramName = NULL; +- HaveOffs = TRUE; +- } +- else if(paramName[-1] && !isalnum(paramName[-1])) +- HaveOffs = TRUE; + ++ HaveOffs = !(*pArg & 1); + pArg++; + ++ TRACE_(typelib)("param %d: paramName %s, *pArg %#x\n", ++ param, debugstr_a(paramName), *pArg); ++ + if(HaveOffs) { /* the next word is an offset to type */ + pType = (WORD*)(pBlk + *pArg); + SLTG_DoElem(pType, pBlk, + &pFuncDesc->funcdesc.lprgelemdescParam[param], ref_lookup); + pArg++; + } else { +- if(paramName) +- paramName--; + pArg = SLTG_DoElem(pArg, pBlk, + &pFuncDesc->funcdesc.lprgelemdescParam[param], ref_lookup); + } +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -From 2404f4a367d658dc2b54f89381e6038a1bb68660 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 22 Jan 2016 11:52:22 +0800 -Subject: widl: Avoid relying on side effects when marking function index as - the last one. - ---- - tools/widl/write_sltg.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c -index bf2ba5f..acfc039 100644 ---- a/tools/widl/write_sltg.c -+++ b/tools/widl/write_sltg.c -@@ -1465,11 +1465,12 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) - - STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(iface)) - { -- if (i == func_count - 1) i |= 0x80000000; -+ int idx = inherited_func_count + i; -+ -+ if (i == func_count - 1) idx |= 0x80000000; - - base_offset += add_func_desc(typelib, &data, stmt_func->u.var, -- inherited_func_count + i, -- dispid++, base_offset, &hrefmap); -+ idx, dispid + i, base_offset, &hrefmap); - i++; - } - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0022-widl-Add-support-for-function-parameter-flags-to-SLT.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0022-widl-Add-support-for-function-parameter-flags-to-SLT.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0022-widl-Add-support-for-function-parameter-flags-to-SLT.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0022-widl-Add-support-for-function-parameter-flags-to-SLT.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,145 @@ +From 95352b40a973bc72e3cd32e1a02b6842f15deea9 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 25 Jan 2016 15:26:12 +0800 +Subject: widl: Add support for function parameter flags to SLTG typelib + generator. + +This makes stdole32.tlb generated by widl have proper [in,out,retval] +parameter flags. +--- + tools/widl/write_sltg.c | 70 ++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 60 insertions(+), 10 deletions(-) + +diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c +index 2ec1770..3cb137c 100644 +--- a/tools/widl/write_sltg.c ++++ b/tools/widl/write_sltg.c +@@ -794,8 +794,8 @@ static int local_href(struct sltg_hrefmap *hrefmap, int typelib_href) + return href << 2; + } + +-static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data, type_t *type, short flags, +- short base_offset, int *size_instance, struct sltg_hrefmap *hrefmap) ++static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data, type_t *type, short param_flags, ++ short flags, short base_offset, int *size_instance, struct sltg_hrefmap *hrefmap) + { + short vt, vt_flags, desc_offset; + +@@ -887,19 +887,20 @@ static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data + + if (is_ptr(ref)) + { +- chat("write_var_desc: vt VT_PTR | 0x0400\n"); +- vt = VT_PTR | 0x0400; ++ chat("write_var_desc: vt VT_PTR | 0x0400 | %04x\n", param_flags); ++ vt = VT_PTR | 0x0400 | param_flags; ++ param_flags = 0; + append_data(data, &vt, sizeof(vt)); +- write_var_desc(typelib, data, ref, 0, base_offset, size_instance, hrefmap); ++ write_var_desc(typelib, data, ref, param_flags, 0, base_offset, size_instance, hrefmap); + } + else +- write_var_desc(typelib, data, ref, 0x0e00, base_offset, size_instance, hrefmap); ++ write_var_desc(typelib, data, ref, param_flags, 0x0e00, base_offset, size_instance, hrefmap); + return desc_offset; + } + + chat("write_var_desc: vt %d, flags %04x\n", vt, flags); + +- vt_flags = vt | flags; ++ vt_flags = vt | flags | param_flags; + append_data(data, &vt_flags, sizeof(vt_flags)); + + if (vt == VT_USERDEFINED) +@@ -994,7 +995,8 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type) + init_sltg_data(&var_data[i]); + + base_offset = var_data_size + (i + 1) * sizeof(struct sltg_variable); +- type_desc_offset[i] = write_var_desc(typelib, &var_data[i], var->type, 0, base_offset, &size_instance, &hrefmap); ++ type_desc_offset[i] = write_var_desc(typelib, &var_data[i], var->type, 0, 0, ++ base_offset, &size_instance, &hrefmap); + dump_var_desc(var_data[i].data, var_data[i].size); + + if (var_data[i].size > sizeof(short)) +@@ -1177,6 +1179,52 @@ static int get_func_flags(const var_t *func, int *dispid, int *invokekind, int * + return flags; + } + ++static int get_param_flags(const var_t *param) ++{ ++ const attr_t *attr; ++ int flags, in, out; ++ ++ if (!param->attrs) return 0; ++ ++ flags = 0; ++ in = out = 0; ++ ++ LIST_FOR_EACH_ENTRY(attr, param->attrs, const attr_t, entry) ++ { ++ switch(attr->type) ++ { ++ case ATTR_IN: ++ in++; ++ break; ++ case ATTR_OUT: ++ out++; ++ break; ++ case ATTR_PARAMLCID: ++ flags |= 0x2000; ++ break; ++ case ATTR_RETVAL: ++ flags |= 0x80; ++ break; ++ default: ++ chat("unhandled param attr %d\n", attr->type); ++ break; ++ } ++ } ++ ++ if (out) ++ { ++ if (in) ++ flags |= 0x8000; ++ else ++ flags |= 0x4000; ++ } ++ else if (!in) ++ flags |= 0xc000; ++ ++ return flags; ++} ++ ++ + static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, var_t *func, + int idx, int dispid, short base_offset, struct sltg_hrefmap *hrefmap) + { +@@ -1194,7 +1242,7 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v + + init_sltg_data(&ret_data); + ret_desc_offset = write_var_desc(typelib, &ret_data, type_function_get_rettype(func->type), +- 0, base_offset, NULL, hrefmap); ++ 0, 0, base_offset, NULL, hrefmap); + dump_var_desc(ret_data.data, ret_data.size); + + arg_data_size = 0; +@@ -1220,13 +1268,15 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v + LIST_FOR_EACH_ENTRY(arg, type_get_function_args(func->type), const var_t, entry) + { + const attr_t *attr; ++ short param_flags = get_param_flags(arg); + + chat("add_func_desc: arg[%d] %p (%s), type %p (%s)\n", + i, arg, arg->name, arg->type, arg->type->name); + + init_sltg_data(&arg_data[i]); + +- arg_desc_offset[i] = write_var_desc(typelib, &arg_data[i], arg->type, 0, arg_offset, NULL, hrefmap); ++ arg_desc_offset[i] = write_var_desc(typelib, &arg_data[i], arg->type, param_flags, 0, ++ arg_offset, NULL, hrefmap); + dump_var_desc(arg_data[i].data, arg_data[i].size); + + if (arg_data[i].size > sizeof(short)) +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0023-oleaut32-Implement-decoding-of-SLTG-help-strings.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0023-oleaut32-Implement-decoding-of-SLTG-help-strings.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0023-oleaut32-Implement-decoding-of-SLTG-help-strings.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0023-oleaut32-Implement-decoding-of-SLTG-help-strings.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,245 @@ +From a0bdaee449916e202a5cac26f3e66c28d1566efb Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 26 Jan 2016 15:05:54 +0800 +Subject: oleaut32: Implement decoding of SLTG help strings. + +Based on the patch by Sebastian Lackner . +--- + dlls/oleaut32/typelib.c | 130 +++++++++++++++++++++++++++++++++++++++--------- + dlls/oleaut32/typelib.h | 4 +- + 2 files changed, 109 insertions(+), 25 deletions(-) + +diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c +index d8d8ec8..4fb5a95 100644 +--- a/dlls/oleaut32/typelib.c ++++ b/dlls/oleaut32/typelib.c +@@ -3717,6 +3717,87 @@ static BOOL TLB_GUIDFromString(const char *str, GUID *guid) + return TRUE; + } + ++struct bitstream ++{ ++ const BYTE *buffer; ++ DWORD length; ++ WORD current; ++}; ++ ++static const char *lookup_code(const BYTE *table, DWORD table_size, struct bitstream *bits) ++{ ++ const BYTE *p = table; ++ ++ while (p < table + table_size && *p == 0x80) ++ { ++ if (p + 2 >= table + table_size) return NULL; ++ ++ if (!(bits->current & 0xff)) ++ { ++ if (!bits->length) return NULL; ++ bits->current = (*bits->buffer << 8) | 1; ++ bits->buffer++; ++ bits->length--; ++ } ++ ++ if (bits->current & 0x8000) ++ { ++ p += 3; ++ } ++ else ++ { ++ p = table + (*(p + 2) | (*(p + 1) << 8)); ++ } ++ ++ bits->current <<= 1; ++ } ++ ++ if (p + 1 < table + table_size && *(p + 1)) ++ { ++ /* FIXME: Whats the meaning of *p? */ ++ const BYTE *q = p + 1; ++ while (q < table + table_size && *q) q++; ++ return (q < table + table_size) ? (const char *)(p + 1) : NULL; ++ } ++ ++ return NULL; ++} ++ ++static const TLBString *decode_string(const BYTE *table, const char *stream, DWORD stream_length, ITypeLibImpl *lib) ++{ ++ DWORD buf_size, table_size; ++ const char *p; ++ struct bitstream bits; ++ BSTR buf; ++ TLBString *tlbstr; ++ ++ if (!stream_length) return NULL; ++ ++ bits.buffer = (const BYTE *)stream; ++ bits.length = stream_length; ++ bits.current = 0; ++ ++ buf_size = *(const WORD *)table; ++ table += sizeof(WORD); ++ table_size = *(const DWORD *)table; ++ table += sizeof(DWORD); ++ ++ buf = SysAllocStringLen(NULL, buf_size); ++ buf[0] = 0; ++ ++ while ((p = lookup_code(table, table_size, &bits))) ++ { ++ static const WCHAR spaceW[] = { ' ',0 }; ++ if (buf[0]) strcatW(buf, spaceW); ++ MultiByteToWideChar(CP_ACP, 0, p, -1, buf + strlenW(buf), buf_size - strlenW(buf)); ++ } ++ ++ tlbstr = TLB_append_str(&lib->string_list, buf); ++ SysFreeString(buf); ++ ++ return tlbstr; ++} ++ + static WORD SLTG_ReadString(const char *ptr, const TLBString **pStr, ITypeLibImpl *lib) + { + WORD bytelen; +@@ -4400,17 +4481,17 @@ static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, + /* Because SLTG_OtherTypeInfo is such a painful struct, we make a more + manageable copy of it into this */ + typedef struct { +- WORD small_no; + char *index_name; + char *other_name; + WORD res1a; + WORD name_offs; +- WORD more_bytes; ++ WORD hlpstr_len; + char *extra; + WORD res20; + DWORD helpcontext; + WORD res26; + GUID uuid; ++ WORD typekind; + } SLTG_InternalOtherTypeInfo; + + /**************************************************************************** +@@ -4429,8 +4510,8 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + LPVOID pBlk, pFirstBlk; + SLTG_LibBlk *pLibBlk; + SLTG_InternalOtherTypeInfo *pOtherTypeInfoBlks; +- char *pAfterOTIBlks = NULL; + char *pNameTable, *ptr; ++ const BYTE *hlp_strings; + int i; + DWORD len, order; + ITypeInfoImpl **ppTypeInfoImpl; +@@ -4496,53 +4577,55 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + len += 0x40; + + /* And now TypeInfoCount of SLTG_OtherTypeInfo */ ++ pTypeLibImpl->TypeInfoCount = *(WORD *)((char *)pLibBlk + len); ++ len += sizeof(WORD); + + pOtherTypeInfoBlks = heap_alloc_zero(sizeof(*pOtherTypeInfoBlks) * pTypeLibImpl->TypeInfoCount); + +- + ptr = (char*)pLibBlk + len; + + for(i = 0; i < pTypeLibImpl->TypeInfoCount; i++) { + WORD w, extra; + len = 0; + +- pOtherTypeInfoBlks[i].small_no = *(WORD*)ptr; +- +- w = *(WORD*)(ptr + 2); ++ w = *(WORD*)ptr; + if(w != 0xffff) { + len += w; + pOtherTypeInfoBlks[i].index_name = heap_alloc(w+1); +- memcpy(pOtherTypeInfoBlks[i].index_name, ptr + 4, w); ++ memcpy(pOtherTypeInfoBlks[i].index_name, ptr + 2, w); + pOtherTypeInfoBlks[i].index_name[w] = '\0'; + } +- w = *(WORD*)(ptr + 4 + len); ++ w = *(WORD*)(ptr + 2 + len); + if(w != 0xffff) { +- TRACE_(typelib)("\twith %s\n", debugstr_an(ptr + 6 + len, w)); +- len += w; ++ TRACE_(typelib)("\twith %s\n", debugstr_an(ptr + 4 + len, w)); + pOtherTypeInfoBlks[i].other_name = heap_alloc(w+1); +- memcpy(pOtherTypeInfoBlks[i].other_name, ptr + 6 + len, w); ++ memcpy(pOtherTypeInfoBlks[i].other_name, ptr + 4 + len, w); + pOtherTypeInfoBlks[i].other_name[w] = '\0'; ++ len += w; + } +- pOtherTypeInfoBlks[i].res1a = *(WORD*)(ptr + len + 6); +- pOtherTypeInfoBlks[i].name_offs = *(WORD*)(ptr + len + 8); +- extra = pOtherTypeInfoBlks[i].more_bytes = *(WORD*)(ptr + 10 + len); ++ pOtherTypeInfoBlks[i].res1a = *(WORD*)(ptr + 4 + len); ++ pOtherTypeInfoBlks[i].name_offs = *(WORD*)(ptr + 6 + len); ++ extra = pOtherTypeInfoBlks[i].hlpstr_len = *(WORD*)(ptr + 8 + len); + if(extra) { + pOtherTypeInfoBlks[i].extra = heap_alloc(extra); +- memcpy(pOtherTypeInfoBlks[i].extra, ptr + 12, extra); ++ memcpy(pOtherTypeInfoBlks[i].extra, ptr + 10 + len, extra); + len += extra; + } +- pOtherTypeInfoBlks[i].res20 = *(WORD*)(ptr + 12 + len); +- pOtherTypeInfoBlks[i].helpcontext = *(DWORD*)(ptr + 14 + len); +- pOtherTypeInfoBlks[i].res26 = *(WORD*)(ptr + 18 + len); +- memcpy(&pOtherTypeInfoBlks[i].uuid, ptr + 20 + len, sizeof(GUID)); ++ pOtherTypeInfoBlks[i].res20 = *(WORD*)(ptr + 10 + len); ++ pOtherTypeInfoBlks[i].helpcontext = *(DWORD*)(ptr + 12 + len); ++ pOtherTypeInfoBlks[i].res26 = *(WORD*)(ptr + 16 + len); ++ memcpy(&pOtherTypeInfoBlks[i].uuid, ptr + 18 + len, sizeof(GUID)); ++ pOtherTypeInfoBlks[i].typekind = *(WORD*)(ptr + 18 + sizeof(GUID) + len); + len += sizeof(SLTG_OtherTypeInfo); + ptr += len; + } + +- pAfterOTIBlks = ptr; ++ /* Get the next DWORD */ ++ len = *(DWORD*)ptr; + +- /* Skip this WORD and get the next DWORD */ +- len = *(DWORD*)(pAfterOTIBlks + 2); ++ hlp_strings = (const BYTE *)ptr + sizeof(DWORD); ++ TRACE("max help string length %#x, help strings length %#x\n", ++ *(WORD *)hlp_strings, *(DWORD *)(hlp_strings + 2)); + + /* Now add this to pLibBLk look at what we're pointing at and + possibly add 0x20, then add 0x216, sprinkle a bit a magic +@@ -4608,6 +4691,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + (*ppTypeInfoImpl)->index = i; + (*ppTypeInfoImpl)->Name = SLTG_ReadName(pNameTable, pOtherTypeInfoBlks[i].name_offs, pTypeLibImpl); + (*ppTypeInfoImpl)->dwHelpContext = pOtherTypeInfoBlks[i].helpcontext; ++ (*ppTypeInfoImpl)->DocString = decode_string(hlp_strings, pOtherTypeInfoBlks[i].extra, pOtherTypeInfoBlks[i].hlpstr_len, pTypeLibImpl); + (*ppTypeInfoImpl)->guid = TLB_append_guid(&pTypeLibImpl->guid_list, &pOtherTypeInfoBlks[i].uuid, 2); + (*ppTypeInfoImpl)->typekind = pTIHeader->typekind; + (*ppTypeInfoImpl)->wMajorVerNum = pTIHeader->major_version; +diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h +index 8f274ba..94ec8f2 100644 +--- a/dlls/oleaut32/typelib.h ++++ b/dlls/oleaut32/typelib.h +@@ -387,18 +387,18 @@ typedef struct { + /* we then get 0x40 bytes worth of 0xffff or small numbers followed by + nrOfFileBlks - 2 of these */ + typedef struct { +- WORD small_no; + SLTG_Name index_name; /* This refers to a name in the directory */ + SLTG_Name other_name; /* Another one of these weird names */ + WORD res1a; /* 0xffff */ + WORD name_offs; /* offset to name in name table */ +- WORD more_bytes; /* if this is non-zero we get this many ++ WORD hlpstr_len; /* if this is non-zero we get this many + bytes before the next element, which seem + to reference the docstring of the type ? */ + WORD res20; /* 0xffff */ + DWORD helpcontext; + WORD res26; /* 0xffff */ + GUID uuid; ++ WORD typekind; + } SLTG_OtherTypeInfo; + + /* Next we get WORD 0x0003 followed by a DWORD which if we add to +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0024-oleaut32-Add-support-for-decoding-SLTG-function-help.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0024-oleaut32-Add-support-for-decoding-SLTG-function-help.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0024-oleaut32-Add-support-for-decoding-SLTG-function-help.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0024-oleaut32-Add-support-for-decoding-SLTG-function-help.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,113 @@ +From 3d5236979b081ae707d7f047fbf9e24a3cd0e4cf Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 26 Jan 2016 15:41:06 +0800 +Subject: oleaut32: Add support for decoding SLTG function help strings. + +--- + dlls/oleaut32/typelib.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c +index 4fb5a95..b9d8cbb 100644 +--- a/dlls/oleaut32/typelib.c ++++ b/dlls/oleaut32/typelib.c +@@ -4240,7 +4240,8 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign + } + + static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, +- unsigned short cFuncs, char *pNameTable, const sltg_ref_lookup_t *ref_lookup) ++ unsigned short cFuncs, char *pNameTable, const sltg_ref_lookup_t *ref_lookup, ++ const BYTE *hlp_strings) + { + SLTG_Function *pFunc; + unsigned short i; +@@ -4277,6 +4278,8 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, + pFuncDesc->funcdesc.cParams = pFunc->nacc >> 3; + pFuncDesc->funcdesc.cParamsOpt = (pFunc->retnextopt & 0x7e) >> 1; + pFuncDesc->funcdesc.oVft = pFunc->vtblpos & ~1; ++ if (pFunc->helpstring != 0xffff) ++ pFuncDesc->HelpString = decode_string(hlp_strings, pBlk + pFunc->helpstring, pNameTable - pBlk, pTI->pTypeLib); + + if(pFunc->magic & SLTG_FUNCTION_FLAGS_PRESENT) + pFuncDesc->funcdesc.wFuncFlags = pFunc->funcflags; +@@ -4364,7 +4367,7 @@ static void SLTG_ProcessCoClass(char *pBlk, ITypeInfoImpl *pTI, + + static void SLTG_ProcessInterface(char *pBlk, ITypeInfoImpl *pTI, + char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, +- const SLTG_TypeInfoTail *pTITail) ++ const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) + { + char *pFirstItem; + sltg_ref_lookup_t *ref_lookup = NULL; +@@ -4381,7 +4384,7 @@ static void SLTG_ProcessInterface(char *pBlk, ITypeInfoImpl *pTI, + } + + if (pTITail->funcs_off != 0xffff) +- SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup); ++ SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup, hlp_strings); + + heap_free(ref_lookup); + +@@ -4426,7 +4429,7 @@ static void SLTG_ProcessAlias(char *pBlk, ITypeInfoImpl *pTI, + + static void SLTG_ProcessDispatch(char *pBlk, ITypeInfoImpl *pTI, + char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, +- const SLTG_TypeInfoTail *pTITail) ++ const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) + { + sltg_ref_lookup_t *ref_lookup = NULL; + if (pTIHeader->href_table != 0xffffffff) +@@ -4437,7 +4440,7 @@ static void SLTG_ProcessDispatch(char *pBlk, ITypeInfoImpl *pTI, + SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup); + + if (pTITail->funcs_off != 0xffff) +- SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup); ++ SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup, hlp_strings); + + if (pTITail->impls_off != 0xffff) + SLTG_DoImpls(pBlk + pTITail->impls_off, pTI, FALSE, ref_lookup); +@@ -4461,7 +4464,7 @@ static void SLTG_ProcessEnum(char *pBlk, ITypeInfoImpl *pTI, + + static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, + char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, +- const SLTG_TypeInfoTail *pTITail) ++ const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) + { + sltg_ref_lookup_t *ref_lookup = NULL; + if (pTIHeader->href_table != 0xffffffff) +@@ -4472,7 +4475,7 @@ static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, + SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup); + + if (pTITail->funcs_off != 0xffff) +- SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup); ++ SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup, hlp_strings); + heap_free(ref_lookup); + if (TRACE_ON(typelib)) + dump_TypeInfo(pTI); +@@ -4734,7 +4737,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + + case TKIND_INTERFACE: + SLTG_ProcessInterface((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, +- pTIHeader, pTITail); ++ pTIHeader, pTITail, hlp_strings); + break; + + case TKIND_COCLASS: +@@ -4749,12 +4752,12 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + + case TKIND_DISPATCH: + SLTG_ProcessDispatch((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, +- pTIHeader, pTITail); ++ pTIHeader, pTITail, hlp_strings); + break; + + case TKIND_MODULE: + SLTG_ProcessModule((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, +- pTIHeader, pTITail); ++ pTIHeader, pTITail, hlp_strings); + break; + + default: +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0025-oleaut32-Add-support-for-decoding-SLTG-variable-help.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0025-oleaut32-Add-support-for-decoding-SLTG-variable-help.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0025-oleaut32-Add-support-for-decoding-SLTG-variable-help.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0025-oleaut32-Add-support-for-decoding-SLTG-variable-help.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,95 @@ +From 1d25ef1b6e9ef476686a3103604850ec5005b658 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 26 Jan 2016 16:17:21 +0800 +Subject: oleaut32: Add support for decoding SLTG variable help strings. + +--- + dlls/oleaut32/typelib.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c +index b9d8cbb..6699e0b 100644 +--- a/dlls/oleaut32/typelib.c ++++ b/dlls/oleaut32/typelib.c +@@ -4129,7 +4129,7 @@ static char *SLTG_DoImpls(char *pBlk, ITypeInfoImpl *pTI, + } + + static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsigned short cVars, +- const char *pNameTable, const sltg_ref_lookup_t *ref_lookup) ++ const char *pNameTable, const sltg_ref_lookup_t *ref_lookup, const BYTE *hlp_strings) + { + TLBVarDesc *pVarDesc; + const TLBString *prevName = NULL; +@@ -4159,6 +4159,12 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign + TRACE_(typelib)("byte_offs = 0x%x\n", pItem->byte_offs); + TRACE_(typelib)("memid = 0x%x\n", pItem->memid); + ++ if (pItem->helpstring != 0xffff) ++ { ++ pVarDesc->HelpString = decode_string(hlp_strings, pBlk + pItem->helpstring, pNameTable - pBlk, pTI->pTypeLib); ++ TRACE_(typelib)("helpstring = %s\n", debugstr_w(pVarDesc->HelpString->str)); ++ } ++ + if(pItem->flags & 0x02) + pType = &pItem->type; + else +@@ -4394,9 +4400,9 @@ static void SLTG_ProcessInterface(char *pBlk, ITypeInfoImpl *pTI, + + static void SLTG_ProcessRecord(char *pBlk, ITypeInfoImpl *pTI, + const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, +- const SLTG_TypeInfoTail *pTITail) ++ const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) + { +- SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, NULL); ++ SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, NULL, hlp_strings); + } + + static void SLTG_ProcessAlias(char *pBlk, ITypeInfoImpl *pTI, +@@ -4437,7 +4443,7 @@ static void SLTG_ProcessDispatch(char *pBlk, ITypeInfoImpl *pTI, + pNameTable); + + if (pTITail->vars_off != 0xffff) +- SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup); ++ SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup, hlp_strings); + + if (pTITail->funcs_off != 0xffff) + SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup, hlp_strings); +@@ -4457,9 +4463,9 @@ static void SLTG_ProcessDispatch(char *pBlk, ITypeInfoImpl *pTI, + + static void SLTG_ProcessEnum(char *pBlk, ITypeInfoImpl *pTI, + const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, +- const SLTG_TypeInfoTail *pTITail) ++ const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) + { +- SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, NULL); ++ SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, NULL, hlp_strings); + } + + static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, +@@ -4472,7 +4478,7 @@ static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, + pNameTable); + + if (pTITail->vars_off != 0xffff) +- SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup); ++ SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, ref_lookup, hlp_strings); + + if (pTITail->funcs_off != 0xffff) + SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup, hlp_strings); +@@ -4727,12 +4733,12 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) + switch(pTIHeader->typekind) { + case TKIND_ENUM: + SLTG_ProcessEnum((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, +- pTIHeader, pTITail); ++ pTIHeader, pTITail, hlp_strings); + break; + + case TKIND_RECORD: + SLTG_ProcessRecord((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, +- pTIHeader, pTITail); ++ pTIHeader, pTITail, hlp_strings); + break; + + case TKIND_INTERFACE: +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0026-widl-Minor-cosmetic-clean-up.patch wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0026-widl-Minor-cosmetic-clean-up.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0026-widl-Minor-cosmetic-clean-up.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/0026-widl-Minor-cosmetic-clean-up.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,39 @@ +From 3ad26c39f490daab83f32e87ec6b1b32a27f1bfa Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Thu, 28 Jan 2016 15:36:12 +0800 +Subject: widl: Minor/cosmetic clean up. + +--- + tools/widl/write_sltg.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c +index 3cb137c..04313e6 100644 +--- a/tools/widl/write_sltg.c ++++ b/tools/widl/write_sltg.c +@@ -298,9 +298,9 @@ static int add_name(struct sltg_typelib *sltg, const char *name) + else + new_size = (new_size + 1) & ~1; + +- if (aligned_size > sltg->name_table.allocated) ++ if (new_size > sltg->name_table.allocated) + { +- sltg->name_table.allocated = max(sltg->name_table.allocated * 2, aligned_size); ++ sltg->name_table.allocated = max(sltg->name_table.allocated * 2, new_size); + sltg->name_table.data = xrealloc(sltg->name_table.data, sltg->name_table.allocated); + } + +@@ -889,9 +889,8 @@ static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data + { + chat("write_var_desc: vt VT_PTR | 0x0400 | %04x\n", param_flags); + vt = VT_PTR | 0x0400 | param_flags; +- param_flags = 0; + append_data(data, &vt, sizeof(vt)); +- write_var_desc(typelib, data, ref, param_flags, 0, base_offset, size_instance, hrefmap); ++ write_var_desc(typelib, data, ref, 0, 0, base_offset, size_instance, hrefmap); + } + else + write_var_desc(typelib, data, ref, param_flags, 0x0e00, base_offset, size_instance, hrefmap); +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/definition wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/widl-SLTG_Typelib_Support/definition 2016-02-08 20:07:32.000000000 +0000 @@ -1,2 +1 @@ Fixes: Implement support for SLTG typelibs in widl -Fixes: [3689] Compile stdole32.tlb in SLTG typelib format diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ -From 8eaad5ab61fe01c56e9d2622b11fd9f1e058273e Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Wed, 4 Nov 2015 19:31:30 +0100 -Subject: wined3d: Rename wined3d_resource_(un)map to - wined3d_resource_sub_resource_(un)map. - -To avoid name conflicts in the CSMT patchset. ---- - dlls/d3d11/device.c | 4 ++-- - dlls/d3d11/texture.c | 8 ++++---- - dlls/d3d8/surface.c | 4 ++-- - dlls/d3d8/volume.c | 4 ++-- - dlls/d3d9/surface.c | 4 ++-- - dlls/d3d9/volume.c | 4 ++-- - dlls/wined3d/resource.c | 4 ++-- - dlls/wined3d/wined3d.spec | 4 ++-- - include/wine/wined3d.h | 6 +++--- - 9 files changed, 21 insertions(+), 21 deletions(-) - -diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 4560f52..b5cb5ed 100644 ---- a/dlls/d3d11/device.c -+++ b/dlls/d3d11/device.c -@@ -215,7 +215,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext - wined3d_resource = wined3d_resource_from_d3d11_resource(resource); - - wined3d_mutex_lock(); -- hr = wined3d_resource_map(wined3d_resource, subresource_idx, -+ hr = wined3d_resource_sub_resource_map(wined3d_resource, subresource_idx, - &map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)); - wined3d_mutex_unlock(); - -@@ -236,7 +236,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext - wined3d_resource = wined3d_resource_from_d3d11_resource(resource); - - wined3d_mutex_lock(); -- wined3d_resource_unmap(wined3d_resource, subresource_idx); -+ wined3d_resource_sub_resource_unmap(wined3d_resource, subresource_idx); - wined3d_mutex_unlock(); - } - -diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c -index 011a5f7..99e531a 100644 ---- a/dlls/d3d11/texture.c -+++ b/dlls/d3d11/texture.c -@@ -366,7 +366,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UIN - FIXME("Ignoring map_flags %#x.\n", map_flags); - - wined3d_mutex_lock(); -- if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, -+ if (SUCCEEDED(hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, - &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) - { - mapped_texture->pData = wined3d_map_desc.data; -@@ -384,7 +384,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT - TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); - - wined3d_mutex_lock(); -- wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); -+ wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); - wined3d_mutex_unlock(); - } - -@@ -823,7 +823,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN - FIXME("Ignoring map_flags %#x.\n", map_flags); - - wined3d_mutex_lock(); -- if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, -+ if (SUCCEEDED(hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, - &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) - { - mapped_texture->pData = wined3d_map_desc.data; -@@ -842,7 +842,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT - TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); - - wined3d_mutex_lock(); -- wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); -+ wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); - wined3d_mutex_unlock(); - } - -diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c -index 679f094..21f1438 100644 ---- a/dlls/d3d8/surface.c -+++ b/dlls/d3d8/surface.c -@@ -234,7 +234,7 @@ static HRESULT WINAPI d3d8_surface_LockRect(IDirect3DSurface8 *iface, - box.back = 1; - } - -- hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, -+ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, - &map_desc, rect ? &box : NULL, flags); - wined3d_mutex_unlock(); - -@@ -260,7 +260,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface) - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); -- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); -+ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); - wined3d_mutex_unlock(); - - switch(hr) -diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c -index f26e424..d1ee0b5 100644 ---- a/dlls/d3d8/volume.c -+++ b/dlls/d3d8/volume.c -@@ -148,7 +148,7 @@ static HRESULT WINAPI d3d8_volume_LockBox(IDirect3DVolume8 *iface, - iface, locked_box, box, flags); - - wined3d_mutex_lock(); -- hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, -+ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, - &map_desc, (const struct wined3d_box *)box, flags); - wined3d_mutex_unlock(); - -@@ -167,7 +167,7 @@ static HRESULT WINAPI d3d8_volume_UnlockBox(IDirect3DVolume8 *iface) - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); -- hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); -+ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); - wined3d_mutex_unlock(); - - return hr; -diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c -index 833c1f4..54baf83 100644 ---- a/dlls/d3d9/surface.c -+++ b/dlls/d3d9/surface.c -@@ -251,7 +251,7 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface, - } - - wined3d_mutex_lock(); -- hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, -+ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, - &map_desc, rect ? &box : NULL, flags); - wined3d_mutex_unlock(); - -@@ -272,7 +272,7 @@ static HRESULT WINAPI d3d9_surface_UnlockRect(IDirect3DSurface9 *iface) - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); -- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); -+ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); - wined3d_mutex_unlock(); - - switch(hr) -diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c -index 52502bf..a81b6c7 100644 ---- a/dlls/d3d9/volume.c -+++ b/dlls/d3d9/volume.c -@@ -148,7 +148,7 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface, - iface, locked_box, box, flags); - - wined3d_mutex_lock(); -- hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, -+ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, - &map_desc, (const struct wined3d_box *)box, flags); - wined3d_mutex_unlock(); - -@@ -167,7 +167,7 @@ static HRESULT WINAPI d3d9_volume_UnlockBox(IDirect3DVolume9 *iface) - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); -- hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); -+ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); - wined3d_mutex_unlock(); - - return hr; -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d466764..74be48d 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -295,7 +295,7 @@ void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, st - desc->size = resource->size; - } - --HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, -+HRESULT CDECL wined3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { - TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x.\n", -@@ -304,7 +304,7 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i - return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags); - } - --HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) -+HRESULT CDECL wined3d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) - { - TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); - -diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index a7e625d..b6be230 100644 ---- a/dlls/wined3d/wined3d.spec -+++ b/dlls/wined3d/wined3d.spec -@@ -182,10 +182,10 @@ - @ cdecl wined3d_resource_get_desc(ptr ptr) - @ cdecl wined3d_resource_get_parent(ptr) - @ cdecl wined3d_resource_get_priority(ptr) --@ cdecl wined3d_resource_map(ptr long ptr ptr long) - @ cdecl wined3d_resource_set_parent(ptr ptr) - @ cdecl wined3d_resource_set_priority(ptr long) --@ cdecl wined3d_resource_unmap(ptr long) -+@ cdecl wined3d_resource_sub_resource_map(ptr long ptr ptr long) -+@ cdecl wined3d_resource_sub_resource_unmap(ptr long) - - @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) - @ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr) -diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 2deb450..e25aa69 100644 ---- a/include/wine/wined3d.h -+++ b/include/wine/wined3d.h -@@ -2422,11 +2422,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, - struct wined3d_resource_desc *desc); - void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); - DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource); --HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, -- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); - void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); - DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority); --HRESULT __cdecl wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx); -+HRESULT __cdecl wined3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, -+ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); -+HRESULT __cdecl wined3d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx); - - HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, - struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, --- -2.6.2 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Helper/definition wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Helper/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Helper/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Helper/definition 2016-02-08 20:07:32.000000000 +0000 @@ -1,3 +1,4 @@ Depends: wined3d-DXTn +Depends: wined3d-resource_map Depends: makedep-PARENTSPEC Depends: ntdll-DllRedirects diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Make-surface_load_location-return-nothing.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Make-surface_load_location-return-nothing.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Make-surface_load_location-return-nothing.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Make-surface_load_location-return-nothing.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 8ac3b701d1b19249fff35e7db8bc4e12212c0886 Mon Sep 17 00:00:00 2001 +From bc6576d6ab3915b43d6b70206138622ead42110e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:25:01 +0100 Subject: wined3d: Make surface_load_location return nothing. @@ -9,10 +9,10 @@ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0f16f79..6490235 100644 +index 4e593e4..8b8ac0d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4239,7 +4239,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi +@@ -4118,7 +4118,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -21,7 +21,7 @@ { HRESULT hr; -@@ -4251,26 +4251,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4130,26 +4130,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); @@ -52,7 +52,7 @@ } if (WARN_ON(d3d_surface)) -@@ -4284,7 +4284,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4163,7 +4163,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co if (!surface->locations) { ERR("Surface %p does not have any up to date location.\n", surface); @@ -61,7 +61,7 @@ } switch (location) -@@ -4298,7 +4298,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4177,7 +4177,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -70,7 +70,7 @@ break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -4310,7 +4310,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4189,7 +4189,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -79,7 +79,7 @@ break; default: -@@ -4323,7 +4323,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4202,7 +4202,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) surface_evict_sysmem(surface); @@ -89,18 +89,18 @@ static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 593456e..c120937 100644 +index 02c09af..1c0c689 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2463,7 +2463,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, +@@ -2549,7 +2549,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; -HRESULT surface_load_location(struct wined3d_surface *surface, +void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, + HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Remove-surface_validate_location.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Remove-surface_validate_location.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Remove-surface_validate_location.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Remove-surface_validate_location.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 803e39eb0ca711ad7a2867bdac796cc4360c4c27 Mon Sep 17 00:00:00 2001 +From 4aad31fd3b9d3949b86cc73e4b4b5f98cce42ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 4 Jan 2014 00:53:47 +0100 Subject: wined3d: Remove surface_validate_location. @@ -13,10 +13,10 @@ 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index e8526d8..a87b09b 100644 +index 7731230..78f24cd 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -7888,7 +7888,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -7902,7 +7902,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ context_release(context); @@ -26,7 +26,7 @@ } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2312267..c10c1fc 100644 +index 7c9e96d..613235d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -398,7 +398,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -38,7 +38,7 @@ surface_invalidate_location(rt, ~rt->container->resource.draw_binding); } } -@@ -4047,7 +4047,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4124,7 +4124,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str context_release(context); @@ -48,10 +48,10 @@ } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 50282c0..4fb2578 100644 +index ea601ff..516b50f1 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1158,14 +1158,14 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1134,14 +1134,14 @@ static void surface_unload(struct wined3d_resource *resource) * and all flags get lost */ if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL) { @@ -68,7 +68,7 @@ surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); } } -@@ -1695,7 +1695,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1677,7 +1677,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P context_release(context); @@ -77,7 +77,7 @@ surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); return WINED3D_OK; -@@ -2133,7 +2133,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2115,7 +2115,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, valid_location = WINED3D_LOCATION_SYSMEM; } @@ -86,7 +86,7 @@ return WINED3D_OK; } -@@ -2679,7 +2679,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2662,7 +2662,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, { TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", wined3d_debug_location(surface->resource.map_binding)); @@ -95,7 +95,7 @@ } else { -@@ -3167,7 +3167,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3144,7 +3144,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -104,7 +104,7 @@ surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3440,7 +3440,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3417,7 +3417,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -113,7 +113,7 @@ surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3918,13 +3918,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3895,13 +3895,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -127,7 +127,7 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) { TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4319,7 +4312,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4296,7 +4289,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte break; } @@ -136,7 +136,7 @@ if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) surface_evict_sysmem(surface); -@@ -4493,7 +4486,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -4479,7 +4472,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); @@ -145,8 +145,8 @@ surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); } -@@ -5474,7 +5467,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); +@@ -5456,7 +5449,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + dst_surface, dst_surface->container->resource.draw_binding, dst_rect); context_release(context); - surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); @@ -154,7 +154,7 @@ surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); return WINED3D_OK; -@@ -5564,7 +5557,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5543,7 +5536,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text } surface->container = container; @@ -163,7 +163,7 @@ list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5596,7 +5589,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5575,7 +5568,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -173,10 +173,10 @@ } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e45fe17..9758be4 100644 +index 7728cdc..a97d1f7 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -562,7 +562,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -570,7 +570,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); @@ -185,7 +185,7 @@ surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM * and INTEXTURE copies can keep their old content if they have any defined content. -@@ -835,7 +835,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -843,7 +843,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); if (!(device->wined3d->flags & WINED3D_NO3D)) { @@ -195,7 +195,7 @@ } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 0f40a3c..6b41db8 100644 +index 093cc56..40b668c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -795,9 +795,7 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource * @@ -210,10 +210,10 @@ static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 87cd0d0..3848e76 100644 +index f03e8a1..d912668 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2477,7 +2477,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2505,7 +2505,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -222,5 +222,5 @@ GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Invalidate-containers-via-callback.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Invalidate-containers-via-callback.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Invalidate-containers-via-callback.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Invalidate-containers-via-callback.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From bc240cf9d9401914b2685b66f21af86aca21bccb Mon Sep 17 00:00:00 2001 +From 790f8208a4873a5d172d7c11a36477e9a6b8e7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 18:44:48 +0100 Subject: wined3d: Invalidate containers via callback. @@ -13,10 +13,10 @@ 6 files changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index ba4ed5d..638c9b9 100644 +index 1e66cae..8aac5cb 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1161,6 +1161,11 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou +@@ -1188,6 +1188,11 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou return WINED3D_OK; } @@ -28,7 +28,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = { buffer_resource_incref, -@@ -1168,6 +1173,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = +@@ -1195,6 +1200,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = buffer_unload, buffer_resource_sub_resource_map, buffer_resource_sub_resource_unmap, @@ -37,10 +37,10 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2a42535..c259eba 100644 +index c4a3a7b..39346b5 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -474,4 +474,6 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -484,4 +484,6 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); resource->locations &= ~location; TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); @@ -48,10 +48,10 @@ + resource->resource_ops->resource_location_invalidated(resource, location); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0d95db3..f5bc72c 100644 +index e286384..c4b9cac 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1220,6 +1220,11 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -1222,6 +1222,11 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso return WINED3DERR_INVALIDCALL; } @@ -63,7 +63,7 @@ static const struct wined3d_resource_ops surface_resource_ops = { surface_resource_incref, -@@ -1227,6 +1232,7 @@ static const struct wined3d_resource_ops surface_resource_ops = +@@ -1229,6 +1234,7 @@ static const struct wined3d_resource_ops surface_resource_ops = surface_unload, surface_resource_sub_resource_map, surface_resource_sub_resource_unmap, @@ -72,10 +72,10 @@ static const struct wined3d_surface_ops surface_ops = diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 2e5276a..520647d 100644 +index 72f00fd..82ddeeb 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -978,6 +978,11 @@ static HRESULT texture2d_resource_sub_resource_unmap(struct wined3d_resource *re +@@ -938,6 +938,11 @@ static HRESULT texture2d_resource_sub_resource_unmap(struct wined3d_resource *re return wined3d_surface_unmap(surface_from_resource(sub_resource)); } @@ -87,19 +87,19 @@ static const struct wined3d_resource_ops texture2d_resource_ops = { texture_resource_incref, -@@ -985,6 +990,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops = +@@ -945,6 +950,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops = wined3d_texture_unload, texture2d_resource_sub_resource_map, texture2d_resource_sub_resource_unmap, + wined3d_texture_load_location_invalidated, }; - static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, + static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index eefdb06..f150795 100644 +index b3b2fe2..00b9814 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -604,10 +604,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -601,10 +601,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -110,7 +110,7 @@ volume->resource.map_count++; -@@ -675,6 +672,14 @@ static HRESULT volume_resource_sub_resource_unmap(struct wined3d_resource *resou +@@ -672,6 +669,14 @@ static HRESULT volume_resource_sub_resource_unmap(struct wined3d_resource *resou return WINED3DERR_INVALIDCALL; } @@ -125,7 +125,7 @@ static const struct wined3d_resource_ops volume_resource_ops = { volume_resource_incref, -@@ -682,6 +687,7 @@ static const struct wined3d_resource_ops volume_resource_ops = +@@ -679,6 +684,7 @@ static const struct wined3d_resource_ops volume_resource_ops = volume_unload, volume_resource_sub_resource_map, volume_resource_sub_resource_unmap, @@ -134,10 +134,10 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 429a093..53e9fe9 100644 +index a282b95..dc24c36 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2159,6 +2159,7 @@ struct wined3d_resource_ops +@@ -2250,6 +2250,7 @@ struct wined3d_resource_ops HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx); @@ -146,5 +146,5 @@ struct wined3d_resource -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From cea59537439aaf4e67ad4c2f9a9eadd1d8e70c11 Mon Sep 17 00:00:00 2001 +From 03998dcf5391b8b5da7b8cecbfe2ac6b82c77502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 4 Jan 2014 01:02:15 +0100 Subject: wined3d: Remove surface_invalidate_location. @@ -8,17 +8,17 @@ dlls/wined3d/context.c | 2 +- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 47 ++++++++++++++++----------------------- - dlls/wined3d/swapchain.c | 6 ++--- - dlls/wined3d/texture.c | 6 ++--- + dlls/wined3d/surface.c | 43 ++++++++++++++++----------------------- + dlls/wined3d/swapchain.c | 6 +++--- + dlls/wined3d/texture.c | 10 ++++----- dlls/wined3d/wined3d_private.h | 1 - 8 files changed, 29 insertions(+), 41 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index e22b558..c2a6a96 100644 +index 60d2560..eb09795 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -7895,7 +7895,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ +@@ -7919,7 +7919,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ context_release(context); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -26,12 +26,12 @@ + wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); } - static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, + static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 1e357e7..230946d 100644 +index 490c20f..9408cd9 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -3311,7 +3311,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d +@@ -3322,7 +3322,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -41,7 +41,7 @@ } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index bacd887..a9ac2ca 100644 +index 3cfff6e..1f061fd 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -399,7 +399,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -53,7 +53,7 @@ } } -@@ -4065,7 +4065,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4140,7 +4140,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str context_release(context); wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -76,7 +76,7 @@ else { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 728b4b2..374b1da 100644 +index c4b9cac..b292adc 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -597,7 +597,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) @@ -88,7 +88,7 @@ } static BOOL surface_use_pbo(const struct wined3d_surface *surface) -@@ -1095,7 +1095,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win +@@ -1111,7 +1111,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win checkGLcall("glDeleteBuffers(1, &surface->pbo)"); surface->pbo = 0; @@ -97,7 +97,7 @@ } static ULONG surface_resource_incref(struct wined3d_resource *resource) -@@ -1135,21 +1135,21 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1159,21 +1159,21 @@ static void surface_unload(struct wined3d_resource *resource) if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL) { wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); @@ -122,7 +122,7 @@ } /* Destroy PBOs, but load them into real sysmem before */ -@@ -1200,7 +1200,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -1224,7 +1224,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { @@ -134,7 +134,7 @@ } static const struct wined3d_resource_ops surface_resource_ops = -@@ -1678,7 +1681,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1708,7 +1711,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P context_release(context); wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -143,7 +143,7 @@ return WINED3D_OK; } -@@ -2678,7 +2681,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2677,7 +2680,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -152,25 +152,7 @@ switch (surface->resource.map_binding) { -@@ -2788,7 +2791,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - } - - surface_load_location(surface, context, WINED3D_LOCATION_DIB); -- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); -+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); - - if (context) - context_release(context); -@@ -2837,7 +2840,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - context = context_acquire(device, NULL); - - surface_load_location(surface, context, surface->resource.map_binding); -- surface_invalidate_location(surface, WINED3D_LOCATION_DIB); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); - if (context) - context_release(context); - } -@@ -3144,7 +3147,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3069,7 +3072,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -179,7 +161,7 @@ } /* Uses the hardware to stretch and flip the image */ -@@ -3212,7 +3215,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3137,7 +3140,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -188,7 +170,7 @@ } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3417,7 +3420,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3342,7 +3345,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -197,7 +179,7 @@ } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3894,18 +3897,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3836,18 +3839,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -216,7 +198,7 @@ static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -4472,7 +4463,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl +@@ -4395,7 +4386,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -225,7 +207,7 @@ } const struct blit_shader ffp_blit = { -@@ -5458,7 +5449,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5373,7 +5364,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst context_release(context); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -234,7 +216,7 @@ return WINED3D_OK; } -@@ -5581,7 +5572,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5492,7 +5483,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text { wined3d_resource_free_sysmem(&surface->resource); wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); @@ -244,7 +226,7 @@ return hr; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 68f12e5..2797067 100644 +index a97d1f7..a054c05 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -526,7 +526,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT @@ -275,7 +257,7 @@ /* MSDN says we're only allowed a single fullscreen swapchain per device, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 8f4c625..b6d21cb 100644 +index 535159a..da1bbbb 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -776,7 +776,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -298,11 +280,29 @@ } static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) +@@ -1560,7 +1558,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + } + + surface_load_location(surface, context, WINED3D_LOCATION_DIB); +- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); + + if (context) + context_release(context); +@@ -1623,7 +1621,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign + context = context_acquire(device, NULL); + + surface_load_location(surface, context, surface->resource.map_binding); +- surface_invalidate_location(surface, WINED3D_LOCATION_DIB); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); + if (context) + context_release(context); + } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0a10b6b..ac43834 100644 +index dc24c36..428eadd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2460,7 +2460,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, +@@ -2544,7 +2544,6 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface) DECLSPEC_HID GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -311,5 +311,5 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-load_location-into-the-resource.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-load_location-into-the-resource.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-load_location-into-the-resource.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-load_location-into-the-resource.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From baafba4da7e88b445e043b45fd1b852c7e0a1f61 Mon Sep 17 00:00:00 2001 +From 9508926776cb6d94f7d184fae9642a379f4ee7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:47:01 +0200 Subject: wined3d: Move load_location into the resource. @@ -16,10 +16,10 @@ 6 files changed, 91 insertions(+), 36 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 638c9b9..e1bd034 100644 +index 8aac5cb..4e91176 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1166,6 +1166,13 @@ static void wined3d_buffer_location_invalidated(struct wined3d_resource *resourc +@@ -1193,6 +1193,13 @@ static void wined3d_buffer_location_invalidated(struct wined3d_resource *resourc ERR("Not yet implemented.\n"); } @@ -33,7 +33,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = { buffer_resource_incref, -@@ -1174,6 +1181,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = +@@ -1201,6 +1208,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = buffer_resource_sub_resource_map, buffer_resource_sub_resource_unmap, wined3d_buffer_location_invalidated, @@ -42,10 +42,10 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index c259eba..bff4997 100644 +index 39346b5..d1f9fd9 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -477,3 +477,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -487,3 +487,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO resource->resource_ops->resource_location_invalidated(resource, location); } @@ -100,10 +100,10 @@ + resource->resource_ops->resource_load_location(resource, context, location); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 34f589b..fed3aaf 100644 +index 146d647..791f351 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1228,6 +1228,13 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour +@@ -1230,6 +1230,13 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour wined3d_texture_set_dirty(surface->container); } @@ -117,7 +117,7 @@ static const struct wined3d_resource_ops surface_resource_ops = { surface_resource_incref, -@@ -1236,6 +1243,7 @@ static const struct wined3d_resource_ops surface_resource_ops = +@@ -1238,6 +1245,7 @@ static const struct wined3d_resource_ops surface_resource_ops = surface_resource_sub_resource_map, surface_resource_sub_resource_unmap, wined3d_surface_location_invalidated, @@ -125,7 +125,7 @@ }; static const struct wined3d_surface_ops surface_ops = -@@ -3941,7 +3949,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3839,7 +3847,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -134,7 +134,7 @@ { switch (location) { -@@ -4273,7 +4281,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4178,7 +4186,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte if (WARN_ON(d3d_surface)) { @@ -144,10 +144,10 @@ WARN("Operation requires %#x access, but surface only has %#x.\n", required_access, surface->resource.access_flags); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index e2df18d..7650f36 100644 +index 377d1bc..bcdf96f 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -981,6 +981,13 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r +@@ -941,6 +941,13 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r ERR("Should not be called on textures.\n"); } @@ -161,16 +161,16 @@ static const struct wined3d_resource_ops texture2d_resource_ops = { texture_resource_incref, -@@ -989,6 +996,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops = +@@ -949,6 +956,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops = texture2d_resource_sub_resource_map, texture2d_resource_sub_resource_unmap, wined3d_texture_load_location_invalidated, + wined3d_texture_load_location, }; - static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, + static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index f150795..82bc3b0 100644 +index 00b9814..457548e 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -137,27 +137,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) @@ -201,7 +201,7 @@ /* Context activation is done by the caller. */ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, struct wined3d_context *context, BOOL dest_is_srgb) -@@ -197,21 +176,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) +@@ -195,21 +174,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) return TRUE; } @@ -227,7 +227,7 @@ if ((volume->resource.access_flags & required_access) != required_access) { ERR("Operation requires %#x access, but volume only has %#x.\n", -@@ -337,7 +312,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -335,7 +310,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -236,7 +236,7 @@ srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -396,7 +371,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -394,7 +369,7 @@ static void volume_unload(struct wined3d_resource *resource) if (volume_prepare_system_memory(volume)) { context = context_acquire(device, NULL); @@ -245,7 +245,7 @@ context_release(context); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); } -@@ -519,7 +494,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -516,7 +491,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, if (flags & WINED3D_MAP_DISCARD) wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); else @@ -254,7 +254,7 @@ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); -@@ -557,7 +532,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -554,7 +529,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) { context = context_acquire(device, NULL); @@ -263,7 +263,7 @@ context_release(context); } base_memory = volume->resource.heap_memory; -@@ -688,6 +663,7 @@ static const struct wined3d_resource_ops volume_resource_ops = +@@ -685,6 +660,7 @@ static const struct wined3d_resource_ops volume_resource_ops = volume_resource_sub_resource_map, volume_resource_sub_resource_unmap, wined3d_volume_location_invalidated, @@ -272,10 +272,10 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4282508..e970088 100644 +index bcd6589..7e60c22 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2160,6 +2160,8 @@ struct wined3d_resource_ops +@@ -2251,6 +2251,8 @@ struct wined3d_resource_ops struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx); void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); @@ -284,7 +284,7 @@ }; struct wined3d_resource -@@ -2212,17 +2214,20 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2303,17 +2305,20 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -307,5 +307,5 @@ /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From b7612231d57a3c77fc57a24690d14d118791824a Mon Sep 17 00:00:00 2001 +From 5c7c9517db811764d7c14ec2fb10ee4ded9ea4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:33:17 +0100 Subject: wined3d: Replace surface_load_location with resource_load_location. @@ -8,17 +8,17 @@ dlls/wined3d/context.c | 2 +- dlls/wined3d/device.c | 4 +- dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 113 +++++++++++++---------------------------- + dlls/wined3d/surface.c | 109 +++++++++++++---------------------------- dlls/wined3d/swapchain.c | 8 +-- - dlls/wined3d/texture.c | 2 +- + dlls/wined3d/texture.c | 6 +-- dlls/wined3d/wined3d_private.h | 2 - 7 files changed, 45 insertions(+), 88 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 230946d..1325dc9 100644 +index 9408cd9..0d9de90 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2292,7 +2292,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, +@@ -2293,7 +2293,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -28,7 +28,7 @@ swapchain_update_draw_bindings(swapchain); context_set_render_offscreen(context, TRUE); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a9ac2ca..0a07197 100644 +index 0a5b48d..ce31e25 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -324,7 +324,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -40,7 +40,7 @@ else wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding); } -@@ -4056,7 +4056,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4123,7 +4123,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else @@ -63,7 +63,7 @@ } else diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 032d284..2d87c08 100644 +index 078befb..1721c6e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -735,7 +735,7 @@ static void surface_unmap(struct wined3d_surface *surface) @@ -99,7 +99,7 @@ else wined3d_surface_prepare(dst_surface, old_ctx, dst_location); -@@ -1148,7 +1148,7 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1156,7 +1156,7 @@ static void surface_unload(struct wined3d_resource *resource) else { surface_prepare_map_memory(surface); @@ -108,7 +108,7 @@ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } -@@ -1206,24 +1206,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour +@@ -1214,24 +1214,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour wined3d_texture_set_dirty(surface->container); } @@ -133,7 +133,7 @@ static const struct wined3d_surface_ops surface_ops = { surface_private_setup, -@@ -1677,7 +1659,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1691,7 +1673,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -142,7 +142,7 @@ wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->resource.locations); -@@ -1810,7 +1792,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1824,7 +1806,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte } TRACE("Reloading because surface is dirty.\n"); @@ -151,7 +151,7 @@ surface_evict_sysmem(surface); } -@@ -2683,7 +2665,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2666,7 +2648,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ if (surface->resource.device->d3d_initialized) context = context_acquire(surface->resource.device, NULL); @@ -160,25 +160,7 @@ if (context) context_release(context); } -@@ -2798,7 +2780,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -- surface_load_location(surface, context, WINED3D_LOCATION_DIB); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); - wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); - - if (context) -@@ -2847,7 +2829,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - if (device->d3d_initialized) - context = context_acquire(device, NULL); - -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); - if (context) - context_release(context); -@@ -3484,8 +3466,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3393,8 +3375,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use @@ -189,7 +171,7 @@ wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3905,29 +3887,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3814,29 +3796,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -219,7 +201,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) { struct wined3d_device *device = surface->resource.device; -@@ -3977,7 +3936,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -3886,7 +3845,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, } if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) @@ -228,7 +210,7 @@ /* Download the surface to system memory. */ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4013,7 +3972,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -3922,7 +3881,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -237,7 +219,7 @@ surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -4086,7 +4045,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3995,7 +3954,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); surface_prepare_map_memory(surface); @@ -246,7 +228,7 @@ } } else -@@ -4097,7 +4056,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4006,7 +3965,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); surface_prepare_map_memory(surface); @@ -255,7 +237,7 @@ } } -@@ -4106,7 +4065,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4015,7 +3974,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ surface_prepare_system_memory(surface); @@ -264,7 +246,7 @@ } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4132,7 +4091,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4041,7 +4000,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_prepare_map_memory(surface); @@ -273,7 +255,7 @@ surface_remove_pbo(surface, gl_info); } -@@ -4207,9 +4166,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi +@@ -4116,9 +4075,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi surface, src_location, &rect, surface, dst_location, &rect); } @@ -287,7 +269,7 @@ HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4236,20 +4197,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4145,20 +4106,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte } } @@ -308,7 +290,7 @@ if (!surface->resource.locations) { ERR("Surface %p does not have any up to date location.\n", surface); -@@ -5413,7 +5360,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5313,7 +5260,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -318,8 +300,8 @@ context_release(context); } return WINED3D_OK; -@@ -5487,6 +5435,17 @@ cpu: - return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); +@@ -5383,6 +5331,17 @@ cpu: + return surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); } +static const struct wined3d_resource_ops surface_resource_ops = @@ -337,7 +319,7 @@ const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) { diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 5e2c515..7463ae2 100644 +index 4009dac..346129e 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -315,7 +315,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, @@ -376,7 +358,7 @@ src_dc = front->hDC; window = swapchain->win_handle; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 71f1c47..e05238d 100644 +index 49bc782..dd3a600 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -774,7 +774,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -388,19 +370,37 @@ context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } +@@ -1565,7 +1565,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +- surface_load_location(surface, context, WINED3D_LOCATION_DIB); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); + wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); + + if (context) +@@ -1628,7 +1628,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign + if (device->d3d_initialized) + context = context_acquire(device, NULL); + +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); + if (context) + context_release(context); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6fa239e..a5af340 100644 +index 0ef35dd..c9985c0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2468,8 +2468,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, +@@ -2551,8 +2551,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; -void surface_load_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, - DWORD location) DECLSPEC_HIDDEN; -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Remove-surface-pbo.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Remove-surface-pbo.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Remove-surface-pbo.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Remove-surface-pbo.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,15 +1,16 @@ -From 2e105cc77b4f86b1dc044e3dc174a61df5d30a43 Mon Sep 17 00:00:00 2001 +From 1c6393b228a4764d3b7383fea540948ba147e009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:25:48 +0100 Subject: wined3d: Remove surface->pbo. --- - dlls/wined3d/surface.c | 36 ++++++++++++++++++------------------ + dlls/wined3d/surface.c | 34 +++++++++++++++++----------------- + dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 2 -- - 2 files changed, 18 insertions(+), 20 deletions(-) + 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 58d825c..4cdd104 100644 +index 604a79c..75abc0a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -46,7 +46,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -70,7 +71,7 @@ checkGLcall("glBindBuffer"); GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, -@@ -735,7 +735,7 @@ static void surface_unmap(struct wined3d_surface *surface) +@@ -711,7 +711,7 @@ static void surface_unmap(struct wined3d_surface *surface) context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -79,7 +80,7 @@ GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("glUnmapBuffer"); -@@ -1127,10 +1127,10 @@ HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *sur +@@ -1091,10 +1091,10 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW /* Context activation is done by the caller. */ static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { @@ -93,7 +94,7 @@ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); } -@@ -1187,7 +1187,7 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1161,7 +1161,7 @@ static void surface_unload(struct wined3d_resource *resource) } /* Destroy PBOs, but load them into real sysmem before */ @@ -102,7 +103,7 @@ surface_remove_pbo(surface, gl_info); /* Destroy fbo render buffers. This is needed for implicit render targets, for -@@ -2753,7 +2753,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2674,7 +2674,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -111,16 +112,7 @@ base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("map PBO"); -@@ -2844,7 +2844,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -- || surface->pbo)) -+ || surface->resource.buffer_object)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -@@ -4180,7 +4180,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3990,7 +3990,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -129,11 +121,24 @@ { TRACE("Removing the pbo attached to surface %p.\n", surface); +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index dd3a600..d41b79e 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1561,7 +1561,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +- || surface->pbo)) ++ || surface->resource.buffer_object)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f948f73..839dc7f 100644 +index 3bbe506..7aba4a7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2390,8 +2390,6 @@ struct wined3d_surface +@@ -2468,8 +2468,6 @@ struct wined3d_surface UINT pow2Width; UINT pow2Height; @@ -143,5 +148,5 @@ GLuint rb_resolved; GLenum texture_target; -- -2.5.1 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 0c74d61fdaa16fbb70f443f6863d864024b8e615 Mon Sep 17 00:00:00 2001 +From cfcfa390db417008fc6824074bc396e0cfa85190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:30:59 +0100 Subject: wined3d: Use resource buffer mapping facilities in surfaces. @@ -9,10 +9,10 @@ 2 files changed, 23 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 5f0a98e..dda77f0 100644 +index 98653cd..3d5b574 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -544,6 +544,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -570,6 +570,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, case WINED3D_LOCATION_SYSMEM: return resource->heap_memory; @@ -25,7 +25,7 @@ default: ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return NULL; -@@ -566,6 +572,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -592,6 +598,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, return; case WINED3D_LOCATION_SYSMEM: @@ -35,10 +35,10 @@ default: diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 62f74bd..583fa59 100644 +index 043e257..9b96625 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) +@@ -692,36 +692,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) static void surface_unmap(struct wined3d_surface *surface) { @@ -75,16 +75,16 @@ if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) { TRACE("Not dirtified, nothing to do.\n"); -@@ -2623,6 +2597,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2585,6 +2559,8 @@ do { \ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; TRACE("surface %p.\n", surface); if (!surface->resource.map_count) -@@ -2632,6 +2608,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +@@ -2594,6 +2570,12 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) } --surface->resource.map_count; @@ -97,7 +97,7 @@ surface->surface_ops->surface_unmap(surface); return WINED3D_OK; -@@ -2643,8 +2625,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2605,8 +2587,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; struct wined3d_device *device = surface->resource.device; @@ -106,8 +106,8 @@ + struct wined3d_context *context = NULL; BYTE *base_memory; - TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", -@@ -2686,6 +2667,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + TRACE("surface %p, map_desc %p, box %s, flags %#x.\n", +@@ -2648,6 +2629,9 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } } @@ -117,7 +117,7 @@ surface_prepare_map_memory(surface); if (flags & WINED3D_MAP_DISCARD) { -@@ -2695,51 +2679,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2657,51 +2641,19 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } else { @@ -149,12 +149,12 @@ - case WINED3D_LOCATION_DIB: - base_memory = surface->resource.bitmap_data; - break; -- ++ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); + - case WINED3D_LOCATION_BUFFER: - context = context_acquire(device, NULL); - gl_info = context->gl_info; -+ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); - +- - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); - base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); @@ -173,5 +173,5 @@ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; -- -2.6.0 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Move-check_block_align-to-resource.c.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Move-check_block_align-to-resource.c.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Move-check_block_align-to-resource.c.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Move-check_block_align-to-resource.c.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 412b76a791b762e2ce9b5da8587a1595f3137c0f Mon Sep 17 00:00:00 2001 +From e7bd14cde60905b56bce90d9ec660b560f67a2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:55:00 +0200 Subject: wined3d: Move check_block_align to resource.c @@ -11,10 +11,10 @@ 4 files changed, 32 insertions(+), 46 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 5e46b84..b47536a 100644 +index 01070a6..b95e17a 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -705,3 +705,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -715,3 +715,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru return FALSE; } } @@ -47,10 +47,10 @@ + return TRUE; +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6630ce5..7ac4867 100644 +index 84975ba..0aa8115 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1448,29 +1448,13 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w +@@ -1472,29 +1472,13 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { @@ -82,7 +82,7 @@ static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index ce702d2..fde518a 100644 +index b0bcd16..e598e1b 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -343,34 +343,6 @@ static void volume_unload(struct wined3d_resource *resource) @@ -127,13 +127,13 @@ - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !wined3d_resource_check_block_align(&volume->resource, box)) { - WARN("Map box is misaligned for %ux%u blocks.\n", - format->block_width, format->block_height); + WARN("Map box %s is misaligned for %ux%u blocks.\n", + debug_box(box), format->block_width, format->block_height); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6402c42..8d49949 100644 +index 8b88406..7c3b82f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2241,6 +2241,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2308,6 +2308,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -143,5 +143,5 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.6.4 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 42b6ba4bb832d0191cda985e2701c61626c103b6 Mon Sep 17 00:00:00 2001 +From 1ad9f7310d40524027fbb81d998bf8eb1a5dd067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:49:21 +0100 Subject: wined3d: Use resource facilities to destroy PBOs. @@ -10,10 +10,10 @@ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 882491c..e10ba41 100644 +index 2ad66de..362da3d 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -223,7 +223,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -233,7 +233,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * return WINED3D_OK; } @@ -23,10 +23,10 @@ struct wined3d_context *context = context_acquire(resource->device, NULL); const struct wined3d_gl_info *gl_info = context->gl_info; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 273da13..8ae36af 100644 +index 91f1229..83c5ad4 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -958,16 +958,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW +@@ -939,16 +939,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW return WINED3D_OK; } @@ -42,8 +42,8 @@ - static ULONG surface_resource_incref(struct wined3d_resource *resource) { - return wined3d_surface_incref(surface_from_resource(resource)); -@@ -1013,10 +1003,6 @@ static void surface_unload(struct wined3d_resource *resource) + struct wined3d_surface *surface = surface_from_resource(resource); +@@ -996,10 +986,6 @@ static void surface_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } @@ -54,7 +54,7 @@ /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface * before calling _Reset -@@ -3949,7 +3935,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3918,7 +3904,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); @@ -65,10 +65,10 @@ wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4fd8b62..50fc36b 100644 +index 8864b3b..9813d84 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2216,6 +2216,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; +@@ -2261,6 +2261,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, const struct wined3d_box *box) DECLSPEC_HIDDEN; @@ -77,5 +77,5 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.6.1 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Move-most-of-volume_map-to-resource.c.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Move-most-of-volume_map-to-resource.c.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Move-most-of-volume_map-to-resource.c.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Move-most-of-volume_map-to-resource.c.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From fe66d6b8129533d88849527339ca52a19e343509 Mon Sep 17 00:00:00 2001 +From 50d846247350c8fbc9823769337016e6f800064e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 17:51:38 +0200 Subject: wined3d: Move most of volume_map to resource.c @@ -7,16 +7,16 @@ sysmem blits. Surfaces and volume have different block alignment and boundary check behaviours. --- - dlls/wined3d/resource.c | 115 +++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/volume.c | 101 +++--------------------------------- + dlls/wined3d/resource.c | 111 +++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/volume.c | 97 +++-------------------------------- dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 124 insertions(+), 95 deletions(-) + 3 files changed, 120 insertions(+), 91 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2e06f21..e5af445 100644 +index 2a73c0e..a08631f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -765,3 +765,118 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, +@@ -791,3 +791,114 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, return TRUE; } @@ -30,8 +30,8 @@ + const struct wined3d_format *format = resource->format; + const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D]; + -+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -+ resource, map_desc, box, flags); ++ TRACE("resource %p, map_desc %p, box %s, flags %#x.\n", ++ resource, map_desc, debug_box(box), flags); + + if (resource->map_count) + { @@ -76,14 +76,10 @@ + + if (!box) + { -+ TRACE("No box supplied - all is ok\n"); + map_desc->data = base_memory; + } + else + { -+ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", -+ box, box->left, box->top, box->right, box->bottom, box->front, box->back); -+ + if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + { + /* Compressed textures are block based, so calculate the offset of @@ -136,10 +132,10 @@ + return WINED3D_OK; +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 38fe516..08dbecb 100644 +index e598e1b..925c833 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -392,26 +392,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -368,26 +368,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol HRESULT wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -150,8 +146,8 @@ const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; -- TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", -- volume, map_desc, box, flags); +- TRACE("volume %p, map_desc %p, box %s, flags %#x.\n", +- volume, map_desc, debug_box(box), flags); - map_desc->data = NULL; if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) @@ -167,7 +163,7 @@ if (!wined3d_volume_check_box_dimensions(volume, box)) { WARN("Map box is invalid.\n"); -@@ -424,95 +414,16 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -400,91 +390,16 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, return WINED3DERR_INVALIDCALL; } @@ -204,14 +200,10 @@ - - if (!box) - { -- TRACE("No box supplied - all is ok\n"); - map_desc->data = base_memory; - } - else - { -- TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", -- box, box->left, box->top, box->right, box->bottom, box->front, box->back); -- - if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) - { - /* Compressed textures are block based, so calculate the offset of @@ -269,10 +261,10 @@ static ULONG volume_resource_incref(struct wined3d_resource *resource) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 949b27b..ac6cd4e 100644 +index 647abec..4fc4784 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2218,12 +2218,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -2323,12 +2323,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -289,5 +281,5 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -- -2.6.0 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 4ca448b9c9fb4ed0e94eaa82b98d7677d486a92c Mon Sep 17 00:00:00 2001 +From 90e387618c439a928d4a7cebc299415f4d1e381e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 18:00:23 +0200 Subject: wined3d: Use resource_map for surface_map. @@ -10,10 +10,10 @@ 3 files changed, 18 insertions(+), 90 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7743a40..74cb6c1 100644 +index a08631f..8d372b9 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -883,7 +883,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +@@ -889,7 +889,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) if (!resource->map_count) { WARN("Trying to unlock an unlocked resource %p.\n", resource); @@ -23,12 +23,12 @@ if (device->d3d_initialized) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f00f6c3..3f7f54c 100644 +index 8392614..4d3b47f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2428,28 +2428,18 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2381,28 +2381,18 @@ do { \ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; @@ -59,8 +59,8 @@ + return hr; } - HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -@@ -2457,18 +2447,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, +@@ -2410,18 +2400,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -68,8 +68,8 @@ - struct wined3d_context *context = NULL; - BYTE *base_memory; - -- TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", -- surface, map_desc, box, flags); +- TRACE("surface %p, map_desc %p, box %s, flags %#x.\n", +- surface, map_desc, debug_box(box), flags); - - if (surface->resource.map_count) - { @@ -79,7 +79,7 @@ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box && !surface_check_block_align(surface, box)) -@@ -2480,11 +2458,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2433,11 +2411,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ return WINED3DERR_INVALIDCALL; } @@ -91,7 +91,7 @@ /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2500,72 +2473,22 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2453,72 +2426,22 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } } @@ -169,12 +169,12 @@ + return wined3d_resource_map(&surface->resource, map_desc, box, flags); } - HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + static void read_from_framebuffer(struct wined3d_surface *surface, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index a237bf6..0e97cd1 100644 +index 925c833..fc43958 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -402,7 +402,12 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -399,7 +399,12 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -189,5 +189,5 @@ static ULONG volume_resource_incref(struct wined3d_resource *resource) -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 68280056e300f90beae6bac338aa94ebacaa4bfc Mon Sep 17 00:00:00 2001 +From 0846dc3670f5f7520a544570627283a4b4e9ced9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 20 Dec 2012 13:09:17 +0100 Subject: wined3d: Move the framebuffer into wined3d_state @@ -20,7 +20,7 @@ 13 files changed, 172 insertions(+), 127 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 9a882cc..df89a05 100644 +index b2ddf55..31f005a 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -684,7 +684,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, @@ -42,10 +42,10 @@ } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 6d08df9..104172f 100644 +index 0d9de90..cb40148 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1506,6 +1506,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, +@@ -1511,6 +1511,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } @@ -58,15 +58,15 @@ /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -1833,6 +1839,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, - out: +@@ -1840,6 +1846,7 @@ out: + if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); + HeapFree(GetProcessHeap(), 0, ret->current_fb.render_targets); HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1867,6 +1874,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont +@@ -1874,6 +1881,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -74,7 +74,7 @@ HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2378,7 +2386,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2385,7 +2393,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i; @@ -83,7 +83,7 @@ || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2423,6 +2431,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2430,6 +2438,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win rt_mask = context_generate_rt_mask_no_fbo(device, rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } @@ -92,7 +92,7 @@ } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2473,7 +2483,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2488,7 +2498,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) { const struct wined3d_state *state = &device->state; @@ -101,7 +101,7 @@ struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; DWORD rt_mask, rt_mask_bits; unsigned int i; -@@ -2503,7 +2513,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -2518,7 +2528,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_device *device = context->swapchain->device; @@ -110,7 +110,7 @@ DWORD rt_mask = find_draw_buffers_mask(context, device); DWORD *cur_mask; -@@ -2535,6 +2545,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat +@@ -2550,6 +2560,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -119,7 +119,7 @@ } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -3159,7 +3171,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de +@@ -3193,7 +3205,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de { const struct wined3d_state *state = &device->state; const struct StateEntry *state_table = context->state_table; @@ -205,10 +205,10 @@ HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a5c1e59..42c5d14 100644 +index 5e02b97..9ea1d67 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -865,7 +865,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi +@@ -939,7 +939,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; unsigned int i; @@ -217,7 +217,7 @@ { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -883,7 +883,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -957,7 +957,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc) { static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -225,7 +225,7 @@ struct wined3d_swapchain *swapchain = NULL; struct wined3d_context *context; DWORD clear_flags = 0; -@@ -896,9 +895,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -970,9 +969,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, if (device->wined3d->flags & WINED3D_NO3D) return WINED3DERR_INVALIDCALL; @@ -235,7 +235,7 @@ if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -986,7 +982,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1061,7 +1057,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -243,7 +243,7 @@ HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1065,8 +1060,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1140,8 +1135,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (device->cursor_texture) wined3d_texture_decref(device->cursor_texture); @@ -269,7 +269,7 @@ /* Unload resources */ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { -@@ -1097,37 +1109,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1173,37 +1185,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) * destroy the context. */ context_release(context); @@ -307,7 +307,7 @@ if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1145,9 +1126,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1221,9 +1202,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -317,7 +317,7 @@ device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1943,7 +1921,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -2021,7 +1999,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -325,8 +325,8 @@ + if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil))) return; - wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -3298,6 +3276,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) + SetRect(&dst_rect, 0, 0, surface->resource.width, surface->resource.height); +@@ -3378,6 +3356,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -335,7 +335,7 @@ TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3309,7 +3289,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3389,7 +3369,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -344,7 +344,7 @@ if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3318,8 +3298,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3398,8 +3378,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -355,7 +355,7 @@ { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3682,8 +3662,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3749,8 +3729,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -366,7 +366,7 @@ if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -4065,20 +4045,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4172,20 +4152,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -390,7 +390,7 @@ TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4118,13 +4099,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4225,13 +4206,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -406,7 +406,7 @@ wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4136,18 +4117,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4243,18 +4224,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -428,7 +428,7 @@ wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4511,10 +4493,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4620,10 +4602,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -440,7 +440,7 @@ { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4523,6 +4504,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4632,6 +4613,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -452,7 +452,7 @@ if (device->onscreen_depth_stencil) { wined3d_texture_decref(device->onscreen_depth_stencil->container); -@@ -4741,7 +4727,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4850,7 +4836,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -461,7 +461,7 @@ &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4750,22 +4736,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4859,22 +4845,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } else if (device->back_buffer_view) { @@ -489,7 +489,7 @@ wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4853,17 +4838,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -4962,17 +4947,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -511,7 +511,7 @@ } } break; -@@ -5026,7 +5011,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5134,7 +5119,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -521,7 +521,7 @@ { ERR("Failed to initialize device state, hr %#x.\n", hr); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 4b01b7d..7e3a7f7 100644 +index 0afeff9..4e66f01 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -611,7 +611,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co @@ -575,10 +575,10 @@ surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 44e7090..787f64a 100644 +index 1eb7e6d..56e4bb9 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1626,7 +1626,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -1627,7 +1627,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -588,10 +588,10 @@ const struct wined3d_shader_lconst *lconst; const char *prefix; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index c3a842e..ae3770d 100644 +index 140665e..cc18f88 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -2411,7 +2411,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -2451,7 +2451,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) { @@ -601,7 +601,7 @@ { static unsigned int warned = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 2be3cab..e789786 100644 +index 1d80fa0..b9263a7 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ @@ -788,10 +788,10 @@ if (FAILED(hr = stateblock_allocate_shader_constants(stateblock))) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index de8d6dc..db36a59 100644 +index 817ef6f..35bf399 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -3283,8 +3283,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3265,8 +3265,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -802,7 +802,7 @@ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index b826445..e1e705b 100644 +index dbf2c8b..73730cd 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -427,7 +427,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT @@ -815,10 +815,10 @@ struct wined3d_context *context; struct wined3d_surface *front; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 4ddfead..32519eb 100644 +index 28a3216..d28994e 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -3733,7 +3733,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w +@@ -3776,7 +3776,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w float y_offset = context->render_offscreen ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -827,7 +827,7 @@ state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? 2.0f : 0.0f; float z_offset = zenable ? -1.0f : 0.0f; -@@ -4325,7 +4325,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d +@@ -4357,7 +4357,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d unsigned int i; DWORD ttff; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; @@ -837,10 +837,10 @@ const struct wined3d_d3d_info *d3d_info = context->d3d_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 720eb3a..6a10ad7 100644 +index 6ae6072..df9d5fa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1149,6 +1149,36 @@ struct wined3d_timestamp_query +@@ -1176,6 +1176,36 @@ struct wined3d_timestamp_query void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; @@ -877,7 +877,7 @@ struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1163,6 +1193,7 @@ struct wined3d_context +@@ -1190,6 +1220,7 @@ struct wined3d_context DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -885,7 +885,7 @@ struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1264,12 +1295,6 @@ struct wined3d_context +@@ -1292,12 +1323,6 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -898,7 +898,7 @@ typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -1986,7 +2011,7 @@ struct wined3d_stream_state +@@ -2020,7 +2045,7 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -907,7 +907,7 @@ struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2092,7 +2117,6 @@ struct wined3d_device +@@ -2126,7 +2151,6 @@ struct wined3d_device struct wine_rb_tree samplers; /* Render Target Support */ @@ -915,7 +915,7 @@ struct wined3d_surface *onscreen_depth_stencil; struct wined3d_rendertarget_view *auto_depth_stencil_view; -@@ -2608,9 +2632,8 @@ struct wined3d_stateblock +@@ -2638,9 +2662,8 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -927,7 +927,7 @@ void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_cs_ops -@@ -2623,7 +2646,6 @@ struct wined3d_cs +@@ -2653,7 +2676,6 @@ struct wined3d_cs { const struct wined3d_cs_ops *ops; struct wined3d_device *device; @@ -936,5 +936,5 @@ size_t data_size; -- -2.6.2 +2.6.4 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-blits-through-the-command-stream.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-blits-through-the-command-stream.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-blits-through-the-command-stream.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-blits-through-the-command-stream.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From eb73b6b42378386ce8af3594094ad61cd2c61754 Mon Sep 17 00:00:00 2001 +From 5d8735b2ffacc388879177422898deffd32ef841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 29 Apr 2013 18:49:53 +0200 Subject: wined3d: Send blits through the command stream. @@ -7,13 +7,13 @@ between surface_blt and surface_blt_ugly isn't particularly nice. --- dlls/d3d9/tests/visual.c | 2 +- - dlls/wined3d/cs.c | 50 +++++++ - dlls/wined3d/surface.c | 309 +++++++++++++++++++++++------------------ + dlls/wined3d/cs.c | 50 ++++++++ + dlls/wined3d/surface.c | 260 +++++++++++++++++++++++------------------ dlls/wined3d/wined3d_private.h | 8 ++ - 4 files changed, 229 insertions(+), 140 deletions(-) + 4 files changed, 204 insertions(+), 116 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index 120d688..fadba7b 100644 +index 8b56dbe..ae4004a 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1339,7 +1339,7 @@ static void color_fill_test(void) @@ -122,32 +122,24 @@ { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3c1ba32..c437fb3 100644 +index 9fafb6b..dfe5c73 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4846,14 +4846,13 @@ const struct blit_shader cpu_blit = { +@@ -4857,7 +4857,7 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; --HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -- struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, +-HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, +void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, -+ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, + struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { - struct wined3d_swapchain *src_swapchain, *dst_swapchain; - struct wined3d_device *device = dst_surface->resource.device; - DWORD src_ds_flags, dst_ds_flags; -- RECT src_rect, dst_rect; - BOOL scale, convert; - - static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4865,111 +4864,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -4875,103 +4875,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; -- TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n", -- dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), +- TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", +- dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), - flags, fx, debug_d3dtexturefiltertype(filter)); - TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); - @@ -188,13 +180,11 @@ - return WINEDDERR_SURFACEBUSY; - } - -- surface_get_rect(dst_surface, dst_rect_in, &dst_rect); -- -- if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom -- || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 -- || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 -- || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 -- || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) +- if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom +- || dst_rect->left > dst_surface->resource.width || dst_rect->left < 0 +- || dst_rect->top > dst_surface->resource.height || dst_rect->top < 0 +- || dst_rect->right > dst_surface->resource.width || dst_rect->right < 0 +- || dst_rect->bottom > dst_surface->resource.height || dst_rect->bottom < 0) - { - WARN("The application gave us a bad destination rectangle.\n"); - return WINEDDERR_INVALIDRECT; @@ -202,22 +192,16 @@ - - if (src_surface) - { -- surface_get_rect(src_surface, src_rect_in, &src_rect); -- -- if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom -- || src_rect.left > src_surface->resource.width || src_rect.left < 0 -- || src_rect.top > src_surface->resource.height || src_rect.top < 0 -- || src_rect.right > src_surface->resource.width || src_rect.right < 0 -- || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) +- if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom +- || src_rect->left > src_surface->resource.width || src_rect->left < 0 +- || src_rect->top > src_surface->resource.height || src_rect->top < 0 +- || src_rect->right > src_surface->resource.width || src_rect->right < 0 +- || src_rect->bottom > src_surface->resource.height || src_rect->bottom < 0) - { -- WARN("Application gave us bad source rectangle for Blt.\n"); +- WARN("The application gave us a bad source rectangle.\n"); - return WINEDDERR_INVALIDRECT; - } - } -- else -- { -- memset(&src_rect, 0, sizeof(src_rect)); -- } - - if (!fx || !(fx->dwDDFX)) - flags &= ~WINEDDBLT_DDFX; @@ -254,27 +238,15 @@ if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5012,8 +4906,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - } - - scale = src_surface -- && (src_rect.right - src_rect.left != dst_rect.right - dst_rect.left -- || src_rect.bottom - src_rect.top != dst_rect.bottom - dst_rect.top); -+ && (src_rect->right - src_rect->left != dst_rect->right - dst_rect->left -+ || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); - convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; - - dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5033,22 +4927,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5035,22 +4938,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) - return WINED3DERR_INVALIDCALL; + return; -- if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, &dst_rect, depth))) + if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) - return WINED3D_OK; -+ if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) + return; } else @@ -286,37 +258,22 @@ - } - if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, -- &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect))) + src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) - return WINED3D_OK; -+ src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) + return; } } else -@@ -5079,8 +4967,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - palette, fx->u5.dwFillColor, &color)) +@@ -5082,7 +4979,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst goto fallback; -- if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) + if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) - return WINED3D_OK; -+ if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) + return; } else { -@@ -5112,9 +5000,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - TRACE("Not doing upload because of format conversion.\n"); - else - { -- POINT dst_point = {dst_rect.left, dst_rect.top}; -+ POINT dst_point = {dst_rect->left, dst_rect->top}; - -- if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) -+ if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) - { - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) - { -@@ -5123,7 +5011,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5125,7 +5022,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst dst_surface->container->resource.draw_binding); context_release(context); } @@ -325,7 +282,7 @@ } } } -@@ -5147,51 +5035,194 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5149,7 +5046,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -334,22 +291,7 @@ } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) -+ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) - { - struct wined3d_context *context; - TRACE("Using FBO blit.\n"); - - context = context_acquire(device, NULL); - surface_blt_fbo(device, context, filter, -- src_surface, src_surface->container->resource.draw_binding, &src_rect, -- dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); -+ src_surface, src_surface->container->resource.draw_binding, src_rect, -+ dst_surface, dst_surface->container->resource.draw_binding, dst_rect); - context_release(context); - +@@ -5168,7 +5065,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -358,16 +300,11 @@ } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); -+ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); - if (blitter) +@@ -5178,18 +5075,151 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst { blitter->blit_surface(device, blit_op, filter, src_surface, -- &src_rect, dst_surface, &dst_rect, color_key); + src_rect, dst_surface, dst_rect, color_key); - return WINED3D_OK; -+ src_rect, dst_surface, dst_rect, color_key); + return; } } @@ -375,7 +312,7 @@ fallback: /* Special cases for render targets. */ -- if (SUCCEEDED(surface_blt_special(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter))) +- if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) - return WINED3D_OK; + if ((dst_surface->resource.usage & WINED3DUSAGE_RENDERTARGET) + || (src_surface && (src_surface->resource.usage & WINED3DUSAGE_RENDERTARGET))) @@ -385,24 +322,19 @@ + } cpu: - - /* For the rest call the X11 surface implementation. For render targets - * this should be implemented OpenGL accelerated in surface_blt_special(), - * other blits are rather rare. */ -- return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); +- return surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); + surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); + return; +} + -+HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, ++HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, ++ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) +{ + struct wined3d_device *device = dst_surface->resource.device; -+ RECT src_rect, dst_rect; + -+ TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n", -+ dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), ++ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", ++ dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), + flags, fx, debug_d3dtexturefiltertype(filter)); + TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); + @@ -456,13 +388,11 @@ + } + } + -+ surface_get_rect(dst_surface, dst_rect_in, &dst_rect); -+ -+ if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom -+ || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 -+ || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 -+ || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 -+ || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) ++ if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom ++ || dst_rect->left > dst_surface->resource.width || dst_rect->left < 0 ++ || dst_rect->top > dst_surface->resource.height || dst_rect->top < 0 ++ || dst_rect->right > dst_surface->resource.width || dst_rect->right < 0 ++ || dst_rect->bottom > dst_surface->resource.height || dst_rect->bottom < 0) + { + WARN("The application gave us a bad destination rectangle.\n"); + return WINEDDERR_INVALIDRECT; @@ -472,15 +402,13 @@ + { + DWORD src_ds_flags, dst_ds_flags; + -+ surface_get_rect(src_surface, src_rect_in, &src_rect); -+ -+ if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom -+ || src_rect.left > src_surface->resource.width || src_rect.left < 0 -+ || src_rect.top > src_surface->resource.height || src_rect.top < 0 -+ || src_rect.right > src_surface->resource.width || src_rect.right < 0 -+ || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) ++ if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom ++ || src_rect->left > src_surface->resource.width || src_rect->left < 0 ++ || src_rect->top > src_surface->resource.height || src_rect->top < 0 ++ || src_rect->right > src_surface->resource.width || src_rect->right < 0 ++ || src_rect->bottom > src_surface->resource.height || src_rect->bottom < 0) + { -+ WARN("Application gave us bad source rectangle for Blt.\n"); ++ WARN("The application gave us a bad source rectangle.\n"); + return WINEDDERR_INVALIDRECT; + } + @@ -493,11 +421,6 @@ + WARN("Rejecting depth / stencil blit between incompatible formats.\n"); + return WINED3DERR_INVALIDCALL; + } -+ -+ } -+ else -+ { -+ memset(&src_rect, 0, sizeof(src_rect)); + } + + if (!fx || !(fx->dwDDFX)) @@ -526,7 +449,7 @@ + } + + TRACE("Emitting blit %p <== %p\n", dst_surface, src_surface); -+ wined3d_cs_emit_blt(device->cs, dst_surface, &dst_rect, src_surface, &src_rect, ++ wined3d_cs_emit_blt(device->cs, dst_surface, dst_rect, src_surface, src_rect, + flags, fx, filter); + + return WINED3D_OK; @@ -534,10 +457,10 @@ static const struct wined3d_resource_ops surface_resource_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9979cb0..cca82ab 100644 +index 6b95f46..b93988c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2522,6 +2522,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2557,6 +2557,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -547,7 +470,7 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2669,6 +2672,7 @@ struct wined3d_cs +@@ -2703,6 +2706,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -555,7 +478,7 @@ DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2747,6 +2751,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2781,6 +2785,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; @@ -567,5 +490,5 @@ /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-CS-in-GetDC.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-CS-in-GetDC.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-CS-in-GetDC.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-CS-in-GetDC.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,19 +1,19 @@ -From 6abbf0a97d9e72b5f599f48c5a591a0d2917eee6 Mon Sep 17 00:00:00 2001 +From d7b34fde19f7788ee528276df9231e9658b2adbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 26 Sep 2013 16:40:34 +0200 Subject: wined3d: Wait for the CS in GetDC. --- - dlls/wined3d/surface.c | 14 ++++++++++++++ + dlls/wined3d/texture.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index bef62bb..3653626 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2548,6 +2548,20 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index efb134b..fddbe93 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1552,6 +1552,20 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i - TRACE("surface %p, dc %p.\n", surface, dc); + surface = surface_from_resource(sub_resource); + if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) + { @@ -33,5 +33,5 @@ if (surface->flags & SFLAG_DCINUSE) return WINEDDERR_DCALREADYCREATED; -- -2.5.1 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-send-resource-maps-through-the-command-strea.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-send-resource-maps-through-the-command-strea.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-send-resource-maps-through-the-command-strea.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-send-resource-maps-through-the-command-strea.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 84bfd1772cafbfdfba4f0fa02703c24fba74c3bb Mon Sep 17 00:00:00 2001 +From fb342d2c58b51885f224b1e4a8a9805fa319fbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 26 Sep 2013 16:41:00 +0200 Subject: wined3d: send resource maps through the command stream @@ -11,7 +11,7 @@ 3 files changed, 120 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6ade585..5e96859 100644 +index 636ff0d..a5d5bde 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -76,6 +76,8 @@ enum wined3d_cs_op @@ -112,10 +112,10 @@ static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8594992..a2fdefb 100644 +index fb84a0f..e1ae8d4 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -766,32 +766,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, +@@ -792,32 +792,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, return TRUE; } @@ -129,8 +129,8 @@ - const struct wined3d_format *format = resource->format; - const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D]; - -- TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -- resource, map_desc, box, flags); +- TRACE("resource %p, map_desc %p, box %s, flags %#x.\n", +- resource, map_desc, debug_box(box), flags); - - if (resource->map_count) - { @@ -150,7 +150,7 @@ if (device->d3d_initialized) context = context_acquire(device, NULL); -@@ -799,9 +778,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, +@@ -825,9 +804,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, if (!wined3d_resource_prepare_map_memory(resource, context)) { WARN("Out of memory.\n"); @@ -161,7 +161,7 @@ } if (flags & WINED3D_MAP_DISCARD) -@@ -809,11 +787,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, +@@ -835,11 +813,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, else wined3d_resource_load_location(resource, context, resource->map_binding); @@ -182,8 +182,8 @@ + const struct wined3d_format *format = resource->format; + const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D]; + -+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -+ resource, map_desc, box, flags); ++ TRACE("resource %p, map_desc %p, box %s, flags %#x.\n", ++ resource, map_desc, debug_box(box), flags); + + if (resource->map_count) + { @@ -203,7 +203,7 @@ TRACE("Base memory pointer %p.\n", base_memory); if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) -@@ -865,10 +872,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, +@@ -887,10 +894,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, return WINED3D_OK; } @@ -226,7 +226,7 @@ TRACE("resource %p.\n", resource); if (!resource->map_count) -@@ -877,12 +895,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +@@ -899,12 +917,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) return WINEDDERR_NOTLOCKED; } @@ -241,10 +241,10 @@ return WINED3D_OK; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index aa7b47b..3592bcc 100644 +index 18fae74..bbbccdd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2239,6 +2239,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -2350,6 +2350,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; @@ -252,7 +252,7 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, struct wined3d_context *context) DECLSPEC_HIDDEN; BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2246,6 +2247,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -2357,6 +2358,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context) DECLSPEC_HIDDEN; DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -260,7 +260,7 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -@@ -2728,6 +2730,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -2844,6 +2846,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; @@ -271,5 +271,5 @@ /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.5.1 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-surface-preloads-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-surface-preloads-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-surface-preloads-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-surface-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -From 2f0bb40d8d1791180b93f3d4eccbf7c3f190d19e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:15:58 +0200 -Subject: wined3d: Send surface preloads through the CS - ---- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 5 +++-- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 35 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 78e5010..4834dd4 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -71,6 +71,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, - WINED3D_CS_OP_TEXTURE_PRELOAD, -+ WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_STOP, - }; - -@@ -396,6 +397,12 @@ struct wined3d_cs_texture_preload - struct wined3d_texture *texture; - }; - -+struct wined3d_cs_surface_preload -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1858,6 +1865,29 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_surface_preload *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ wined3d_texture_preload(op->surface->container); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_surface_preload *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1907,6 +1937,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -+ /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9dadb6d..b2a5d22 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1771,15 +1771,16 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface) - - void CDECL wined3d_surface_preload(struct wined3d_surface *surface) - { -+ const struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - -- if (!surface->resource.device->d3d_initialized) -+ if (!device->d3d_initialized) - { - ERR("D3D not initialized.\n"); - return; - } - -- wined3d_texture_preload(surface->container); -+ wined3d_cs_emit_surface_preload(device->cs, surface); - } - - void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index de82b46..409f395 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2654,6 +2654,7 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * - void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, - const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-update_texture-calls-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-update_texture-calls-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-update_texture-calls-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Send-update_texture-calls-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,305 @@ +From 74ca9354ca44c727c7efeeee0d5f56caf19960ef Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 00:33:48 +0200 +Subject: wined3d: Send update_texture calls through the CS + +--- + dlls/wined3d/cs.c | 33 +++++++++++ + dlls/wined3d/device.c | 125 ++++++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 4 ++ + 3 files changed, 98 insertions(+), 64 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 2da4249..392ef36 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -72,6 +72,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, + WINED3D_CS_OP_TEXTURE_PRELOAD, ++ WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_STOP, + }; + +@@ -406,6 +407,12 @@ struct wined3d_cs_texture_preload + struct wined3d_texture *texture; + }; + ++struct wined3d_cs_update_texture ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_texture *src, *dst; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1972,6 +1979,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_update_texture *op = data; ++ struct wined3d_context *context; ++ ++ context = context_acquire(cs->device, NULL); ++ device_exec_update_texture(context, op->src, op->dst); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, ++ struct wined3d_texture *dst) ++{ ++ struct wined3d_cs_update_texture *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE; ++ op->src = src; ++ op->dst = dst; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2022,6 +2054,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, ++ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 4db078d..2dde4b6 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3494,16 +3494,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + } + + /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +-static HRESULT device_update_volume(struct wined3d_device *device, ++static HRESULT device_update_volume(struct wined3d_context *context, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) + { + struct wined3d_const_bo_address data; + struct wined3d_map_desc src; + HRESULT hr; +- struct wined3d_context *context; + +- TRACE("device %p, src_volume %p, dst_volume %p.\n", +- device, src_volume, dst_volume); ++ TRACE("src_volume %p, dst_volume %p.\n", ++ src_volume, dst_volume); + + if (src_volume->resource.format != dst_volume->resource.format) + { +@@ -3521,8 +3520,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, + if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) + return hr; + +- context = context_acquire(device, NULL); +- + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); +@@ -3532,57 +3529,20 @@ static HRESULT device_update_volume(struct wined3d_device *device, + wined3d_volume_upload_data(dst_volume, context, &data); + wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + +- context_release(context); +- + hr = wined3d_volume_unmap(src_volume); + + return hr; + } + +-HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) ++/* Context activation is done by the caller */ ++void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, ++ struct wined3d_texture *dst_texture) + { + unsigned int src_size, dst_size, src_skip_levels = 0; + unsigned int layer_count, level_count, i, j; +- enum wined3d_resource_type type; +- HRESULT hr; +- struct wined3d_context *context; +- +- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); +- +- /* Verify that the source and destination textures are non-NULL. */ +- if (!src_texture || !dst_texture) +- { +- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- +- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) +- { +- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) +- { +- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- +- /* Verify that the source and destination textures are the same type. */ +- type = src_texture->resource.type; +- if (dst_texture->resource.type != type) +- { +- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } ++ enum wined3d_resource_type type = src_texture->resource.type; + + layer_count = src_texture->layer_count; +- if (layer_count != dst_texture->layer_count) +- { +- WARN("Source and destination have different layer counts.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- + level_count = min(wined3d_texture_get_level_count(src_texture), + wined3d_texture_get_level_count(dst_texture)); + +@@ -3599,17 +3559,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + ++src_skip_levels; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + /* Make sure that the destination texture is loaded. */ +- context = context_acquire(device, NULL); + wined3d_texture_load(dst_texture, context, FALSE); +- context_release(context); + + /* Update every surface level of the texture. */ + switch (type) +@@ -3629,11 +3580,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + i * src_levels + j + src_skip_levels)); + dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, + i * dst_levels + j)); +- if (FAILED(hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL))) +- { +- WARN("Failed to update surface, hr %#x.\n", hr); +- return hr; +- } ++ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); + } + } + break; +@@ -3643,14 +3590,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + { + for (i = 0; i < level_count; ++i) + { +- hr = device_update_volume(device, ++ HRESULT hr; ++ hr = device_update_volume(context, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, + i + src_skip_levels)), + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); + if (FAILED(hr)) + { + WARN("Failed to update volume, hr %#x.\n", hr); +- return hr; ++ return; + } + } + break; +@@ -3658,9 +3606,58 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + + default: + FIXME("Unsupported texture type %#x.\n", type); +- return WINED3DERR_INVALIDCALL; ++ return; ++ } ++} ++ ++HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, ++ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) ++{ ++ enum wined3d_resource_type type; ++ unsigned int layer_count; ++ ++ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); ++ ++ /* Verify that the source and destination textures are non-NULL. */ ++ if (!src_texture || !dst_texture) ++ { ++ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; + } + ++ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) ++ { ++ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) ++ { ++ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ if (dst_texture->resource.format != src_texture->resource.format) ++ { ++ WARN("Formats do not match, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ /* Verify that the source and destination textures are the same type. */ ++ type = src_texture->resource.type; ++ if (dst_texture->resource.type != type) ++ { ++ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ layer_count = src_texture->layer_count; ++ if (layer_count != dst_texture->layer_count) ++ { ++ WARN("Source and destination have different layer counts.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); ++ + return WINED3D_OK; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 8985d99..e5e0336 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2212,6 +2212,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource + void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; + void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; ++void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, ++ struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2806,6 +2808,8 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * + void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, + const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, ++ struct wined3d_texture *dst) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,27 @@ +From bd911b7f7d610d7b2a4441827aef64bb24257e45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 01:43:35 +0200 +Subject: wined3d: Get rid of the surface_upload_data glFinish + +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index c503c67..5dda903 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1403,9 +1403,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + checkGLcall("glBindBuffer"); + } + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); + + if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Send-update_texture-calls-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Send-update_texture-calls-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Send-update_texture-calls-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Send-update_texture-calls-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,303 +0,0 @@ -From a67a9a39ffcf23526dbabc064d02520c41a5ecdb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:33:48 +0200 -Subject: wined3d: Send update_texture calls through the CS - ---- - dlls/wined3d/cs.c | 33 ++++++++++++ - dlls/wined3d/device.c | 119 +++++++++++++++++++---------------------- - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 91 insertions(+), 65 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f17a222..31f7087 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -73,6 +73,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_SURFACE, - WINED3D_CS_OP_TEXTURE_PRELOAD, - WINED3D_CS_OP_SURFACE_PRELOAD, -+ WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_STOP, - }; - -@@ -413,6 +414,12 @@ struct wined3d_cs_surface_preload - struct wined3d_surface *surface; - }; - -+struct wined3d_cs_update_texture -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *src, *dst; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2002,6 +2009,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_texture *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ device_exec_update_texture(context, op->src, op->dst); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, -+ struct wined3d_texture *dst) -+{ -+ struct wined3d_cs_update_texture *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE; -+ op->src = src; -+ op->dst = dst; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2053,6 +2085,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, -+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index d302b17..e7c5bcc 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3420,16 +3420,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - } - - /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ --static HRESULT device_update_volume(struct wined3d_device *device, -+static HRESULT device_update_volume(struct wined3d_context *context, - struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) - { - struct wined3d_const_bo_address data; - struct wined3d_map_desc src; - HRESULT hr; -- struct wined3d_context *context; - -- TRACE("device %p, src_volume %p, dst_volume %p.\n", -- device, src_volume, dst_volume); -+ TRACE("src_volume %p, dst_volume %p.\n", -+ src_volume, dst_volume); - - if (src_volume->resource.format != dst_volume->resource.format) - { -@@ -3447,8 +3446,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, - if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) - return hr; - -- context = context_acquire(device, NULL); -- - /* Only a prepare, since we're uploading the entire volume. */ - wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); -@@ -3458,48 +3455,17 @@ static HRESULT device_update_volume(struct wined3d_device *device, - wined3d_volume_upload_data(dst_volume, context, &data); - wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - -- context_release(context); -- - hr = wined3d_volume_unmap(src_volume); - - return hr; - } - --HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, -- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) -+/* Context activation is done by the caller */ -+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -+ struct wined3d_texture *dst_texture) - { -- enum wined3d_resource_type type; -+ enum wined3d_resource_type type = src_texture->resource.type; - unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; -- HRESULT hr; -- struct wined3d_context *context; -- -- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -- -- /* Verify that the source and destination textures are non-NULL. */ -- if (!src_texture || !dst_texture) -- { -- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- -- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) -- { -- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) -- { -- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- -- /* Verify that the source and destination textures are the same type. */ -- type = src_texture->resource.type; -- if (dst_texture->resource.type != type) -- { -- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } - - level_count = min(wined3d_texture_get_level_count(src_texture), - wined3d_texture_get_level_count(dst_texture)); -@@ -3517,17 +3483,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - ++src_skip_levels; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - /* Make sure that the destination texture is loaded. */ -- context = context_acquire(device, NULL); - wined3d_texture_load(dst_texture, context, FALSE); -- context_release(context); - - /* Update every surface level of the texture. */ - switch (type) -@@ -3542,12 +3499,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); -- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -- if (FAILED(hr)) -- { -- WARN("Failed to update surface, hr %#x.\n", hr); -- return hr; -- } -+ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); - } - break; - } -@@ -3567,12 +3519,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - i * src_levels + j + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, - i * dst_levels + j)); -- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -- if (FAILED(hr)) -- { -- WARN("Failed to update surface, hr %#x.\n", hr); -- return hr; -- } -+ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); - } - } - break; -@@ -3582,14 +3529,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - { - for (i = 0; i < level_count; ++i) - { -- hr = device_update_volume(device, -+ HRESULT hr; -+ hr = device_update_volume(context, - volume_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)), - volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); - if (FAILED(hr)) - { - WARN("Failed to update volume, hr %#x.\n", hr); -- return hr; -+ return; - } - } - break; -@@ -3597,9 +3545,50 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - - default: - FIXME("Unsupported texture type %#x.\n", type); -- return WINED3DERR_INVALIDCALL; -+ return; -+ } -+} -+ -+HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, -+ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) -+{ -+ enum wined3d_resource_type type; -+ -+ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -+ -+ /* Verify that the source and destination textures are non-NULL. */ -+ if (!src_texture || !dst_texture) -+ { -+ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; - } - -+ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) -+ { -+ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) -+ { -+ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ if (dst_texture->resource.format != src_texture->resource.format) -+ { -+ WARN("Formats do not match, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ /* Verify that the source and destination textures are the same type. */ -+ type = src_texture->resource.type; -+ if (dst_texture->resource.type != type) -+ { -+ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); -+ - return WINED3D_OK; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3081be5..3297c5e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2152,6 +2152,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource - void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; - void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; -+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -+ struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2744,6 +2746,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac - const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, -+ struct wined3d_texture *dst) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,90 @@ +From 39991b8b55a61f725745fde7e8a2622ec6a457a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 29 Aug 2013 22:25:14 +0200 +Subject: wined3d: Don't lock the src volume in device_update_volume + +This will attempt to wait for the CS, but this code is executed by the CS, so +it will, among other problems, break the single producer, single consumer +assumption of the work queue. + +FIXME: Maybe merge this with the previous patch or change their order. +--- + dlls/wined3d/device.c | 30 +++++++----------------------- + 1 file changed, 7 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index e7c5bcc..e3b4217 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3420,12 +3420,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + } + + /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +-static HRESULT device_update_volume(struct wined3d_context *context, ++static void device_update_volume(struct wined3d_context *context, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) + { +- struct wined3d_const_bo_address data; +- struct wined3d_map_desc src; +- HRESULT hr; ++ struct wined3d_bo_address data; + + TRACE("src_volume %p, dst_volume %p.\n", + src_volume, dst_volume); +@@ -3433,31 +3431,23 @@ static HRESULT device_update_volume(struct wined3d_context *context, + if (src_volume->resource.format != dst_volume->resource.format) + { + FIXME("Source and destination formats do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; + } + if (src_volume->resource.width != dst_volume->resource.width + || src_volume->resource.height != dst_volume->resource.height + || src_volume->resource.depth != dst_volume->resource.depth) + { + FIXME("Source and destination sizes do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; + } + +- if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) +- return hr; +- + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); + +- data.buffer_object = 0; +- data.addr = src.data; +- wined3d_volume_upload_data(dst_volume, context, &data); ++ wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); ++ wined3d_volume_upload_data(dst_volume, context, wined3d_const_bo_address(&data)); + wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); +- +- hr = wined3d_volume_unmap(src_volume); +- +- return hr; + } + + /* Context activation is done by the caller */ +@@ -3529,16 +3519,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ + { + for (i = 0; i < level_count; ++i) + { +- HRESULT hr; +- hr = device_update_volume(context, ++ device_update_volume(context, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, + i + src_skip_levels)), + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); +- if (FAILED(hr)) +- { +- WARN("Failed to update volume, hr %#x.\n", hr); +- return; +- } + } + break; + } +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From bd911b7f7d610d7b2a4441827aef64bb24257e45 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 01:43:35 +0200 -Subject: wined3d: Get rid of the surface_upload_data glFinish - ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c503c67..5dda903 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1403,9 +1403,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - checkGLcall("glBindBuffer"); - } - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); - - if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -From 39991b8b55a61f725745fde7e8a2622ec6a457a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 29 Aug 2013 22:25:14 +0200 -Subject: wined3d: Don't lock the src volume in device_update_volume - -This will attempt to wait for the CS, but this code is executed by the CS, so -it will, among other problems, break the single producer, single consumer -assumption of the work queue. - -FIXME: Maybe merge this with the previous patch or change their order. ---- - dlls/wined3d/device.c | 30 +++++++----------------------- - 1 file changed, 7 insertions(+), 23 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e7c5bcc..e3b4217 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3420,12 +3420,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - } - - /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ --static HRESULT device_update_volume(struct wined3d_context *context, -+static void device_update_volume(struct wined3d_context *context, - struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) - { -- struct wined3d_const_bo_address data; -- struct wined3d_map_desc src; -- HRESULT hr; -+ struct wined3d_bo_address data; - - TRACE("src_volume %p, dst_volume %p.\n", - src_volume, dst_volume); -@@ -3433,31 +3431,23 @@ static HRESULT device_update_volume(struct wined3d_context *context, - if (src_volume->resource.format != dst_volume->resource.format) - { - FIXME("Source and destination formats do not match.\n"); -- return WINED3DERR_INVALIDCALL; -+ return; - } - if (src_volume->resource.width != dst_volume->resource.width - || src_volume->resource.height != dst_volume->resource.height - || src_volume->resource.depth != dst_volume->resource.depth) - { - FIXME("Source and destination sizes do not match.\n"); -- return WINED3DERR_INVALIDCALL; -+ return; - } - -- if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) -- return hr; -- - /* Only a prepare, since we're uploading the entire volume. */ - wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); - -- data.buffer_object = 0; -- data.addr = src.data; -- wined3d_volume_upload_data(dst_volume, context, &data); -+ wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); -+ wined3d_volume_upload_data(dst_volume, context, wined3d_const_bo_address(&data)); - wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); -- -- hr = wined3d_volume_unmap(src_volume); -- -- return hr; - } - - /* Context activation is done by the caller */ -@@ -3529,16 +3519,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ - { - for (i = 0; i < level_count; ++i) - { -- HRESULT hr; -- hr = device_update_volume(context, -+ device_update_volume(context, - volume_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)), - volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); -- if (FAILED(hr)) -- { -- WARN("Failed to update volume, hr %#x.\n", hr); -- return; -- } - } - break; - } --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Handle-evit_managed_resources-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Handle-evit_managed_resources-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Handle-evit_managed_resources-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Handle-evit_managed_resources-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,129 @@ +From f93c689f0844961269bd2e4f83bf242841c1e305 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 6 Aug 2013 13:50:31 +0200 +Subject: wined3d: Handle evit_managed_resources through the CS + +--- + dlls/wined3d/cs.c | 37 +++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 14 +++----------- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 41 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 392ef36..bbec667 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -73,6 +73,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UPDATE_SURFACE, + WINED3D_CS_OP_TEXTURE_PRELOAD, + WINED3D_CS_OP_UPDATE_TEXTURE, ++ WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_STOP, + }; + +@@ -413,6 +414,12 @@ struct wined3d_cs_update_texture + struct wined3d_texture *src, *dst; + }; + ++struct wined3d_cs_evict_resource ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2004,6 +2011,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_evict_resource(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_evict_resource *op = data; ++ struct wined3d_resource *resource = op->resource; ++ ++ resource->resource_ops->resource_unload(resource); ++ ++ /* FIXME: Is this necessary? Bound buffers are preloaded anyway, and in theory ++ * PreLoad should take care of invalidating the state if the VBO changes */ ++ if (resource->bind_count && resource->type == WINED3D_RTYPE_BUFFER) ++ { ++ device_invalidate_state(cs->device, STATE_STREAMSRC); ++ device_invalidate_state(cs->device, STATE_INDEXBUFFER); ++ } ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_evict_resource *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_EVICT_RESOURCE; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2055,6 +2091,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, ++ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 4abc2c5..7f7ddbb 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4489,13 +4489,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + + TRACE("device %p.\n", device); + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- ++ /* The resource list is manged by the main thread, iterate here and emit commands for ++ * each resource */ + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Checking resource %p for eviction.\n", resource); +@@ -4503,12 +4498,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) + { + TRACE("Evicting %p.\n", resource); +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } + } +- +- /* Invalidate stream sources, the buffer(s) may have been evicted. */ +- device_invalidate_state(device, STATE_STREAMSRC); + } + + static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index e5e0336..60ff62f 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2810,6 +2810,7 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac + void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Handle-evit_managed_resources-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Handle-evit_managed_resources-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Handle-evit_managed_resources-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Handle-evit_managed_resources-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -From 87f659571c4214fcc73a42a1e112d6bda34950a3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 6 Aug 2013 13:50:31 +0200 -Subject: wined3d: Handle evit_managed_resources through the CS - ---- - dlls/wined3d/cs.c | 37 +++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 14 +++----------- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 41 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index aeba50f..11aa133 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -73,6 +73,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_TEXTURE_PRELOAD, - WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_UPDATE_TEXTURE, -+ WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_STOP, - }; - -@@ -410,6 +411,12 @@ struct wined3d_cs_update_texture - struct wined3d_texture *src, *dst; - }; - -+struct wined3d_cs_evict_resource -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1920,6 +1927,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_evict_resource(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_evict_resource *op = data; -+ struct wined3d_resource *resource = op->resource; -+ -+ resource->resource_ops->resource_unload(resource); -+ -+ /* FIXME: Is this necessary? Bound buffers are preloaded anyway, and in theory -+ * PreLoad should take care of invalidating the state if the VBO changes */ -+ if (resource->bind_count && resource->type == WINED3D_RTYPE_BUFFER) -+ { -+ device_invalidate_state(cs->device, STATE_STREAMSRC); -+ device_invalidate_state(cs->device, STATE_INDEXBUFFER); -+ } -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_evict_resource *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_EVICT_RESOURCE; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1971,6 +2007,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, -+ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ae7ad31..f062e84 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4207,13 +4207,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - - TRACE("device %p.\n", device); - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -+ /* The resource list is manged by the main thread, iterate here and emit commands for -+ * each resource */ - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Checking resource %p for eviction.\n", resource); -@@ -4221,12 +4216,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) - { - TRACE("Evicting %p.\n", resource); -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } - } -- -- /* Invalidate stream sources, the buffer(s) may have been evicted. */ -- device_invalidate_state(device, STATE_STREAMSRC); - } - - static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 25fce7f..b9eee2c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2659,6 +2659,7 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, - struct wined3d_texture *dst) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Introduce-resource-fencing.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Introduce-resource-fencing.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Introduce-resource-fencing.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Introduce-resource-fencing.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,99 @@ +From cba6a35d48886d00959d29d4fef9115a46143589 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Aug 2014 18:01:36 +0200 +Subject: wined3d: Introduce resource fencing. + +FIXME: The buffer part doesn't really make sense without dynamic buffer maps. +--- + dlls/wined3d/cs.c | 19 +++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 16 ++++++++++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 11aa133..1197eef 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -575,6 +575,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; + const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; ++ unsigned int i; + + if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) + { +@@ -593,6 +594,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); + ++ if (op->indexed) ++ wined3d_resource_dec_fence(&cs->state.index_buffer->resource); ++ for (i = 0; i < sizeof(cs->state.streams) / sizeof(*cs->state.streams); i++) ++ { ++ if (cs->state.streams[i].buffer) ++ wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); ++ } ++ + return sizeof(*op); + } + +@@ -600,6 +609,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + UINT start_instance, UINT instance_count, BOOL indexed) + { + struct wined3d_cs_draw *op; ++ unsigned int i; ++ const struct wined3d_state *state = &cs->device->state; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_DRAW; +@@ -609,6 +620,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + op->instance_count = instance_count; + op->indexed = indexed; + ++ if (indexed) ++ wined3d_resource_inc_fence(&state->index_buffer->resource); ++ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) ++ { ++ if (state->streams[i].buffer) ++ wined3d_resource_inc_fence(&state->streams[i].buffer->resource); ++ } ++ + cs->ops->submit(cs, sizeof(*op)); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 570f5e3..10d0789 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2129,6 +2129,7 @@ struct wined3d_resource + GLuint buffer_object; + struct list resource_list_entry; + DWORD locations; ++ LONG access_fence; + + void *parent; + const struct wined3d_parent_ops *parent_ops; +@@ -2182,6 +2183,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + ++static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource) ++{ ++ InterlockedIncrement(&resource->access_fence); ++} ++ ++static inline void wined3d_resource_dec_fence(struct wined3d_resource *resource) ++{ ++ InterlockedDecrement(&resource->access_fence); ++} ++ ++static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource) ++{ ++ while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); ++} ++ + /* Tests show that the start address of resources is 32 byte aligned */ + #define RESOURCE_ALIGNMENT 16 + +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Fence-update_texture-and-update_surface-call.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Fence-update_texture-and-update_surface-call.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Fence-update_texture-and-update_surface-call.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Fence-update_texture-and-update_surface-call.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,117 @@ +From a83b0e8543213b11848897ea954412ac0f06083a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 10:41:42 +0200 +Subject: wined3d: Fence update_texture and update_surface calls + +--- + dlls/wined3d/cs.c | 26 ++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 54 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 1197eef..9a7e6df 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1844,6 +1844,16 @@ static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *da + surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, + op->src, op->has_src_rect ? &op->src_rect : NULL); + ++ if (op->src->container) ++ wined3d_resource_dec_fence(&op->src->container->resource); ++ else ++ wined3d_resource_inc_fence(&op->src->resource); ++ ++ if (op->dst->container) ++ wined3d_resource_dec_fence(&op->dst->container->resource); ++ else ++ wined3d_resource_inc_fence(&op->dst->resource); ++ + return sizeof(*op); + } + +@@ -1871,6 +1881,16 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac + op->dst_point = *dst_point; + } + ++ if (src->container) ++ wined3d_resource_inc_fence(&src->container->resource); ++ else ++ wined3d_resource_inc_fence(&src->resource); ++ ++ if (dst->container) ++ wined3d_resource_inc_fence(&dst->container->resource); ++ else ++ wined3d_resource_inc_fence(&dst->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +@@ -1930,6 +1950,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da + device_exec_update_texture(context, op->src, op->dst); + context_release(context); + ++ wined3d_resource_dec_fence(&op->src->resource); ++ wined3d_resource_dec_fence(&op->dst->resource); ++ + return sizeof(*op); + } + +@@ -1943,6 +1966,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + op->src = src; + op->dst = dst; + ++ wined3d_resource_inc_fence(&op->src->resource); ++ wined3d_resource_inc_fence(&op->dst->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index af60d51..708b080 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -712,6 +712,32 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla + return mem; + } + ++static void wined3d_resource_sync(struct wined3d_resource *resource) ++{ ++ struct wined3d_resource *real_res = resource; ++ struct wined3d_surface *surface; ++ struct wined3d_volume *volume; ++ ++ switch (resource->type) ++ { ++ case WINED3D_RTYPE_SURFACE: ++ surface = surface_from_resource(resource); ++ if (surface->container) ++ real_res = &surface->container->resource; ++ break; ++ ++ case WINED3D_RTYPE_VOLUME: ++ volume = volume_from_resource(resource); ++ real_res = &volume->container->resource; ++ break; ++ ++ default: ++ break; ++ } ++ if (!real_res->access_fence) ++ FIXME("Waiting for CS even though resource %p is idle.\n", resource); ++} ++ + HRESULT wined3d_resource_map(struct wined3d_resource *resource, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { +@@ -730,6 +756,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + ++ wined3d_resource_sync(resource); ++ + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); + if (!base_memory) + { +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Introduce-resource-fencing.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Introduce-resource-fencing.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Introduce-resource-fencing.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Introduce-resource-fencing.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -From cba6a35d48886d00959d29d4fef9115a46143589 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Aug 2014 18:01:36 +0200 -Subject: wined3d: Introduce resource fencing. - -FIXME: The buffer part doesn't really make sense without dynamic buffer maps. ---- - dlls/wined3d/cs.c | 19 +++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 16 ++++++++++++++++ - 2 files changed, 35 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 11aa133..1197eef 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -575,6 +575,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; - const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; -+ unsigned int i; - - if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) - { -@@ -593,6 +594,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); - -+ if (op->indexed) -+ wined3d_resource_dec_fence(&cs->state.index_buffer->resource); -+ for (i = 0; i < sizeof(cs->state.streams) / sizeof(*cs->state.streams); i++) -+ { -+ if (cs->state.streams[i].buffer) -+ wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); -+ } -+ - return sizeof(*op); - } - -@@ -600,6 +609,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - UINT start_instance, UINT instance_count, BOOL indexed) - { - struct wined3d_cs_draw *op; -+ unsigned int i; -+ const struct wined3d_state *state = &cs->device->state; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_DRAW; -@@ -609,6 +620,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - op->instance_count = instance_count; - op->indexed = indexed; - -+ if (indexed) -+ wined3d_resource_inc_fence(&state->index_buffer->resource); -+ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) -+ { -+ if (state->streams[i].buffer) -+ wined3d_resource_inc_fence(&state->streams[i].buffer->resource); -+ } -+ - cs->ops->submit(cs, sizeof(*op)); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 570f5e3..10d0789 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2129,6 +2129,7 @@ struct wined3d_resource - GLuint buffer_object; - struct list resource_list_entry; - DWORD locations; -+ LONG access_fence; - - void *parent; - const struct wined3d_parent_ops *parent_ops; -@@ -2182,6 +2183,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - -+static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource) -+{ -+ InterlockedIncrement(&resource->access_fence); -+} -+ -+static inline void wined3d_resource_dec_fence(struct wined3d_resource *resource) -+{ -+ InterlockedDecrement(&resource->access_fence); -+} -+ -+static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource) -+{ -+ while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); -+} -+ - /* Tests show that the start address of resources is 32 byte aligned */ - #define RESOURCE_ALIGNMENT 16 - --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Dirtify-resources-on-unmap.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Dirtify-resources-on-unmap.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Dirtify-resources-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Dirtify-resources-on-unmap.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,81 @@ +From 440a516b0908c7282e89fe73a788ca461d90d81e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 26 Sep 2013 17:25:01 +0200 +Subject: wined3d: Dirtify resources on unmap + +--- + dlls/wined3d/resource.c | 7 ++++++- + dlls/wined3d/surface.c | 4 ++++ + dlls/wined3d/volume.c | 3 +++ + dlls/wined3d/wined3d_private.h | 1 + + 4 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 708b080..73011f8 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -806,7 +806,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++ resource->unmap_dirtify = TRUE; + + resource->map_count++; + +@@ -826,6 +826,11 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) + wined3d_resource_release_map_ptr(resource, context); + if (context) + context_release(context); ++ ++ if (resource->unmap_dirtify) ++ wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++ resource->unmap_dirtify = FALSE; ++ + } + + HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 0c3313d..e661494 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2405,6 +2405,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT hr; + TRACE("surface %p.\n", surface); + ++ if (surface->resource.unmap_dirtify && surface->container) ++ wined3d_texture_set_dirty(surface->container); ++ ++ + hr = wined3d_resource_unmap(&surface->resource); + if (FAILED(hr)) + return hr; +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 7ce5331..faadea1 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -424,6 +424,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { + HRESULT hr; + ++ if (volume->resource.unmap_dirtify) ++ wined3d_texture_set_dirty(volume->container); ++ + hr = wined3d_resource_unmap(&volume->resource); + if (hr == WINEDDERR_NOTLOCKED) + return WINED3DERR_INVALIDCALL; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index b4e5679..d670fe1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2119,6 +2119,7 @@ struct wined3d_resource + struct list resource_list_entry; + DWORD locations; + LONG access_fence; ++ BOOL unmap_dirtify; + + void *parent; + const struct wined3d_parent_ops *parent_ops; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Fence-update_texture-and-update_surface-call.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Fence-update_texture-and-update_surface-call.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Fence-update_texture-and-update_surface-call.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Fence-update_texture-and-update_surface-call.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -From a83b0e8543213b11848897ea954412ac0f06083a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 10:41:42 +0200 -Subject: wined3d: Fence update_texture and update_surface calls - ---- - dlls/wined3d/cs.c | 26 ++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 1197eef..9a7e6df 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1844,6 +1844,16 @@ static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *da - surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, - op->src, op->has_src_rect ? &op->src_rect : NULL); - -+ if (op->src->container) -+ wined3d_resource_dec_fence(&op->src->container->resource); -+ else -+ wined3d_resource_inc_fence(&op->src->resource); -+ -+ if (op->dst->container) -+ wined3d_resource_dec_fence(&op->dst->container->resource); -+ else -+ wined3d_resource_inc_fence(&op->dst->resource); -+ - return sizeof(*op); - } - -@@ -1871,6 +1881,16 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac - op->dst_point = *dst_point; - } - -+ if (src->container) -+ wined3d_resource_inc_fence(&src->container->resource); -+ else -+ wined3d_resource_inc_fence(&src->resource); -+ -+ if (dst->container) -+ wined3d_resource_inc_fence(&dst->container->resource); -+ else -+ wined3d_resource_inc_fence(&dst->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -1930,6 +1950,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da - device_exec_update_texture(context, op->src, op->dst); - context_release(context); - -+ wined3d_resource_dec_fence(&op->src->resource); -+ wined3d_resource_dec_fence(&op->dst->resource); -+ - return sizeof(*op); - } - -@@ -1943,6 +1966,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - op->src = src; - op->dst = dst; - -+ wined3d_resource_inc_fence(&op->src->resource); -+ wined3d_resource_inc_fence(&op->dst->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index af60d51..708b080 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -712,6 +712,32 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - return mem; - } - -+static void wined3d_resource_sync(struct wined3d_resource *resource) -+{ -+ struct wined3d_resource *real_res = resource; -+ struct wined3d_surface *surface; -+ struct wined3d_volume *volume; -+ -+ switch (resource->type) -+ { -+ case WINED3D_RTYPE_SURFACE: -+ surface = surface_from_resource(resource); -+ if (surface->container) -+ real_res = &surface->container->resource; -+ break; -+ -+ case WINED3D_RTYPE_VOLUME: -+ volume = volume_from_resource(resource); -+ real_res = &volume->container->resource; -+ break; -+ -+ default: -+ break; -+ } -+ if (!real_res->access_fence) -+ FIXME("Waiting for CS even though resource %p is idle.\n", resource); -+} -+ - HRESULT wined3d_resource_map(struct wined3d_resource *resource, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { -@@ -730,6 +756,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -+ wined3d_resource_sync(resource); -+ - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); - if (!base_memory) - { --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Dirtify-resources-on-unmap.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Dirtify-resources-on-unmap.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Dirtify-resources-on-unmap.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Dirtify-resources-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -From 440a516b0908c7282e89fe73a788ca461d90d81e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 26 Sep 2013 17:25:01 +0200 -Subject: wined3d: Dirtify resources on unmap - ---- - dlls/wined3d/resource.c | 7 ++++++- - dlls/wined3d/surface.c | 4 ++++ - dlls/wined3d/volume.c | 3 +++ - dlls/wined3d/wined3d_private.h | 1 + - 4 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 708b080..73011f8 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -806,7 +806,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+ resource->unmap_dirtify = TRUE; - - resource->map_count++; - -@@ -826,6 +826,11 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) - wined3d_resource_release_map_ptr(resource, context); - if (context) - context_release(context); -+ -+ if (resource->unmap_dirtify) -+ wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+ resource->unmap_dirtify = FALSE; -+ - } - - HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0c3313d..e661494 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2405,6 +2405,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - HRESULT hr; - TRACE("surface %p.\n", surface); - -+ if (surface->resource.unmap_dirtify && surface->container) -+ wined3d_texture_set_dirty(surface->container); -+ -+ - hr = wined3d_resource_unmap(&surface->resource); - if (FAILED(hr)) - return hr; -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 7ce5331..faadea1 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -424,6 +424,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { - HRESULT hr; - -+ if (volume->resource.unmap_dirtify) -+ wined3d_texture_set_dirty(volume->container); -+ - hr = wined3d_resource_unmap(&volume->resource); - if (hr == WINEDDERR_NOTLOCKED) - return WINED3DERR_INVALIDCALL; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b4e5679..d670fe1 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2119,6 +2119,7 @@ struct wined3d_resource - struct list resource_list_entry; - DWORD locations; - LONG access_fence; -+ BOOL unmap_dirtify; - - void *parent; - const struct wined3d_parent_ops *parent_ops; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Fence-texture-reads-in-draws.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Fence-texture-reads-in-draws.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Fence-texture-reads-in-draws.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Fence-texture-reads-in-draws.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,53 @@ +From 2d87f930869bcd32273e722a50a13a9330ce6a30 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 22:42:33 +0200 +Subject: wined3d: Fence texture reads in draws + +This is probably stricter than necessary. GL BOs and allocated sysmem +are just staging resources. After they have been uploaded into the GL +texture, it's in theory OK to write new data buffer without interfering +with old draws. However, it is impossible to tell when if data has been +transfered into the texture because texture loads are delayed until draw +time. Specifically, it is difficult to separate two consecutive maps +from a map, draw, map sequence, where the draw hasn't been executed by +the time the second map occurs. + +The other problem is that sRGB may cause a texture load from +buffer/sysmem even though the GL texture is thought to be loaded. This +is limited to situations where sRGB textures are supported, but +sRGB_decode isn't. +--- + dlls/wined3d/cs.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9a7e6df..0277a1e 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -601,6 +601,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + if (cs->state.streams[i].buffer) + wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); + } ++ for (i = 0; i < sizeof(cs->state.textures) / sizeof(*cs->state.textures); i++) ++ { ++ if (cs->state.textures[i]) ++ wined3d_resource_dec_fence(&cs->state.textures[i]->resource); ++ } + + return sizeof(*op); + } +@@ -627,6 +632,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + if (state->streams[i].buffer) + wined3d_resource_inc_fence(&state->streams[i].buffer->resource); + } ++ for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) ++ { ++ if (state->textures[i]) ++ wined3d_resource_inc_fence(&state->textures[i]->resource); ++ } + + cs->ops->submit(cs, sizeof(*op)); + } +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-render-targets-and-depth-stencils.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-render-targets-and-depth-stencils.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-render-targets-and-depth-stencils.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-render-targets-and-depth-stencils.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,75 @@ +From 18f06f3fccac3871c0db9d0229a137f920edfbef Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:55:58 +0200 +Subject: wined3d: Fence render targets and depth stencils + +--- + dlls/wined3d/cs.c | 38 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index cc73bdc..73c3dc6 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -581,6 +581,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + cs->ops->submit(cs, size); + } + ++static inline BOOL wined3d_cs_colorwrite_enabled(const struct wined3d_state *state, unsigned int i) ++{ ++ switch (i) ++ { ++ case 0: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE]; ++ case 1: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE1]; ++ case 2: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE2]; ++ case 3: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE3]; ++ default: ++ ERR("Unexpected color target %u.\n", i); ++ return TRUE; ++ } ++} ++ ++static inline BOOL wined3d_cs_depth_stencil_enabled(const struct wined3d_state *state) ++{ ++ return state->render_states[WINED3D_RS_ZENABLE] ++ || state->render_states[WINED3D_RS_STENCILENABLE]; ++} ++ + static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; +@@ -616,6 +640,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + if (cs->state.textures[i]) + wined3d_resource_dec_fence(&cs->state.textures[i]->resource); + } ++ for (i = 0; i < gl_info->limits.buffers; i++) ++ { ++ if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i)) ++ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); ++ } ++ if (cs->state.fb.depth_stencil && wined3d_cs_depth_stencil_enabled(&cs->state)) ++ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); + + return sizeof(*op); + } +@@ -647,6 +678,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + if (state->textures[i]) + wined3d_resource_inc_fence(&state->textures[i]->resource); + } ++ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) ++ { ++ if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i)) ++ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); ++ } ++ if (state->fb.depth_stencil && wined3d_cs_depth_stencil_enabled(state)) ++ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); + + cs->ops->submit(cs, sizeof(*op)); + } +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-texture-reads-in-draws.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-texture-reads-in-draws.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-texture-reads-in-draws.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Fence-texture-reads-in-draws.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -From 2d87f930869bcd32273e722a50a13a9330ce6a30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 22:42:33 +0200 -Subject: wined3d: Fence texture reads in draws - -This is probably stricter than necessary. GL BOs and allocated sysmem -are just staging resources. After they have been uploaded into the GL -texture, it's in theory OK to write new data buffer without interfering -with old draws. However, it is impossible to tell when if data has been -transfered into the texture because texture loads are delayed until draw -time. Specifically, it is difficult to separate two consecutive maps -from a map, draw, map sequence, where the draw hasn't been executed by -the time the second map occurs. - -The other problem is that sRGB may cause a texture load from -buffer/sysmem even though the GL texture is thought to be loaded. This -is limited to situations where sRGB textures are supported, but -sRGB_decode isn't. ---- - dlls/wined3d/cs.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9a7e6df..0277a1e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -601,6 +601,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - if (cs->state.streams[i].buffer) - wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); - } -+ for (i = 0; i < sizeof(cs->state.textures) / sizeof(*cs->state.textures); i++) -+ { -+ if (cs->state.textures[i]) -+ wined3d_resource_dec_fence(&cs->state.textures[i]->resource); -+ } - - return sizeof(*op); - } -@@ -627,6 +632,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - if (state->streams[i].buffer) - wined3d_resource_inc_fence(&state->streams[i].buffer->resource); - } -+ for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) -+ { -+ if (state->textures[i]) -+ wined3d_resource_inc_fence(&state->textures[i]->resource); -+ } - - cs->ops->submit(cs, sizeof(*op)); - } --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-blit-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-blit-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-blit-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-blit-operations.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,38 @@ +From 5903d5d7db4ffbfb87d1b9616d13ea05d19dd171 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:57:01 +0200 +Subject: wined3d: Fence blit operations. + +--- + dlls/wined3d/cs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a4b996e..5603a37 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1709,6 +1709,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) + op->src_surface, &op->src_rect, + op->flags, &op->fx, op->filter); + ++ wined3d_resource_dec_fence(&op->dst_surface->container->resource); ++ if (op->src_surface && op->src_surface != op->dst_surface) ++ wined3d_resource_dec_fence(&op->src_surface->container->resource); ++ + return sizeof(*op); + } + +@@ -1730,6 +1734,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + if (fx) + op->fx = *fx; + ++ wined3d_resource_inc_fence(&dst_surface->container->resource); ++ if (src_surface && src_surface != dst_surface) ++ wined3d_resource_inc_fence(&src_surface->container->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-render-targets-and-depth-stencils.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-render-targets-and-depth-stencils.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-render-targets-and-depth-stencils.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Fence-render-targets-and-depth-stencils.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -From 18f06f3fccac3871c0db9d0229a137f920edfbef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:55:58 +0200 -Subject: wined3d: Fence render targets and depth stencils - ---- - dlls/wined3d/cs.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index cc73bdc..73c3dc6 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -581,6 +581,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - cs->ops->submit(cs, size); - } - -+static inline BOOL wined3d_cs_colorwrite_enabled(const struct wined3d_state *state, unsigned int i) -+{ -+ switch (i) -+ { -+ case 0: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE]; -+ case 1: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE1]; -+ case 2: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE2]; -+ case 3: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE3]; -+ default: -+ ERR("Unexpected color target %u.\n", i); -+ return TRUE; -+ } -+} -+ -+static inline BOOL wined3d_cs_depth_stencil_enabled(const struct wined3d_state *state) -+{ -+ return state->render_states[WINED3D_RS_ZENABLE] -+ || state->render_states[WINED3D_RS_STENCILENABLE]; -+} -+ - static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; -@@ -616,6 +640,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - if (cs->state.textures[i]) - wined3d_resource_dec_fence(&cs->state.textures[i]->resource); - } -+ for (i = 0; i < gl_info->limits.buffers; i++) -+ { -+ if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i)) -+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); -+ } -+ if (cs->state.fb.depth_stencil && wined3d_cs_depth_stencil_enabled(&cs->state)) -+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); - - return sizeof(*op); - } -@@ -647,6 +678,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - if (state->textures[i]) - wined3d_resource_inc_fence(&state->textures[i]->resource); - } -+ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) -+ { -+ if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i)) -+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); -+ } -+ if (state->fb.depth_stencil && wined3d_cs_depth_stencil_enabled(state)) -+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); - - cs->ops->submit(cs, sizeof(*op)); - } --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-blit-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-blit-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-blit-operations.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-blit-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -From 5903d5d7db4ffbfb87d1b9616d13ea05d19dd171 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:57:01 +0200 -Subject: wined3d: Fence blit operations. - ---- - dlls/wined3d/cs.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a4b996e..5603a37 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1709,6 +1709,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) - op->src_surface, &op->src_rect, - op->flags, &op->fx, op->filter); - -+ wined3d_resource_dec_fence(&op->dst_surface->container->resource); -+ if (op->src_surface && op->src_surface != op->dst_surface) -+ wined3d_resource_dec_fence(&op->src_surface->container->resource); -+ - return sizeof(*op); - } - -@@ -1730,6 +1734,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - if (fx) - op->fx = *fx; - -+ wined3d_resource_inc_fence(&dst_surface->container->resource); -+ if (src_surface && src_surface != dst_surface) -+ wined3d_resource_inc_fence(&src_surface->container->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-color_fill-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-color_fill-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-color_fill-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Fence-color_fill-operations.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,34 @@ +From 97f6ef9c0d1d05efc640183d3b045296bca762a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:58:13 +0200 +Subject: wined3d: Fence color_fill operations. + +--- + dlls/wined3d/cs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 5603a37..fb92286 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1750,6 +1750,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) + + surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); + ++ wined3d_resource_dec_fence(op->view->resource); ++ + return sizeof(*op); + } + +@@ -1764,6 +1766,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + op->rect = *rect; + op->color = *color; + ++ wined3d_resource_inc_fence(view->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-clear-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-clear-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-clear-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-clear-calls.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,72 @@ +From bf044ed200f71fa0d27d5b74254afb4cef8fe7ca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:04:47 +0200 +Subject: wined3d: Fence clear calls. + +--- + dlls/wined3d/cs.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 23683d0..78731a0 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -550,7 +550,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + const struct wined3d_cs_clear *op = data; + struct wined3d_device *device; + RECT draw_rect; +- unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; ++ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0, i; + + device = cs->device; + wined3d_get_draw_rect(&cs->state, &draw_rect); +@@ -558,6 +558,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, + &op->color, op->depth, op->stencil); + ++ if (op->flags & WINED3DCLEAR_TARGET) ++ { ++ for (i = 0; i < device->adapter->gl_info.limits.buffers; i++) ++ { ++ if (cs->state.fb.render_targets[i]) ++ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); ++ } ++ } ++ if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) ++ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); ++ + return sizeof(*op) + sizeof(*op->rects) * extra_rects; + } + +@@ -565,8 +576,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) + { + struct wined3d_cs_clear *op; +- unsigned int extra_rects = rect_count ? rect_count - 1 : 0; ++ unsigned int extra_rects = rect_count ? rect_count - 1 : 0, i; + size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; ++ const struct wined3d_state *state = &cs->device->state; + + op = cs->ops->require_space(cs, size); + op->opcode = WINED3D_CS_OP_CLEAR; +@@ -578,6 +590,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + op->depth = depth; + op->stencil = stencil; + ++ if (flags & WINED3DCLEAR_TARGET) ++ { ++ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) ++ { ++ if (state->fb.render_targets[i]) ++ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); ++ } ++ } ++ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) ++ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); ++ + cs->ops->submit(cs, size); + } + +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-color_fill-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-color_fill-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-color_fill-operations.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Fence-color_fill-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From 97f6ef9c0d1d05efc640183d3b045296bca762a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:58:13 +0200 -Subject: wined3d: Fence color_fill operations. - ---- - dlls/wined3d/cs.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 5603a37..fb92286 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1750,6 +1750,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) - - surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); - -+ wined3d_resource_dec_fence(op->view->resource); -+ - return sizeof(*op); - } - -@@ -1764,6 +1766,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - op->rect = *rect; - op->color = *color; - -+ wined3d_resource_inc_fence(view->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-clear-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-clear-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-clear-calls.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-clear-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -From bf044ed200f71fa0d27d5b74254afb4cef8fe7ca Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:04:47 +0200 -Subject: wined3d: Fence clear calls. - ---- - dlls/wined3d/cs.c | 27 +++++++++++++++++++++++++-- - 1 file changed, 25 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 23683d0..78731a0 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -550,7 +550,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - const struct wined3d_cs_clear *op = data; - struct wined3d_device *device; - RECT draw_rect; -- unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; -+ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0, i; - - device = cs->device; - wined3d_get_draw_rect(&cs->state, &draw_rect); -@@ -558,6 +558,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, - &op->color, op->depth, op->stencil); - -+ if (op->flags & WINED3DCLEAR_TARGET) -+ { -+ for (i = 0; i < device->adapter->gl_info.limits.buffers; i++) -+ { -+ if (cs->state.fb.render_targets[i]) -+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); -+ } -+ } -+ if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) -+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); -+ - return sizeof(*op) + sizeof(*op->rects) * extra_rects; - } - -@@ -565,8 +576,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) - { - struct wined3d_cs_clear *op; -- unsigned int extra_rects = rect_count ? rect_count - 1 : 0; -+ unsigned int extra_rects = rect_count ? rect_count - 1 : 0, i; - size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; -+ const struct wined3d_state *state = &cs->device->state; - - op = cs->ops->require_space(cs, size); - op->opcode = WINED3D_CS_OP_CLEAR; -@@ -578,6 +590,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - op->depth = depth; - op->stencil = stencil; - -+ if (flags & WINED3DCLEAR_TARGET) -+ { -+ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) -+ { -+ if (state->fb.render_targets[i]) -+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); -+ } -+ } -+ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) -+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); -+ - cs->ops->submit(cs, size); - } - --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-present-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-present-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-present-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Fence-present-calls.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,54 @@ +From e485302fbcd610c34cf3e664d3d9a588fb7f3a32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:55:35 +0200 +Subject: wined3d: Fence present calls. + +--- + dlls/wined3d/cs.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index bdb9279..45dc5ce 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -485,6 +485,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; + const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; + const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; ++ unsigned int i; + + swapchain = op->swapchain; + wined3d_swapchain_set_window(swapchain, op->dst_window_override); +@@ -495,6 +496,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + + InterlockedDecrement(&cs->pending_presents); + ++ wined3d_resource_dec_fence(&swapchain->front_buffer->resource); ++ for (i = 0; i < swapchain->desc.backbuffer_count; i++) ++ wined3d_resource_dec_fence(&swapchain->back_buffers[i]->resource); ++ + return sizeof(*op); + } + +@@ -504,6 +509,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + { + struct wined3d_cs_present *op; + LONG pending; ++ unsigned int i; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_PRESENT; +@@ -527,6 +533,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + } + op->flags = flags; + ++ wined3d_resource_inc_fence(&swapchain->front_buffer->resource); ++ for (i = 0; i < swapchain->desc.backbuffer_count; i++) ++ wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); ++ + pending = InterlockedIncrement(&cs->pending_presents); + + cs->ops->submit(cs, sizeof(*op)); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Fence-present-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Fence-present-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Fence-present-calls.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Fence-present-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From e485302fbcd610c34cf3e664d3d9a588fb7f3a32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:55:35 +0200 -Subject: wined3d: Fence present calls. - ---- - dlls/wined3d/cs.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index bdb9279..45dc5ce 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -485,6 +485,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; - const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; - const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; -+ unsigned int i; - - swapchain = op->swapchain; - wined3d_swapchain_set_window(swapchain, op->dst_window_override); -@@ -495,6 +496,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - - InterlockedDecrement(&cs->pending_presents); - -+ wined3d_resource_dec_fence(&swapchain->front_buffer->resource); -+ for (i = 0; i < swapchain->desc.backbuffer_count; i++) -+ wined3d_resource_dec_fence(&swapchain->back_buffers[i]->resource); -+ - return sizeof(*op); - } - -@@ -504,6 +509,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - { - struct wined3d_cs_present *op; - LONG pending; -+ unsigned int i; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_PRESENT; -@@ -527,6 +533,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - } - op->flags = flags; - -+ wined3d_resource_inc_fence(&swapchain->front_buffer->resource); -+ for (i = 0; i < swapchain->desc.backbuffer_count; i++) -+ wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); -+ - pending = InterlockedIncrement(&cs->pending_presents); - - cs->ops->submit(cs, sizeof(*op)); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,80 @@ +From a14049c3703ec2f275f2ce21b45ba4bc32d6021d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:58:25 +0200 +Subject: wined3d: Make resource maps and unmaps a priority command. + +--- + dlls/wined3d/cs.c | 14 +++++--------- + dlls/wined3d/resource.c | 8 ++++++-- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 45dc5ce..054c000 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1819,19 +1819,15 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc + struct wined3d_cs_resource_map *op; + void *ret; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_MAP; + op->resource = resource; + op->flags = flags; + op->mem = &ret; + +- cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->submit_prio(cs, sizeof(*op)); + +- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) +- { +- FIXME("Dynamic resource map is inefficient\n"); +- } +- cs->ops->finish(cs); ++ cs->ops->finish_prio(cs); + + return ret; + } +@@ -1850,11 +1846,11 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour + { + struct wined3d_cs_resource_unmap *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; + op->resource = resource; + +- cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->submit_prio(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 73011f8..d2407a1 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -734,8 +734,7 @@ static void wined3d_resource_sync(struct wined3d_resource *resource) + default: + break; + } +- if (!real_res->access_fence) +- FIXME("Waiting for CS even though resource %p is idle.\n", resource); ++ wined3d_resource_wait_fence(real_res); + } + + HRESULT wined3d_resource_map(struct wined3d_resource *resource, +@@ -756,6 +755,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + ++ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) ++ { ++ FIXME("Dynamic resource map is inefficient\n"); ++ } ++ + wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-changed-textures-through-the-command.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-changed-textures-through-the-command.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-changed-textures-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-changed-textures-through-the-command.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,176 @@ +From eb59e53d03f032fe4e04a6e7843ac06e9dddbbdd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 18:46:19 +0200 +Subject: wined3d: Dirtify changed textures through the command stream. + +This makes sure unsynchronized maps (NOOVERWRITE /DISCARD) are reflected +in the volume's location flags at the right time. +--- + dlls/wined3d/cs.c | 31 ++++++++++++++++++++++++++++++- + dlls/wined3d/resource.c | 15 ++++++++++----- + dlls/wined3d/surface.c | 9 +++------ + dlls/wined3d/wined3d_private.h | 2 ++ + 4 files changed, 45 insertions(+), 12 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 054c000..f5c10dd 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -65,6 +65,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, + WINED3D_CS_OP_CLEAR_RTV, ++ WINED3D_CS_OP_RESOURCE_CHANGED, + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, +@@ -365,6 +366,12 @@ struct wined3d_cs_resource_unmap + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_resource_changed ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -1804,6 +1811,27 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_changed *op = data; ++ struct wined3d_resource *resource = op->resource; ++ ++ wined3d_resource_changed(resource); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_resource_changed *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_resource_map *op = data; +@@ -2110,11 +2138,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, + /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, +- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, + /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, + /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, + /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, ++ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, + /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, + /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, +@@ -2133,6 +2161,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, ++ /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index d2407a1..7cafdc6 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -830,11 +830,6 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) + wined3d_resource_release_map_ptr(resource, context); + if (context) + context_release(context); +- +- if (resource->unmap_dirtify) +- wined3d_resource_invalidate_location(resource, ~resource->map_binding); +- resource->unmap_dirtify = FALSE; +- + } + + HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +@@ -849,7 +844,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + } + + wined3d_cs_emit_resource_unmap(device->cs, resource); ++ ++ if (resource->unmap_dirtify) ++ wined3d_cs_emit_resource_changed(device->cs, resource); ++ resource->unmap_dirtify = FALSE; ++ + resource->map_count--; + + return WINED3D_OK; + } ++ ++void wined3d_resource_changed(struct wined3d_resource *resource) ++{ ++ wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++} +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index e661494..535e21a 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1093,6 +1093,9 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour + + if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + wined3d_texture_set_dirty(surface->container); ++ ++ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) ++ surface->surface_ops->surface_frontbuffer_updated(surface); + } + + static const struct wined3d_surface_ops surface_ops = +@@ -2405,16 +2408,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT hr; + TRACE("surface %p.\n", surface); + +- if (surface->resource.unmap_dirtify && surface->container) +- wined3d_texture_set_dirty(surface->container); +- +- + hr = wined3d_resource_unmap(&surface->resource); + if (FAILED(hr)) + return hr; + +- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) +- surface->surface_ops->surface_frontbuffer_updated(surface); + memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); + + return hr; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d670fe1..b9831fd 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2146,6 +2146,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + const struct wined3d_box *box) DECLSPEC_HIDDEN; + void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2662,6 +2663,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -From a14049c3703ec2f275f2ce21b45ba4bc32d6021d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:58:25 +0200 -Subject: wined3d: Make resource maps and unmaps a priority command. - ---- - dlls/wined3d/cs.c | 14 +++++--------- - dlls/wined3d/resource.c | 8 ++++++-- - 2 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 45dc5ce..054c000 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1819,19 +1819,15 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc - struct wined3d_cs_resource_map *op; - void *ret; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_MAP; - op->resource = resource; - op->flags = flags; - op->mem = &ret; - -- cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->submit_prio(cs, sizeof(*op)); - -- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -- { -- FIXME("Dynamic resource map is inefficient\n"); -- } -- cs->ops->finish(cs); -+ cs->ops->finish_prio(cs); - - return ret; - } -@@ -1850,11 +1846,11 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour - { - struct wined3d_cs_resource_unmap *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; - op->resource = resource; - -- cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->submit_prio(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 73011f8..d2407a1 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -734,8 +734,7 @@ static void wined3d_resource_sync(struct wined3d_resource *resource) - default: - break; - } -- if (!real_res->access_fence) -- FIXME("Waiting for CS even though resource %p is idle.\n", resource); -+ wined3d_resource_wait_fence(real_res); - } - - HRESULT wined3d_resource_map(struct wined3d_resource *resource, -@@ -756,6 +755,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -+ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -+ { -+ FIXME("Dynamic resource map is inefficient\n"); -+ } -+ - wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Dirtify-changed-textures-through-the-command.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Dirtify-changed-textures-through-the-command.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Dirtify-changed-textures-through-the-command.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Dirtify-changed-textures-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -From eb59e53d03f032fe4e04a6e7843ac06e9dddbbdd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 18:46:19 +0200 -Subject: wined3d: Dirtify changed textures through the command stream. - -This makes sure unsynchronized maps (NOOVERWRITE /DISCARD) are reflected -in the volume's location flags at the right time. ---- - dlls/wined3d/cs.c | 31 ++++++++++++++++++++++++++++++- - dlls/wined3d/resource.c | 15 ++++++++++----- - dlls/wined3d/surface.c | 9 +++------ - dlls/wined3d/wined3d_private.h | 2 ++ - 4 files changed, 45 insertions(+), 12 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 054c000..f5c10dd 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -65,6 +65,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT_ENABLE, - WINED3D_CS_OP_BLT, - WINED3D_CS_OP_CLEAR_RTV, -+ WINED3D_CS_OP_RESOURCE_CHANGED, - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_QUERY_ISSUE, -@@ -365,6 +366,12 @@ struct wined3d_cs_resource_unmap - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_resource_changed -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -1804,6 +1811,27 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_changed *op = data; -+ struct wined3d_resource *resource = op->resource; -+ -+ wined3d_resource_changed(resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_resource_changed *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_resource_map *op = data; -@@ -2110,11 +2138,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, - /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, - /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, -- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, - /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, - /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, - /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, -+ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, - /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, - /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, -@@ -2133,6 +2161,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, - /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, -+ /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d2407a1..7cafdc6 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -830,11 +830,6 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) - wined3d_resource_release_map_ptr(resource, context); - if (context) - context_release(context); -- -- if (resource->unmap_dirtify) -- wined3d_resource_invalidate_location(resource, ~resource->map_binding); -- resource->unmap_dirtify = FALSE; -- - } - - HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -@@ -849,7 +844,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - } - - wined3d_cs_emit_resource_unmap(device->cs, resource); -+ -+ if (resource->unmap_dirtify) -+ wined3d_cs_emit_resource_changed(device->cs, resource); -+ resource->unmap_dirtify = FALSE; -+ - resource->map_count--; - - return WINED3D_OK; - } -+ -+void wined3d_resource_changed(struct wined3d_resource *resource) -+{ -+ wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+} -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e661494..535e21a 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1093,6 +1093,9 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour - - if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - wined3d_texture_set_dirty(surface->container); -+ -+ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -+ surface->surface_ops->surface_frontbuffer_updated(surface); - } - - static const struct wined3d_surface_ops surface_ops = -@@ -2405,16 +2408,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - HRESULT hr; - TRACE("surface %p.\n", surface); - -- if (surface->resource.unmap_dirtify && surface->container) -- wined3d_texture_set_dirty(surface->container); -- -- - hr = wined3d_resource_unmap(&surface->resource); - if (FAILED(hr)) - return hr; - -- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -- surface->surface_ops->surface_frontbuffer_updated(surface); - memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); - - return hr; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d670fe1..b9831fd 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2146,6 +2146,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) DECLSPEC_HIDDEN; - void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2662,6 +2663,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Wrap-GL-BOs-in-a-structure.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Wrap-GL-BOs-in-a-structure.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Wrap-GL-BOs-in-a-structure.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Wrap-GL-BOs-in-a-structure.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,274 @@ +From c9ba533914088eba32bfa04e4318c1b18b20388e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 17:00:35 +0200 +Subject: wined3d: Wrap GL BOs in a structure + +The idea is to use those structures for mapping through the command stream and caching +them for DISCARD maps. +--- + dlls/wined3d/device.c | 53 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 34 +++++++++++---------------- + dlls/wined3d/surface.c | 4 ++-- + dlls/wined3d/texture.c | 2 +- + dlls/wined3d/volume.c | 6 ++--- + dlls/wined3d/wined3d_private.h | 15 +++++++++++- + 6 files changed, 86 insertions(+), 28 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 46058ef..4325e65 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -5254,3 +5254,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL + else + return CallWindowProcA(proc, window, message, wparam, lparam); + } ++ ++/* Context activation is done by the caller */ ++struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, ++ GLenum type_hint, struct wined3d_context *context) ++{ ++ struct wined3d_gl_bo *ret; ++ const struct wined3d_gl_info *gl_info; ++ ++ TRACE("device %p, size %u, gl_usage %u, type_hint %u\n", device, size, gl_usage, ++ type_hint); ++ ++ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); ++ if(!ret) ++ return NULL; ++ ret->type_hint = type_hint; ++ ret->size = size; ++ ret->usage = gl_usage; ++ ++ gl_info = context->gl_info; ++ ++ GL_EXTCALL(glGenBuffers(1, &ret->name)); ++ if (type_hint == GL_ELEMENT_ARRAY_BUFFER) ++ context_invalidate_state(context, STATE_INDEXBUFFER); ++ GL_EXTCALL(glBindBuffer(type_hint, ret->name)); ++ GL_EXTCALL(glBufferData(type_hint, size, NULL, gl_usage)); ++ GL_EXTCALL(glBindBuffer(type_hint, 0)); ++ checkGLcall("Create buffer object"); ++ ++ TRACE("Successfully created and set up buffer %u\n", ret->name); ++ return ret; ++} ++ ++/* Context activation is done by the caller */ ++static void wined3d_device_destroy_bo(struct wined3d_device *device, const struct wined3d_context *context, ++ struct wined3d_gl_bo *bo) ++{ ++ const struct wined3d_gl_info *gl_info = context->gl_info; ++ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); ++ ++ GL_EXTCALL(glDeleteBuffers(1, &bo->name)); ++ checkGLcall("glDeleteBuffers"); ++ ++ HeapFree(GetProcessHeap(), 0, bo); ++} ++ ++/* Context activation is done by the caller */ ++void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, ++ const struct wined3d_context *context) ++{ ++ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); ++ ++ wined3d_device_destroy_bo(device, context, bo); ++} +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 3b9c609..611bfa3 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -236,12 +236,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void wined3d_resource_free_bo(struct wined3d_resource *resource) + { + struct wined3d_context *context = context_acquire(resource->device, NULL); +- const struct wined3d_gl_info *gl_info = context->gl_info; + +- TRACE("Deleting GL buffer %u belonging to resource %p.\n", resource->buffer_object, resource); +- GL_EXTCALL(glDeleteBuffers(1, &resource->buffer_object)); +- checkGLcall("glDeleteBuffers"); +- resource->buffer_object = 0; ++ wined3d_device_release_bo(resource->device, resource->buffer, context); ++ resource->buffer = NULL; ++ + context_release(context); + } + +@@ -257,7 +255,7 @@ void resource_cleanup(struct wined3d_resource *resource) + adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); + } + +- if (resource->buffer_object) ++ if (resource->buffer) + wined3d_resource_free_bo(resource); + + wined3d_resource_free_sysmem(resource); +@@ -270,7 +268,7 @@ void resource_unload(struct wined3d_resource *resource) + if (resource->map_count) + ERR("Resource %p is being unloaded while mapped.\n", resource); + +- if (resource->buffer_object) ++ if (resource->buffer) + wined3d_resource_free_bo(resource); + + context_resource_unloaded(resource->device, +@@ -537,7 +535,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, + { + if (location & WINED3D_LOCATION_BUFFER) + { +- data->buffer_object = resource->buffer_object; ++ data->buffer_object = resource->buffer->name; + data->addr = NULL; + return; + } +@@ -646,7 +644,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); + + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { +@@ -689,7 +687,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); + GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Unmap GL buffer"); +@@ -707,20 +705,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + } + + /* Context activation is done by the caller. */ +-static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) ++static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struct wined3d_context *context) + { +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- if (resource->buffer_object) ++ if (resource->buffer) + return; + +- GL_EXTCALL(glGenBuffers(1, &resource->buffer_object)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); +- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, resource->size, NULL, GL_STREAM_DRAW)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("Create GL buffer"); +- +- TRACE("Created GL buffer %u for resource %p.\n", resource->buffer_object, resource); ++ resource->buffer = wined3d_device_get_bo(resource->device, resource->size, ++ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); ++ TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); + } + + BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 40f4dab..3816f35 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) + surface->resource.device->cs->ops->finish(surface->resource.device->cs); + } + +- if (surface->resource.buffer_object || surface->rb_multisample ++ if (surface->resource.buffer || surface->rb_multisample + || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { + struct wined3d_renderbuffer_entry *entry, *entry2; +@@ -3701,7 +3701,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + /* Don't use PBOs for converted surfaces. During PBO conversion we look at + * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is + * getting called. */ +- if ((format.convert || conversion) && surface->resource.buffer_object) ++ if ((format.convert || conversion) && surface->resource.buffer) + { + TRACE("Removing the pbo attached to surface %p.\n", surface); + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 12796198..0fcc436 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1586,7 +1586,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +- || surface->resource.buffer_object)) ++ || surface->resource.buffer)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 807e626..d93a0bd 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + } + else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) + { +- struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; ++ struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); +@@ -267,12 +267,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + break; + + case WINED3D_LOCATION_BUFFER: +- if (!volume->resource.buffer_object) ++ if (!volume->resource.buffer) + ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); + + if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +- struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; ++ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; + + if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 877dd1e..67301c8 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2120,6 +2120,14 @@ struct wined3d_state + DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; + }; + ++struct wined3d_gl_bo ++{ ++ GLuint name; ++ GLenum usage; ++ GLenum type_hint; ++ UINT size; ++}; ++ + #define WINED3D_UNMAPPED_STAGE ~0U + + /* Multithreaded flag. Removed from the public header to signal that +@@ -2229,6 +2237,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D + void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; + void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, + struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; ++struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, ++ GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; ++void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, ++ const struct wined3d_context *context) DECLSPEC_HIDDEN; ++ + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2277,7 +2290,7 @@ struct wined3d_resource + DWORD priority; + void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; +- GLuint buffer_object; ++ struct wined3d_gl_bo *buffer; + struct list resource_list_entry; + DWORD locations; + LONG access_fence; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Separate-resource-map-and-draw-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Separate-resource-map-and-draw-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Separate-resource-map-and-draw-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Separate-resource-map-and-draw-buffers.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,69 @@ +From 93fe426cbd0d2b61997d59fbbd1e49b2615f8c0c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 17:06:29 +0200 +Subject: wined3d: Separate resource map and draw buffers + +--- + dlls/wined3d/resource.c | 9 +++++++-- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 8fb95a1..39555ef 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -146,8 +146,12 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) + { + struct wined3d_context *context = context_acquire(resource->device, NULL); + ++ if (resource->buffer != resource->map_buffer) ++ ERR("Releasing resource buffer with buffer != map_buffer.\n"); ++ + wined3d_device_release_bo(resource->device, resource->buffer, context); + resource->buffer = NULL; ++ resource->map_buffer = NULL; + + context_release(context); + } +@@ -535,7 +539,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); + + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { +@@ -578,7 +582,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); + GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Unmap GL buffer"); +@@ -603,6 +607,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc + + resource->buffer = wined3d_device_get_bo(resource->device, resource->size, + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); ++ resource->map_buffer = resource->buffer; + TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ff64215..374dbc2 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2139,7 +2139,7 @@ struct wined3d_resource + DWORD priority; + void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; +- struct wined3d_gl_bo *buffer; ++ struct wined3d_gl_bo *buffer, *map_buffer; + struct list resource_list_entry; + DWORD locations; + LONG access_fence; +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Wrap-GL-BOs-in-a-structure.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Wrap-GL-BOs-in-a-structure.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Wrap-GL-BOs-in-a-structure.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Wrap-GL-BOs-in-a-structure.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -From 08092b494b98ca7ca22998b5afb4adcd6172a0fc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 17:00:35 +0200 -Subject: wined3d: Wrap GL BOs in a structure - -The idea is to use those structures for mapping through the command stream and caching -them for DISCARD maps. ---- - dlls/wined3d/device.c | 53 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 34 +++++++++++---------------- - dlls/wined3d/surface.c | 6 ++--- - dlls/wined3d/volume.c | 6 ++--- - dlls/wined3d/wined3d_private.h | 15 +++++++++++- - 5 files changed, 86 insertions(+), 28 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index eb0c0ba..d0fcba2 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -5139,3 +5139,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL - else - return CallWindowProcA(proc, window, message, wparam, lparam); - } -+ -+/* Context activation is done by the caller */ -+struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -+ GLenum type_hint, struct wined3d_context *context) -+{ -+ struct wined3d_gl_bo *ret; -+ const struct wined3d_gl_info *gl_info; -+ -+ TRACE("device %p, size %u, gl_usage %u, type_hint %u\n", device, size, gl_usage, -+ type_hint); -+ -+ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); -+ if(!ret) -+ return NULL; -+ ret->type_hint = type_hint; -+ ret->size = size; -+ ret->usage = gl_usage; -+ -+ gl_info = context->gl_info; -+ -+ GL_EXTCALL(glGenBuffers(1, &ret->name)); -+ if (type_hint == GL_ELEMENT_ARRAY_BUFFER) -+ context_invalidate_state(context, STATE_INDEXBUFFER); -+ GL_EXTCALL(glBindBuffer(type_hint, ret->name)); -+ GL_EXTCALL(glBufferData(type_hint, size, NULL, gl_usage)); -+ GL_EXTCALL(glBindBuffer(type_hint, 0)); -+ checkGLcall("Create buffer object"); -+ -+ TRACE("Successfully created and set up buffer %u\n", ret->name); -+ return ret; -+} -+ -+/* Context activation is done by the caller */ -+static void wined3d_device_destroy_bo(struct wined3d_device *device, const struct wined3d_context *context, -+ struct wined3d_gl_bo *bo) -+{ -+ const struct wined3d_gl_info *gl_info = context->gl_info; -+ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); -+ -+ GL_EXTCALL(glDeleteBuffers(1, &bo->name)); -+ checkGLcall("glDeleteBuffers"); -+ -+ HeapFree(GetProcessHeap(), 0, bo); -+} -+ -+/* Context activation is done by the caller */ -+void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, -+ const struct wined3d_context *context) -+{ -+ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); -+ -+ wined3d_device_destroy_bo(device, context, bo); -+} -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 49ef6b9..37a2644 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -226,12 +226,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void wined3d_resource_free_bo(struct wined3d_resource *resource) - { - struct wined3d_context *context = context_acquire(resource->device, NULL); -- const struct wined3d_gl_info *gl_info = context->gl_info; - -- TRACE("Deleting GL buffer %u belonging to resource %p.\n", resource->buffer_object, resource); -- GL_EXTCALL(glDeleteBuffers(1, &resource->buffer_object)); -- checkGLcall("glDeleteBuffers"); -- resource->buffer_object = 0; -+ wined3d_device_release_bo(resource->device, resource->buffer, context); -+ resource->buffer = NULL; -+ - context_release(context); - } - -@@ -247,7 +245,7 @@ void resource_cleanup(struct wined3d_resource *resource) - adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); - } - -- if (resource->buffer_object) -+ if (resource->buffer) - wined3d_resource_free_bo(resource); - - wined3d_resource_free_sysmem(resource); -@@ -260,7 +258,7 @@ void resource_unload(struct wined3d_resource *resource) - if (resource->map_count) - ERR("Resource %p is being unloaded while mapped.\n", resource); - -- if (resource->buffer_object) -+ if (resource->buffer) - wined3d_resource_free_bo(resource); - - context_resource_unloaded(resource->device, -@@ -511,7 +509,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, - { - if (location & WINED3D_LOCATION_BUFFER) - { -- data->buffer_object = resource->buffer_object; -+ data->buffer_object = resource->buffer->name; - data->addr = NULL; - return; - } -@@ -620,7 +618,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); - - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { -@@ -663,7 +661,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); - GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Unmap GL buffer"); -@@ -681,20 +679,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - } - - /* Context activation is done by the caller. */ --static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) -+static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struct wined3d_context *context) - { -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- if (resource->buffer_object) -+ if (resource->buffer) - return; - -- GL_EXTCALL(glGenBuffers(1, &resource->buffer_object)); -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); -- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, resource->size, NULL, GL_STREAM_DRAW)); -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -- checkGLcall("Create GL buffer"); -- -- TRACE("Created GL buffer %u for resource %p.\n", resource->buffer_object, resource); -+ resource->buffer = wined3d_device_get_bo(resource->device, resource->size, -+ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); -+ TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); - } - - BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 025e85e1..fc1fc45 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) - surface->resource.device->cs->ops->finish(surface->resource.device->cs); - } - -- if (surface->resource.buffer_object || surface->rb_multisample -+ if (surface->resource.buffer || surface->rb_multisample - || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { - struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2586,7 +2586,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -- || surface->resource.buffer_object)) -+ || surface->resource.buffer)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -@@ -3905,7 +3905,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - /* Don't use PBOs for converted surfaces. During PBO conversion we look at - * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is - * getting called. */ -- if ((format.convert || conversion) && surface->resource.buffer_object) -+ if ((format.convert || conversion) && surface->resource.buffer) - { - TRACE("Removing the pbo attached to surface %p.\n", surface); - -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index b79f44e..ea9a047 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - } - else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) - { -- struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; -+ struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; - wined3d_texture_bind_and_dirtify(volume->container, context, - location == WINED3D_LOCATION_TEXTURE_SRGB); - wined3d_volume_upload_data(volume, context, &data); -@@ -269,12 +269,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - break; - - case WINED3D_LOCATION_BUFFER: -- if (!volume->resource.buffer_object) -+ if (!volume->resource.buffer) - ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); - - if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -- struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; -+ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; - - if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8a25420..9eb038e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2048,6 +2048,14 @@ struct wined3d_state - DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; - }; - -+struct wined3d_gl_bo -+{ -+ GLuint name; -+ GLenum usage; -+ GLenum type_hint; -+ UINT size; -+}; -+ - #define WINED3D_UNMAPPED_STAGE ~0U - - /* Multithreaded flag. Removed from the public header to signal that -@@ -2154,6 +2162,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D - void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; - void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, - struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; -+struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -+ GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; -+void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, -+ const struct wined3d_context *context) DECLSPEC_HIDDEN; -+ - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2199,7 +2212,7 @@ struct wined3d_resource - DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; -- GLuint buffer_object; -+ struct wined3d_gl_bo *buffer; - struct list resource_list_entry; - DWORD locations; - LONG access_fence; --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,150 @@ +From eb880bc806a44d2d2d09df19a43fd1a5f7d8ecf1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 19:06:41 +0200 +Subject: wined3d: Implement DISCARD resource maps with buffers. + +--- + dlls/wined3d/cs.c | 7 +++++-- + dlls/wined3d/resource.c | 41 ++++++++++++++++++++++++++++++++++------- + dlls/wined3d/wined3d_private.h | 6 ++++-- + 3 files changed, 43 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f5c10dd..d86aa59 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -370,6 +370,7 @@ struct wined3d_cs_resource_changed + { + enum wined3d_cs_op opcode; + struct wined3d_resource *resource; ++ struct wined3d_gl_bo *swap_buffer; + }; + + struct wined3d_cs_skip +@@ -1816,18 +1817,20 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * + const struct wined3d_cs_resource_changed *op = data; + struct wined3d_resource *resource = op->resource; + +- wined3d_resource_changed(resource); ++ wined3d_resource_changed(resource, op->swap_buffer); + + return sizeof(*op); + } + +-void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) + { + struct wined3d_cs_resource_changed *op; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; + op->resource = resource; ++ op->swap_buffer = swap_buffer; + + cs->ops->submit(cs, sizeof(*op)); + } +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 39555ef..69dd95a 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -697,9 +697,27 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla + } + + if (flags & WINED3D_MAP_DISCARD) ++ { ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ resource->map_buffer = wined3d_device_get_bo(device, resource->size, ++ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); ++ break; ++ ++ default: ++ if (resource->access_fence) ++ ERR("Location %s does not support DISCARD maps.\n", ++ wined3d_debug_location(resource->map_binding)); ++ if (resource->pool != WINED3D_POOL_DEFAULT) ++ FIXME("Discard used on %s pool resource.\n", debug_d3dpool(resource->pool)); ++ } + wined3d_resource_validate_location(resource, resource->map_binding); ++ } + else ++ { + wined3d_resource_load_location(resource, context, resource->map_binding); ++ } + + mem = wined3d_resource_get_map_ptr(resource, context, flags); + +@@ -752,12 +770,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + +- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) +- { +- FIXME("Dynamic resource map is inefficient\n"); +- } ++ if (flags & WINED3D_MAP_NOOVERWRITE) ++ FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); + +- wined3d_resource_sync(resource); ++ if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) ++ wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); + if (!base_memory) +@@ -843,7 +860,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + wined3d_cs_emit_resource_unmap(device->cs, resource); + + if (resource->unmap_dirtify) +- wined3d_cs_emit_resource_changed(device->cs, resource); ++ wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); + resource->unmap_dirtify = FALSE; + + resource->map_count--; +@@ -851,7 +868,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + return WINED3D_OK; + } + +-void wined3d_resource_changed(struct wined3d_resource *resource) ++void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) + { ++ struct wined3d_device *device = resource->device; ++ ++ if (swap_buffer && swap_buffer != resource->buffer) ++ { ++ struct wined3d_context *context = context_acquire(device, NULL); ++ wined3d_device_release_bo(device, resource->buffer, context); ++ context_release(context); ++ resource->buffer = swap_buffer; ++ } ++ + wined3d_resource_invalidate_location(resource, ~resource->map_binding); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 374dbc2..abf3ca2 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2170,7 +2170,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_changed(struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; + BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + const struct wined3d_box *box) DECLSPEC_HIDDEN; + void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2693,7 +2694,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; +-void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Separate-resource-map-and-draw-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Separate-resource-map-and-draw-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Separate-resource-map-and-draw-buffers.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Separate-resource-map-and-draw-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From 93fe426cbd0d2b61997d59fbbd1e49b2615f8c0c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 17:06:29 +0200 -Subject: wined3d: Separate resource map and draw buffers - ---- - dlls/wined3d/resource.c | 9 +++++++-- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8fb95a1..39555ef 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -146,8 +146,12 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) - { - struct wined3d_context *context = context_acquire(resource->device, NULL); - -+ if (resource->buffer != resource->map_buffer) -+ ERR("Releasing resource buffer with buffer != map_buffer.\n"); -+ - wined3d_device_release_bo(resource->device, resource->buffer, context); - resource->buffer = NULL; -+ resource->map_buffer = NULL; - - context_release(context); - } -@@ -535,7 +539,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); - - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { -@@ -578,7 +582,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); - GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Unmap GL buffer"); -@@ -603,6 +607,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc - - resource->buffer = wined3d_device_get_bo(resource->device, resource->size, - GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); -+ resource->map_buffer = resource->buffer; - TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ff64215..374dbc2 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2139,7 +2139,7 @@ struct wined3d_resource - DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; -- struct wined3d_gl_bo *buffer; -+ struct wined3d_gl_bo *buffer, *map_buffer; - struct list resource_list_entry; - DWORD locations; - LONG access_fence; --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -From eb880bc806a44d2d2d09df19a43fd1a5f7d8ecf1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 19:06:41 +0200 -Subject: wined3d: Implement DISCARD resource maps with buffers. - ---- - dlls/wined3d/cs.c | 7 +++++-- - dlls/wined3d/resource.c | 41 ++++++++++++++++++++++++++++++++++------- - dlls/wined3d/wined3d_private.h | 6 ++++-- - 3 files changed, 43 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f5c10dd..d86aa59 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -370,6 +370,7 @@ struct wined3d_cs_resource_changed - { - enum wined3d_cs_op opcode; - struct wined3d_resource *resource; -+ struct wined3d_gl_bo *swap_buffer; - }; - - struct wined3d_cs_skip -@@ -1816,18 +1817,20 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * - const struct wined3d_cs_resource_changed *op = data; - struct wined3d_resource *resource = op->resource; - -- wined3d_resource_changed(resource); -+ wined3d_resource_changed(resource, op->swap_buffer); - - return sizeof(*op); - } - --void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) - { - struct wined3d_cs_resource_changed *op; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; - op->resource = resource; -+ op->swap_buffer = swap_buffer; - - cs->ops->submit(cs, sizeof(*op)); - } -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 39555ef..69dd95a 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -697,9 +697,27 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - } - - if (flags & WINED3D_MAP_DISCARD) -+ { -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ resource->map_buffer = wined3d_device_get_bo(device, resource->size, -+ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); -+ break; -+ -+ default: -+ if (resource->access_fence) -+ ERR("Location %s does not support DISCARD maps.\n", -+ wined3d_debug_location(resource->map_binding)); -+ if (resource->pool != WINED3D_POOL_DEFAULT) -+ FIXME("Discard used on %s pool resource.\n", debug_d3dpool(resource->pool)); -+ } - wined3d_resource_validate_location(resource, resource->map_binding); -+ } - else -+ { - wined3d_resource_load_location(resource, context, resource->map_binding); -+ } - - mem = wined3d_resource_get_map_ptr(resource, context, flags); - -@@ -752,12 +770,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -- { -- FIXME("Dynamic resource map is inefficient\n"); -- } -+ if (flags & WINED3D_MAP_NOOVERWRITE) -+ FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); - -- wined3d_resource_sync(resource); -+ if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) -+ wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); - if (!base_memory) -@@ -843,7 +860,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - wined3d_cs_emit_resource_unmap(device->cs, resource); - - if (resource->unmap_dirtify) -- wined3d_cs_emit_resource_changed(device->cs, resource); -+ wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); - resource->unmap_dirtify = FALSE; - - resource->map_count--; -@@ -851,7 +868,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - return WINED3D_OK; - } - --void wined3d_resource_changed(struct wined3d_resource *resource) -+void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) - { -+ struct wined3d_device *device = resource->device; -+ -+ if (swap_buffer && swap_buffer != resource->buffer) -+ { -+ struct wined3d_context *context = context_acquire(device, NULL); -+ wined3d_device_release_bo(device, resource->buffer, context); -+ context_release(context); -+ resource->buffer = swap_buffer; -+ } -+ - wined3d_resource_invalidate_location(resource, ~resource->map_binding); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 374dbc2..abf3ca2 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2170,7 +2170,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; --void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_changed(struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) DECLSPEC_HIDDEN; - void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2693,7 +2694,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; --void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,258 @@ +From 589330d01be6e2555b395b0914012248b1bff069 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 19:24:21 +0200 +Subject: wined3d: Implement DISCARD resource maps with heap memory. + +--- + dlls/wined3d/buffer.c | 1 + + dlls/wined3d/cs.c | 6 ++++-- + dlls/wined3d/resource.c | 40 +++++++++++++++++++++++++++++++++++----- + dlls/wined3d/surface.c | 3 +++ + dlls/wined3d/volume.c | 2 ++ + dlls/wined3d/wined3d_private.h | 6 +++--- + 6 files changed, 48 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 7187114..c9b2ae7b2 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -493,6 +493,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con + + if (!wined3d_resource_allocate_sysmem(&This->resource)) + ERR("Failed to allocate system memory.\n"); ++ This->resource.heap_memory = This->resource.map_heap_memory; + + if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) + context_invalidate_state(context, STATE_INDEXBUFFER); +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index d86aa59..9307246 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -371,6 +371,7 @@ struct wined3d_cs_resource_changed + enum wined3d_cs_op opcode; + struct wined3d_resource *resource; + struct wined3d_gl_bo *swap_buffer; ++ void *swap_heap_memory; + }; + + struct wined3d_cs_skip +@@ -1817,13 +1818,13 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * + const struct wined3d_cs_resource_changed *op = data; + struct wined3d_resource *resource = op->resource; + +- wined3d_resource_changed(resource, op->swap_buffer); ++ wined3d_resource_changed(resource, op->swap_buffer, op->swap_heap_memory); + + return sizeof(*op); + } + + void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) + { + struct wined3d_cs_resource_changed *op; + +@@ -1831,6 +1832,7 @@ void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_reso + op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; + op->resource = resource; + op->swap_buffer = swap_buffer; ++ op->swap_heap_memory = swap_heap_memory; + + cs->ops->submit(cs, sizeof(*op)); + } +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 69dd95a..b7aa587 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -119,6 +119,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + ERR("Failed to allocate system memory.\n"); + return E_OUTOFMEMORY; + } ++ resource->heap_memory = resource->map_heap_memory; + } + else + { +@@ -172,6 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) + wined3d_resource_free_bo(resource); + + wined3d_resource_free_sysmem(resource); ++ resource->map_heap_memory = NULL; + + device_resource_released(resource->device, resource); + } +@@ -246,7 +248,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) + p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; + *p = mem; + +- resource->heap_memory = ++p; ++ resource->map_heap_memory = ++p; + + return TRUE; + } +@@ -559,7 +561,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + return ptr; + + case WINED3D_LOCATION_SYSMEM: +- return resource->heap_memory; ++ return resource->map_heap_memory; + + case WINED3D_LOCATION_DIB: + return resource->bitmap_data; +@@ -621,6 +623,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) + ERR("Failed to allocate system memory.\n"); + return FALSE; + } ++ resource->heap_memory = resource->map_heap_memory; + return TRUE; + } + +@@ -705,6 +708,10 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + break; + ++ case WINED3D_LOCATION_SYSMEM: ++ wined3d_resource_allocate_sysmem(resource); ++ break; ++ + default: + if (resource->access_fence) + ERR("Location %s does not support DISCARD maps.\n", +@@ -773,7 +780,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + if (flags & WINED3D_MAP_NOOVERWRITE) + FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); + +- if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) ++ if (flags & WINED3D_MAP_DISCARD) ++ { ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ case WINED3D_LOCATION_SYSMEM: ++ break; ++ ++ default: ++ FIXME("Implement discard maps with %s map binding.\n", ++ wined3d_debug_location(resource->map_binding)); ++ wined3d_resource_sync(resource); ++ } ++ } ++ else + wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); +@@ -860,7 +881,10 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + wined3d_cs_emit_resource_unmap(device->cs, resource); + + if (resource->unmap_dirtify) +- wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); ++ { ++ wined3d_cs_emit_resource_changed(device->cs, resource, ++ resource->map_buffer, resource->map_heap_memory); ++ } + resource->unmap_dirtify = FALSE; + + resource->map_count--; +@@ -868,7 +892,8 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + return WINED3D_OK; + } + +-void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) ++void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer, ++ void *swap_heap_memory) + { + struct wined3d_device *device = resource->device; + +@@ -879,6 +904,11 @@ void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_ + context_release(context); + resource->buffer = swap_buffer; + } ++ if (swap_heap_memory && swap_heap_memory != resource->heap_memory) ++ { ++ wined3d_resource_free_sysmem(resource); ++ resource->heap_memory = swap_heap_memory; ++ } + + wined3d_resource_invalidate_location(resource, ~resource->map_binding); + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 90fa582..f56bb6b 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -487,6 +487,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) + return; + + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } + +@@ -1997,6 +1998,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + + surface->resource.locations = 0; + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + + width = texture_resource->width; + height = texture_resource->height; +@@ -5489,6 +5491,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + if (surface->resource.map_binding == WINED3D_LOCATION_DIB) + { + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 28985a4..d253a17 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -134,6 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, + static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) + { + wined3d_resource_free_sysmem(&volume->resource); ++ volume->resource.map_heap_memory = NULL; + wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + } + +@@ -516,6 +517,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture + { + wined3d_resource_free_sysmem(&volume->resource); + volume->resource.map_binding = WINED3D_LOCATION_BUFFER; ++ volume->resource.map_heap_memory = NULL; + } + + volume->container = container; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index abf3ca2..ac4aeb3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2137,7 +2137,7 @@ struct wined3d_resource + UINT depth; + UINT size; + DWORD priority; +- void *heap_memory, *user_memory, *bitmap_data; ++ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; + struct wined3d_gl_bo *buffer, *map_buffer; + struct list resource_list_entry; +@@ -2171,7 +2171,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_changed(struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + const struct wined3d_box *box) DECLSPEC_HIDDEN; + void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2695,7 +2695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ -From 589330d01be6e2555b395b0914012248b1bff069 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 19:24:21 +0200 -Subject: wined3d: Implement DISCARD resource maps with heap memory. - ---- - dlls/wined3d/buffer.c | 1 + - dlls/wined3d/cs.c | 6 ++++-- - dlls/wined3d/resource.c | 40 +++++++++++++++++++++++++++++++++++----- - dlls/wined3d/surface.c | 3 +++ - dlls/wined3d/volume.c | 2 ++ - dlls/wined3d/wined3d_private.h | 6 +++--- - 6 files changed, 48 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 7187114..c9b2ae7b2 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -493,6 +493,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con - - if (!wined3d_resource_allocate_sysmem(&This->resource)) - ERR("Failed to allocate system memory.\n"); -+ This->resource.heap_memory = This->resource.map_heap_memory; - - if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d86aa59..9307246 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -371,6 +371,7 @@ struct wined3d_cs_resource_changed - enum wined3d_cs_op opcode; - struct wined3d_resource *resource; - struct wined3d_gl_bo *swap_buffer; -+ void *swap_heap_memory; - }; - - struct wined3d_cs_skip -@@ -1817,13 +1818,13 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * - const struct wined3d_cs_resource_changed *op = data; - struct wined3d_resource *resource = op->resource; - -- wined3d_resource_changed(resource, op->swap_buffer); -+ wined3d_resource_changed(resource, op->swap_buffer, op->swap_heap_memory); - - return sizeof(*op); - } - - void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) - { - struct wined3d_cs_resource_changed *op; - -@@ -1831,6 +1832,7 @@ void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_reso - op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; - op->resource = resource; - op->swap_buffer = swap_buffer; -+ op->swap_heap_memory = swap_heap_memory; - - cs->ops->submit(cs, sizeof(*op)); - } -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 69dd95a..b7aa587 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -119,6 +119,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - ERR("Failed to allocate system memory.\n"); - return E_OUTOFMEMORY; - } -+ resource->heap_memory = resource->map_heap_memory; - } - else - { -@@ -172,6 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) - wined3d_resource_free_bo(resource); - - wined3d_resource_free_sysmem(resource); -+ resource->map_heap_memory = NULL; - - device_resource_released(resource->device, resource); - } -@@ -246,7 +248,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) - p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; - *p = mem; - -- resource->heap_memory = ++p; -+ resource->map_heap_memory = ++p; - - return TRUE; - } -@@ -559,7 +561,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - return ptr; - - case WINED3D_LOCATION_SYSMEM: -- return resource->heap_memory; -+ return resource->map_heap_memory; - - case WINED3D_LOCATION_DIB: - return resource->bitmap_data; -@@ -621,6 +623,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) - ERR("Failed to allocate system memory.\n"); - return FALSE; - } -+ resource->heap_memory = resource->map_heap_memory; - return TRUE; - } - -@@ -705,6 +708,10 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); - break; - -+ case WINED3D_LOCATION_SYSMEM: -+ wined3d_resource_allocate_sysmem(resource); -+ break; -+ - default: - if (resource->access_fence) - ERR("Location %s does not support DISCARD maps.\n", -@@ -773,7 +780,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - if (flags & WINED3D_MAP_NOOVERWRITE) - FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); - -- if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) -+ if (flags & WINED3D_MAP_DISCARD) -+ { -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ case WINED3D_LOCATION_SYSMEM: -+ break; -+ -+ default: -+ FIXME("Implement discard maps with %s map binding.\n", -+ wined3d_debug_location(resource->map_binding)); -+ wined3d_resource_sync(resource); -+ } -+ } -+ else - wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); -@@ -860,7 +881,10 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - wined3d_cs_emit_resource_unmap(device->cs, resource); - - if (resource->unmap_dirtify) -- wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); -+ { -+ wined3d_cs_emit_resource_changed(device->cs, resource, -+ resource->map_buffer, resource->map_heap_memory); -+ } - resource->unmap_dirtify = FALSE; - - resource->map_count--; -@@ -868,7 +892,8 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - return WINED3D_OK; - } - --void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) -+void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer, -+ void *swap_heap_memory) - { - struct wined3d_device *device = resource->device; - -@@ -879,6 +904,11 @@ void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_ - context_release(context); - resource->buffer = swap_buffer; - } -+ if (swap_heap_memory && swap_heap_memory != resource->heap_memory) -+ { -+ wined3d_resource_free_sysmem(resource); -+ resource->heap_memory = swap_heap_memory; -+ } - - wined3d_resource_invalidate_location(resource, ~resource->map_binding); - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 90fa582..f56bb6b 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -487,6 +487,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) - return; - - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - -@@ -1997,6 +1998,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - - surface->resource.locations = 0; - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - - width = texture_resource->width; - height = texture_resource->height; -@@ -5489,6 +5491,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - if (surface->resource.map_binding == WINED3D_LOCATION_DIB) - { - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 28985a4..d253a17 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -134,6 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, - static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) - { - wined3d_resource_free_sysmem(&volume->resource); -+ volume->resource.map_heap_memory = NULL; - wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - } - -@@ -516,6 +517,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture - { - wined3d_resource_free_sysmem(&volume->resource); - volume->resource.map_binding = WINED3D_LOCATION_BUFFER; -+ volume->resource.map_heap_memory = NULL; - } - - volume->container = container; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index abf3ca2..ac4aeb3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2137,7 +2137,7 @@ struct wined3d_resource - UINT depth; - UINT size; - DWORD priority; -- void *heap_memory, *user_memory, *bitmap_data; -+ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; - struct wined3d_gl_bo *buffer, *map_buffer; - struct list resource_list_entry; -@@ -2171,7 +2171,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_changed(struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) DECLSPEC_HIDDEN; - void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2695,7 +2695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Unset-some-objects-in-state_init_default.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Unset-some-objects-in-state_init_default.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Unset-some-objects-in-state_init_default.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Unset-some-objects-in-state_init_default.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,34 @@ +From 09ff7fca62f88791ece6e95f287579687418ba24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 1 Oct 2013 21:30:07 +0200 +Subject: wined3d: Unset some objects in state_init_default. + +FIXME: Many more are needed. +FIXME2: Is this still needed? +--- + dlls/wined3d/stateblock.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c +index 606134c..690bcc7 100644 +--- a/dlls/wined3d/stateblock.c ++++ b/dlls/wined3d/stateblock.c +@@ -1339,7 +1339,15 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d + state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; + /* TODO: Vertex offset in the presampled displacement map. */ + state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; ++ state->textures[i] = NULL; + } ++ ++ state->index_buffer = NULL; ++ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) ++ memset(&state->streams[i], 0, sizeof(state->streams[i])); ++ ++ state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL; ++ state->shader[WINED3D_SHADER_TYPE_PIXEL] = NULL; + } + + HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,26 @@ +From c7d9b4666e695ab3c3c3589337108d221665152c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 12:36:02 +0200 +Subject: wined3d: Don't request the frontbuffer to create dummy textures. + +--- + dlls/wined3d/device.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index ea125c2..0977e12 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -991,8 +991,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + device->swapchains[0] = swapchain; + device_init_swapchain_state(device, swapchain); + +- context = context_acquire(device, +- surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0))); ++ context = context_acquire(device, NULL); + + create_dummy_textures(device, context); + create_default_sampler(device); +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Unset-some-objects-in-state_init_default.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Unset-some-objects-in-state_init_default.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Unset-some-objects-in-state_init_default.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Unset-some-objects-in-state_init_default.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From 09ff7fca62f88791ece6e95f287579687418ba24 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 1 Oct 2013 21:30:07 +0200 -Subject: wined3d: Unset some objects in state_init_default. - -FIXME: Many more are needed. -FIXME2: Is this still needed? ---- - dlls/wined3d/stateblock.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 606134c..690bcc7 100644 ---- a/dlls/wined3d/stateblock.c -+++ b/dlls/wined3d/stateblock.c -@@ -1339,7 +1339,15 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d - state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; - /* TODO: Vertex offset in the presampled displacement map. */ - state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; -+ state->textures[i] = NULL; - } -+ -+ state->index_buffer = NULL; -+ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) -+ memset(&state->streams[i], 0, sizeof(state->streams[i])); -+ -+ state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL; -+ state->shader[WINED3D_SHADER_TYPE_PIXEL] = NULL; - } - - HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From c7d9b4666e695ab3c3c3589337108d221665152c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 12:36:02 +0200 -Subject: wined3d: Don't request the frontbuffer to create dummy textures. - ---- - dlls/wined3d/device.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ea125c2..0977e12 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -991,8 +991,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - device->swapchains[0] = swapchain; - device_init_swapchain_state(device, swapchain); - -- context = context_acquire(device, -- surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0))); -+ context = context_acquire(device, NULL); - - create_dummy_textures(device, context); - create_default_sampler(device); --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Use-double-buffered-buffers-for-multithreade.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Use-double-buffered-buffers-for-multithreade.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Use-double-buffered-buffers-for-multithreade.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Use-double-buffered-buffers-for-multithreade.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,26 @@ +From e54d3de255928108db07a5f3367213a24d8bf959 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:44:11 +0200 +Subject: wined3d: Use double-buffered buffers for multithreaded CS + +--- + dlls/wined3d/buffer.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 3ca1143..de0eaec 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1254,6 +1254,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + } + buffer->maps_size = 1; + ++ if (wined3d_settings.cs_multithreaded) ++ buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; ++ + return WINED3D_OK; + } + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,58 @@ +From 4dab2b426c1d4eb918dda550a547b33858617395 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:49:26 +0200 +Subject: wined3d: Don't synchronize NOOVERWRITE buffer maps + +TODO: Put the patch that makes PreLoad ignore the mapped state here. +--- + dlls/wined3d/buffer.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index de0eaec..fd03fb5 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -958,13 +958,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + + TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with +@@ -995,6 +988,13 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("waiting for cs\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + context = context_acquire(device, NULL); + gl_info = context->gl_info; + +@@ -1056,6 +1056,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_SYNC; + } + ++ if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) ++ { ++ FIXME("waiting for cs.\n"); ++ device->cs->ops->finish(device->cs); ++ } ++ + base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; + *data = base + offset; + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Use-double-buffered-buffers-for-multithreade.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Use-double-buffered-buffers-for-multithreade.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Use-double-buffered-buffers-for-multithreade.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Use-double-buffered-buffers-for-multithreade.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From e54d3de255928108db07a5f3367213a24d8bf959 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:44:11 +0200 -Subject: wined3d: Use double-buffered buffers for multithreaded CS - ---- - dlls/wined3d/buffer.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 3ca1143..de0eaec 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1254,6 +1254,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - } - buffer->maps_size = 1; - -+ if (wined3d_settings.cs_multithreaded) -+ buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; -+ - return WINED3D_OK; - } - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From 4dab2b426c1d4eb918dda550a547b33858617395 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:49:26 +0200 -Subject: wined3d: Don't synchronize NOOVERWRITE buffer maps - -TODO: Put the patch that makes PreLoad ignore the mapped state here. ---- - dlls/wined3d/buffer.c | 20 +++++++++++++------- - 1 file changed, 13 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index de0eaec..fd03fb5 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -958,13 +958,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - - TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); - /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture - * fill rate test seems to depend on this. When we map a buffer with -@@ -995,6 +988,13 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - struct wined3d_context *context; - const struct wined3d_gl_info *gl_info; - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -@@ -1056,6 +1056,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -+ if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs.\n"); -+ device->cs->ops->finish(device->cs); -+ } -+ - base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; - *data = base + offset; - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,47 @@ +From eaad769483668455de518d4bea0013ddef6d5f6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 15:59:11 +0200 +Subject: wined3d: Separate buffer map write and draw read memory pointers + +TODO: Think about making this generic for all resources. +TODO 2: This is rather pointless on its own, merge this with the +patch that introduces this for all resources. +--- + dlls/wined3d/buffer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index fd03fb5..2a814c6 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -191,7 +191,10 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine + if (This->flags & WINED3D_BUFFER_DOUBLEBUFFER) + buffer_invalidate_bo_range(This, 0, 0); + else ++ { + wined3d_resource_free_sysmem(&This->resource); ++ This->resource.map_heap_memory = NULL; ++ } + + return; + +@@ -1044,7 +1047,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer_get_sysmem(buffer, context); + } + TRACE("New pointer is %p.\n", buffer->resource.heap_memory); +- buffer->map_ptr = NULL; + } + context_release(context); + } +@@ -1062,7 +1064,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + device->cs->ops->finish(device->cs); + } + +- base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; ++ base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; + *data = base + offset; + + TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Accelerate-DISCARD-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Accelerate-DISCARD-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Accelerate-DISCARD-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Accelerate-DISCARD-buffer-maps.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,139 @@ +From 46ed74a72057957b7046b45b4cdfb4b34ad4016e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 16:14:16 +0200 +Subject: wined3d: Accelerate DISCARD buffer maps + +TODO: Make this generic for all resources. +TODO2: Merge this with the patch that controlls BUFFER_DISCARD in the CS thread +TODO3: Clean up the map_mem allocation mess. +--- + dlls/wined3d/buffer.c | 15 ++++++++++++--- + dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++++++- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 52 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 2a814c6..5c6d36e 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1058,10 +1058,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_SYNC; + } + +- if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) ++ if (wined3d_settings.cs_multithreaded && count == 1) + { +- FIXME("waiting for cs.\n"); +- device->cs->ops->finish(device->cs); ++ BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; ++ if (flags & WINED3D_MAP_DISCARD && !swvp) ++ { ++ wined3d_resource_allocate_sysmem(&buffer->resource); ++ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ } ++ else if(!(flags & WINED3D_MAP_NOOVERWRITE)) ++ { ++ FIXME("waiting for cs.\n"); ++ device->cs->ops->finish(device->cs); ++ } + } + + base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9307246..341b51c 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -68,6 +68,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_CHANGED, + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, ++ WINED3D_CS_OP_BUFFER_SWAP_MEM, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -374,6 +375,13 @@ struct wined3d_cs_resource_changed + void *swap_heap_memory; + }; + ++struct wined3d_cs_buffer_swap_mem ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++ BYTE *mem; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -2123,6 +2131,34 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_swap_mem *op = data; ++ struct wined3d_buffer *buffer = op->buffer; ++ ++ wined3d_resource_free_sysmem(&buffer->resource); ++ buffer->resource.heap_memory = op->mem; ++ ++ if (!buffer->buffer_object && buffer->resource.bind_count) ++ { ++ device_invalidate_state(cs->device, STATE_STREAMSRC); ++ device_invalidate_state(cs->device, STATE_INDEXBUFFER); ++ } ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, BYTE *mem) ++{ ++ struct wined3d_cs_buffer_swap_mem *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_SWAP_MEM; ++ op->buffer = buffer; ++ op->mem = mem; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2143,11 +2179,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, + /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, ++ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, + /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, + /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, + /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, +- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, + /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, + /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, +@@ -2169,6 +2205,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, ++ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 270162f..7d12df9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2694,6 +2694,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa + void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; + void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, ++ BYTE *mem) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -From eaad769483668455de518d4bea0013ddef6d5f6a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 15:59:11 +0200 -Subject: wined3d: Separate buffer map write and draw read memory pointers - -TODO: Think about making this generic for all resources. -TODO 2: This is rather pointless on its own, merge this with the -patch that introduces this for all resources. ---- - dlls/wined3d/buffer.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index fd03fb5..2a814c6 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -191,7 +191,10 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - if (This->flags & WINED3D_BUFFER_DOUBLEBUFFER) - buffer_invalidate_bo_range(This, 0, 0); - else -+ { - wined3d_resource_free_sysmem(&This->resource); -+ This->resource.map_heap_memory = NULL; -+ } - - return; - -@@ -1044,7 +1047,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer_get_sysmem(buffer, context); - } - TRACE("New pointer is %p.\n", buffer->resource.heap_memory); -- buffer->map_ptr = NULL; - } - context_release(context); - } -@@ -1062,7 +1064,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - device->cs->ops->finish(device->cs); - } - -- base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; -+ base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; - *data = base + offset; - - TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-DISCARD-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-DISCARD-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-DISCARD-buffer-maps.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-DISCARD-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -From 46ed74a72057957b7046b45b4cdfb4b34ad4016e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 16:14:16 +0200 -Subject: wined3d: Accelerate DISCARD buffer maps - -TODO: Make this generic for all resources. -TODO2: Merge this with the patch that controlls BUFFER_DISCARD in the CS thread -TODO3: Clean up the map_mem allocation mess. ---- - dlls/wined3d/buffer.c | 15 ++++++++++++--- - dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++++++- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 52 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 2a814c6..5c6d36e 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1058,10 +1058,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -- if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) -+ if (wined3d_settings.cs_multithreaded && count == 1) - { -- FIXME("waiting for cs.\n"); -- device->cs->ops->finish(device->cs); -+ BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; -+ if (flags & WINED3D_MAP_DISCARD && !swvp) -+ { -+ wined3d_resource_allocate_sysmem(&buffer->resource); -+ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); -+ } -+ else if(!(flags & WINED3D_MAP_NOOVERWRITE)) -+ { -+ FIXME("waiting for cs.\n"); -+ device->cs->ops->finish(device->cs); -+ } - } - - base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9307246..341b51c 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -68,6 +68,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_CHANGED, - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, -+ WINED3D_CS_OP_BUFFER_SWAP_MEM, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -374,6 +375,13 @@ struct wined3d_cs_resource_changed - void *swap_heap_memory; - }; - -+struct wined3d_cs_buffer_swap_mem -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+ BYTE *mem; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -2123,6 +2131,34 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_swap_mem *op = data; -+ struct wined3d_buffer *buffer = op->buffer; -+ -+ wined3d_resource_free_sysmem(&buffer->resource); -+ buffer->resource.heap_memory = op->mem; -+ -+ if (!buffer->buffer_object && buffer->resource.bind_count) -+ { -+ device_invalidate_state(cs->device, STATE_STREAMSRC); -+ device_invalidate_state(cs->device, STATE_INDEXBUFFER); -+ } -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, BYTE *mem) -+{ -+ struct wined3d_cs_buffer_swap_mem *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_SWAP_MEM; -+ op->buffer = buffer; -+ op->mem = mem; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2143,11 +2179,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, - /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, - /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, -+ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, - /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, - /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, - /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, -- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, - /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, - /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, -@@ -2169,6 +2205,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, -+ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 270162f..7d12df9 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2694,6 +2694,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, - struct wined3d_texture *dst) DECLSPEC_HIDDEN; - void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -+ BYTE *mem) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-READONLY-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-READONLY-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-READONLY-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Accelerate-READONLY-buffer-maps.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,29 @@ +From 14090e86e52e7fcc475ae83c3a25039a313a6d32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 16:44:35 +0200 +Subject: wined3d: Accelerate READONLY buffer maps + +FIXME: ProcessVertices can write to buffers +--- + dlls/wined3d/buffer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 5c6d36e..f4c0d07 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1066,9 +1066,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +- else if(!(flags & WINED3D_MAP_NOOVERWRITE)) ++ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { +- FIXME("waiting for cs.\n"); ++ FIXME("waiting for cs, flags 0x%04x.\n", flags); + device->cs->ops->finish(device->cs); + } + } +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Accelerate-READONLY-buffer-maps.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Accelerate-READONLY-buffer-maps.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Accelerate-READONLY-buffer-maps.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Accelerate-READONLY-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 14090e86e52e7fcc475ae83c3a25039a313a6d32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 16:44:35 +0200 -Subject: wined3d: Accelerate READONLY buffer maps - -FIXME: ProcessVertices can write to buffers ---- - dlls/wined3d/buffer.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5c6d36e..f4c0d07 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1066,9 +1066,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -- else if(!(flags & WINED3D_MAP_NOOVERWRITE)) -+ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { -- FIXME("waiting for cs.\n"); -+ FIXME("waiting for cs, flags 0x%04x.\n", flags); - device->cs->ops->finish(device->cs); - } - } --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,140 @@ +From 9725eb43a6e513c68761a40b534f308c85e55086 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 17:05:12 +0200 +Subject: wined3d: Access the buffer dirty areas through the CS + +This avoids the following issues: + +1) The worker thread uploading a dirtified area before the application +unlocks the buffer and marking it clean + +2) The worker thread uploading data from the old memory and marking the +area clean although the data was written to a new block of memory. + +However, this adds more synchronization than necessary. The first +problem could be solved by moving dirtification to unmap, e.g. via a +flag in each dirty area. The second problem can be fixed by not +dirtifying in map if map_mem != resource.allocatedMemory and dirtifying +the entire buffer in buffer_swap_memory (DISCARD dirtifies the entire +buffer anyway, and this could be the reason why). + +If one of those ideas is used, access to the dirty area array needs to +be protected by locks. +--- + dlls/wined3d/buffer.c | 6 +++--- + dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 37 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 7d1a532..9b6ccc8 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ + #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ + +-static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) ++void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) + { + if (!offset && !size) + goto invalidate_all; +@@ -979,9 +979,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * being uploaded in that case. Two such applications are Port Royale + * and Darkstar One. */ + if (flags & WINED3D_MAP_DISCARD) +- buffer_invalidate_bo_range(buffer, 0, 0); ++ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0); + else if (!(flags & WINED3D_MAP_READONLY)) +- buffer_invalidate_bo_range(buffer, offset, size); ++ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size); + + if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) + { +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 491ad85..bc90df2 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -70,6 +70,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_BUFFER_SWAP_MEM, ++ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -392,6 +393,13 @@ struct wined3d_cs_buffer_swap_mem + BYTE *mem; + }; + ++struct wined3d_cs_buffer_invalidate_bo_range ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++ UINT offset, size; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -2273,6 +2281,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_invalidate_bo_range(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_invalidate_bo_range *op = data; ++ ++ buffer_invalidate_bo_range(op->buffer, op->offset, op->size); ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, ++ struct wined3d_buffer *buffer, UINT offset, UINT size) ++{ ++ struct wined3d_cs_buffer_invalidate_bo_range *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE; ++ op->buffer = buffer; ++ op->offset = offset; ++ op->size = size; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2321,6 +2351,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, ++ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index e30ae80..7d0eba9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2813,6 +2813,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, + BYTE *mem) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, ++ struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2898,6 +2900,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co + BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; + void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) DECLSPEC_HIDDEN; ++void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -From 9725eb43a6e513c68761a40b534f308c85e55086 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 17:05:12 +0200 -Subject: wined3d: Access the buffer dirty areas through the CS - -This avoids the following issues: - -1) The worker thread uploading a dirtified area before the application -unlocks the buffer and marking it clean - -2) The worker thread uploading data from the old memory and marking the -area clean although the data was written to a new block of memory. - -However, this adds more synchronization than necessary. The first -problem could be solved by moving dirtification to unmap, e.g. via a -flag in each dirty area. The second problem can be fixed by not -dirtifying in map if map_mem != resource.allocatedMemory and dirtifying -the entire buffer in buffer_swap_memory (DISCARD dirtifies the entire -buffer anyway, and this could be the reason why). - -If one of those ideas is used, access to the dirty area array needs to -be protected by locks. ---- - dlls/wined3d/buffer.c | 6 +++--- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 3 +++ - 3 files changed, 37 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 7d1a532..9b6ccc8 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ - #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ - --static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) -+void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) - { - if (!offset && !size) - goto invalidate_all; -@@ -979,9 +979,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * being uploaded in that case. Two such applications are Port Royale - * and Darkstar One. */ - if (flags & WINED3D_MAP_DISCARD) -- buffer_invalidate_bo_range(buffer, 0, 0); -+ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0); - else if (!(flags & WINED3D_MAP_READONLY)) -- buffer_invalidate_bo_range(buffer, offset, size); -+ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size); - - if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) - { -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 491ad85..bc90df2 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_BUFFER_SWAP_MEM, -+ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -392,6 +393,13 @@ struct wined3d_cs_buffer_swap_mem - BYTE *mem; - }; - -+struct wined3d_cs_buffer_invalidate_bo_range -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+ UINT offset, size; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -2273,6 +2281,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_invalidate_bo_range(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_invalidate_bo_range *op = data; -+ -+ buffer_invalidate_bo_range(op->buffer, op->offset, op->size); -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, -+ struct wined3d_buffer *buffer, UINT offset, UINT size) -+{ -+ struct wined3d_cs_buffer_invalidate_bo_range *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE; -+ op->buffer = buffer; -+ op->offset = offset; -+ op->size = size; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2321,6 +2351,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, -+ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e30ae80..7d0eba9 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2813,6 +2813,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, - BYTE *mem) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, -+ struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2898,6 +2900,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co - BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; - void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, - const struct wined3d_state *state) DECLSPEC_HIDDEN; -+void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; - HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,58 @@ +From e7637b3b410855296289ec8ebe199b80b5a7a2b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 22:52:06 +0200 +Subject: wined3d: Ignore buffer->resource.map_count in the CS + +This fixes sporadic test failures caused by preload refusing to load +data into the GL buffer. + +It's fine to preload or create a VBO if a DISCARD or NOOVERWRITE map is +happening at the same time. A non-dynamic map will finish the CS before +incrementing map_count. +--- + dlls/wined3d/buffer.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 551cc7a..3ac45c6 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -457,7 +457,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co + data->buffer_object = buffer->buffer_object; + if (!buffer->buffer_object) + { +- if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count) ++ if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) ++ && buffer->flags & WINED3D_BUFFER_CREATEBO) + { + buffer_create_buffer_object(buffer, context); + buffer->flags &= ~WINED3D_BUFFER_CREATEBO; +@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + + TRACE("buffer %p.\n", buffer); + +- if (buffer->resource.map_count) +- { +- WARN("Buffer is mapped, skipping preload.\n"); +- return; +- } +- + buffer_mark_used(buffer); + + if (!buffer->buffer_object) +@@ -934,6 +929,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + struct wined3d_context *context; + struct wined3d_device *device = buffer->resource.device; + ++ if (buffer->resource.map_count) ++ { ++ WARN("Buffer is mapped, skipping preload.\n"); ++ return; ++ } ++ + if (wined3d_settings.cs_multithreaded) + { + FIXME("Waiting for cs.\n"); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From e7637b3b410855296289ec8ebe199b80b5a7a2b0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 22:52:06 +0200 -Subject: wined3d: Ignore buffer->resource.map_count in the CS - -This fixes sporadic test failures caused by preload refusing to load -data into the GL buffer. - -It's fine to preload or create a VBO if a DISCARD or NOOVERWRITE map is -happening at the same time. A non-dynamic map will finish the CS before -incrementing map_count. ---- - dlls/wined3d/buffer.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 551cc7a..3ac45c6 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -457,7 +457,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co - data->buffer_object = buffer->buffer_object; - if (!buffer->buffer_object) - { -- if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count) -+ if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) -+ && buffer->flags & WINED3D_BUFFER_CREATEBO) - { - buffer_create_buffer_object(buffer, context); - buffer->flags &= ~WINED3D_BUFFER_CREATEBO; -@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - - TRACE("buffer %p.\n", buffer); - -- if (buffer->resource.map_count) -- { -- WARN("Buffer is mapped, skipping preload.\n"); -- return; -- } -- - buffer_mark_used(buffer); - - if (!buffer->buffer_object) -@@ -934,6 +929,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; - -+ if (buffer->resource.map_count) -+ { -+ WARN("Buffer is mapped, skipping preload.\n"); -+ return; -+ } -+ - if (wined3d_settings.cs_multithreaded) - { - FIXME("Waiting for cs.\n"); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Send-buffer-preloads-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Send-buffer-preloads-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Send-buffer-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Send-buffer-preloads-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,122 @@ +From f0608f8a5916eea7e342db36ffe49427e40a4b49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 7 Jul 2013 12:02:59 +0200 +Subject: wined3d: Send buffer preloads through the CS + +Think about making this a fast command. Might help if the driver +supports async data transfer, but synchronization side effects, esp. wrt +the dirty area list, have to be considered. +--- + dlls/wined3d/buffer.c | 12 +----------- + dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 33 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 3ac45c6..a09ca90 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -926,7 +926,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + + void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + { +- struct wined3d_context *context; + struct wined3d_device *device = buffer->resource.device; + + if (buffer->resource.map_count) +@@ -935,16 +934,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + return; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- +- context = context_acquire(buffer->resource.device, NULL); +- buffer_internal_preload(buffer, context, NULL); +- context_release(context); ++ wined3d_cs_emit_buffer_preload(device->cs, buffer); + } + + struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 179f2e6..6b16d51 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -70,6 +70,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_BUFFER_SWAP_MEM, + WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, ++ WINED3D_CS_OP_BUFFER_PRELOAD, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -442,6 +443,12 @@ struct wined3d_cs_evict_resource + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_buffer_preload ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2189,6 +2196,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_preload *op = data; ++ struct wined3d_context *context; ++ ++ context = context_acquire(cs->device, NULL); ++ buffer_internal_preload(op->buffer, context, NULL); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_buffer_preload *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; ++ op->buffer = buffer; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2237,6 +2267,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, + /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, ++ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index c683880..4070e1d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2698,6 +2698,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + BYTE *mem) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Send-buffer-preloads-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Send-buffer-preloads-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Send-buffer-preloads-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Send-buffer-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From f0608f8a5916eea7e342db36ffe49427e40a4b49 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 7 Jul 2013 12:02:59 +0200 -Subject: wined3d: Send buffer preloads through the CS - -Think about making this a fast command. Might help if the driver -supports async data transfer, but synchronization side effects, esp. wrt -the dirty area list, have to be considered. ---- - dlls/wined3d/buffer.c | 12 +----------- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 33 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 3ac45c6..a09ca90 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -926,7 +926,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - { -- struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; - - if (buffer->resource.map_count) -@@ -935,16 +934,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - return; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -- context = context_acquire(buffer->resource.device, NULL); -- buffer_internal_preload(buffer, context, NULL); -- context_release(context); -+ wined3d_cs_emit_buffer_preload(device->cs, buffer); - } - - struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 179f2e6..6b16d51 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_BUFFER_SWAP_MEM, - WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, -+ WINED3D_CS_OP_BUFFER_PRELOAD, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -442,6 +443,12 @@ struct wined3d_cs_evict_resource - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_buffer_preload -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2189,6 +2196,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_preload *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ buffer_internal_preload(op->buffer, context, NULL); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_buffer_preload *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; -+ op->buffer = buffer; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2237,6 +2267,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, - /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, -+ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c683880..4070e1d 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2698,6 +2698,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - BYTE *mem) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,91 @@ +From 23c12ecbb385011837969d44bafdd50d2853eb6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 24 Jul 2013 13:02:06 +0200 +Subject: wined3d: Use glBufferSubData instead of glMapBufferRange + +This is faster on Nvidia once we're stuck in double-buffer mode for some +reason (e.g. using threaded cs). For other cards, we want to be able to +do mapbuffer through the CS. +--- + dlls/wined3d/buffer.c | 50 ++++++-------------------------------------------- + 1 file changed, 6 insertions(+), 44 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 4fff195..5bdd6e4 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -657,43 +657,17 @@ drop_query: + /* The caller provides a GL context */ + static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) + { +- BYTE *map; + UINT start, len; + + /* This potentially invalidates the element array buffer binding, but the + * caller always takes care of this. */ + GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); + checkGLcall("glBindBuffer"); +- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) +- { +- GLbitfield mapflags; +- mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; +- if (flags & WINED3D_BUFFER_DISCARD) +- mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT; +- else if (!(flags & WINED3D_BUFFER_SYNC)) +- mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; +- map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, +- This->resource.size, mapflags)); +- checkGLcall("glMapBufferRange"); +- } +- else +- { +- if (This->flags & WINED3D_BUFFER_APPLESYNC) +- { +- DWORD syncflags = 0; +- if (flags & WINED3D_BUFFER_DISCARD) +- syncflags |= WINED3D_MAP_DISCARD; +- else if (!(flags & WINED3D_BUFFER_SYNC)) +- syncflags |= WINED3D_MAP_NOOVERWRITE; +- buffer_sync_apple(This, syncflags, gl_info); +- } +- map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); +- checkGLcall("glMapBuffer"); +- } +- if (!map) ++ ++ if (flags & WINED3D_BUFFER_DISCARD) + { +- ERR("Failed to map opengl buffer\n"); +- return; ++ GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); ++ checkGLcall("glBufferData"); + } + + while (This->modified_areas) +@@ -702,21 +676,9 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + start = This->maps[This->modified_areas].offset; + len = This->maps[This->modified_areas].size; + +- memcpy(map + start, (BYTE *)This->resource.heap_memory + start, len); +- +- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) +- { +- GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); +- checkGLcall("glFlushMappedBufferRange"); +- } +- else if (This->flags & WINED3D_BUFFER_APPLESYNC) +- { +- GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); +- checkGLcall("glFlushMappedBufferRangeAPPLE"); +- } ++ GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); ++ checkGLcall("glBufferSubData"); + } +- GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); +- checkGLcall("glUnmapBuffer"); + } + + static void buffer_mark_used(struct wined3d_buffer *buffer) +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Separate-GL-buffer-discard-control-from-igno.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Separate-GL-buffer-discard-control-from-igno.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,135 @@ +From cb3001744c90910e2a44caa6bb05eb0c5a685efd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 30 Jul 2013 22:17:10 +0200 +Subject: wined3d: Separate GL buffer discard control from ignoring + MAP_DISCARD. + +Ignoring WINED3D_MAP_DISCARD is controlled purely in the main thread, +whereas the other one is controlled in the worker thread. Store them in +separate fields for synchronization purposes. + +There are some problems left: +* buffer->flags is still accessed by both threads without sync. +* CSMT=off has a separate codepath that is untested. +--- + dlls/wined3d/buffer.c | 25 +++++++++++++++++++------ + dlls/wined3d/cs.c | 9 +++++++-- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 28 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 3945549..2421eb3 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ + #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ + #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ +-#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ ++#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */ + #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ + #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ + +@@ -921,7 +921,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * previous contents of the buffer. The r600g driver only does this when + * the buffer is currently in use, while the proprietary NVIDIA driver + * appears to do this unconditionally. */ +- if (buffer->flags & WINED3D_BUFFER_DISCARD) ++ if (buffer->ignore_discard) + flags &= ~WINED3D_MAP_DISCARD; + count = ++buffer->resource.map_count; + +@@ -1004,10 +1004,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + context_release(context); + } + } +- +- if (flags & WINED3D_MAP_DISCARD) +- buffer->flags |= WINED3D_BUFFER_DISCARD; +- else if (!(flags & WINED3D_MAP_NOOVERWRITE)) ++ else if(!wined3d_settings.cs_multithreaded) ++ { ++ if (flags & WINED3D_MAP_DISCARD) ++ { ++ buffer->flags |= WINED3D_BUFFER_DISCARD; ++ buffer->ignore_discard = TRUE; ++ } ++ } ++ if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) + buffer->flags |= WINED3D_BUFFER_SYNC; + } + +@@ -1016,6 +1021,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; + if (flags & WINED3D_MAP_DISCARD && !swvp) + { ++ buffer->ignore_discard = TRUE; + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +@@ -1399,3 +1405,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, + + return WINED3D_OK; + } ++ ++void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) ++{ ++ wined3d_resource_free_sysmem(&buffer->resource); ++ buffer->resource.heap_memory = mem; ++ buffer->flags |= WINED3D_BUFFER_DISCARD; ++} +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index ee76ef0..5eb8803 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -732,11 +732,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + op->indexed = indexed; + + if (indexed) ++ { + wined3d_resource_inc_fence(&state->index_buffer->resource); ++ state->index_buffer->ignore_discard = FALSE; ++ } + for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) + { + if (state->streams[i].buffer) ++ { + wined3d_resource_inc_fence(&state->streams[i].buffer->resource); ++ state->streams[i].buffer->ignore_discard = FALSE; ++ } + } + for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) + { +@@ -2265,8 +2271,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d + const struct wined3d_cs_buffer_swap_mem *op = data; + struct wined3d_buffer *buffer = op->buffer; + +- wined3d_resource_free_sysmem(&buffer->resource); +- buffer->resource.heap_memory = op->mem; ++ buffer_swap_mem(buffer, op->mem); + + if (!buffer->buffer_object && buffer->resource.bind_count) + { +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 27a534a..c79b6a9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2877,6 +2877,7 @@ struct wined3d_buffer + GLenum buffer_object_usage; + GLenum buffer_type_hint; + DWORD flags; ++ BOOL ignore_discard; + void *map_ptr; + + struct wined3d_map_range *maps; +@@ -2902,6 +2903,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con + void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) DECLSPEC_HIDDEN; + void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; ++void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -From 23c12ecbb385011837969d44bafdd50d2853eb6c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 24 Jul 2013 13:02:06 +0200 -Subject: wined3d: Use glBufferSubData instead of glMapBufferRange - -This is faster on Nvidia once we're stuck in double-buffer mode for some -reason (e.g. using threaded cs). For other cards, we want to be able to -do mapbuffer through the CS. ---- - dlls/wined3d/buffer.c | 50 ++++++-------------------------------------------- - 1 file changed, 6 insertions(+), 44 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 4fff195..5bdd6e4 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -657,43 +657,17 @@ drop_query: - /* The caller provides a GL context */ - static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) - { -- BYTE *map; - UINT start, len; - - /* This potentially invalidates the element array buffer binding, but the - * caller always takes care of this. */ - GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); - checkGLcall("glBindBuffer"); -- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) -- { -- GLbitfield mapflags; -- mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; -- if (flags & WINED3D_BUFFER_DISCARD) -- mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT; -- else if (!(flags & WINED3D_BUFFER_SYNC)) -- mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; -- map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, -- This->resource.size, mapflags)); -- checkGLcall("glMapBufferRange"); -- } -- else -- { -- if (This->flags & WINED3D_BUFFER_APPLESYNC) -- { -- DWORD syncflags = 0; -- if (flags & WINED3D_BUFFER_DISCARD) -- syncflags |= WINED3D_MAP_DISCARD; -- else if (!(flags & WINED3D_BUFFER_SYNC)) -- syncflags |= WINED3D_MAP_NOOVERWRITE; -- buffer_sync_apple(This, syncflags, gl_info); -- } -- map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); -- checkGLcall("glMapBuffer"); -- } -- if (!map) -+ -+ if (flags & WINED3D_BUFFER_DISCARD) - { -- ERR("Failed to map opengl buffer\n"); -- return; -+ GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); -+ checkGLcall("glBufferData"); - } - - while (This->modified_areas) -@@ -702,21 +676,9 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - start = This->maps[This->modified_areas].offset; - len = This->maps[This->modified_areas].size; - -- memcpy(map + start, (BYTE *)This->resource.heap_memory + start, len); -- -- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) -- { -- GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); -- checkGLcall("glFlushMappedBufferRange"); -- } -- else if (This->flags & WINED3D_BUFFER_APPLESYNC) -- { -- GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); -- checkGLcall("glFlushMappedBufferRangeAPPLE"); -- } -+ GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); -+ checkGLcall("glBufferSubData"); - } -- GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); -- checkGLcall("glUnmapBuffer"); - } - - static void buffer_mark_used(struct wined3d_buffer *buffer) --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Create-buffers-before-mapping-them.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Create-buffers-before-mapping-them.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Create-buffers-before-mapping-them.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Create-buffers-before-mapping-them.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,66 @@ +From 26b18d0685e6c3bc9d00cc9eba3359c8c671bdd9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 29 Aug 2013 17:35:53 +0200 +Subject: wined3d: Create buffers before mapping them. + +--- + dlls/wined3d/buffer.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 5d71e9c..bd788c4 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -185,6 +185,8 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine + ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); + goto fail; + } ++ if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + This->buffer_object_usage = gl_usage; + +@@ -911,9 +913,32 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + LONG count; + BYTE *base; + struct wined3d_device *device = buffer->resource.device; ++ struct wined3d_context *context; + + TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); + ++ /* FIXME: There is a race condition with the same code in ++ * buffer_internal_preload and buffer_get_memory. ++ * ++ * This deals with a race condition concering buffer creation and buffer maps. ++ * If a VBO is created by the worker thread while the buffer is mapped, outdated ++ * data may be uploaded, and the BO range is not properly invaliated. Keep in ++ * mind that a broken application might draw from a buffer before mapping it. ++ * ++ * Don't try to solve this by going back to always invalidating changed areas. ++ * This won't work if we ever want to support glMapBufferRange mapping with ++ * GL_ARB_buffer_storage in the CS. ++ * ++ * Also keep in mind that UnLoad can destroy the VBO, so simply creating it ++ * on buffer creation won't work either. */ ++ if (buffer->flags & WINED3D_BUFFER_CREATEBO) ++ { ++ context = context_acquire(device, NULL); ++ buffer_create_buffer_object(buffer, context); ++ context_release(context); ++ buffer->flags &= ~WINED3D_BUFFER_CREATEBO; ++ } ++ + flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with +@@ -941,7 +966,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + if (count == 1) + { + struct wined3d_device *device = buffer->resource.device; +- struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + + if (wined3d_settings.cs_multithreaded) +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Separate-GL-buffer-discard-control-from-igno.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Separate-GL-buffer-discard-control-from-igno.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -From cb3001744c90910e2a44caa6bb05eb0c5a685efd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 30 Jul 2013 22:17:10 +0200 -Subject: wined3d: Separate GL buffer discard control from ignoring - MAP_DISCARD. - -Ignoring WINED3D_MAP_DISCARD is controlled purely in the main thread, -whereas the other one is controlled in the worker thread. Store them in -separate fields for synchronization purposes. - -There are some problems left: -* buffer->flags is still accessed by both threads without sync. -* CSMT=off has a separate codepath that is untested. ---- - dlls/wined3d/buffer.c | 25 +++++++++++++++++++------ - dlls/wined3d/cs.c | 9 +++++++-- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 28 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 3945549..2421eb3 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ - #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ - #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ --#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ -+#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */ - #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ - #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ - -@@ -921,7 +921,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * previous contents of the buffer. The r600g driver only does this when - * the buffer is currently in use, while the proprietary NVIDIA driver - * appears to do this unconditionally. */ -- if (buffer->flags & WINED3D_BUFFER_DISCARD) -+ if (buffer->ignore_discard) - flags &= ~WINED3D_MAP_DISCARD; - count = ++buffer->resource.map_count; - -@@ -1004,10 +1004,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - context_release(context); - } - } -- -- if (flags & WINED3D_MAP_DISCARD) -- buffer->flags |= WINED3D_BUFFER_DISCARD; -- else if (!(flags & WINED3D_MAP_NOOVERWRITE)) -+ else if(!wined3d_settings.cs_multithreaded) -+ { -+ if (flags & WINED3D_MAP_DISCARD) -+ { -+ buffer->flags |= WINED3D_BUFFER_DISCARD; -+ buffer->ignore_discard = TRUE; -+ } -+ } -+ if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -@@ -1016,6 +1021,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; - if (flags & WINED3D_MAP_DISCARD && !swvp) - { -+ buffer->ignore_discard = TRUE; - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -@@ -1399,3 +1405,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, - - return WINED3D_OK; - } -+ -+void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) -+{ -+ wined3d_resource_free_sysmem(&buffer->resource); -+ buffer->resource.heap_memory = mem; -+ buffer->flags |= WINED3D_BUFFER_DISCARD; -+} -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index ee76ef0..5eb8803 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -732,11 +732,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - op->indexed = indexed; - - if (indexed) -+ { - wined3d_resource_inc_fence(&state->index_buffer->resource); -+ state->index_buffer->ignore_discard = FALSE; -+ } - for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) - { - if (state->streams[i].buffer) -+ { - wined3d_resource_inc_fence(&state->streams[i].buffer->resource); -+ state->streams[i].buffer->ignore_discard = FALSE; -+ } - } - for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) - { -@@ -2265,8 +2271,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d - const struct wined3d_cs_buffer_swap_mem *op = data; - struct wined3d_buffer *buffer = op->buffer; - -- wined3d_resource_free_sysmem(&buffer->resource); -- buffer->resource.heap_memory = op->mem; -+ buffer_swap_mem(buffer, op->mem); - - if (!buffer->buffer_object && buffer->resource.bind_count) - { -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 27a534a..c79b6a9 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2877,6 +2877,7 @@ struct wined3d_buffer - GLenum buffer_object_usage; - GLenum buffer_type_hint; - DWORD flags; -+ BOOL ignore_discard; - void *map_ptr; - - struct wined3d_map_range *maps; -@@ -2902,6 +2903,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con - void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, - const struct wined3d_state *state) DECLSPEC_HIDDEN; - void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; -+void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; - HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Create-buffers-before-mapping-them.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Create-buffers-before-mapping-them.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Create-buffers-before-mapping-them.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Create-buffers-before-mapping-them.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -From 26b18d0685e6c3bc9d00cc9eba3359c8c671bdd9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 29 Aug 2013 17:35:53 +0200 -Subject: wined3d: Create buffers before mapping them. - ---- - dlls/wined3d/buffer.c | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5d71e9c..bd788c4 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -185,6 +185,8 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); - goto fail; - } -+ if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - This->buffer_object_usage = gl_usage; - -@@ -911,9 +913,32 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - LONG count; - BYTE *base; - struct wined3d_device *device = buffer->resource.device; -+ struct wined3d_context *context; - - TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); - -+ /* FIXME: There is a race condition with the same code in -+ * buffer_internal_preload and buffer_get_memory. -+ * -+ * This deals with a race condition concering buffer creation and buffer maps. -+ * If a VBO is created by the worker thread while the buffer is mapped, outdated -+ * data may be uploaded, and the BO range is not properly invaliated. Keep in -+ * mind that a broken application might draw from a buffer before mapping it. -+ * -+ * Don't try to solve this by going back to always invalidating changed areas. -+ * This won't work if we ever want to support glMapBufferRange mapping with -+ * GL_ARB_buffer_storage in the CS. -+ * -+ * Also keep in mind that UnLoad can destroy the VBO, so simply creating it -+ * on buffer creation won't work either. */ -+ if (buffer->flags & WINED3D_BUFFER_CREATEBO) -+ { -+ context = context_acquire(device, NULL); -+ buffer_create_buffer_object(buffer, context); -+ context_release(context); -+ buffer->flags &= ~WINED3D_BUFFER_CREATEBO; -+ } -+ - flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); - /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture - * fill rate test seems to depend on this. When we map a buffer with -@@ -941,7 +966,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - if (count == 1) - { - struct wined3d_device *device = buffer->resource.device; -- struct wined3d_context *context; - const struct wined3d_gl_info *gl_info; - - if (wined3d_settings.cs_multithreaded) --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Destroy-views-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Destroy-views-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Destroy-views-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Destroy-views-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,173 @@ +From eef628fde30bac893e13569c49213893a46583cb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 21 Aug 2014 22:47:58 +0200 +Subject: wined3d: Destroy views through the CS. + +Move this ahead. This has caused sporadic test failures ever since blits were moved to the CS. + +Also contains an ugly hack for ffp_blit_depth_fill. +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 4 ++-- + dlls/wined3d/view.c | 29 ++++++++++++++++++++++++++++- + dlls/wined3d/wined3d_private.h | 4 ++++ + 4 files changed, 62 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index b489506..a5df7a7 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -78,6 +78,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_TEXTURE_PRELOAD, + WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_EVICT_RESOURCE, ++ WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -452,6 +453,12 @@ struct wined3d_cs_buffer_preload + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_view_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_rendertarget_view *view; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2308,6 +2315,26 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_view_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_view_destroy *op = data; ++ ++ wined3d_rendertarget_view_destroy(op->view); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) ++{ ++ struct wined3d_cs_view_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VIEW_DESTROY; ++ op->view = view; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2364,6 +2391,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, ++ /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index b1db403..9f89468 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -939,7 +939,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const + } + + hr = blitter->depth_fill(device, view, rect, depth); +- wined3d_rendertarget_view_decref(view); ++ wined3d_rendertarget_view_decref_worker(view); + + return hr; + } +@@ -3207,7 +3207,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st + } + + hr = blitter->color_fill(device, view, rect, color); +- wined3d_rendertarget_view_decref(view); ++ wined3d_rendertarget_view_decref_worker(view); + + return hr; + } +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index 8d4f7fd..e4694af 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -33,6 +33,11 @@ ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *v + return refcount; + } + ++void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) ++{ ++ HeapFree(GetProcessHeap(), 0, view); ++} ++ + ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view) + { + ULONG refcount = InterlockedDecrement(&view->refcount); +@@ -41,11 +46,33 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v + + if (!refcount) + { ++ struct wined3d_device *device = view->resource->device; ++ + /* Call wined3d_object_destroyed() before releasing the resource, + * since releasing the resource may end up destroying the parent. */ + view->parent_ops->wined3d_object_destroyed(view->parent); + wined3d_resource_decref(view->resource); +- HeapFree(GetProcessHeap(), 0, view); ++ wined3d_cs_emit_view_destroy(device->cs, view); ++ } ++ ++ return refcount; ++} ++ ++/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the ++ * worker thread. */ ++ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) ++{ ++ ULONG refcount = InterlockedDecrement(&view->refcount); ++ ++ TRACE("%p decreasing refcount to %u.\n", view, refcount); ++ ++ if (!refcount) ++ { ++ /* Call wined3d_object_destroyed() before releasing the resource, ++ * since releasing the resource may end up destroying the parent. */ ++ view->parent_ops->wined3d_object_destroyed(view->parent); ++ wined3d_resource_decref(view->resource); ++ wined3d_rendertarget_view_destroy(view); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index c9578bd..9c70257 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2902,6 +2902,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -3027,6 +3028,9 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return surface_from_resource(resource); + } + ++ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++ + struct wined3d_shader_resource_view + { + LONG refcount; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Destroy-views-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Destroy-views-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Destroy-views-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Destroy-views-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ -From a31fb6ca1b9379028340024e2bd7e97e894b0532 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 21 Aug 2014 22:47:58 +0200 -Subject: wined3d: Destroy views through the CS. - -Move this ahead. This has caused sporadic test failures ever since blits were moved to the CS. - -Also contains an ugly hack for ffp_blit_depth_fill. ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 4 ++-- - dlls/wined3d/view.c | 29 ++++++++++++++++++++++++++++- - dlls/wined3d/wined3d_private.h | 4 ++++ - 4 files changed, 62 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4b9af57..8e48c55 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -78,6 +78,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_EVICT_RESOURCE, -+ WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -449,6 +450,12 @@ struct wined3d_cs_buffer_preload - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_view_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_rendertarget_view *view; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2224,6 +2231,26 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_view_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_view_destroy *op = data; -+ -+ wined3d_rendertarget_view_destroy(op->view); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -+{ -+ struct wined3d_cs_view_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VIEW_DESTROY; -+ op->view = view; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2280,6 +2307,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, -+ /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 73160ff..43f68c6 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4140,7 +4140,7 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d - } - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -- wined3d_rendertarget_view_decref(view); -+ wined3d_rendertarget_view_decref_worker(view); - - return WINED3D_OK; - } -@@ -4160,7 +4160,7 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d - } - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -- wined3d_rendertarget_view_decref(fb.depth_stencil); -+ wined3d_rendertarget_view_decref_worker(fb.depth_stencil); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 9cda64d..56eb7b3 100644 ---- a/dlls/wined3d/view.c -+++ b/dlls/wined3d/view.c -@@ -33,6 +33,11 @@ ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *v - return refcount; - } - -+void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) -+{ -+ HeapFree(GetProcessHeap(), 0, view); -+} -+ - ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view) - { - ULONG refcount = InterlockedDecrement(&view->refcount); -@@ -41,11 +46,33 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v - - if (!refcount) - { -+ struct wined3d_device *device = view->resource->device; -+ - /* Call wined3d_object_destroyed() before releasing the resource, - * since releasing the resource may end up destroying the parent. */ - view->parent_ops->wined3d_object_destroyed(view->parent); - wined3d_resource_decref(view->resource); -- HeapFree(GetProcessHeap(), 0, view); -+ wined3d_cs_emit_view_destroy(device->cs, view); -+ } -+ -+ return refcount; -+} -+ -+/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the -+ * worker thread. */ -+ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) -+{ -+ ULONG refcount = InterlockedDecrement(&view->refcount); -+ -+ TRACE("%p decreasing refcount to %u.\n", view, refcount); -+ -+ if (!refcount) -+ { -+ /* Call wined3d_object_destroyed() before releasing the resource, -+ * since releasing the resource may end up destroying the parent. */ -+ view->parent_ops->wined3d_object_destroyed(view->parent); -+ wined3d_resource_decref(view->resource); -+ wined3d_rendertarget_view_destroy(view); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0f88961..7d68448 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2699,6 +2699,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2824,6 +2825,9 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( - return surface_from_resource(resource); - } - -+ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+ - struct wined3d_shader_resource_view - { - LONG refcount; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Remove-another-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Remove-another-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Remove-another-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Remove-another-glFinish.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,28 @@ +From 8a0e110ba10657b84aa33a1cd51fe46128062d4d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 22:08:39 +0200 +Subject: wined3d: Remove another glFinish + +I don't think this is needed any more. +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 43f68c6..1d777e2 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -825,9 +825,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, + dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering ++ if (wined3d_settings.strict_draw_ordering + || (dst_location == WINED3D_LOCATION_DRAWABLE + && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + gl_info->gl_ops.gl.p_glFlush(); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Destroy-vertex-declarations-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Destroy-vertex-declarations-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Destroy-vertex-declarations-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Destroy-vertex-declarations-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,131 @@ +From a26808a39c226fc0f168336becc97ed512029d52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 31 Jul 2013 23:06:27 +0200 +Subject: wined3d: Destroy vertex declarations through the CS + +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/vertexdeclaration.c | 15 ++++++++------- + dlls/wined3d/wined3d_private.h | 4 ++++ + 3 files changed, 41 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 8e48c55..38063d7 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -79,6 +79,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_VIEW_DESTROY, ++ WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -456,6 +457,12 @@ struct wined3d_cs_view_destroy + struct wined3d_rendertarget_view *view; + }; + ++struct wined3d_cs_vertex_declaration_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_vertex_declaration *declaration; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2251,6 +2258,27 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_vertex_declaration_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_vertex_declaration_destroy *op = data; ++ ++ wined3d_vertex_declaration_destroy(op->declaration); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, ++ struct wined3d_vertex_declaration *declaration) ++{ ++ struct wined3d_cs_vertex_declaration_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VDECL_DESTROY; ++ op->declaration = declaration; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2308,6 +2336,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, ++ /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c +index 3f4d5e4..fc7a110 100644 +--- a/dlls/wined3d/vertexdeclaration.c ++++ b/dlls/wined3d/vertexdeclaration.c +@@ -48,6 +48,12 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration + return refcount; + } + ++void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) ++{ ++ HeapFree(GetProcessHeap(), 0, declaration->elements); ++ HeapFree(GetProcessHeap(), 0, declaration); ++} ++ + ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration) + { + ULONG refcount = InterlockedDecrement(&declaration->ref); +@@ -56,14 +62,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- declaration->device->cs->ops->finish(declaration->device->cs); +- } +- HeapFree(GetProcessHeap(), 0, declaration->elements); ++ const struct wined3d_device *device = declaration->device; + declaration->parent_ops->wined3d_object_destroyed(declaration->parent); +- HeapFree(GetProcessHeap(), 0, declaration); ++ wined3d_cs_emit_vertex_declaration_destroy(device->cs, declaration); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7d68448..5d3393c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2499,6 +2499,8 @@ struct wined3d_vertex_declaration + BOOL half_float_conv_needed; + }; + ++void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; ++ + struct wined3d_saved_states + { + DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; +@@ -2700,6 +2702,8 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, ++ struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Remove-another-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Remove-another-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Remove-another-glFinish.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Remove-another-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From 8a0e110ba10657b84aa33a1cd51fe46128062d4d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 22:08:39 +0200 -Subject: wined3d: Remove another glFinish - -I don't think this is needed any more. ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 43f68c6..1d777e2 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -825,9 +825,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, - dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering -+ if (wined3d_settings.strict_draw_ordering - || (dst_location == WINED3D_LOCATION_DRAWABLE - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-shaders-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-shaders-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-shaders-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-shaders-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,126 @@ +From c75e1fc10eb6a040ef2736cee8262e4200366905 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 31 Jul 2013 23:18:28 +0200 +Subject: wined3d: Destroy shaders through the CS + +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/shader.c | 12 ++++-------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 35 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f088200..c745460 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -81,6 +81,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_VDECL_DESTROY, ++ WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -473,6 +474,12 @@ struct wined3d_cs_vertex_declaration_destroy + struct wined3d_vertex_declaration *declaration; + }; + ++struct wined3d_cs_shader_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_shader *shader; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2392,6 +2399,27 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_shader_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_shader_cleanup *op = data; ++ ++ shader_cleanup(op->shader); ++ HeapFree(GetProcessHeap(), 0, op->shader); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) ++{ ++ struct wined3d_cs_shader_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SHADER_CLEANUP; ++ op->shader = shader; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2451,6 +2479,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, ++ /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c +index ec2a269..04e217e 100644 +--- a/dlls/wined3d/shader.c ++++ b/dlls/wined3d/shader.c +@@ -1859,7 +1859,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe + } + } + +-static void shader_cleanup(struct wined3d_shader *shader) ++void shader_cleanup(struct wined3d_shader *shader) + { + HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); + HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); +@@ -2115,14 +2115,10 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- shader->device->cs->ops->finish(shader->device->cs); +- } +- shader_cleanup(shader); ++ const struct wined3d_device *device = shader->device; ++ + shader->parent_ops->wined3d_object_destroyed(shader->parent); +- HeapFree(GetProcessHeap(), 0, shader); ++ wined3d_cs_emit_shader_cleanup(device->cs, shader); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a2f2044..545c97e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2751,6 +2751,7 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, + struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -3153,6 +3154,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map + void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, + const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; + BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; ++void shader_cleanup(struct wined3d_shader *shader) DECLSPEC_HIDDEN; + + static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg) + { +-- +2.3.5 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-vertex-declarations-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-vertex-declarations-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-vertex-declarations-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Destroy-vertex-declarations-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -From a26808a39c226fc0f168336becc97ed512029d52 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 31 Jul 2013 23:06:27 +0200 -Subject: wined3d: Destroy vertex declarations through the CS - ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/vertexdeclaration.c | 15 ++++++++------- - dlls/wined3d/wined3d_private.h | 4 ++++ - 3 files changed, 41 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8e48c55..38063d7 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -79,6 +79,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_VIEW_DESTROY, -+ WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -456,6 +457,12 @@ struct wined3d_cs_view_destroy - struct wined3d_rendertarget_view *view; - }; - -+struct wined3d_cs_vertex_declaration_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_vertex_declaration *declaration; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2251,6 +2258,27 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_vertex_declaration_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_vertex_declaration_destroy *op = data; -+ -+ wined3d_vertex_declaration_destroy(op->declaration); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, -+ struct wined3d_vertex_declaration *declaration) -+{ -+ struct wined3d_cs_vertex_declaration_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VDECL_DESTROY; -+ op->declaration = declaration; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2308,6 +2336,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, -+ /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c -index 3f4d5e4..fc7a110 100644 ---- a/dlls/wined3d/vertexdeclaration.c -+++ b/dlls/wined3d/vertexdeclaration.c -@@ -48,6 +48,12 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration - return refcount; - } - -+void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) -+{ -+ HeapFree(GetProcessHeap(), 0, declaration->elements); -+ HeapFree(GetProcessHeap(), 0, declaration); -+} -+ - ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration) - { - ULONG refcount = InterlockedDecrement(&declaration->ref); -@@ -56,14 +62,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- declaration->device->cs->ops->finish(declaration->device->cs); -- } -- HeapFree(GetProcessHeap(), 0, declaration->elements); -+ const struct wined3d_device *device = declaration->device; - declaration->parent_ops->wined3d_object_destroyed(declaration->parent); -- HeapFree(GetProcessHeap(), 0, declaration); -+ wined3d_cs_emit_vertex_declaration_destroy(device->cs, declaration); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7d68448..5d3393c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2499,6 +2499,8 @@ struct wined3d_vertex_declaration - BOOL half_float_conv_needed; - }; - -+void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; -+ - struct wined3d_saved_states - { - DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2700,6 +2702,8 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, -+ struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Create-VBOs-through-the-command-stream.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Create-VBOs-through-the-command-stream.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Create-VBOs-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Create-VBOs-through-the-command-stream.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,133 @@ +From 66a6fe6a092a4fa661e5baab52bbb2c1d7c661de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 21:47:08 +0200 +Subject: wined3d: Create VBOs through the command stream. + +A stop-gap solution to make fglrx happier until buffers are updated. +--- + dlls/wined3d/buffer.c | 8 ++------ + dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 37 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 8f86a5b..a937b90 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -117,7 +117,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g + } + + /* Context activation is done by the caller. */ +-static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) ++void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) + { + GLenum gl_usage = GL_STATIC_DRAW_ARB; + GLenum error; +@@ -185,8 +185,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine + ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); + goto fail; + } +- if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + This->buffer_object_usage = gl_usage; + +@@ -933,9 +931,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * on buffer creation won't work either. */ + if (buffer->flags & WINED3D_BUFFER_CREATEBO) + { +- context = context_acquire(device, NULL); +- buffer_create_buffer_object(buffer, context); +- context_release(context); ++ wined3d_cs_emit_create_vbo(device->cs, buffer); + buffer->flags &= ~WINED3D_BUFFER_CREATEBO; + } + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 59b9a9c..33a3b05 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -82,6 +82,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_SHADER_CLEANUP, ++ WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_STOP, + }; + +@@ -480,6 +481,12 @@ struct wined3d_cs_shader_cleanup + struct wined3d_shader *shader; + }; + ++struct wined3d_cs_create_vbo ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2421,6 +2428,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_create_vbo(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_vbo *op = data; ++ struct wined3d_context *context = context_acquire(cs->device, NULL); ++ ++ buffer_create_buffer_object(op->buffer, context); ++ ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_create_vbo *op; ++ ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_VBO; ++ op->buffer = buffer; ++ ++ cs->ops->submit_prio(cs, sizeof(*op)); ++ cs->ops->finish_prio(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2481,6 +2512,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, ++ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 9eb3c3a..4d5710a 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2822,6 +2822,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta + void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, + struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; + void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2910,6 +2911,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + const struct wined3d_state *state) DECLSPEC_HIDDEN; + void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; + void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; ++void buffer_create_buffer_object(struct wined3d_buffer *This, ++ struct wined3d_context *context) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Destroy-shaders-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Destroy-shaders-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Destroy-shaders-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Destroy-shaders-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -From c75e1fc10eb6a040ef2736cee8262e4200366905 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 31 Jul 2013 23:18:28 +0200 -Subject: wined3d: Destroy shaders through the CS - ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/shader.c | 12 ++++-------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 35 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f088200..c745460 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -81,6 +81,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_VDECL_DESTROY, -+ WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -473,6 +474,12 @@ struct wined3d_cs_vertex_declaration_destroy - struct wined3d_vertex_declaration *declaration; - }; - -+struct wined3d_cs_shader_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_shader *shader; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2392,6 +2399,27 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_shader_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_shader_cleanup *op = data; -+ -+ shader_cleanup(op->shader); -+ HeapFree(GetProcessHeap(), 0, op->shader); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) -+{ -+ struct wined3d_cs_shader_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SHADER_CLEANUP; -+ op->shader = shader; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2451,6 +2479,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, -+ /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index ec2a269..04e217e 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -1859,7 +1859,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe - } - } - --static void shader_cleanup(struct wined3d_shader *shader) -+void shader_cleanup(struct wined3d_shader *shader) - { - HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); - HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); -@@ -2115,14 +2115,10 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- shader->device->cs->ops->finish(shader->device->cs); -- } -- shader_cleanup(shader); -+ const struct wined3d_device *device = shader->device; -+ - shader->parent_ops->wined3d_object_destroyed(shader->parent); -- HeapFree(GetProcessHeap(), 0, shader); -+ wined3d_cs_emit_shader_cleanup(device->cs, shader); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a2f2044..545c97e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2751,6 +2751,7 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, - struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -3153,6 +3154,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map - void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, - const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; - BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; -+void shader_cleanup(struct wined3d_shader *shader) DECLSPEC_HIDDEN; - - static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg) - { --- -2.3.5 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Clean-up-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Clean-up-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Clean-up-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Clean-up-resource-data-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,211 @@ +From 9109cd39e2867e3e9061d1720bde4598111b3d3b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:38:51 +0200 +Subject: wined3d: Clean up resource data through the CS. + +--- + dlls/wined3d/buffer.c | 3 +++ + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 15 ++++++++++----- + dlls/wined3d/surface.c | 5 +++++ + dlls/wined3d/texture.c | 4 ++++ + dlls/wined3d/volume.c | 3 +++ + dlls/wined3d/wined3d_private.h | 3 +++ + 7 files changed, 56 insertions(+), 5 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index fc65d3a..d968dcb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -570,6 +570,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) + } + + resource_cleanup(&buffer->resource); ++ if (wined3d_settings.cs_multithreaded) ++ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); ++ + buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); + HeapFree(GetProcessHeap(), 0, buffer->maps); + HeapFree(GetProcessHeap(), 0, buffer); +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index c00d1d3..6edd5e3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -82,6 +82,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_CREATE_VBO, ++ WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -477,6 +478,12 @@ struct wined3d_cs_create_vbo + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_resource_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2338,6 +2345,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu + cs->ops->finish_prio(cs); + } + ++static UINT wined3d_cs_exec_resource_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_cleanup *op = data; ++ ++ wined3d_resource_cleanup_cs(op->resource); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_resource_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_CLEANUP; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2398,6 +2425,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, ++ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index ef0b213..dd21986 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -157,6 +157,15 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) + context_release(context); + } + ++void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) ++{ ++ if (resource->buffer) ++ wined3d_resource_free_bo(resource); ++ ++ wined3d_resource_free_sysmem(resource); ++ resource->map_heap_memory = NULL; ++} ++ + void resource_cleanup(struct wined3d_resource *resource) + { + const struct wined3d *d3d = resource->device->wined3d; +@@ -169,11 +178,7 @@ void resource_cleanup(struct wined3d_resource *resource) + adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); + } + +- if (resource->buffer) +- wined3d_resource_free_bo(resource); +- +- wined3d_resource_free_sysmem(resource); +- resource->map_heap_memory = NULL; ++ wined3d_cs_emit_resource_cleanup(resource->device->cs, resource); + + device_resource_released(resource->device, resource); + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 1d777e2..4a1cf30 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -101,9 +101,12 @@ static void surface_cleanup(struct wined3d_surface *surface) + + void wined3d_surface_destroy(struct wined3d_surface *surface) + { ++ struct wined3d_device *device = surface->resource.device; + TRACE("surface %p.\n", surface); + + surface_cleanup(surface); ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); + HeapFree(GetProcessHeap(), 0, surface); + } +@@ -5321,6 +5324,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + { + ERR("Private setup failed, hr %#x.\n", hr); + surface_cleanup(surface); ++ if (wined3d_settings.cs_multithreaded) ++ surface->resource.device->cs->ops->finish(surface->resource.device->cs); + return hr; + } + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index ea8589a..f7988e5 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -74,6 +74,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc + { + ERR("Failed to allocate sub-resource array.\n"); + resource_cleanup(&texture->resource); ++ if (wined3d_settings.cs_multithreaded) ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); + return E_OUTOFMEMORY; + } + +@@ -153,6 +155,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + wined3d_texture_unload_gl_texture(texture); + HeapFree(GetProcessHeap(), 0, texture->sub_resources); + resource_cleanup(&texture->resource); ++ if (wined3d_settings.cs_multithreaded) ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); + } + + void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 34b72d1..218118d 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -291,9 +291,12 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * + + void wined3d_volume_destroy(struct wined3d_volume *volume) + { ++ struct wined3d_device *device = volume->resource.device; + TRACE("volume %p.\n", volume); + + resource_cleanup(&volume->resource); ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); + HeapFree(GetProcessHeap(), 0, volume); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 74e059c..f4c269c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2163,6 +2163,7 @@ void wined3d_resource_changed(struct wined3d_resource *resource, + struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + const struct wined3d_box *box) DECLSPEC_HIDDEN; ++void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -2706,6 +2707,8 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, + struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; + void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; + void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, ++ struct wined3d_resource *resource) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Create-VBOs-through-the-command-stream.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Create-VBOs-through-the-command-stream.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Create-VBOs-through-the-command-stream.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Create-VBOs-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -From 66a6fe6a092a4fa661e5baab52bbb2c1d7c661de Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 21:47:08 +0200 -Subject: wined3d: Create VBOs through the command stream. - -A stop-gap solution to make fglrx happier until buffers are updated. ---- - dlls/wined3d/buffer.c | 8 ++------ - dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 3 +++ - 3 files changed, 37 insertions(+), 6 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 8f86a5b..a937b90 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -117,7 +117,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g - } - - /* Context activation is done by the caller. */ --static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) -+void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) - { - GLenum gl_usage = GL_STATIC_DRAW_ARB; - GLenum error; -@@ -185,8 +185,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); - goto fail; - } -- if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - This->buffer_object_usage = gl_usage; - -@@ -933,9 +931,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * on buffer creation won't work either. */ - if (buffer->flags & WINED3D_BUFFER_CREATEBO) - { -- context = context_acquire(device, NULL); -- buffer_create_buffer_object(buffer, context); -- context_release(context); -+ wined3d_cs_emit_create_vbo(device->cs, buffer); - buffer->flags &= ~WINED3D_BUFFER_CREATEBO; - } - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 59b9a9c..33a3b05 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -82,6 +82,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_SHADER_CLEANUP, -+ WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_STOP, - }; - -@@ -480,6 +481,12 @@ struct wined3d_cs_shader_cleanup - struct wined3d_shader *shader; - }; - -+struct wined3d_cs_create_vbo -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2421,6 +2428,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_create_vbo(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_vbo *op = data; -+ struct wined3d_context *context = context_acquire(cs->device, NULL); -+ -+ buffer_create_buffer_object(op->buffer, context); -+ -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_create_vbo *op; -+ -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_VBO; -+ op->buffer = buffer; -+ -+ cs->ops->submit_prio(cs, sizeof(*op)); -+ cs->ops->finish_prio(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2481,6 +2512,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, -+ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9eb3c3a..4d5710a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2822,6 +2822,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta - void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, - struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; - void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2910,6 +2911,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - const struct wined3d_state *state) DECLSPEC_HIDDEN; - void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; - void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; -+void buffer_create_buffer_object(struct wined3d_buffer *This, -+ struct wined3d_context *context) DECLSPEC_HIDDEN; - HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,156 @@ +From 1ddba156e6aa9f96e9e05b18b1324183884a2596 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:50:08 +0200 +Subject: wined3d: Clean up buffer resource data through the CS. + +--- + dlls/wined3d/buffer.c | 39 ++++++++++++++++++++------------------- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 50 insertions(+), 19 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index e248ca9..12a1ca0 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -545,37 +545,38 @@ static void buffer_unload(struct wined3d_resource *resource) + resource_unload(resource); + } + ++void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) ++{ ++ struct wined3d_context *context; ++ struct wined3d_device *device = buffer->resource.device; ++ ++ if (buffer->buffer_object) ++ { ++ context = context_acquire(device, NULL); ++ delete_gl_buffer(buffer, context->gl_info); ++ context_release(context); ++ ++ HeapFree(GetProcessHeap(), 0, buffer->conversion_map); ++ } ++ ++ HeapFree(GetProcessHeap(), 0, buffer->maps); ++ HeapFree(GetProcessHeap(), 0, buffer); ++} ++ + ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) + { + ULONG refcount = InterlockedDecrement(&buffer->resource.ref); +- struct wined3d_context *context; + + TRACE("%p decreasing refcount to %u.\n", buffer, refcount); + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); +- } +- +- if (buffer->buffer_object) +- { +- context = context_acquire(buffer->resource.device, NULL); +- delete_gl_buffer(buffer, context->gl_info); +- context_release(context); +- +- HeapFree(GetProcessHeap(), 0, buffer->conversion_map); +- } ++ struct wined3d_device *device = buffer->resource.device; + + resource_cleanup(&buffer->resource); +- if (wined3d_settings.cs_multithreaded) +- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); + + buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); +- HeapFree(GetProcessHeap(), 0, buffer->maps); +- HeapFree(GetProcessHeap(), 0, buffer); ++ wined3d_cs_emit_buffer_cleanup(device->cs, buffer); + } + + return refcount; +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 4a42ca3..f64c43d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -84,6 +84,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_RESOURCE_CLEANUP, ++ WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -494,6 +495,12 @@ struct wined3d_cs_resource_cleanup + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_buffer_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2479,6 +2486,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_cleanup *op = data; ++ ++ wined3d_buffer_cleanup_cs(op->buffer); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_buffer_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_CLEANUP; ++ op->buffer = buffer; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2541,6 +2568,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, ++ /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index e80859a..83c94c5 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2826,6 +2826,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader + void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2916,6 +2917,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s + void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; + void buffer_create_buffer_object(struct wined3d_buffer *This, + struct wined3d_context *context) DECLSPEC_HIDDEN; ++void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-resource-data-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Clean-up-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -From 9109cd39e2867e3e9061d1720bde4598111b3d3b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:38:51 +0200 -Subject: wined3d: Clean up resource data through the CS. - ---- - dlls/wined3d/buffer.c | 3 +++ - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 15 ++++++++++----- - dlls/wined3d/surface.c | 5 +++++ - dlls/wined3d/texture.c | 4 ++++ - dlls/wined3d/volume.c | 3 +++ - dlls/wined3d/wined3d_private.h | 3 +++ - 7 files changed, 56 insertions(+), 5 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index fc65d3a..d968dcb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -570,6 +570,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) - } - - resource_cleanup(&buffer->resource); -+ if (wined3d_settings.cs_multithreaded) -+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); -+ - buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); - HeapFree(GetProcessHeap(), 0, buffer->maps); - HeapFree(GetProcessHeap(), 0, buffer); -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index c00d1d3..6edd5e3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -82,6 +82,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_CREATE_VBO, -+ WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -477,6 +478,12 @@ struct wined3d_cs_create_vbo - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_resource_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2338,6 +2345,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu - cs->ops->finish_prio(cs); - } - -+static UINT wined3d_cs_exec_resource_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_cleanup *op = data; -+ -+ wined3d_resource_cleanup_cs(op->resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_resource_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_CLEANUP; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2398,6 +2425,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, -+ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index ef0b213..dd21986 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -157,6 +157,15 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) - context_release(context); - } - -+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) -+{ -+ if (resource->buffer) -+ wined3d_resource_free_bo(resource); -+ -+ wined3d_resource_free_sysmem(resource); -+ resource->map_heap_memory = NULL; -+} -+ - void resource_cleanup(struct wined3d_resource *resource) - { - const struct wined3d *d3d = resource->device->wined3d; -@@ -169,11 +178,7 @@ void resource_cleanup(struct wined3d_resource *resource) - adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); - } - -- if (resource->buffer) -- wined3d_resource_free_bo(resource); -- -- wined3d_resource_free_sysmem(resource); -- resource->map_heap_memory = NULL; -+ wined3d_cs_emit_resource_cleanup(resource->device->cs, resource); - - device_resource_released(resource->device, resource); - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1d777e2..4a1cf30 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -101,9 +101,12 @@ static void surface_cleanup(struct wined3d_surface *surface) - - void wined3d_surface_destroy(struct wined3d_surface *surface) - { -+ struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - - surface_cleanup(surface); -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); - HeapFree(GetProcessHeap(), 0, surface); - } -@@ -5321,6 +5324,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - { - ERR("Private setup failed, hr %#x.\n", hr); - surface_cleanup(surface); -+ if (wined3d_settings.cs_multithreaded) -+ surface->resource.device->cs->ops->finish(surface->resource.device->cs); - return hr; - } - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index ea8589a..f7988e5 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -74,6 +74,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc - { - ERR("Failed to allocate sub-resource array.\n"); - resource_cleanup(&texture->resource); -+ if (wined3d_settings.cs_multithreaded) -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); - return E_OUTOFMEMORY; - } - -@@ -153,6 +155,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - wined3d_texture_unload_gl_texture(texture); - HeapFree(GetProcessHeap(), 0, texture->sub_resources); - resource_cleanup(&texture->resource); -+ if (wined3d_settings.cs_multithreaded) -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); - } - - void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 34b72d1..218118d 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -291,9 +291,12 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * - - void wined3d_volume_destroy(struct wined3d_volume *volume) - { -+ struct wined3d_device *device = volume->resource.device; - TRACE("volume %p.\n", volume); - - resource_cleanup(&volume->resource); -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); - HeapFree(GetProcessHeap(), 0, volume); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 74e059c..f4c269c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2163,6 +2163,7 @@ void wined3d_resource_changed(struct wined3d_resource *resource, - struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) DECLSPEC_HIDDEN; -+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, -@@ -2706,6 +2707,8 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, - struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; - void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; - void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, -+ struct wined3d_resource *resource) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -From 1ddba156e6aa9f96e9e05b18b1324183884a2596 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:50:08 +0200 -Subject: wined3d: Clean up buffer resource data through the CS. - ---- - dlls/wined3d/buffer.c | 39 ++++++++++++++++++++------------------- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 50 insertions(+), 19 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index e248ca9..12a1ca0 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -545,37 +545,38 @@ static void buffer_unload(struct wined3d_resource *resource) - resource_unload(resource); - } - -+void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) -+{ -+ struct wined3d_context *context; -+ struct wined3d_device *device = buffer->resource.device; -+ -+ if (buffer->buffer_object) -+ { -+ context = context_acquire(device, NULL); -+ delete_gl_buffer(buffer, context->gl_info); -+ context_release(context); -+ -+ HeapFree(GetProcessHeap(), 0, buffer->conversion_map); -+ } -+ -+ HeapFree(GetProcessHeap(), 0, buffer->maps); -+ HeapFree(GetProcessHeap(), 0, buffer); -+} -+ - ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) - { - ULONG refcount = InterlockedDecrement(&buffer->resource.ref); -- struct wined3d_context *context; - - TRACE("%p decreasing refcount to %u.\n", buffer, refcount); - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); -- } -- -- if (buffer->buffer_object) -- { -- context = context_acquire(buffer->resource.device, NULL); -- delete_gl_buffer(buffer, context->gl_info); -- context_release(context); -- -- HeapFree(GetProcessHeap(), 0, buffer->conversion_map); -- } -+ struct wined3d_device *device = buffer->resource.device; - - resource_cleanup(&buffer->resource); -- if (wined3d_settings.cs_multithreaded) -- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); - - buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); -- HeapFree(GetProcessHeap(), 0, buffer->maps); -- HeapFree(GetProcessHeap(), 0, buffer); -+ wined3d_cs_emit_buffer_cleanup(device->cs, buffer); - } - - return refcount; -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4a42ca3..f64c43d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -84,6 +84,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_RESOURCE_CLEANUP, -+ WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -494,6 +495,12 @@ struct wined3d_cs_resource_cleanup - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_buffer_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2479,6 +2486,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_cleanup *op = data; -+ -+ wined3d_buffer_cleanup_cs(op->buffer); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_buffer_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_CLEANUP; -+ op->buffer = buffer; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2541,6 +2568,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, -+ /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e80859a..83c94c5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2826,6 +2826,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader - void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2916,6 +2917,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s - void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; - void buffer_create_buffer_object(struct wined3d_buffer *This, - struct wined3d_context *context) DECLSPEC_HIDDEN; -+void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-volume-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-volume-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,122 @@ +From 40087b5024636170ee3bc5c4ed3436898a97e21c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:54:57 +0200 +Subject: wined3d: Clean up volume resource data through the CS. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/volume.c | 9 ++++++--- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 36 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 54b6d1a..18b556d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -85,6 +85,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_BUFFER_CLEANUP, ++ WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -501,6 +502,12 @@ struct wined3d_cs_buffer_cleanup + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_volume_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_volume *volume; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2506,6 +2513,26 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_volume_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_volume_cleanup *op = data; ++ ++ wined3d_volume_cleanup_cs(op->volume); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) ++{ ++ struct wined3d_cs_volume_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VOLUME_CLEANUP; ++ op->volume = volume; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2569,6 +2596,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, ++ /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 15c80ce..eb0341a 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -313,10 +313,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) + TRACE("volume %p.\n", volume); + + resource_cleanup(&volume->resource); +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); + volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); +- HeapFree(GetProcessHeap(), 0, volume); ++ wined3d_cs_emit_volume_cleanup(device->cs, volume); + } + + static void volume_unload(struct wined3d_resource *resource) +@@ -425,6 +423,11 @@ static ULONG volume_resource_incref(struct wined3d_resource *resource) + return wined3d_texture_incref(volume->container); + } + ++void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) ++{ ++ HeapFree(GetProcessHeap(), 0, volume); ++} ++ + static ULONG volume_resource_decref(struct wined3d_resource *resource) + { + struct wined3d_volume *volume = volume_from_resource(resource); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f4cc159..04a403a 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2435,6 +2435,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, + HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, + const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; ++void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) DECLSPEC_HIDDEN; + + struct wined3d_surface_dib + { +@@ -2809,6 +2810,7 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu + void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.6.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-surfaces-through-the-cs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-surfaces-through-the-cs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-surfaces-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-surfaces-through-the-cs.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,178 @@ +From 0fd12af6067cbe8aa8800098a602d808978d14ac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 6 Oct 2013 16:12:24 +0200 +Subject: wined3d: Clean up surfaces through the cs. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 37 ++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 46 insertions(+), 21 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 18b556d..91b76f5 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -86,6 +86,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_VOLUME_CLEANUP, ++ WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -508,6 +509,12 @@ struct wined3d_cs_volume_cleanup + struct wined3d_volume *volume; + }; + ++struct wined3d_cs_surface_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2533,6 +2540,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_surface_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_surface_cleanup *op = data; ++ ++ wined3d_surface_cleanup_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_surface_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SURFACE_CLEANUP; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2597,6 +2624,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, ++ /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index c607072..e0164f1 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); + + #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ + +-static void surface_cleanup(struct wined3d_surface *surface) +-{ +- struct wined3d_surface *overlay, *cur; +- +- TRACE("surface %p.\n", surface); +- +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- surface->resource.device->cs->ops->finish(surface->resource.device->cs); +- } + +- if (surface->resource.buffer || surface->rb_multisample +- || surface->rb_resolved || !list_empty(&surface->renderbuffers)) ++void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) ++{ ++ if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { + struct wined3d_renderbuffer_entry *entry, *entry2; + const struct wined3d_gl_info *gl_info; +@@ -87,6 +77,16 @@ static void surface_cleanup(struct wined3d_surface *surface) + surface->resource.bitmap_data = NULL; + } + ++ TRACE("Destroyed surface %p.\n", surface); ++ HeapFree(GetProcessHeap(), 0, surface); ++} ++ ++static void surface_cleanup(struct wined3d_surface *surface) ++{ ++ struct wined3d_surface *overlay, *cur; ++ ++ TRACE("surface %p.\n", surface); ++ + if (surface->overlay_dest) + list_remove(&surface->overlay_entry); + +@@ -97,18 +97,15 @@ static void surface_cleanup(struct wined3d_surface *surface) + } + + resource_cleanup(&surface->resource); ++ wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); + } + + void wined3d_surface_destroy(struct wined3d_surface *surface) + { +- struct wined3d_device *device = surface->resource.device; + TRACE("surface %p.\n", surface); + +- surface_cleanup(surface); +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); + surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); +- HeapFree(GetProcessHeap(), 0, surface); ++ surface_cleanup(surface); + } + + void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, +@@ -5360,8 +5357,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + { + ERR("Private setup failed, hr %#x.\n", hr); + surface_cleanup(surface); +- if (wined3d_settings.cs_multithreaded) +- surface->resource.device->cs->ops->finish(surface->resource.device->cs); + return hr; + } + +@@ -5404,7 +5399,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w + if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) + { + WARN("Failed to initialize surface, returning %#x.\n", hr); +- HeapFree(GetProcessHeap(), 0, object); ++ /* The command stream takes care of freeing the memory. */ + return hr; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 96102af..cbc3fa9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2537,6 +2537,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ + struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; ++void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2800,6 +2801,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.6.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-volume-resource-data-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-volume-resource-data-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From 40087b5024636170ee3bc5c4ed3436898a97e21c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:54:57 +0200 -Subject: wined3d: Clean up volume resource data through the CS. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/volume.c | 9 ++++++--- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 36 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 54b6d1a..18b556d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -85,6 +85,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_BUFFER_CLEANUP, -+ WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -501,6 +502,12 @@ struct wined3d_cs_buffer_cleanup - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_volume_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_volume *volume; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2506,6 +2513,26 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_volume_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_volume_cleanup *op = data; -+ -+ wined3d_volume_cleanup_cs(op->volume); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) -+{ -+ struct wined3d_cs_volume_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VOLUME_CLEANUP; -+ op->volume = volume; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2569,6 +2596,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, -+ /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 15c80ce..eb0341a 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -313,10 +313,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) - TRACE("volume %p.\n", volume); - - resource_cleanup(&volume->resource); -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); - volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); -- HeapFree(GetProcessHeap(), 0, volume); -+ wined3d_cs_emit_volume_cleanup(device->cs, volume); - } - - static void volume_unload(struct wined3d_resource *resource) -@@ -425,6 +423,11 @@ static ULONG volume_resource_incref(struct wined3d_resource *resource) - return wined3d_texture_incref(volume->container); - } - -+void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) -+{ -+ HeapFree(GetProcessHeap(), 0, volume); -+} -+ - static ULONG volume_resource_decref(struct wined3d_resource *resource) - { - struct wined3d_volume *volume = volume_from_resource(resource); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f4cc159..04a403a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2435,6 +2435,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, - HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -+void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - - struct wined3d_surface_dib - { -@@ -2809,6 +2810,7 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu - void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.0 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-surfaces-through-the-cs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-surfaces-through-the-cs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-surfaces-through-the-cs.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-surfaces-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -From 0fd12af6067cbe8aa8800098a602d808978d14ac Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 6 Oct 2013 16:12:24 +0200 -Subject: wined3d: Clean up surfaces through the cs. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 37 ++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 46 insertions(+), 21 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 18b556d..91b76f5 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -86,6 +86,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_VOLUME_CLEANUP, -+ WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -508,6 +509,12 @@ struct wined3d_cs_volume_cleanup - struct wined3d_volume *volume; - }; - -+struct wined3d_cs_surface_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2533,6 +2540,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_surface_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_surface_cleanup *op = data; -+ -+ wined3d_surface_cleanup_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_surface_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SURFACE_CLEANUP; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2597,6 +2624,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, -+ /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c607072..e0164f1 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); - - #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ - --static void surface_cleanup(struct wined3d_surface *surface) --{ -- struct wined3d_surface *overlay, *cur; -- -- TRACE("surface %p.\n", surface); -- -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- surface->resource.device->cs->ops->finish(surface->resource.device->cs); -- } - -- if (surface->resource.buffer || surface->rb_multisample -- || surface->rb_resolved || !list_empty(&surface->renderbuffers)) -+void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) -+{ -+ if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { - struct wined3d_renderbuffer_entry *entry, *entry2; - const struct wined3d_gl_info *gl_info; -@@ -87,6 +77,16 @@ static void surface_cleanup(struct wined3d_surface *surface) - surface->resource.bitmap_data = NULL; - } - -+ TRACE("Destroyed surface %p.\n", surface); -+ HeapFree(GetProcessHeap(), 0, surface); -+} -+ -+static void surface_cleanup(struct wined3d_surface *surface) -+{ -+ struct wined3d_surface *overlay, *cur; -+ -+ TRACE("surface %p.\n", surface); -+ - if (surface->overlay_dest) - list_remove(&surface->overlay_entry); - -@@ -97,18 +97,15 @@ static void surface_cleanup(struct wined3d_surface *surface) - } - - resource_cleanup(&surface->resource); -+ wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); - } - - void wined3d_surface_destroy(struct wined3d_surface *surface) - { -- struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - -- surface_cleanup(surface); -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); - surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); -- HeapFree(GetProcessHeap(), 0, surface); -+ surface_cleanup(surface); - } - - void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -5360,8 +5357,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - { - ERR("Private setup failed, hr %#x.\n", hr); - surface_cleanup(surface); -- if (wined3d_settings.cs_multithreaded) -- surface->resource.device->cs->ops->finish(surface->resource.device->cs); - return hr; - } - -@@ -5404,7 +5399,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w - if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) - { - WARN("Failed to initialize surface, returning %#x.\n", hr); -- HeapFree(GetProcessHeap(), 0, object); -+ /* The command stream takes care of freeing the memory. */ - return hr; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 96102af..cbc3fa9 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2537,6 +2537,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ - struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; -+void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2800,6 +2801,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.0 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-texture-resources-through-the-cs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-texture-resources-through-the-cs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-texture-resources-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-texture-resources-through-the-cs.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,245 @@ +From 422533270db1400ad7a8a0d4bfd5fa74ed2f8424 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 6 Oct 2013 16:20:32 +0200 +Subject: wined3d: Clean up texture resources through the cs. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/texture.c | 33 +++++++++++++++++++++++++-------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 55 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 1c7b3c7..4f7e49f 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -86,6 +86,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_SURFACE_CLEANUP, ++ WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -508,6 +509,12 @@ struct wined3d_cs_surface_cleanup + struct wined3d_surface *surface; + }; + ++struct wined3d_cs_texture_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_texture *texture; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2530,6 +2537,26 @@ void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surfa + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_texture_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_texture_cleanup *op = data; ++ ++ wined3d_texture_cleanup_cs(op->texture); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) ++{ ++ struct wined3d_cs_texture_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_TEXTURE_CLEANUP; ++ op->texture = texture; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2594,6 +2621,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, ++ /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 0e9b6ea..18fc976 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -114,17 +114,26 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) + resource_unload(&texture->resource); + } + ++void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) ++{ ++ wined3d_texture_unload_gl_texture(texture); ++ HeapFree(GetProcessHeap(), 0, texture->sub_resources); ++ HeapFree(GetProcessHeap(), 0, texture); ++} ++ + static void wined3d_texture_cleanup(struct wined3d_texture *texture) + { + UINT sub_count = texture->level_count * texture->layer_count; + UINT i; ++ struct wined3d_device *device = texture->resource.device; + + TRACE("texture %p.\n", texture); + ++ /* Because sub_resource_cleanup interferes with GL resources */ + if (wined3d_settings.cs_multithreaded) + { + FIXME("Waiting for cs.\n"); +- texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ device->cs->ops->finish(device->cs); + } + + for (i = 0; i < sub_count; ++i) +@@ -135,11 +144,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + texture->texture_ops->texture_sub_resource_cleanup(sub_resource); + } + +- wined3d_texture_unload_gl_texture(texture); +- HeapFree(GetProcessHeap(), 0, texture->sub_resources); + resource_cleanup(&texture->resource); +- if (wined3d_settings.cs_multithreaded) +- texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ wined3d_cs_emit_texture_cleanup(device->cs, texture); + } + + void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) +@@ -423,9 +429,10 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) + + if (!refcount) + { ++ void *parent = texture->resource.parent; ++ const struct wined3d_parent_ops *parent_ops = texture->resource.parent_ops; + wined3d_texture_cleanup(texture); +- texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent); +- HeapFree(GetProcessHeap(), 0, texture); ++ parent_ops->wined3d_object_destroyed(parent); + } + + return refcount; +@@ -990,6 +997,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + if (WINED3DFMT_UNKNOWN >= desc->format) + { + WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + +@@ -1020,6 +1028,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + else + { + WARN("Attempted to create a mipmapped/cube NPOT texture without unconditional NPOT support.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1032,12 +1041,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) + { + WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (level_count != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1046,6 +1057,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + flags, device, parent, parent_ops, &texture2d_resource_ops))) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); ++ HeapFree(GetProcessHeap(), 0, texture); + return hr; + } + +@@ -1248,12 +1260,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + if (WINED3DFMT_UNKNOWN >= desc->format) + { + WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (!gl_info->supported[EXT_TEXTURE3D]) + { + WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + +@@ -1263,12 +1277,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) + { + WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (levels != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1296,6 +1312,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + { + WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", + desc->width, desc->height, desc->depth); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1305,6 +1322,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + 0, device, parent, parent_ops, &texture3d_resource_ops))) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); ++ HeapFree(GetProcessHeap(), 0, texture); + return hr; + } + +@@ -1424,7 +1442,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct + if (FAILED(hr)) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); +- HeapFree(GetProcessHeap(), 0, object); + return hr; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7a1b9aa..2da4a16 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2484,6 +2484,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t + + void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, + const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; ++void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_texture_bind(struct wined3d_texture *texture, + struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; + void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, +@@ -2917,6 +2918,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-texture-resources-through-the-cs.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-texture-resources-through-the-cs.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-texture-resources-through-the-cs.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-texture-resources-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,284 +0,0 @@ -From 99c21f03b539568231b746938b4b0cb5ba664720 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 6 Oct 2013 16:20:32 +0200 -Subject: wined3d: Clean up texture resources through the cs. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 38 ++++++++++++++++++++++++++++++-------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 60 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 91b76f5..ba8d19e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -87,6 +87,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_SURFACE_CLEANUP, -+ WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -515,6 +516,12 @@ struct wined3d_cs_surface_cleanup - struct wined3d_surface *surface; - }; - -+struct wined3d_cs_texture_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *texture; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2560,6 +2567,26 @@ void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surfa - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_texture_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_texture_cleanup *op = data; -+ -+ wined3d_texture_cleanup_cs(op->texture); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) -+{ -+ struct wined3d_cs_texture_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_TEXTURE_CLEANUP; -+ op->texture = texture; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2625,6 +2652,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, -+ /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 61ef22e..85abaa4 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -114,17 +114,26 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) - resource_unload(&texture->resource); - } - -+void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) -+{ -+ wined3d_texture_unload_gl_texture(texture); -+ HeapFree(GetProcessHeap(), 0, texture->sub_resources); -+ HeapFree(GetProcessHeap(), 0, texture); -+} -+ - static void wined3d_texture_cleanup(struct wined3d_texture *texture) - { - UINT sub_count = texture->level_count * texture->layer_count; - UINT i; -+ struct wined3d_device *device = texture->resource.device; - - TRACE("texture %p.\n", texture); - -+ /* Because sub_resource_cleanup interferes with GL resources */ - if (wined3d_settings.cs_multithreaded) - { - FIXME("Waiting for cs.\n"); -- texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ device->cs->ops->finish(device->cs); - } - - for (i = 0; i < sub_count; ++i) -@@ -135,11 +144,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - texture->texture_ops->texture_sub_resource_cleanup(sub_resource); - } - -- wined3d_texture_unload_gl_texture(texture); -- HeapFree(GetProcessHeap(), 0, texture->sub_resources); - resource_cleanup(&texture->resource); -- if (wined3d_settings.cs_multithreaded) -- texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ wined3d_cs_emit_texture_cleanup(device->cs, texture); - } - - void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) -@@ -423,9 +429,10 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) - - if (!refcount) - { -+ void *parent = texture->resource.parent; -+ const struct wined3d_parent_ops *parent_ops = texture->resource.parent_ops; - wined3d_texture_cleanup(texture); -- texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent); -- HeapFree(GetProcessHeap(), 0, texture); -+ parent_ops->wined3d_object_destroyed(parent); - } - - return refcount; -@@ -1028,6 +1035,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1037,12 +1045,14 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1063,6 +1073,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - else - { - WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1072,6 +1083,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1134,6 +1146,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1164,6 +1177,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - else - { - WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1176,12 +1190,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1190,6 +1206,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1392,12 +1409,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (!gl_info->supported[EXT_TEXTURE3D]) - { - WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1407,12 +1426,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1440,6 +1461,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - { - WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", - desc->width, desc->height, desc->depth); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1449,6 +1471,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - 0, device, parent, parent_ops, &texture3d_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1549,7 +1572,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct - if (FAILED(hr)) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -- HeapFree(GetProcessHeap(), 0, object); - return hr; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 55b057c..e5baaa4 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2393,6 +2393,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t - - void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, - const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; -+void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_texture_bind(struct wined3d_texture *texture, - struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; - void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2827,6 +2828,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.2 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,29 @@ +From a0e7463e86758e478993d59c339f590283e3532b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 23:28:56 +0200 +Subject: wined3d: Unload resources through the CS in uninit_3d. + +--- + dlls/wined3d/device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index e0e2c82..1d7d733 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1066,9 +1066,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Unloading resource %p.\n", resource); +- +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + + wine_rb_clear(&device->samplers, device_free_sampler, NULL); + +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-device_re.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-device_re.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-device_re.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-device_re.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,44 @@ +From d2b010c4c1c08d71ed6e2e4257db236535c20deb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 23:40:20 +0200 +Subject: wined3d: Unload resources through the CS in device_reset. + +--- + dlls/wined3d/device.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 28819af..2410547 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4228,21 +4228,23 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + struct wined3d_context *context; + struct wined3d_shader *shader; + +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Unloading resource %p.\n", resource); + +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + + LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) + { + device->shader_backend->shader_destroy(shader); + } + ++ context = context_acquire(device, NULL); ++ gl_info = context->gl_info; ++ + if (device->depth_blt_texture) + { + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From a0e7463e86758e478993d59c339f590283e3532b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 23:28:56 +0200 -Subject: wined3d: Unload resources through the CS in uninit_3d. - ---- - dlls/wined3d/device.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e0e2c82..1d7d733 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1066,9 +1066,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Unloading resource %p.\n", resource); -- -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - - wine_rb_clear(&device->samplers, device_free_sampler, NULL); - --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,27 @@ +From 81f901210e683ac2a2193957849497031f424545 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 17:39:08 +0200 +Subject: wined3d: Don't glFinish after a depth buffer blit. + +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4d8bd1c..3c5489f 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -694,9 +694,7 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Unload-resources-through-the-CS-in-device_re.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Unload-resources-through-the-CS-in-device_re.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Unload-resources-through-the-CS-in-device_re.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Unload-resources-through-the-CS-in-device_re.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From d2b010c4c1c08d71ed6e2e4257db236535c20deb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 23:40:20 +0200 -Subject: wined3d: Unload resources through the CS in device_reset. - ---- - dlls/wined3d/device.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 28819af..2410547 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4228,21 +4228,23 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - struct wined3d_context *context; - struct wined3d_shader *shader; - -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Unloading resource %p.\n", resource); - -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - - LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) - { - device->shader_backend->shader_destroy(shader); - } - -+ context = context_acquire(device, NULL); -+ gl_info = context->gl_info; -+ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 81f901210e683ac2a2193957849497031f424545 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 17:39:08 +0200 -Subject: wined3d: Don't glFinish after a depth buffer blit. - ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4d8bd1c..3c5489f 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -694,9 +694,7 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-software-cursor-support.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-software-cursor-support.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-software-cursor-support.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-software-cursor-support.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,180 @@ +From 5630b5ff775157526358b39aa01da3d3d3ed2a5e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 19:23:24 +0200 +Subject: wined3d: Remove software cursor support. + +This has been broken since quite some time and only serves to crash fglrx by acquiring a context +in the main thread. + +FIXME: Make sure wined3d_device_show_cursor returns the correct value if a software cursor is set. +--- + dlls/wined3d/device.c | 64 ------------------------------------------ + dlls/wined3d/swapchain.c | 29 ------------------- + dlls/wined3d/wined3d_private.h | 1 - + 3 files changed, 94 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 7b7d5c9..d521cca 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1119,8 +1119,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + + if (device->logo_texture) + wined3d_texture_decref(device->logo_texture); +- if (device->cursor_texture) +- wined3d_texture_decref(device->cursor_texture); + + /* Release the buffers (with sanity checks). + * FIXME: Move this move into a separate patch. I think the idea +@@ -4259,48 +4257,6 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, + wined3d_rendertarget_view_decref(prev); + } + +-static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, +- struct wined3d_surface *cursor_image) +-{ +- struct wined3d_sub_resource_data data; +- struct wined3d_resource_desc desc; +- struct wined3d_map_desc map_desc; +- struct wined3d_texture *texture; +- HRESULT hr; +- +- if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) +- { +- ERR("Failed to map source surface.\n"); +- return NULL; +- } +- +- data.data = map_desc.data; +- data.row_pitch = map_desc.row_pitch; +- data.slice_pitch = map_desc.slice_pitch; +- +- desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; +- desc.format = WINED3DFMT_B8G8R8A8_UNORM; +- desc.multisample_type = WINED3D_MULTISAMPLE_NONE; +- desc.multisample_quality = 0; +- desc.usage = WINED3DUSAGE_DYNAMIC; +- desc.pool = WINED3D_POOL_DEFAULT; +- desc.width = cursor_image->resource.width; +- desc.height = cursor_image->resource.height; +- desc.depth = 1; +- desc.size = 0; +- +- hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, +- &data, NULL, &wined3d_null_parent_ops, &texture); +- wined3d_surface_unmap(cursor_image); +- if (FAILED(hr)) +- { +- ERR("Failed to create cursor texture.\n"); +- return NULL; +- } +- +- return texture; +-} +- + HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, + UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx) + { +@@ -4319,12 +4275,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device + + cursor_image = surface_from_resource(sub_resource); + +- if (device->cursor_texture) +- { +- wined3d_texture_decref(device->cursor_texture); +- device->cursor_texture = NULL; +- } +- + if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) + { + WARN("Surface %p has an invalid format %s.\n", +@@ -4352,11 +4302,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device + * release it after setting the cursor image. Windows doesn't + * addref the set surface, so we can't do this either without + * creating circular refcount dependencies. */ +- if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) +- { +- ERR("Failed to create cursor texture.\n"); +- return WINED3DERR_INVALIDCALL; +- } + + if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) + { +@@ -4461,10 +4406,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) + else + SetCursor(NULL); + } +- else if (device->cursor_texture) +- { +- device->bCursorVisible = show; +- } + + return oldVisible; + } +@@ -4621,11 +4562,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + wined3d_texture_decref(device->logo_texture); + device->logo_texture = NULL; + } +- if (device->cursor_texture) +- { +- wined3d_texture_decref(device->cursor_texture); +- device->cursor_texture = NULL; +- } + } + + if (device->state.fb.render_targets) +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 6a1363e..5d2b17d 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -455,35 +455,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + NULL, WINED3D_TEXF_POINT); + } + +- if (swapchain->device->bCursorVisible && swapchain->device->cursor_texture +- && !swapchain->device->hardwareCursor) +- { +- struct wined3d_surface *cursor = surface_from_resource( +- wined3d_texture_get_sub_resource(swapchain->device->cursor_texture, 0)); +- RECT destRect = +- { +- swapchain->device->xScreenSpace - swapchain->device->xHotSpot, +- swapchain->device->yScreenSpace - swapchain->device->yHotSpot, +- swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot, +- swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot, +- }; +- RECT src_rect = +- { +- 0, 0, +- swapchain->device->cursor_texture->resource.width, +- swapchain->device->cursor_texture->resource.height +- }; +- const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height}; +- +- TRACE("Rendering the software cursor.\n"); +- +- if (swapchain->desc.windowed) +- MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2); +- if (wined3d_clip_blit(&clip_rect, &destRect, &src_rect)) +- wined3d_surface_blt(back_buffer, &destRect, cursor, &src_rect, WINEDDBLT_ALPHATEST, +- NULL, WINED3D_TEXF_POINT); +- } +- + TRACE("Presenting HDC %p.\n", context->hdc); + + render_to_fbo = swapchain->render_to_fbo; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d45d35f..6a57cc9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2165,7 +2165,6 @@ struct wined3d_device + UINT xScreenSpace; + UINT yScreenSpace; + UINT cursorWidth, cursorHeight; +- struct wined3d_texture *cursor_texture; + HCURSOR hardwareCursor; + + /* The Wine logo texture */ +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-dummy-textures-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-dummy-textures-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-dummy-textures-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-dummy-textures-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,172 @@ +From e95849bf089a6b93c67e1927a646a4e8bb35a243 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 16:29:42 +0200 +Subject: wined3d: Create dummy textures through the CS. + +Hacky version. Just good enough to see if the double context during init is what makes fglrx +crash. +--- + dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 19 +++++++------------ + dlls/wined3d/wined3d_private.h | 4 +++- + 3 files changed, 40 insertions(+), 13 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index bd83689..383c9a5 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -88,6 +88,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_TEXTURE_CLEANUP, ++ WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_STOP, + }; + +@@ -522,6 +523,11 @@ struct wined3d_cs_texture_cleanup + struct wined3d_texture *texture; + }; + ++struct wined3d_cs_create_dummy_textures ++{ ++ enum wined3d_cs_op opcode; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2587,6 +2593,29 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_create_dummy_textures(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_dummy_textures *op = data; ++ struct wined3d_context *context = context_acquire(cs->device, NULL); ++ ++ device_create_dummy_textures(cs->device, context); ++ device_create_default_sampler(cs->device); ++ ++ context_release(context); ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) ++{ ++ struct wined3d_cs_create_dummy_textures *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_DUMMY_TEXTURES; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2653,6 +2682,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, ++ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 1b0226a..df19923 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -651,7 +651,7 @@ out: + } + + /* Context activation is done by the caller. */ +-static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) ++void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + unsigned int i, j, count; +@@ -758,7 +758,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w + } + + /* Context activation is done by the caller. */ +-static void create_default_sampler(struct wined3d_device *device) ++void device_create_default_sampler(struct wined3d_device *device) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + +@@ -940,7 +940,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + { + static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; + struct wined3d_swapchain *swapchain = NULL; +- struct wined3d_context *context; + DWORD clear_flags = 0; + HRESULT hr; + +@@ -991,10 +990,8 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + device->swapchains[0] = swapchain; + device_init_swapchain_state(device, swapchain); + +- context = context_acquire(device, NULL); +- +- create_dummy_textures(device, context); +- create_default_sampler(device); ++ /* also calls create_default_sampler */ ++ wined3d_cs_emit_create_dummy_textures(device->cs); + + device->contexts[0]->last_was_rhw = 0; + +@@ -1006,7 +1003,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + + case ORM_BACKBUFFER: + { +- if (context_get_current()->aux_buffers > 0) ++ if (device->contexts[0]->aux_buffers > 0) + { + TRACE("Using auxiliary buffer for offscreen rendering\n"); + device->offscreenBuffer = GL_AUX0; +@@ -1022,8 +1019,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + + TRACE("All defaults now set up, leaving 3D init.\n"); + +- context_release(context); +- + /* Clear the screen */ + if (swapchain->back_buffers && swapchain->back_buffers[0]) + clear_flags |= WINED3DCLEAR_TARGET; +@@ -4504,8 +4499,8 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru + + swapchain->context[0] = context; + swapchain->num_contexts = 1; +- create_dummy_textures(device, context); +- create_default_sampler(device); ++ device_create_dummy_textures(device, context); ++ device_create_default_sampler(device); + context_release(context); + + return WINED3D_OK; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d187c0a..f9ffece 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2198,7 +2198,8 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT + GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; + void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, + const struct wined3d_context *context) DECLSPEC_HIDDEN; +- ++void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; ++void device_create_default_sampler(struct wined3d_device *device); + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2837,6 +2838,7 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -From 649e5b815399a26eb4f3ace31d604310771a9eac Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 19:23:24 +0200 -Subject: wined3d: Remove software cursor support. - -This has been broken since quite some time and only serves to crash fglrx by acquiring a context -in the main thread. - -FIXME: Make sure wined3d_device_show_cursor returns the correct value if a software cursor is set. ---- - dlls/wined3d/device.c | 64 ------------------------------------------ - dlls/wined3d/swapchain.c | 29 ------------------- - dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 94 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 70fb2cb..e9ef79f 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1073,8 +1073,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - - if (device->logo_texture) - wined3d_texture_decref(device->logo_texture); -- if (device->cursor_texture) -- wined3d_texture_decref(device->cursor_texture); - - /* Release the buffers (with sanity checks). - * FIXME: Move this move into a separate patch. I think the idea -@@ -4181,48 +4179,6 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, - wined3d_rendertarget_view_decref(prev); - } - --static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, -- struct wined3d_surface *cursor_image) --{ -- struct wined3d_sub_resource_data data; -- struct wined3d_resource_desc desc; -- struct wined3d_map_desc map_desc; -- struct wined3d_texture *texture; -- HRESULT hr; -- -- if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) -- { -- ERR("Failed to map source surface.\n"); -- return NULL; -- } -- -- data.data = map_desc.data; -- data.row_pitch = map_desc.row_pitch; -- data.slice_pitch = map_desc.slice_pitch; -- -- desc.resource_type = WINED3D_RTYPE_TEXTURE; -- desc.format = WINED3DFMT_B8G8R8A8_UNORM; -- desc.multisample_type = WINED3D_MULTISAMPLE_NONE; -- desc.multisample_quality = 0; -- desc.usage = WINED3DUSAGE_DYNAMIC; -- desc.pool = WINED3D_POOL_DEFAULT; -- desc.width = cursor_image->resource.width; -- desc.height = cursor_image->resource.height; -- desc.depth = 1; -- desc.size = 0; -- -- hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, -- &data, NULL, &wined3d_null_parent_ops, &texture); -- wined3d_surface_unmap(cursor_image); -- if (FAILED(hr)) -- { -- ERR("Failed to create cursor texture.\n"); -- return NULL; -- } -- -- return texture; --} -- - HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx) - { -@@ -4241,12 +4197,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device - - cursor_image = surface_from_resource(sub_resource); - -- if (device->cursor_texture) -- { -- wined3d_texture_decref(device->cursor_texture); -- device->cursor_texture = NULL; -- } -- - if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) - { - WARN("Surface %p has an invalid format %s.\n", -@@ -4274,11 +4224,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device - * release it after setting the cursor image. Windows doesn't - * addref the set surface, so we can't do this either without - * creating circular refcount dependencies. */ -- if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) -- { -- ERR("Failed to create cursor texture.\n"); -- return WINED3DERR_INVALIDCALL; -- } - - if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) - { -@@ -4383,10 +4328,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) - else - SetCursor(NULL); - } -- else if (device->cursor_texture) -- { -- device->bCursorVisible = show; -- } - - return oldVisible; - } -@@ -4541,11 +4482,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - wined3d_texture_decref(device->logo_texture); - device->logo_texture = NULL; - } -- if (device->cursor_texture) -- { -- wined3d_texture_decref(device->cursor_texture); -- device->cursor_texture = NULL; -- } - } - - if (device->state.fb.render_targets) -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 77eb532..d0c7c54 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -455,35 +455,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - NULL, WINED3D_TEXF_POINT); - } - -- if (swapchain->device->bCursorVisible && swapchain->device->cursor_texture -- && !swapchain->device->hardwareCursor) -- { -- struct wined3d_surface *cursor = surface_from_resource( -- wined3d_texture_get_sub_resource(swapchain->device->cursor_texture, 0)); -- RECT destRect = -- { -- swapchain->device->xScreenSpace - swapchain->device->xHotSpot, -- swapchain->device->yScreenSpace - swapchain->device->yHotSpot, -- swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot, -- swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot, -- }; -- RECT src_rect = -- { -- 0, 0, -- swapchain->device->cursor_texture->resource.width, -- swapchain->device->cursor_texture->resource.height -- }; -- const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height}; -- -- TRACE("Rendering the software cursor.\n"); -- -- if (swapchain->desc.windowed) -- MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2); -- if (wined3d_clip_blit(&clip_rect, &destRect, &src_rect)) -- wined3d_surface_blt(back_buffer, &destRect, cursor, &src_rect, WINEDDBLT_ALPHATEST, -- NULL, WINED3D_TEXF_POINT); -- } -- - TRACE("Presenting HDC %p.\n", context->hdc); - - render_to_fbo = swapchain->render_to_fbo; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9450bdc..27a4a87 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2151,7 +2151,6 @@ struct wined3d_device - UINT xScreenSpace; - UINT yScreenSpace; - UINT cursorWidth, cursorHeight; -- struct wined3d_texture *cursor_texture; - HCURSOR hardwareCursor; - - /* The Wine logo texture */ --- -2.6.2 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-dummy-textures-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-dummy-textures-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-dummy-textures-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-dummy-textures-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -From e95849bf089a6b93c67e1927a646a4e8bb35a243 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 16:29:42 +0200 -Subject: wined3d: Create dummy textures through the CS. - -Hacky version. Just good enough to see if the double context during init is what makes fglrx -crash. ---- - dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 19 +++++++------------ - dlls/wined3d/wined3d_private.h | 4 +++- - 3 files changed, 40 insertions(+), 13 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index bd83689..383c9a5 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -88,6 +88,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_TEXTURE_CLEANUP, -+ WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_STOP, - }; - -@@ -522,6 +523,11 @@ struct wined3d_cs_texture_cleanup - struct wined3d_texture *texture; - }; - -+struct wined3d_cs_create_dummy_textures -+{ -+ enum wined3d_cs_op opcode; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2587,6 +2593,29 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_create_dummy_textures(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_dummy_textures *op = data; -+ struct wined3d_context *context = context_acquire(cs->device, NULL); -+ -+ device_create_dummy_textures(cs->device, context); -+ device_create_default_sampler(cs->device); -+ -+ context_release(context); -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_create_dummy_textures *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_DUMMY_TEXTURES; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2653,6 +2682,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, -+ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 1b0226a..df19923 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -651,7 +651,7 @@ out: - } - - /* Context activation is done by the caller. */ --static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) -+void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) - { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - unsigned int i, j, count; -@@ -758,7 +758,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w - } - - /* Context activation is done by the caller. */ --static void create_default_sampler(struct wined3d_device *device) -+void device_create_default_sampler(struct wined3d_device *device) - { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - -@@ -940,7 +940,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - { - static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; - struct wined3d_swapchain *swapchain = NULL; -- struct wined3d_context *context; - DWORD clear_flags = 0; - HRESULT hr; - -@@ -991,10 +990,8 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - device->swapchains[0] = swapchain; - device_init_swapchain_state(device, swapchain); - -- context = context_acquire(device, NULL); -- -- create_dummy_textures(device, context); -- create_default_sampler(device); -+ /* also calls create_default_sampler */ -+ wined3d_cs_emit_create_dummy_textures(device->cs); - - device->contexts[0]->last_was_rhw = 0; - -@@ -1006,7 +1003,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - - case ORM_BACKBUFFER: - { -- if (context_get_current()->aux_buffers > 0) -+ if (device->contexts[0]->aux_buffers > 0) - { - TRACE("Using auxiliary buffer for offscreen rendering\n"); - device->offscreenBuffer = GL_AUX0; -@@ -1022,8 +1019,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - - TRACE("All defaults now set up, leaving 3D init.\n"); - -- context_release(context); -- - /* Clear the screen */ - if (swapchain->back_buffers && swapchain->back_buffers[0]) - clear_flags |= WINED3DCLEAR_TARGET; -@@ -4504,8 +4499,8 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru - - swapchain->context[0] = context; - swapchain->num_contexts = 1; -- create_dummy_textures(device, context); -- create_default_sampler(device); -+ device_create_dummy_textures(device, context); -+ device_create_default_sampler(device); - context_release(context); - - return WINED3D_OK; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d187c0a..f9ffece 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2198,7 +2198,8 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT - GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; - void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, - const struct wined3d_context *context) DECLSPEC_HIDDEN; -- -+void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; -+void device_create_default_sampler(struct wined3d_device *device); - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2837,6 +2838,7 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-the-initial-context-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-the-initial-context-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-the-initial-context-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Create-the-initial-context-through-the-CS.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,240 @@ +From 070101f77c342c4eeb49e01d3cc9ca9eaa63fe24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 16:43:19 +0200 +Subject: wined3d: Create the initial context through the CS. + +Very hacky. +--- + dlls/wined3d/cs.c | 34 ++++++++++++ + dlls/wined3d/swapchain.c | 118 +++++++++++++++++++++++------------------ + dlls/wined3d/wined3d_private.h | 4 ++ + 3 files changed, 103 insertions(+), 53 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 7dc847b..c78ac12 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -89,6 +89,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, ++ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, + WINED3D_CS_OP_STOP, + }; + +@@ -528,6 +529,13 @@ struct wined3d_cs_create_dummy_textures + enum wined3d_cs_op opcode; + }; + ++struct wined3d_cs_create_swapchain_context ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_swapchain *swapchain; ++ HRESULT *ret; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2615,6 +2623,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_swapchain_context *op = data; ++ ++ *op->ret = swapchain_create_context_cs(cs->device, op->swapchain); ++ ++ return sizeof(*op); ++} ++ ++HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) ++{ ++ HRESULT ret; ++ struct wined3d_cs_create_swapchain_context *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT; ++ op->swapchain = swapchain; ++ op->ret = &ret; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++ ++ return ret; ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2682,6 +2715,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, ++ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index efe6987..71e5df6 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -723,6 +723,69 @@ static void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) + swapchain->render_to_fbo = TRUE; + } + ++HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++{ ++ const struct wined3d_adapter *adapter = device->adapter; ++ unsigned int i; ++ static const enum wined3d_format_id formats[] = ++ { ++ WINED3DFMT_D24_UNORM_S8_UINT, ++ WINED3DFMT_D32_UNORM, ++ WINED3DFMT_R24_UNORM_X8_TYPELESS, ++ WINED3DFMT_D16_UNORM, ++ WINED3DFMT_S1_UINT_D15_UNORM ++ }; ++ struct wined3d_surface *front_buffer; ++ const struct wined3d_gl_info *gl_info = &adapter->gl_info; ++ ++ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); ++ if (!swapchain->context) ++ { ++ ERR("Failed to create the context array.\n"); ++ return E_OUTOFMEMORY; ++ } ++ swapchain->num_contexts = 1; ++ ++ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. ++ * You are able to add a depth + stencil surface at a later stage when you need it. ++ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and ++ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new ++ * context, need torecreate shaders, textures and other resources. ++ * ++ * The context manager already takes care of the state problem and for the other tasks code from Reset ++ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. ++ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the ++ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this ++ * issue needs to be fixed. */ ++ front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); ++ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) ++ { ++ swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); ++ swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); ++ if (swapchain->context[0]) break; ++ TRACE("Depth stencil format %s is not supported, trying next format\n", ++ debug_d3dformat(formats[i])); ++ } ++ ++ if (!swapchain->context[0]) ++ { ++ WARN("Failed to create context.\n"); ++ HeapFree(GetProcessHeap(), 0, swapchain->context); ++ swapchain->context = NULL; ++ return WINED3DERR_NOTAVAILABLE; ++ } ++ ++ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO ++ && (!swapchain->desc.enable_auto_depth_stencil ++ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) ++ { ++ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); ++ } ++ context_release(swapchain->context[0]); ++ ++ return WINED3D_OK; ++} ++ + static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, + struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) + { +@@ -840,60 +903,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 + + if (!(device->wined3d->flags & WINED3D_NO3D)) + { +- static const enum wined3d_format_id formats[] = +- { +- WINED3DFMT_D24_UNORM_S8_UINT, +- WINED3DFMT_D32_UNORM, +- WINED3DFMT_R24_UNORM_X8_TYPELESS, +- WINED3DFMT_D16_UNORM, +- WINED3DFMT_S1_UINT_D15_UNORM +- }; +- +- const struct wined3d_gl_info *gl_info = &adapter->gl_info; +- +- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); +- if (!swapchain->context) +- { +- ERR("Failed to create the context array.\n"); +- hr = E_OUTOFMEMORY; ++ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); ++ if (FAILED(hr)) + goto err; +- } +- swapchain->num_contexts = 1; +- +- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. +- * You are able to add a depth + stencil surface at a later stage when you need it. +- * In order to support this properly in WineD3D we need the ability to recreate the opengl context and +- * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new +- * context, need torecreate shaders, textures and other resources. +- * +- * The context manager already takes care of the state problem and for the other tasks code from Reset +- * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. +- * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the +- * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this +- * issue needs to be fixed. */ +- for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) +- { +- swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); +- swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); +- if (swapchain->context[0]) break; +- TRACE("Depth stencil format %s is not supported, trying next format\n", +- debug_d3dformat(formats[i])); +- } +- +- if (!swapchain->context[0]) +- { +- WARN("Failed to create context.\n"); +- hr = WINED3DERR_NOTAVAILABLE; +- goto err; +- } +- +- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO +- && (!desc->enable_auto_depth_stencil +- || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) +- { +- FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); +- } +- context_release(swapchain->context[0]); + } + + if (swapchain->desc.backbuffer_count > 0) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index df99c6f..4f2e652 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2804,6 +2804,8 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; ++HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2988,6 +2990,8 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai + void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++HRESULT swapchain_create_context_cs(struct wined3d_device *device, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /***************************************************************************** + * Utility function prototypes +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-the-initial-context-through-the-CS.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-the-initial-context-through-the-CS.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-the-initial-context-through-the-CS.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-the-initial-context-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ -From 070101f77c342c4eeb49e01d3cc9ca9eaa63fe24 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 16:43:19 +0200 -Subject: wined3d: Create the initial context through the CS. - -Very hacky. ---- - dlls/wined3d/cs.c | 34 ++++++++++++ - dlls/wined3d/swapchain.c | 118 +++++++++++++++++++++++------------------ - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 103 insertions(+), 53 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 7dc847b..c78ac12 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -89,6 +89,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, -+ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, - WINED3D_CS_OP_STOP, - }; - -@@ -528,6 +529,13 @@ struct wined3d_cs_create_dummy_textures - enum wined3d_cs_op opcode; - }; - -+struct wined3d_cs_create_swapchain_context -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+ HRESULT *ret; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2615,6 +2623,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) - cs->ops->finish(cs); - } - -+static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_swapchain_context *op = data; -+ -+ *op->ret = swapchain_create_context_cs(cs->device, op->swapchain); -+ -+ return sizeof(*op); -+} -+ -+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ HRESULT ret; -+ struct wined3d_cs_create_swapchain_context *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT; -+ op->swapchain = swapchain; -+ op->ret = &ret; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+ -+ return ret; -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2682,6 +2715,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, -+ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index efe6987..71e5df6 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -723,6 +723,69 @@ static void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) - swapchain->render_to_fbo = TRUE; - } - -+HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+{ -+ const struct wined3d_adapter *adapter = device->adapter; -+ unsigned int i; -+ static const enum wined3d_format_id formats[] = -+ { -+ WINED3DFMT_D24_UNORM_S8_UINT, -+ WINED3DFMT_D32_UNORM, -+ WINED3DFMT_R24_UNORM_X8_TYPELESS, -+ WINED3DFMT_D16_UNORM, -+ WINED3DFMT_S1_UINT_D15_UNORM -+ }; -+ struct wined3d_surface *front_buffer; -+ const struct wined3d_gl_info *gl_info = &adapter->gl_info; -+ -+ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -+ if (!swapchain->context) -+ { -+ ERR("Failed to create the context array.\n"); -+ return E_OUTOFMEMORY; -+ } -+ swapchain->num_contexts = 1; -+ -+ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. -+ * You are able to add a depth + stencil surface at a later stage when you need it. -+ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and -+ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new -+ * context, need torecreate shaders, textures and other resources. -+ * -+ * The context manager already takes care of the state problem and for the other tasks code from Reset -+ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. -+ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the -+ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this -+ * issue needs to be fixed. */ -+ front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -+ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) -+ { -+ swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); -+ swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); -+ if (swapchain->context[0]) break; -+ TRACE("Depth stencil format %s is not supported, trying next format\n", -+ debug_d3dformat(formats[i])); -+ } -+ -+ if (!swapchain->context[0]) -+ { -+ WARN("Failed to create context.\n"); -+ HeapFree(GetProcessHeap(), 0, swapchain->context); -+ swapchain->context = NULL; -+ return WINED3DERR_NOTAVAILABLE; -+ } -+ -+ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO -+ && (!swapchain->desc.enable_auto_depth_stencil -+ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) -+ { -+ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); -+ } -+ context_release(swapchain->context[0]); -+ -+ return WINED3D_OK; -+} -+ - static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, - struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) - { -@@ -840,60 +903,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 - - if (!(device->wined3d->flags & WINED3D_NO3D)) - { -- static const enum wined3d_format_id formats[] = -- { -- WINED3DFMT_D24_UNORM_S8_UINT, -- WINED3DFMT_D32_UNORM, -- WINED3DFMT_R24_UNORM_X8_TYPELESS, -- WINED3DFMT_D16_UNORM, -- WINED3DFMT_S1_UINT_D15_UNORM -- }; -- -- const struct wined3d_gl_info *gl_info = &adapter->gl_info; -- -- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -- if (!swapchain->context) -- { -- ERR("Failed to create the context array.\n"); -- hr = E_OUTOFMEMORY; -+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); -+ if (FAILED(hr)) - goto err; -- } -- swapchain->num_contexts = 1; -- -- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. -- * You are able to add a depth + stencil surface at a later stage when you need it. -- * In order to support this properly in WineD3D we need the ability to recreate the opengl context and -- * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new -- * context, need torecreate shaders, textures and other resources. -- * -- * The context manager already takes care of the state problem and for the other tasks code from Reset -- * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. -- * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the -- * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this -- * issue needs to be fixed. */ -- for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) -- { -- swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); -- swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); -- if (swapchain->context[0]) break; -- TRACE("Depth stencil format %s is not supported, trying next format\n", -- debug_d3dformat(formats[i])); -- } -- -- if (!swapchain->context[0]) -- { -- WARN("Failed to create context.\n"); -- hr = WINED3DERR_NOTAVAILABLE; -- goto err; -- } -- -- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO -- && (!desc->enable_auto_depth_stencil -- || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) -- { -- FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); -- } -- context_release(swapchain->context[0]); - } - - if (swapchain->desc.backbuffer_count > 0) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index df99c6f..4f2e652 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2804,6 +2804,8 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2988,6 +2990,8 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai - void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+HRESULT swapchain_create_context_cs(struct wined3d_device *device, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /***************************************************************************** - * Utility function prototypes --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,63 @@ +From 031a0b58fd0d26fabae25fd1ad9f0030f8e58290 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 18:40:04 +0200 +Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. + +--- + dlls/wined3d/device.c | 27 ++++----------------------- + 1 file changed, 4 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index df19923..fe0a014 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4457,8 +4457,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + + static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { +- struct wined3d_context *context; +- struct wined3d_surface *target; + HRESULT hr; + + if (FAILED(hr = device->shader_backend->shader_alloc_private(device, +@@ -4475,33 +4473,16 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru + return hr; + } + +- /* Recreate the primary swapchain's context */ +- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); +- if (!swapchain->context) +- { +- ERR("Failed to allocate memory for swapchain context array.\n"); +- device->blitter->free_private(device); +- device->shader_backend->shader_free_private(device); +- return E_OUTOFMEMORY; +- } +- +- target = swapchain->back_buffers +- ? surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)) +- : surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); +- if (!(context = context_create(swapchain, target, swapchain->ds_format))) ++ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); ++ if (FAILED(hr)) + { + WARN("Failed to create context.\n"); + device->blitter->free_private(device); + device->shader_backend->shader_free_private(device); +- HeapFree(GetProcessHeap(), 0, swapchain->context); +- return E_FAIL; ++ return hr; + } + +- swapchain->context[0] = context; +- swapchain->num_contexts = 1; +- device_create_dummy_textures(device, context); +- device_create_default_sampler(device); +- context_release(context); ++ wined3d_cs_emit_create_dummy_textures(device->cs); + + return WINED3D_OK; + } +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,37 @@ +From 00632c0c269b313ecf484bf7aff6d61666d27ff9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 19:18:06 +0200 +Subject: wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map. + +TODO: This flag and add_dirty_rect need tests. + +The primary purpose of this patch is to fix a memory leak in World of +Warcraft. WoW uses WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_DISCARD on +sysmem surfaces. A new block of memory is allocated, but never assigned +to heap_mem because wined3d_cs_emit_resource_changed is not called. + +The bigger picture is that we don't know how this flag and AddDirtyRect +/ AddDirtyBox are supposed to work. Msdn mentions some interaction with +update_surface and update_texture, but personally I think it is more +likely that this functionality is used to update separate rectangles in +a texture, similar to what can be achieved by mapping a buffer twice. +--- + dlls/wined3d/resource.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index dd21986..805c6da 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -849,7 +849,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + } + } + +- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) ++ if (!(flags & WINED3D_MAP_READONLY)) + resource->unmap_dirtify = TRUE; + + resource->map_count++; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -From 031a0b58fd0d26fabae25fd1ad9f0030f8e58290 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 18:40:04 +0200 -Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. - ---- - dlls/wined3d/device.c | 27 ++++----------------------- - 1 file changed, 4 insertions(+), 23 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index df19923..fe0a014 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4457,8 +4457,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - - static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { -- struct wined3d_context *context; -- struct wined3d_surface *target; - HRESULT hr; - - if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4475,33 +4473,16 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru - return hr; - } - -- /* Recreate the primary swapchain's context */ -- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -- if (!swapchain->context) -- { -- ERR("Failed to allocate memory for swapchain context array.\n"); -- device->blitter->free_private(device); -- device->shader_backend->shader_free_private(device); -- return E_OUTOFMEMORY; -- } -- -- target = swapchain->back_buffers -- ? surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)) -- : surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -- if (!(context = context_create(swapchain, target, swapchain->ds_format))) -+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); -+ if (FAILED(hr)) - { - WARN("Failed to create context.\n"); - device->blitter->free_private(device); - device->shader_backend->shader_free_private(device); -- HeapFree(GetProcessHeap(), 0, swapchain->context); -- return E_FAIL; -+ return hr; - } - -- swapchain->context[0] = context; -- swapchain->num_contexts = 1; -- device_create_dummy_textures(device, context); -- device_create_default_sampler(device); -- context_release(context); -+ wined3d_cs_emit_create_dummy_textures(device->cs); - - return WINED3D_OK; - } --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,147 @@ +From e97fb065249c11f83234e5d8b713112725fc3039 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 10:11:13 +0200 +Subject: wined3d: Delete GL contexts through the CS in reset. + +Let's see if this fixes the remaining fglrx crashes... +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 26 +++++++++++++++----------- + dlls/wined3d/wined3d_private.h | 4 ++++ + 3 files changed, 48 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index b0b86ae..b30bb4e 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -90,6 +90,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, ++ WINED3D_CS_OP_DELETE_GL_CONTEXTS, + WINED3D_CS_OP_STOP, + }; + +@@ -536,6 +537,12 @@ struct wined3d_cs_create_swapchain_context + HRESULT *ret; + }; + ++struct wined3d_cs_delete_gl_contexts ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_swapchain *swapchain; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2649,6 +2656,27 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w + return ret; + } + ++static UINT wined3d_cs_exec_delete_gl_contexts(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_delete_gl_contexts *op = data; ++ ++ device_delete_opengl_contexts_cs(cs->device, op->swapchain); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) ++{ ++ struct wined3d_cs_delete_gl_contexts *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS; ++ op->swapchain = swapchain; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2717,6 +2745,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, ++ /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 525b61b..039b645 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4409,22 +4409,12 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + } + } + +-static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { +- struct wined3d_resource *resource, *cursor; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_shader *shader; + +- LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) +- { +- TRACE("Unloading resource %p.\n", resource); +- +- wined3d_cs_emit_evict_resource(device->cs, resource); +- } +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); +- + LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) + { + device->shader_backend->shader_destroy(shader); +@@ -4454,6 +4444,20 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + swapchain->context = NULL; + } + ++static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++{ ++ struct wined3d_resource *resource, *cursor; ++ ++ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) ++ { ++ TRACE("Unloading resource %p.\n", resource); ++ ++ wined3d_cs_emit_evict_resource(device->cs, resource); ++ } ++ ++ wined3d_cs_emit_delete_opengl_contexts(device->cs, swapchain); ++} ++ + static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { + HRESULT hr; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d5b939c..9f509e5 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2200,6 +2200,8 @@ void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_ + const struct wined3d_context *context) DECLSPEC_HIDDEN; + void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; + void device_create_default_sampler(struct wined3d_device *device); ++void device_delete_opengl_contexts_cs(struct wined3d_device *device, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2841,6 +2843,8 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu + void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From 00632c0c269b313ecf484bf7aff6d61666d27ff9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 19:18:06 +0200 -Subject: wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map. - -TODO: This flag and add_dirty_rect need tests. - -The primary purpose of this patch is to fix a memory leak in World of -Warcraft. WoW uses WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_DISCARD on -sysmem surfaces. A new block of memory is allocated, but never assigned -to heap_mem because wined3d_cs_emit_resource_changed is not called. - -The bigger picture is that we don't know how this flag and AddDirtyRect -/ AddDirtyBox are supposed to work. Msdn mentions some interaction with -update_surface and update_texture, but personally I think it is more -likely that this functionality is used to update separate rectangles in -a texture, similar to what can be achieved by mapping a buffer twice. ---- - dlls/wined3d/resource.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index dd21986..805c6da 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -849,7 +849,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - } - } - -- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -+ if (!(flags & WINED3D_MAP_READONLY)) - resource->unmap_dirtify = TRUE; - - resource->map_count++; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -From e97fb065249c11f83234e5d8b713112725fc3039 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 10:11:13 +0200 -Subject: wined3d: Delete GL contexts through the CS in reset. - -Let's see if this fixes the remaining fglrx crashes... ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 26 +++++++++++++++----------- - dlls/wined3d/wined3d_private.h | 4 ++++ - 3 files changed, 48 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b0b86ae..b30bb4e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -90,6 +90,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, -+ WINED3D_CS_OP_DELETE_GL_CONTEXTS, - WINED3D_CS_OP_STOP, - }; - -@@ -536,6 +537,12 @@ struct wined3d_cs_create_swapchain_context - HRESULT *ret; - }; - -+struct wined3d_cs_delete_gl_contexts -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2649,6 +2656,27 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w - return ret; - } - -+static UINT wined3d_cs_exec_delete_gl_contexts(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_delete_gl_contexts *op = data; -+ -+ device_delete_opengl_contexts_cs(cs->device, op->swapchain); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_cs_delete_gl_contexts *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS; -+ op->swapchain = swapchain; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2717,6 +2745,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, -+ /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 525b61b..039b645 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4409,22 +4409,12 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - } - } - --static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { -- struct wined3d_resource *resource, *cursor; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_shader *shader; - -- LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) -- { -- TRACE("Unloading resource %p.\n", resource); -- -- wined3d_cs_emit_evict_resource(device->cs, resource); -- } -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); -- - LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) - { - device->shader_backend->shader_destroy(shader); -@@ -4454,6 +4444,20 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - swapchain->context = NULL; - } - -+static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_resource *resource, *cursor; -+ -+ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) -+ { -+ TRACE("Unloading resource %p.\n", resource); -+ -+ wined3d_cs_emit_evict_resource(device->cs, resource); -+ } -+ -+ wined3d_cs_emit_delete_opengl_contexts(device->cs, swapchain); -+} -+ - static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { - HRESULT hr; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d5b939c..9f509e5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2200,6 +2200,8 @@ void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_ - const struct wined3d_context *context) DECLSPEC_HIDDEN; - void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; - void device_create_default_sampler(struct wined3d_device *device); -+void device_delete_opengl_contexts_cs(struct wined3d_device *device, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2841,6 +2843,8 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu - void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,80 @@ +From fd1de8f949ff49edbaff899af7e3a6ce83b99521 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 10:17:42 +0200 +Subject: wined3d: Delete GL contexts through the CS in uninit_3d. + +--- + dlls/wined3d/device.c | 33 +++------------------------------ + 1 file changed, 3 insertions(+), 30 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 800944b..8941632 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1091,8 +1091,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) + HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + { + struct wined3d_resource *resource, *cursor; +- const struct wined3d_gl_info *gl_info; +- struct wined3d_context *context; + struct wined3d_surface *surface; + UINT i; + +@@ -1104,12 +1102,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + if (wined3d_settings.cs_multithreaded) + device->cs->ops->finish(device->cs); + +- /* I don't think that the interface guarantees that the device is destroyed from the same thread +- * it was created. Thus make sure a context is active for the glDelete* calls +- */ +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- + if (device->logo_texture) + wined3d_texture_decref(device->logo_texture); + +@@ -1139,31 +1131,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + TRACE("Unloading resource %p.\n", resource); + wined3d_cs_emit_evict_resource(device->cs, resource); + } +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); + + wine_rb_clear(&device->samplers, device_free_sampler, NULL); + +- /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader +- * private data, it might contain opengl pointers +- */ +- if (device->depth_blt_texture) +- { +- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); +- device->depth_blt_texture = 0; +- } +- +- /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */ +- device->blitter->free_private(device); +- device->shader_backend->shader_free_private(device); +- destroy_dummy_textures(device, gl_info); +- destroy_default_sampler(device); +- +- /* Release the context again as soon as possible. In particular, +- * releasing the render target views below may release the last reference +- * to the swapchain associated with this context, which in turn will +- * destroy the context. */ +- context_release(context); ++ /* FIXME: Is this in the right place??? */ ++ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); + + if (device->back_buffer_view) + { +@@ -4443,6 +4415,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine + + HeapFree(GetProcessHeap(), 0, swapchain->context); + swapchain->context = NULL; ++ swapchain->num_contexts = 0; + } + + static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -From fd1de8f949ff49edbaff899af7e3a6ce83b99521 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 10:17:42 +0200 -Subject: wined3d: Delete GL contexts through the CS in uninit_3d. - ---- - dlls/wined3d/device.c | 33 +++------------------------------ - 1 file changed, 3 insertions(+), 30 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 800944b..8941632 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1091,8 +1091,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) - HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - { - struct wined3d_resource *resource, *cursor; -- const struct wined3d_gl_info *gl_info; -- struct wined3d_context *context; - struct wined3d_surface *surface; - UINT i; - -@@ -1104,12 +1102,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - if (wined3d_settings.cs_multithreaded) - device->cs->ops->finish(device->cs); - -- /* I don't think that the interface guarantees that the device is destroyed from the same thread -- * it was created. Thus make sure a context is active for the glDelete* calls -- */ -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - if (device->logo_texture) - wined3d_texture_decref(device->logo_texture); - -@@ -1139,31 +1131,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - TRACE("Unloading resource %p.\n", resource); - wined3d_cs_emit_evict_resource(device->cs, resource); - } -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); - - wine_rb_clear(&device->samplers, device_free_sampler, NULL); - -- /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader -- * private data, it might contain opengl pointers -- */ -- if (device->depth_blt_texture) -- { -- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -- device->depth_blt_texture = 0; -- } -- -- /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */ -- device->blitter->free_private(device); -- device->shader_backend->shader_free_private(device); -- destroy_dummy_textures(device, gl_info); -- destroy_default_sampler(device); -- -- /* Release the context again as soon as possible. In particular, -- * releasing the render target views below may release the last reference -- * to the swapchain associated with this context, which in turn will -- * destroy the context. */ -- context_release(context); -+ /* FIXME: Is this in the right place??? */ -+ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); - - if (device->back_buffer_view) - { -@@ -4443,6 +4415,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine - - HeapFree(GetProcessHeap(), 0, swapchain->context); - swapchain->context = NULL; -+ swapchain->num_contexts = 0; - } - - static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,31 @@ +From 210ed15c0132830fe2a6b4bf422fdc794982cf9c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 12:09:37 +0200 +Subject: wined3d: Invoke surface_unload through the CS in + wined3d_surface_update_desc. + +This fixes another case where we use a GL context in the main thread and +crash fglrx in doing so. +--- + dlls/wined3d/texture.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index f055d5e..09ac38f 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -769,7 +769,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT + } + + if (device->d3d_initialized) +- texture->resource.resource_ops->resource_unload(&texture->resource); ++ { ++ wined3d_cs_emit_evict_resource(device->cs, &surface->resource); ++ device->cs->ops->finish(device->cs); ++ } + + texture->resource.format = format; + texture->resource.multisample_type = multisample_type; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 210ed15c0132830fe2a6b4bf422fdc794982cf9c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 12:09:37 +0200 -Subject: wined3d: Invoke surface_unload through the CS in - wined3d_surface_update_desc. - -This fixes another case where we use a GL context in the main thread and -crash fglrx in doing so. ---- - dlls/wined3d/texture.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index f055d5e..09ac38f 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -769,7 +769,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT - } - - if (device->d3d_initialized) -- texture->resource.resource_ops->resource_unload(&texture->resource); -+ { -+ wined3d_cs_emit_evict_resource(device->cs, &surface->resource); -+ device->cs->ops->finish(device->cs); -+ } - - texture->resource.format = format; - texture->resource.multisample_type = multisample_type; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Use-an-event-to-block-the-worker-thread-when.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Use-an-event-to-block-the-worker-thread-when.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,177 @@ +From e18809d8ea1a9d47a592c91d3bfb703a5df08ac2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 24 Oct 2013 18:56:13 +0200 +Subject: wined3d: Use an event to block the worker thread when it is idle. + +I could not find a canonical implementation for this. Suggestions are +welcome. + +The main goal was to avoid SetEvent / WaitForSingleObject / ResetEvent +calls at all costs. They go straight to wineserver, bringing it to 25% +CPU time and cutting framerates in half. Hence the extra BOOL to tell +cs_submit when to set the event. + +Finding the correct spin count is tricky. The value I set is high enough +to prevent 3DMark2001 car chase high detail from waiting. This benchmark +maps a lot of in-use managed buffers and thus waits for the CS. But what +the ideal number is depends a lot on the game and CPU. + +A better heuristic is needed. E.g. we could tell the worker thread when +the main thread is waiting for a resource to become idle and avoid +waiting for the event in that case. We may have to use POSIX +synchronization primitives for efficiency. On the other hand, the +current implementation probably still spins way too much for an +application that throttles the framerate to 30 fps by waiting in its own +code. So it is probably only good enough for Microsoft Powerpoint. + +We should also think about blocking the main thread with events if it is +waiting for the worker thread when waiting for resources, the swap +counter or space in the command Stream. This should preserve power when +vsync is turned on. +--- + dlls/wined3d/cs.c | 51 +++++++++++++++++++++++++++++++++++++++--- + dlls/wined3d/wined3d_private.h | 5 +++++ + 2 files changed, 53 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 489fad0..8cbca6c 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -539,6 +539,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + /* There is only one thread writing to queue.head, InterlockedExchange + * is used for the memory barrier. */ + InterlockedExchange(&cs->queue.head, new_val); ++ ++ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) ++ SetEvent(cs->event); + } + + static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) +@@ -547,6 +550,9 @@ static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) + /* There is only one thread writing to queue.head, InterlockedExchange + * is used for the memory barrier. */ + InterlockedExchange(&cs->prio_queue.head, new_val); ++ ++ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) ++ SetEvent(cs->event); + } + + static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) +@@ -2826,6 +2832,34 @@ static inline void poll_queries(struct wined3d_cs *cs) + } + } + ++static inline BOOL queue_is_empty(const struct wined3d_cs_queue *queue) ++{ ++ return *((volatile LONG *)&queue->head) == queue->tail; ++} ++ ++static void wined3d_cs_wait_event(struct wined3d_cs *cs) ++{ ++ InterlockedExchange(&cs->waiting_for_event, TRUE); ++ ++ /* The main thread might enqueue a finish command and block on it ++ * after the worker thread decided to enter wined3d_cs_wait_event ++ * and before waiting_for_event was set to TRUE. Check again if ++ * the queues are empty */ ++ if (!queue_is_empty(&cs->prio_queue) || !queue_is_empty(&cs->queue)) ++ { ++ /* The main thread might have signalled the event, or be in the process ++ * of doing so. Wait for the event to reset it. ResetEvent is not good ++ * because the main thread might be beween the waiting_for_event reset ++ * and SignalEvent call. */ ++ if (!InterlockedCompareExchange(&cs->waiting_for_event, FALSE, FALSE)) ++ WaitForSingleObject(cs->event, INFINITE); ++ } ++ else ++ { ++ WaitForSingleObject(cs->event, INFINITE); ++ } ++} ++ + static DWORD WINAPI wined3d_cs_run(void *thread_param) + { + struct wined3d_cs *cs = thread_param; +@@ -2833,6 +2867,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + LONG tail; + char poll = 0; + struct wined3d_cs_queue *queue; ++ unsigned int spin_count = 0; + + TRACE("Started.\n"); + +@@ -2848,21 +2883,27 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + else + poll++; + +- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ if (!queue_is_empty(&cs->prio_queue)) + { + queue = &cs->prio_queue; + } +- else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) ++ else if (!queue_is_empty(&cs->queue)) + { + queue = &cs->queue; +- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ if (!queue_is_empty(&cs->prio_queue)) + queue = &cs->prio_queue; + } + else + { ++ spin_count++; ++ if (spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list)) ++ wined3d_cs_wait_event(cs); ++ + continue; + } + ++ spin_count = 0; ++ + tail = queue->tail; + opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; + +@@ -2904,6 +2945,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + { + cs->ops = &wined3d_cs_mt_ops; + ++ cs->event = CreateEventW(NULL, FALSE, FALSE, NULL); ++ + if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) + { + ERR("Failed to create wined3d command stream thread.\n"); +@@ -2934,6 +2977,8 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) + CloseHandle(cs->thread); + if (ret != WAIT_OBJECT_0) + ERR("Wait failed (%#x).\n", ret); ++ if (!CloseHandle(cs->event)) ++ ERR("Closing event failed.\n"); + } + + HeapFree(GetProcessHeap(), 0, cs); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2f7dd75..63b67da 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2583,6 +2583,8 @@ struct wined3d_cs_list + }; + + #define WINED3D_CS_QUEUE_SIZE 0x100000 ++#define WINED3D_CS_SPIN_COUNT 10000000 ++ + struct wined3d_cs_queue + { + LONG head, tail; +@@ -2612,6 +2614,9 @@ struct wined3d_cs + + LONG pending_presents; + struct list query_poll_list; ++ ++ HANDLE event; ++ BOOL waiting_for_event; + }; + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Fence-preload-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Fence-preload-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Fence-preload-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Fence-preload-operations.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,71 @@ +From c1bf11e5e355915f1ac6e1e9cdfaf3b5a7309167 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 24 Oct 2013 22:38:26 +0200 +Subject: wined3d: Fence preload operations. + +Otherwise texture data might get lost, thanks to surface/volume_evict_sysmem: + +1) preload(texture) +2) map(texture) + -> Loads sysmem / sets it with discard map. +3) unmap(texture) + -> enqueues a resource_changed operation +4) preload is executed. + -> Uploads data written in 3. Discards sysmem. Questionable if + DISCARD was passed, but without it, no harm done. + -> texture is only up to date location. +5) resource_changed executed. + -> Discards texture. + +And data is lost. This patch prevents that by stalling the map until the +PreLoad is done. + +What's left open is finding out why anyone (I'm looking at you EVE +online) preloads a texture right before mapping it... +--- + dlls/wined3d/cs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a542270..0318315 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -2252,6 +2252,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d + wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); + context_release(context); + ++ wined3d_resource_dec_fence(&texture->resource); ++ + return sizeof(*op); + } + +@@ -2263,6 +2265,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu + op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; + op->texture = texture; + ++ wined3d_resource_inc_fence(&texture->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +@@ -2384,6 +2388,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da + buffer_internal_preload(op->buffer, context, NULL); + context_release(context); + ++ wined3d_resource_dec_fence(&op->buffer->resource); ++ + return sizeof(*op); + } + +@@ -2395,6 +2401,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; + op->buffer = buffer; + ++ wined3d_resource_inc_fence(&buffer->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Use-an-event-to-block-the-worker-thread-when.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Use-an-event-to-block-the-worker-thread-when.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -From e18809d8ea1a9d47a592c91d3bfb703a5df08ac2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 24 Oct 2013 18:56:13 +0200 -Subject: wined3d: Use an event to block the worker thread when it is idle. - -I could not find a canonical implementation for this. Suggestions are -welcome. - -The main goal was to avoid SetEvent / WaitForSingleObject / ResetEvent -calls at all costs. They go straight to wineserver, bringing it to 25% -CPU time and cutting framerates in half. Hence the extra BOOL to tell -cs_submit when to set the event. - -Finding the correct spin count is tricky. The value I set is high enough -to prevent 3DMark2001 car chase high detail from waiting. This benchmark -maps a lot of in-use managed buffers and thus waits for the CS. But what -the ideal number is depends a lot on the game and CPU. - -A better heuristic is needed. E.g. we could tell the worker thread when -the main thread is waiting for a resource to become idle and avoid -waiting for the event in that case. We may have to use POSIX -synchronization primitives for efficiency. On the other hand, the -current implementation probably still spins way too much for an -application that throttles the framerate to 30 fps by waiting in its own -code. So it is probably only good enough for Microsoft Powerpoint. - -We should also think about blocking the main thread with events if it is -waiting for the worker thread when waiting for resources, the swap -counter or space in the command Stream. This should preserve power when -vsync is turned on. ---- - dlls/wined3d/cs.c | 51 +++++++++++++++++++++++++++++++++++++++--- - dlls/wined3d/wined3d_private.h | 5 +++++ - 2 files changed, 53 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 489fad0..8cbca6c 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -539,6 +539,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - /* There is only one thread writing to queue.head, InterlockedExchange - * is used for the memory barrier. */ - InterlockedExchange(&cs->queue.head, new_val); -+ -+ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) -+ SetEvent(cs->event); - } - - static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) -@@ -547,6 +550,9 @@ static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) - /* There is only one thread writing to queue.head, InterlockedExchange - * is used for the memory barrier. */ - InterlockedExchange(&cs->prio_queue.head, new_val); -+ -+ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) -+ SetEvent(cs->event); - } - - static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) -@@ -2826,6 +2832,34 @@ static inline void poll_queries(struct wined3d_cs *cs) - } - } - -+static inline BOOL queue_is_empty(const struct wined3d_cs_queue *queue) -+{ -+ return *((volatile LONG *)&queue->head) == queue->tail; -+} -+ -+static void wined3d_cs_wait_event(struct wined3d_cs *cs) -+{ -+ InterlockedExchange(&cs->waiting_for_event, TRUE); -+ -+ /* The main thread might enqueue a finish command and block on it -+ * after the worker thread decided to enter wined3d_cs_wait_event -+ * and before waiting_for_event was set to TRUE. Check again if -+ * the queues are empty */ -+ if (!queue_is_empty(&cs->prio_queue) || !queue_is_empty(&cs->queue)) -+ { -+ /* The main thread might have signalled the event, or be in the process -+ * of doing so. Wait for the event to reset it. ResetEvent is not good -+ * because the main thread might be beween the waiting_for_event reset -+ * and SignalEvent call. */ -+ if (!InterlockedCompareExchange(&cs->waiting_for_event, FALSE, FALSE)) -+ WaitForSingleObject(cs->event, INFINITE); -+ } -+ else -+ { -+ WaitForSingleObject(cs->event, INFINITE); -+ } -+} -+ - static DWORD WINAPI wined3d_cs_run(void *thread_param) - { - struct wined3d_cs *cs = thread_param; -@@ -2833,6 +2867,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - LONG tail; - char poll = 0; - struct wined3d_cs_queue *queue; -+ unsigned int spin_count = 0; - - TRACE("Started.\n"); - -@@ -2848,21 +2883,27 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - else - poll++; - -- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ if (!queue_is_empty(&cs->prio_queue)) - { - queue = &cs->prio_queue; - } -- else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) -+ else if (!queue_is_empty(&cs->queue)) - { - queue = &cs->queue; -- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ if (!queue_is_empty(&cs->prio_queue)) - queue = &cs->prio_queue; - } - else - { -+ spin_count++; -+ if (spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list)) -+ wined3d_cs_wait_event(cs); -+ - continue; - } - -+ spin_count = 0; -+ - tail = queue->tail; - opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; - -@@ -2904,6 +2945,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - { - cs->ops = &wined3d_cs_mt_ops; - -+ cs->event = CreateEventW(NULL, FALSE, FALSE, NULL); -+ - if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) - { - ERR("Failed to create wined3d command stream thread.\n"); -@@ -2934,6 +2977,8 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) - CloseHandle(cs->thread); - if (ret != WAIT_OBJECT_0) - ERR("Wait failed (%#x).\n", ret); -+ if (!CloseHandle(cs->event)) -+ ERR("Closing event failed.\n"); - } - - HeapFree(GetProcessHeap(), 0, cs); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2f7dd75..63b67da 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2583,6 +2583,8 @@ struct wined3d_cs_list - }; - - #define WINED3D_CS_QUEUE_SIZE 0x100000 -+#define WINED3D_CS_SPIN_COUNT 10000000 -+ - struct wined3d_cs_queue - { - LONG head, tail; -@@ -2612,6 +2614,9 @@ struct wined3d_cs - - LONG pending_presents; - struct list query_poll_list; -+ -+ HANDLE event; -+ BOOL waiting_for_event; - }; - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,26 @@ +From c8083ad9f76ddba995df169c8b2f3486e81bbe02 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Nov 2013 18:04:50 +0100 +Subject: d3d8/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is + temporarily broken. + +--- + dlls/d3d8/tests/visual.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c +index a8a771e..9535b69 100644 +--- a/dlls/d3d8/tests/visual.c ++++ b/dlls/d3d8/tests/visual.c +@@ -4998,7 +4998,7 @@ static void add_dirty_rect_test(void) + fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); +- ok(color_match(color, 0x00ff0000, 1), ++ todo_wine ok(color_match(color, 0x00ff0000, 1), + "Expected color 0x00ff0000, got 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Fence-preload-operations.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Fence-preload-operations.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Fence-preload-operations.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Fence-preload-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -From 4a770e26268a89e0f211b42dfdd857f3180bb73e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 24 Oct 2013 22:38:26 +0200 -Subject: wined3d: Fence preload operations. - -Otherwise texture data might get lost, thanks to surface/volume_evict_sysmem: - -1) preload(texture) -2) map(texture) - -> Loads sysmem / sets it with discard map. -3) unmap(texture) - -> enqueues a resource_changed operation -4) preload is executed. - -> Uploads data written in 3. Discards sysmem. Questionable if - DISCARD was passed, but without it, no harm done. - -> texture is only up to date location. -5) resource_changed executed. - -> Discards texture. - -And data is lost. This patch prevents that by stalling the map until the -PreLoad is done. - -What's left open is finding out why anyone (I'm looking at you EVE -online) preloads a texture right before mapping it... ---- - dlls/wined3d/cs.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8cbca6c..b152a0d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -2145,6 +2145,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d - wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); - context_release(context); - -+ wined3d_resource_dec_fence(&texture->resource); -+ - return sizeof(*op); - } - -@@ -2156,6 +2158,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; - op->texture = texture; - -+ wined3d_resource_inc_fence(&texture->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -2168,6 +2172,8 @@ static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *d - wined3d_texture_preload(op->surface->container); - context_release(context); - -+ wined3d_resource_dec_fence(&op->surface->container->resource); -+ - return sizeof(*op); - } - -@@ -2179,6 +2185,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; - op->surface = surface; - -+ wined3d_resource_inc_fence(&op->surface->container->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -2300,6 +2308,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da - buffer_internal_preload(op->buffer, context, NULL); - context_release(context); - -+ wined3d_resource_dec_fence(&op->buffer->resource); -+ - return sizeof(*op); - } - -@@ -2311,6 +2321,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; - op->buffer = buffer; - -+ wined3d_resource_inc_fence(&buffer->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From c8083ad9f76ddba995df169c8b2f3486e81bbe02 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Nov 2013 18:04:50 +0100 -Subject: d3d8/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is - temporarily broken. - ---- - dlls/d3d8/tests/visual.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c -index a8a771e..9535b69 100644 ---- a/dlls/d3d8/tests/visual.c -+++ b/dlls/d3d8/tests/visual.c -@@ -4998,7 +4998,7 @@ static void add_dirty_rect_test(void) - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); - add_dirty_rect_test_draw(device); - color = getPixelColor(device, 320, 240); -- ok(color_match(color, 0x00ff0000, 1), -+ todo_wine ok(color_match(color, 0x00ff0000, 1), - "Expected color 0x00ff0000, got 0x%08x.\n", color); - hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,26 @@ +From 1bdcaa3e831f627806a00a07fb92ef28502c4f7a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Nov 2013 18:06:02 +0100 +Subject: d3d9/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is + temporarily broken. + +--- + dlls/d3d9/tests/visual.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c +index d1aa3d4..6b28d14 100644 +--- a/dlls/d3d9/tests/visual.c ++++ b/dlls/d3d9/tests/visual.c +@@ -16457,7 +16457,7 @@ static void add_dirty_rect_test(void) + fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); +- ok(color_match(color, 0x00ff0000, 1), ++ todo_wine ok(color_match(color, 0x00ff0000, 1), + "Expected color 0x00ff0000, got 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 1bdcaa3e831f627806a00a07fb92ef28502c4f7a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Nov 2013 18:06:02 +0100 -Subject: d3d9/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is - temporarily broken. - ---- - dlls/d3d9/tests/visual.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index d1aa3d4..6b28d14 100644 ---- a/dlls/d3d9/tests/visual.c -+++ b/dlls/d3d9/tests/visual.c -@@ -16457,7 +16457,7 @@ static void add_dirty_rect_test(void) - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); - add_dirty_rect_test_draw(device); - color = getPixelColor(device, 320, 240); -- ok(color_match(color, 0x00ff0000, 1), -+ todo_wine ok(color_match(color, 0x00ff0000, 1), - "Expected color 0x00ff0000, got 0x%08x.\n", color); - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Completely-reset-the-state-on-reset.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Completely-reset-the-state-on-reset.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Completely-reset-the-state-on-reset.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Completely-reset-the-state-on-reset.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,24 @@ +From eb14a8f5c8dc07cda57b588e11f4b3381a340dcb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 10 Jan 2014 17:57:03 +0100 +Subject: wined3d: Completely reset the state on reset. + +--- + dlls/wined3d/device.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 278bbdc..62b0625 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4531,6 +4531,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + wined3d_cs_emit_reset_state(device->cs); + state_cleanup(&device->state); ++ memset(&device->state, 0, sizeof(device->state)); + + if (device->d3d_initialized) + delete_opengl_contexts(device, swapchain); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Completely-reset-the-state-on-reset.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Completely-reset-the-state-on-reset.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Completely-reset-the-state-on-reset.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Completely-reset-the-state-on-reset.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From eb14a8f5c8dc07cda57b588e11f4b3381a340dcb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 10 Jan 2014 17:57:03 +0100 -Subject: wined3d: Completely reset the state on reset. - ---- - dlls/wined3d/device.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 278bbdc..62b0625 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4531,6 +4531,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - wined3d_cs_emit_reset_state(device->cs); - state_cleanup(&device->state); -+ memset(&device->state, 0, sizeof(device->state)); - - if (device->d3d_initialized) - delete_opengl_contexts(device, swapchain); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Send-getdc-and-releasedc-through-the-command.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Send-getdc-and-releasedc-through-the-command.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Send-getdc-and-releasedc-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Send-getdc-and-releasedc-through-the-command.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,302 @@ +From f51b464c3100bfdea3de7e6dde646f97e09fccb6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 16 Mar 2014 14:13:42 +0100 +Subject: wined3d: Send getdc and releasedc through the command stream. + +As with the palette patch just a cheap workaround for a context +activation bug I just regret that I didn't describe more verbously +earlier. I forgot what it was about exactly and can't be bothered to +investigate atm. +--- + dlls/wined3d/cs.c | 58 ++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 56 +++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/texture.c | 60 +++--------------------------------------- + dlls/wined3d/wined3d_private.h | 4 +++ + 4 files changed, 121 insertions(+), 57 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 0aab83b..c135ece 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -90,6 +90,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, + WINED3D_CS_OP_DELETE_GL_CONTEXTS, ++ WINED3D_CS_OP_GETDC, ++ WINED3D_CS_OP_RELEASEDC, + WINED3D_CS_OP_STOP, + }; + +@@ -536,6 +538,18 @@ struct wined3d_cs_delete_gl_contexts + struct wined3d_swapchain *swapchain; + }; + ++struct wined3d_cs_getdc ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ ++struct wined3d_cs_releasedc ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2661,6 +2675,48 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3 + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_getdc(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_getdc *op = data; ++ ++ wined3d_surface_getdc_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_getdc *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_GETDC; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ ++static UINT wined3d_cs_exec_releasedc(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_releasedc *op = data; ++ ++ wined3d_surface_releasedc_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_releasedc *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RELEASEDC; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2729,6 +2785,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, + /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, ++ /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, ++ /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 822f36f..d70e310 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2456,6 +2456,62 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + return wined3d_resource_map(&surface->resource, map_desc, box, flags); + } + ++void wined3d_surface_getdc_cs(struct wined3d_surface *surface) ++{ ++ HRESULT hr; ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ /* Create a DIB section if there isn't a dc yet. */ ++ if (!surface->hDC) ++ { ++ if (FAILED(hr = surface_create_dib_section(surface))) ++ { ++ if (context) ++ context_release(context); ++ return; ++ } ++ if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY ++ || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++ || surface->resource.buffer)) ++ surface->resource.map_binding = WINED3D_LOCATION_DIB; ++ } ++ ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); ++ ++ if (context) ++ context_release(context); ++} ++ ++void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) ++{ ++ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++ && surface->resource.map_binding != WINED3D_LOCATION_DIB)) ++ { ++ /* The game Salammbo modifies the surface contents without mapping the surface between ++ * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active ++ * copy and is copied to the screen, this update, which draws the mouse pointer, is lost. ++ * Do not only copy the DIB to the map location, but also make sure the map location is ++ * copied back to the DIB in the next getdc call. ++ * ++ * The same consideration applies to user memory surfaces. */ ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); ++ if (context) ++ context_release(context); ++ } ++} ++ + static void read_from_framebuffer(struct wined3d_surface *surface, + struct wined3d_context *old_ctx, DWORD dst_location) + { +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index d17a6e1..a9dbf42 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1561,10 +1561,8 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct + HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc) + { + struct wined3d_device *device = texture->resource.device; +- struct wined3d_context *context = NULL; + struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; +- HRESULT hr; + + TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); + +@@ -1585,14 +1583,6 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + return WINED3DERR_INVALIDCALL; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- struct wined3d_device *device = surface->resource.device; +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + /* Give more detailed info for ddraw. */ + if (surface->flags & SFLAG_DCINUSE) + return WINEDDERR_DCALREADYCREATED; +@@ -1601,43 +1591,18 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; + +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); +- +- /* Create a DIB section if there isn't a dc yet. */ +- if (!surface->hDC) +- { +- if (FAILED(hr = surface_create_dib_section(surface))) +- { +- if (context) +- context_release(context); +- return WINED3DERR_INVALIDCALL; +- } +- if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY +- || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +- || surface->resource.buffer)) +- surface->resource.map_binding = WINED3D_LOCATION_DIB; +- } +- +- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); +- wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); +- +- if (context) +- context_release(context); +- + surface->flags |= SFLAG_DCINUSE; + surface->resource.map_count++; +- ++ wined3d_cs_emit_getdc(device->cs, surface); + *dc = surface->hDC; + TRACE("Returning dc %p.\n", *dc); + +- return WINED3D_OK; ++ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; + } + + HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) + { + struct wined3d_device *device = texture->resource.device; +- struct wined3d_context *context = NULL; + struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; + +@@ -1667,26 +1632,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign + surface->resource.map_count--; + surface->flags &= ~SFLAG_DCINUSE; + +- if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY +- || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +- && surface->resource.map_binding != WINED3D_LOCATION_DIB)) +- { +- /* The game Salammbo modifies the surface contents without mapping the surface between +- * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active +- * copy and is copied to the screen, this update, which draws the mouse pointer, is lost. +- * Do not only copy the DIB to the map location, but also make sure the map location is +- * copied back to the DIB in the next getdc call. +- * +- * The same consideration applies to user memory surfaces. */ +- +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); +- +- wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); +- wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); +- if (context) +- context_release(context); +- } ++ wined3d_cs_emit_releasedc(device->cs, surface); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 5bb6a21..0e0e3fe 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2623,6 +2623,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; + void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2895,6 +2897,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Send-getdc-and-releasedc-through-the-command.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Send-getdc-and-releasedc-through-the-command.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Send-getdc-and-releasedc-through-the-command.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Send-getdc-and-releasedc-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -From d16e01527b157dc80e7d6417b6f209d09450aecd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 16 Mar 2014 14:13:42 +0100 -Subject: wined3d: Send getdc and releasedc through the command stream. - -As with the palette patch just a cheap workaround for a context -activation bug I just regret that I didn't describe more verbously -earlier. I forgot what it was about exactly and can't be bothered to -investigate atm. ---- - dlls/wined3d/cs.c | 58 ++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 93 +++++++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 109 insertions(+), 46 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index afc17a4..4830eb5 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -91,6 +91,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, - WINED3D_CS_OP_DELETE_GL_CONTEXTS, -+ WINED3D_CS_OP_GETDC, -+ WINED3D_CS_OP_RELEASEDC, - WINED3D_CS_OP_STOP, - }; - -@@ -543,6 +545,18 @@ struct wined3d_cs_delete_gl_contexts - struct wined3d_swapchain *swapchain; - }; - -+struct wined3d_cs_getdc -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ -+struct wined3d_cs_releasedc -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2694,6 +2708,48 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3 - cs->ops->finish(cs); - } - -+static UINT wined3d_cs_exec_getdc(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_getdc *op = data; -+ -+ wined3d_surface_getdc_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_getdc *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_GETDC; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ -+static UINT wined3d_cs_exec_releasedc(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_releasedc *op = data; -+ -+ wined3d_surface_releasedc_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_releasedc *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RELEASEDC; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2763,6 +2819,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, - /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, -+ /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, -+ /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c63bb66..18a2f91 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2474,36 +2474,12 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - return wined3d_resource_map(&surface->resource, map_desc, box, flags); - } - --HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) -+void wined3d_surface_getdc_cs(struct wined3d_surface *surface) - { - HRESULT hr; - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; - -- TRACE("surface %p, dc %p.\n", surface, dc); -- -- if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) -- { -- WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); -- return WINED3DERR_INVALIDCALL; -- } -- -- if (wined3d_settings.cs_multithreaded) -- { -- struct wined3d_device *device = surface->resource.device; -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -- /* Give more detailed info for ddraw. */ -- if (surface->flags & SFLAG_DCINUSE) -- return WINEDDERR_DCALREADYCREATED; -- -- /* Can't GetDC if the surface is locked. */ -- if (surface->resource.map_count) -- return WINED3DERR_INVALIDCALL; -- - if (device->d3d_initialized) - context = context_acquire(surface->resource.device, NULL); - -@@ -2514,7 +2490,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { - if (context) - context_release(context); -- return WINED3DERR_INVALIDCALL; -+ return; - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -@@ -2527,35 +2503,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - - if (context) - context_release(context); -- -- surface->flags |= SFLAG_DCINUSE; -- surface->resource.map_count++; -- -- *dc = surface->hDC; -- TRACE("Returning dc %p.\n", *dc); -- -- return WINED3D_OK; - } - --HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -+HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { -- TRACE("surface %p, dc %p.\n", surface, dc); -+ struct wined3d_device *device = surface->resource.device; - -- if (!(surface->flags & SFLAG_DCINUSE)) -- return WINEDDERR_NODC; -+ TRACE("surface %p, dc %p.\n", surface, dc); - -- if (surface->hDC != dc) -+ if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) - { -- WARN("Application tries to release invalid DC %p, surface DC is %p.\n", -- dc, surface->hDC); -- return WINEDDERR_NODC; -+ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); -+ return WINED3DERR_INVALIDCALL; - } - -- surface->resource.map_count--; -- surface->flags &= ~SFLAG_DCINUSE; -+ /* Give more detailed info for ddraw. */ -+ if (surface->flags & SFLAG_DCINUSE) -+ return WINEDDERR_DCALREADYCREATED; -+ -+ /* Can't GetDC if the surface is locked. */ -+ if (surface->resource.map_count) -+ return WINED3DERR_INVALIDCALL; -+ -+ surface->flags |= SFLAG_DCINUSE; -+ surface->resource.map_count++; -+ wined3d_cs_emit_getdc(device->cs, surface); -+ *dc = surface->hDC; -+ TRACE("Returning dc %p.\n", *dc); -+ -+ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; -+} - -- if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -- || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -+void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -+{ -+ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM - && surface->resource.map_binding != WINED3D_LOCATION_DIB)) - { - /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2576,6 +2557,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - if (context) - context_release(context); - } -+} -+ -+HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -+{ -+ TRACE("surface %p, dc %p.\n", surface, dc); -+ -+ if (!(surface->flags & SFLAG_DCINUSE)) -+ return WINEDDERR_NODC; -+ -+ if (surface->hDC != dc) -+ { -+ WARN("Application tries to release invalid DC %p, surface DC is %p.\n", -+ dc, surface->hDC); -+ return WINEDDERR_NODC; -+ } -+ -+ surface->resource.map_count--; -+ surface->flags &= ~SFLAG_DCINUSE; -+ -+ wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ec7bda3..670c14c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2571,6 +2571,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; - void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2844,6 +2846,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,31 @@ +From 80c6dcd25ef96df6885a55cdd23900ae55f30bab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 5 Jun 2014 13:07:27 +0200 +Subject: wined3d: Set map_heap_memory = NULL when allocating a PBO. + +Otherwise the next unmap will re-assign it with the resource_changed +message. Freeing the actual memory and setting the read pointer to 0 is +the task of the worker thread. + +Wined3d_resource_prepare_bo is only called if the map binding is +LOCATION_BUFFER, and map_heap_memory is only used if the map binding is +LOCATION_SYSMEM. +--- + dlls/wined3d/resource.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 671ab50..1dff0ed 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -616,6 +616,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + resource->map_buffer = resource->buffer; + TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); ++ resource->map_heap_memory = NULL; + } + + BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 80c6dcd25ef96df6885a55cdd23900ae55f30bab Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 5 Jun 2014 13:07:27 +0200 -Subject: wined3d: Set map_heap_memory = NULL when allocating a PBO. - -Otherwise the next unmap will re-assign it with the resource_changed -message. Freeing the actual memory and setting the read pointer to 0 is -the task of the worker thread. - -Wined3d_resource_prepare_bo is only called if the map binding is -LOCATION_BUFFER, and map_heap_memory is only used if the map binding is -LOCATION_SYSMEM. ---- - dlls/wined3d/resource.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 671ab50..1dff0ed 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -616,6 +616,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc - GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); - resource->map_buffer = resource->buffer; - TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); -+ resource->map_heap_memory = NULL; - } - - BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Wait-only-for-the-buffer-to-be-idle.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Wait-only-for-the-buffer-to-be-idle.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,27 @@ +From 82ec316a058cc2e1894fb64eee1249ff663f112e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 22 Aug 2014 15:52:50 +0200 +Subject: wined3d: Wait only for the buffer to be idle. + +This got lost somewhere during the patch reordering. +--- + dlls/wined3d/buffer.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 15ed760..c0f96e3 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1051,8 +1051,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + } + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { +- FIXME("waiting for cs, flags 0x%04x.\n", flags); +- device->cs->ops->finish(device->cs); ++ wined3d_resource_wait_fence(&buffer->resource); + } + } + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Add-a-comment-about-worker-thread-lag.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Add-a-comment-about-worker-thread-lag.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Add-a-comment-about-worker-thread-lag.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Add-a-comment-about-worker-thread-lag.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,31 @@ +From 7cfd19b8d052ed99f3060d5cab1349ec33e162ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 25 Aug 2014 19:57:42 +0200 +Subject: wined3d: Add a comment about worker thread lag. + +--- + dlls/wined3d/cs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 44930c1..9b890ae 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -677,6 +677,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + + cs->ops->submit(cs, sizeof(*op)); + ++ /* D3D10 documentation suggests that Windows allows the game to run ++ * 3 frames ahead of the GPU. Increasing this above 1 causes uneven ++ * animation in some games, most notably StarCraft II. The framerates ++ * don't show this problem. The issue is more noticable with vsync ++ * on, but also happens with vsync off. ++ * ++ * In Counter-Strike: Source a frame difference of 3 causes noticable ++ * input delay that makes the game unplayable. */ + while (pending > 1) + pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); + } +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Wait-only-for-the-buffer-to-be-idle.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Wait-only-for-the-buffer-to-be-idle.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 82ec316a058cc2e1894fb64eee1249ff663f112e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 22 Aug 2014 15:52:50 +0200 -Subject: wined3d: Wait only for the buffer to be idle. - -This got lost somewhere during the patch reordering. ---- - dlls/wined3d/buffer.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 15ed760..c0f96e3 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1051,8 +1051,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - } - else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { -- FIXME("waiting for cs, flags 0x%04x.\n", flags); -- device->cs->ops->finish(device->cs); -+ wined3d_resource_wait_fence(&buffer->resource); - } - } - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Add-a-comment-about-worker-thread-lag.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Add-a-comment-about-worker-thread-lag.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Add-a-comment-about-worker-thread-lag.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Add-a-comment-about-worker-thread-lag.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 7cfd19b8d052ed99f3060d5cab1349ec33e162ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 25 Aug 2014 19:57:42 +0200 -Subject: wined3d: Add a comment about worker thread lag. - ---- - dlls/wined3d/cs.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 44930c1..9b890ae 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -677,6 +677,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - - cs->ops->submit(cs, sizeof(*op)); - -+ /* D3D10 documentation suggests that Windows allows the game to run -+ * 3 frames ahead of the GPU. Increasing this above 1 causes uneven -+ * animation in some games, most notably StarCraft II. The framerates -+ * don't show this problem. The issue is more noticable with vsync -+ * on, but also happens with vsync off. -+ * -+ * In Counter-Strike: Source a frame difference of 3 causes noticable -+ * input delay that makes the game unplayable. */ - while (pending > 1) - pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); - } --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Remove-the-texture-destroy-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Remove-the-texture-destroy-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Remove-the-texture-destroy-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Remove-the-texture-destroy-glFinish.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,32 @@ +From c064211d94884f2c131c5496e60f591511c5462d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 15:02:12 +0200 +Subject: wined3d: Remove the texture destroy glFinish. + +This should work now that surface_decref is essentially gone and the +container is never unset. +--- + dlls/wined3d/texture.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 09ac38f..6f78292 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -146,13 +146,6 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + + TRACE("texture %p.\n", texture); + +- /* Because sub_resource_cleanup interferes with GL resources */ +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- device->cs->ops->finish(device->cs); +- } +- + for (i = 0; i < sub_count; ++i) + { + struct wined3d_resource *sub_resource = texture->sub_resources[i]; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Move-FBO-destruction-into-the-worker-thread.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Move-FBO-destruction-into-the-worker-thread.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,40 @@ +From 05b16589d0f658e929eaafb416d4b19bd88bb47d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 16:09:45 +0200 +Subject: wined3d: Move FBO destruction into the worker thread. + +This protects the context array against races. +--- + dlls/wined3d/device.c | 2 -- + dlls/wined3d/resource.c | 2 ++ + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 62b0625..b5ce2c3 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4638,8 +4638,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso + + TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); + +- context_resource_released(device, resource, type); +- + switch (type) + { + case WINED3D_RTYPE_SURFACE: +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 8069160..cd60356 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -159,6 +159,8 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) + + void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) + { ++ context_resource_released(resource->device, resource, resource->type); ++ + if (resource->buffer) + wined3d_resource_free_bo(resource); + +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Remove-the-texture-destroy-glFinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Remove-the-texture-destroy-glFinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Remove-the-texture-destroy-glFinish.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Remove-the-texture-destroy-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From c064211d94884f2c131c5496e60f591511c5462d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 15:02:12 +0200 -Subject: wined3d: Remove the texture destroy glFinish. - -This should work now that surface_decref is essentially gone and the -container is never unset. ---- - dlls/wined3d/texture.c | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 09ac38f..6f78292 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -146,13 +146,6 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - - TRACE("texture %p.\n", texture); - -- /* Because sub_resource_cleanup interferes with GL resources */ -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- device->cs->ops->finish(device->cs); -- } -- - for (i = 0; i < sub_count; ++i) - { - struct wined3d_resource *sub_resource = texture->sub_resources[i]; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,160 @@ +From 9ceff8564c938a798238a8ff91ab75ad2659eb32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 16:10:09 +0200 +Subject: wined3d: Don't incref / decref textures in color / depth fill blits. + +See comment in the code. The solution is not particularly nice. A better +approach may be to handle them in ddraw, where we have a permanent view +for the surface. +--- + dlls/wined3d/surface.c | 59 +++++++++++++++++++++--------------------- + dlls/wined3d/view.c | 20 -------------- + dlls/wined3d/wined3d_private.h | 1 - + 3 files changed, 30 insertions(+), 50 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index bff8df5..aa844fc 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -911,8 +911,8 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const + { + struct wined3d_resource *resource = &surface->container->resource; + struct wined3d_device *device = resource->device; +- struct wined3d_rendertarget_view_desc view_desc; +- struct wined3d_rendertarget_view *view; ++ struct wined3d_rendertarget_view view; ++ struct wined3d_texture *texture = surface->container; + const struct blit_shader *blitter; + HRESULT hr; + +@@ -923,19 +923,17 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const + return WINED3DERR_INVALIDCALL; + } + +- view_desc.format_id = resource->format->id; +- view_desc.u.texture.level_idx = surface->texture_level; +- view_desc.u.texture.layer_idx = surface->texture_layer; +- view_desc.u.texture.layer_count = 1; +- if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, +- resource, NULL, &wined3d_null_parent_ops, &view))) +- { +- ERR("Failed to create rendertarget view, hr %#x.\n", hr); +- return hr; +- } ++ view.resource = &surface->container->resource; ++ view.parent = NULL; ++ view.parent_ops = &wined3d_null_parent_ops; ++ view.format = surface->resource.format; ++ view.buffer_offset = 0; ++ view.width = surface->resource.width; ++ view.height = surface->resource.height; ++ view.depth = 1; ++ view.sub_resource_idx = surface->texture_layer * texture->level_count + surface->texture_level; + +- hr = blitter->depth_fill(device, view, rect, depth); +- wined3d_rendertarget_view_decref_worker(view); ++ hr = blitter->depth_fill(device, &view, rect, depth); + + return hr; + } +@@ -3235,8 +3233,8 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st + { + struct wined3d_resource *resource = &s->container->resource; + struct wined3d_device *device = resource->device; +- struct wined3d_rendertarget_view_desc view_desc; +- struct wined3d_rendertarget_view *view; ++ struct wined3d_rendertarget_view view; ++ struct wined3d_texture *texture = s->container; + const struct blit_shader *blitter; + HRESULT hr; + +@@ -3247,19 +3245,22 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st + return WINED3DERR_INVALIDCALL; + } + +- view_desc.format_id = resource->format->id; +- view_desc.u.texture.level_idx = s->texture_level; +- view_desc.u.texture.layer_idx = s->texture_layer; +- view_desc.u.texture.layer_count = 1; +- if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, +- resource, NULL, &wined3d_null_parent_ops, &view))) +- { +- ERR("Failed to create rendertarget view, hr %#x.\n", hr); +- return hr; +- } ++ /* Can't incref / decref the resource here. This is executed inside the worker ++ * thread. Playing with the refcount here makes the worker thread visible to ++ * the client lib. Problems occur when the worker thread happens to hold the ++ * last reference and the resource destruction callbacks are called from the ++ * wrong thread. */ ++ view.resource = &texture->resource; ++ view.parent = NULL; ++ view.parent_ops = &wined3d_null_parent_ops; ++ view.format = s->resource.format; ++ view.buffer_offset = 0; ++ view.width = s->resource.width; ++ view.height = s->resource.height; ++ view.depth = 1; ++ view.sub_resource_idx = s->texture_layer * texture->level_count + s->texture_level; + +- hr = blitter->color_fill(device, view, rect, color); +- wined3d_rendertarget_view_decref_worker(view); ++ hr = blitter->color_fill(device, &view, rect, color); + + return hr; + } +@@ -4056,7 +4057,7 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d + const RECT *rect, const struct wined3d_color *color) + { + const RECT draw_rect = {0, 0, view->width, view->height}; +- struct wined3d_fb_state fb = {&view, NULL}; ++ struct wined3d_fb_state fb = {&view, NULL, 1}; + + device_clear_render_targets(device, 1, &fb, 1, rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); + +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index e4694af..f2134f4 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -58,26 +58,6 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v + return refcount; + } + +-/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the +- * worker thread. */ +-ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) +-{ +- ULONG refcount = InterlockedDecrement(&view->refcount); +- +- TRACE("%p decreasing refcount to %u.\n", view, refcount); +- +- if (!refcount) +- { +- /* Call wined3d_object_destroyed() before releasing the resource, +- * since releasing the resource may end up destroying the parent. */ +- view->parent_ops->wined3d_object_destroyed(view->parent); +- wined3d_resource_decref(view->resource); +- wined3d_rendertarget_view_destroy(view); +- } +- +- return refcount; +-} +- + void * CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view) + { + TRACE("view %p.\n", view); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 929e7c7..0e0c8fa 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -3063,7 +3063,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return surface_from_resource(resource); + } + +-ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + + struct wined3d_shader_resource_view +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Move-FBO-destruction-into-the-worker-thread.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Move-FBO-destruction-into-the-worker-thread.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -From 05b16589d0f658e929eaafb416d4b19bd88bb47d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 16:09:45 +0200 -Subject: wined3d: Move FBO destruction into the worker thread. - -This protects the context array against races. ---- - dlls/wined3d/device.c | 2 -- - dlls/wined3d/resource.c | 2 ++ - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 62b0625..b5ce2c3 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4638,8 +4638,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso - - TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); - -- context_resource_released(device, resource, type); -- - switch (type) - { - case WINED3D_RTYPE_SURFACE: -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8069160..cd60356 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -159,6 +159,8 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) - - void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) - { -+ context_resource_released(resource->device, resource, resource->type); -+ - if (resource->buffer) - wined3d_resource_free_bo(resource); - --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -From 54eb3e212afc243fef25a46017ae3d822014f336 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 16:10:09 +0200 -Subject: wined3d: Don't incref / decref textures in color / depth fill blits. - -See comment in the code. The solution is not particularly nice. A better -approach may be to handle them in ddraw, where we have a permanent view -for the surface. ---- - dlls/wined3d/surface.c | 52 +++++++++++++++++++++++++----------------- - dlls/wined3d/view.c | 20 ---------------- - dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 31 insertions(+), 42 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1ccbe35..82485f3 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4124,19 +4124,26 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d - const RECT *dst_rect, const struct wined3d_color *color) - { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; -- struct wined3d_rendertarget_view *view; -- struct wined3d_fb_state fb = {&view, NULL}; -- HRESULT hr; -- -- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -- NULL, &wined3d_null_parent_ops, &view))) -- { -- ERR("Failed to create rendertarget view, hr %#x.\n", hr); -- return hr; -- } -+ struct wined3d_rendertarget_view view, *view_ptr = &view; -+ struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; -+ struct wined3d_texture *texture = dst_surface->container; -+ -+ /* Can't incref / decref the resource here. This is executed inside the worker -+ * thread. Playing with the refcount here makes the worker thread visible to -+ * the client lib. Problems occur when the worker thread happens to hold the -+ * last reference and the resource destruction callbacks are called from the -+ * wrong thread. */ -+ view.resource = &texture->resource; -+ view.parent = NULL; -+ view.parent_ops = &wined3d_null_parent_ops; -+ view.format = dst_surface->resource.format; -+ view.buffer_offset = 0; -+ view.width = dst_surface->resource.width; -+ view.height = dst_surface->resource.height; -+ view.depth = 1; -+ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -- wined3d_rendertarget_view_decref_worker(view); - - return WINED3D_OK; - } -@@ -4145,18 +4152,21 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d - const RECT *dst_rect, float depth) - { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; -- struct wined3d_fb_state fb = {NULL, NULL}; -- HRESULT hr; -- -- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -- NULL, &wined3d_null_parent_ops, &fb.depth_stencil))) -- { -- ERR("Failed to create rendertarget view, hr %#x.\n", hr); -- return hr; -- } -+ struct wined3d_rendertarget_view view; -+ struct wined3d_fb_state fb = {NULL, &view}; -+ struct wined3d_texture *texture = dst_surface->container; -+ -+ view.resource = &dst_surface->container->resource; -+ view.parent = NULL; -+ view.parent_ops = &wined3d_null_parent_ops; -+ view.format = dst_surface->resource.format; -+ view.buffer_offset = 0; -+ view.width = dst_surface->resource.width; -+ view.height = dst_surface->resource.height; -+ view.depth = 1; -+ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -- wined3d_rendertarget_view_decref_worker(fb.depth_stencil); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 56eb7b3..870f1df 100644 ---- a/dlls/wined3d/view.c -+++ b/dlls/wined3d/view.c -@@ -58,26 +58,6 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v - return refcount; - } - --/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the -- * worker thread. */ --ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) --{ -- ULONG refcount = InterlockedDecrement(&view->refcount); -- -- TRACE("%p decreasing refcount to %u.\n", view, refcount); -- -- if (!refcount) -- { -- /* Call wined3d_object_destroyed() before releasing the resource, -- * since releasing the resource may end up destroying the parent. */ -- view->parent_ops->wined3d_object_destroyed(view->parent); -- wined3d_resource_decref(view->resource); -- wined3d_rendertarget_view_destroy(view); -- } -- -- return refcount; --} -- - void * CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view) - { - TRACE("view %p.\n", view); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3abd0a8..88329e5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2859,7 +2859,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( - return surface_from_resource(resource); - } - --ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - - struct wined3d_shader_resource_view --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-Winex11-complain-about-glfinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-Winex11-complain-about-glfinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-Winex11-complain-about-glfinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-Winex11-complain-about-glfinish.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,32 @@ +From 7af302e360179e2ef395c66327876b276f30fe9f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 12:12:11 +0200 +Subject: Winex11: complain about glfinish + +--- + dlls/winex11.drv/opengl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c +index 3d0bd24..069dcc5 100644 +--- a/dlls/winex11.drv/opengl.c ++++ b/dlls/winex11.drv/opengl.c +@@ -1962,6 +1962,7 @@ static void wglFinish(void) + escape.code = X11DRV_FLUSH_GL_DRAWABLE; + escape.gl_drawable = 0; + ++ ERR("glFinish\n"); + if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) + { + switch (gl->type) +@@ -1987,6 +1988,7 @@ static void wglFlush(void) + escape.code = X11DRV_FLUSH_GL_DRAWABLE; + escape.gl_drawable = 0; + ++ ERR("glFlush\n"); + if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) + { + switch (gl->type) +-- +2.6.2 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,69 @@ +From 003aabc11ecba217dbf01cd479a9b4b9a9ec4464 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 14:46:19 +0200 +Subject: wined3d: Make sure the new window is set up before setting up a + context. + +--- + dlls/wined3d/device.c | 31 +++++++++++++++++++++---------- + 1 file changed, 21 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 1f02518..f5bc02a 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4570,6 +4570,27 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + } + ++ /* Free implicit resources and wait for the command stream before modifying ++ * swapchain parameters. After modifying the swapchain parameters a new GL ++ * context may be acquired by the worker thread. This causes problems in the ++ * d3d8/9 test that passes a hidden window as the new device window. ++ * SetPixelFormat will call SetWindowPos inside the X11 driver, which sends ++ * a message to the window to query the icon. Since the worker thread is ++ * not the thread that created the window and the d3d8 test does not run ++ * an event loop this deadlocks. Set up the window first from the main thread ++ * before calling SetPixelFormat from the worker thread to avoid this. */ ++ if (device->auto_depth_stencil_view) ++ { ++ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); ++ device->auto_depth_stencil_view = NULL; ++ } ++ if (device->back_buffer_view) ++ { ++ wined3d_rendertarget_view_decref(device->back_buffer_view); ++ device->back_buffer_view = NULL; ++ } ++ device->cs->ops->finish(device->cs); ++ + TRACE("New params:\n"); + TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); + TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); +@@ -4696,11 +4717,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) + return hr; + +- if (device->auto_depth_stencil_view) +- { +- wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); +- device->auto_depth_stencil_view = NULL; +- } + if (swapchain->desc.enable_auto_depth_stencil) + { + struct wined3d_resource_desc texture_desc; +@@ -4742,11 +4758,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); + } + +- if (device->back_buffer_view) +- { +- wined3d_rendertarget_view_decref(device->back_buffer_view); +- device->back_buffer_view = NULL; +- } + if (swapchain->desc.backbuffer_count) + { + view_desc.format_id = swapchain_desc->backbuffer_format; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-Winex11-complain-about-glfinish.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-Winex11-complain-about-glfinish.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-Winex11-complain-about-glfinish.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-Winex11-complain-about-glfinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From 7af302e360179e2ef395c66327876b276f30fe9f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 12:12:11 +0200 -Subject: Winex11: complain about glfinish - ---- - dlls/winex11.drv/opengl.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c -index 3d0bd24..069dcc5 100644 ---- a/dlls/winex11.drv/opengl.c -+++ b/dlls/winex11.drv/opengl.c -@@ -1962,6 +1962,7 @@ static void wglFinish(void) - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; - -+ ERR("glFinish\n"); - if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) - { - switch (gl->type) -@@ -1987,6 +1988,7 @@ static void wglFlush(void) - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; - -+ ERR("glFlush\n"); - if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) - { - switch (gl->type) --- -2.6.2 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From cc06aee370abd3cb1d9cd3ff52a8859c7810fcd7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 14:46:19 +0200 -Subject: wined3d: Make sure the new window is set up before setting up a - context. - ---- - dlls/wined3d/device.c | 31 +++++++++++++++++++++---------- - 1 file changed, 21 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0173d18..3ae0091 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4454,6 +4454,27 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - } - -+ /* Free implicit resources and wait for the command stream before modifying -+ * swapchain parameters. After modifying the swapchain parameters a new GL -+ * context may be acquired by the worker thread. This causes problems in the -+ * d3d8/9 test that passes a hidden window as the new device window. -+ * SetPixelFormat will call SetWindowPos inside the X11 driver, which sends -+ * a message to the window to query the icon. Since the worker thread is -+ * not the thread that created the window and the d3d8 test does not run -+ * an event loop this deadlocks. Set up the window first from the main thread -+ * before calling SetPixelFormat from the worker thread to avoid this. */ -+ if (device->auto_depth_stencil_view) -+ { -+ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); -+ device->auto_depth_stencil_view = NULL; -+ } -+ if (device->back_buffer_view) -+ { -+ wined3d_rendertarget_view_decref(device->back_buffer_view); -+ device->back_buffer_view = NULL; -+ } -+ device->cs->ops->finish(device->cs); -+ - TRACE("New params:\n"); - TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); - TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); -@@ -4580,11 +4601,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) - return hr; - -- if (device->auto_depth_stencil_view) -- { -- wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); -- device->auto_depth_stencil_view = NULL; -- } - if (swapchain->desc.enable_auto_depth_stencil) - { - struct wined3d_resource_desc texture_desc; -@@ -4627,11 +4643,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); - } - -- if (device->back_buffer_view) -- { -- wined3d_rendertarget_view_decref(device->back_buffer_view); -- device->back_buffer_view = NULL; -- } - if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), - NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-device_reset-CS-sync-fixme.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-device_reset-CS-sync-fixme.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,31 @@ +From 87ccefcb423dc16c82c5324fba63a6f30a7c8126 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 14:46:55 +0200 +Subject: wined3d: Remove the device_reset CS sync fixme. + +--- + dlls/wined3d/device.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index f79db11..18cecac 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4402,12 +4402,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", + device, swapchain_desc, mode, callback, reset_state); + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); + + if (!(swapchain = wined3d_device_get_swapchain(device, 0))) + { +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,52 @@ +From 86347e81d7f9b1cf0c231833b5cbba783c0acbd9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 18:52:22 +0200 +Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place. + +--- + dlls/wined3d/buffer.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index e1ba423..d2da303 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -673,6 +673,12 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); + checkGLcall("glBufferData"); + } ++ else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) ++ { ++ /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set ++ * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ ++ buffer_sync_apple(This, 0, gl_info); ++ } + + while (This->modified_areas) + { +@@ -1035,9 +1041,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_DISCARD; + buffer->ignore_discard = TRUE; + } ++ else if (!(flags & WINED3D_MAP_NOOVERWRITE)) ++ buffer->flags |= WINED3D_BUFFER_SYNC; + } +- if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) +- buffer->flags |= WINED3D_BUFFER_SYNC; + } + + if (wined3d_settings.cs_multithreaded && count == 1) +@@ -1052,6 +1058,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { + wined3d_resource_wait_fence(&buffer->resource); ++ /* Writing to the (otherwise worker thread controlled) ++ * flags field is OK here since the wait_fence call made ++ * sure the buffer is idle. */ ++ buffer->flags |= WINED3D_BUFFER_SYNC; + } + } + +-- +2.2.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Remove-the-device_reset-CS-sync-fixme.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Remove-the-device_reset-CS-sync-fixme.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 87ccefcb423dc16c82c5324fba63a6f30a7c8126 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 14:46:55 +0200 -Subject: wined3d: Remove the device_reset CS sync fixme. - ---- - dlls/wined3d/device.c | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f79db11..18cecac 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4402,12 +4402,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", - device, swapchain_desc, mode, callback, reset_state); - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); - - if (!(swapchain = wined3d_device_get_swapchain(device, 0))) - { --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -From 86347e81d7f9b1cf0c231833b5cbba783c0acbd9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 18:52:22 +0200 -Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place. - ---- - dlls/wined3d/buffer.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index e1ba423..d2da303 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -673,6 +673,12 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); - checkGLcall("glBufferData"); - } -+ else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) -+ { -+ /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set -+ * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ -+ buffer_sync_apple(This, 0, gl_info); -+ } - - while (This->modified_areas) - { -@@ -1035,9 +1041,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_DISCARD; - buffer->ignore_discard = TRUE; - } -+ else if (!(flags & WINED3D_MAP_NOOVERWRITE)) -+ buffer->flags |= WINED3D_BUFFER_SYNC; - } -- if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) -- buffer->flags |= WINED3D_BUFFER_SYNC; - } - - if (wined3d_settings.cs_multithreaded && count == 1) -@@ -1052,6 +1058,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { - wined3d_resource_wait_fence(&buffer->resource); -+ /* Writing to the (otherwise worker thread controlled) -+ * flags field is OK here since the wait_fence call made -+ * sure the buffer is idle. */ -+ buffer->flags |= WINED3D_BUFFER_SYNC; - } - } - --- -2.2.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,41 @@ +From ba0d7248f185c8d6024f0d92b8c87b2d7153317c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 3 Sep 2014 20:20:39 +0200 +Subject: wined3d: Wait for the resource to be idle when destroying user memory + surfaces. + +--- + dlls/wined3d/surface.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 82485f3..3557c00 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -84,6 +84,8 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) + static void surface_cleanup(struct wined3d_surface *surface) + { + struct wined3d_surface *overlay, *cur; ++ struct wined3d_cs *cs = surface->resource.device->cs; ++ BOOL user_mem = surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY; + + TRACE("surface %p.\n", surface); + +@@ -97,7 +99,13 @@ static void surface_cleanup(struct wined3d_surface *surface) + } + + resource_cleanup(&surface->resource); +- wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); ++ wined3d_cs_emit_surface_cleanup(cs, surface); ++ ++ /* Wait for the CS to finish operations on this surface when user memory was in use. ++ * The application is allowed to free the memory after texture / surface destruction ++ * returns. */ ++ if (user_mem) ++ wined3d_resource_wait_fence(&surface->container->resource); + } + + void wined3d_surface_destroy(struct wined3d_surface *surface) +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Don-t-sync-on-redundant-discard-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Don-t-sync-on-redundant-discard-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Don-t-sync-on-redundant-discard-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Don-t-sync-on-redundant-discard-calls.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,25 @@ +From 4e89934c223fd43aab2679042c7c808c8200aa68 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 14:53:57 +0200 +Subject: wined3d: Don't sync on redundant discard calls. + +--- + dlls/wined3d/buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index d743f0a..1081247 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1055,7 +1055,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +- else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) ++ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) + { + wined3d_resource_wait_fence(&buffer->resource); + /* Writing to the (otherwise worker thread controlled) +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From ba0d7248f185c8d6024f0d92b8c87b2d7153317c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 3 Sep 2014 20:20:39 +0200 -Subject: wined3d: Wait for the resource to be idle when destroying user memory - surfaces. - ---- - dlls/wined3d/surface.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 82485f3..3557c00 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -84,6 +84,8 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) - static void surface_cleanup(struct wined3d_surface *surface) - { - struct wined3d_surface *overlay, *cur; -+ struct wined3d_cs *cs = surface->resource.device->cs; -+ BOOL user_mem = surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY; - - TRACE("surface %p.\n", surface); - -@@ -97,7 +99,13 @@ static void surface_cleanup(struct wined3d_surface *surface) - } - - resource_cleanup(&surface->resource); -- wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); -+ wined3d_cs_emit_surface_cleanup(cs, surface); -+ -+ /* Wait for the CS to finish operations on this surface when user memory was in use. -+ * The application is allowed to free the memory after texture / surface destruction -+ * returns. */ -+ if (user_mem) -+ wined3d_resource_wait_fence(&surface->container->resource); - } - - void wined3d_surface_destroy(struct wined3d_surface *surface) --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-discard-new-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-discard-new-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-discard-new-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-discard-new-buffers.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,24 @@ +From 6f08171470d477868721be4e6a1f1178856340d4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 14:57:37 +0200 +Subject: wined3d: Don't discard new buffers. + +--- + dlls/wined3d/buffer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 1081247..e6e56bb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1196,6 +1196,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + return hr; + } + buffer->buffer_type_hint = bind_hint; ++ buffer->ignore_discard = TRUE; + + TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, + debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-sync-on-redundant-discard-calls.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-sync-on-redundant-discard-calls.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-sync-on-redundant-discard-calls.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Don-t-sync-on-redundant-discard-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 4e89934c223fd43aab2679042c7c808c8200aa68 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 14:53:57 +0200 -Subject: wined3d: Don't sync on redundant discard calls. - ---- - dlls/wined3d/buffer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d743f0a..1081247 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1055,7 +1055,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -- else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) -+ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) - { - wined3d_resource_wait_fence(&buffer->resource); - /* Writing to the (otherwise worker thread controlled) --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-discard-new-buffers.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-discard-new-buffers.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-discard-new-buffers.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-discard-new-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From 6f08171470d477868721be4e6a1f1178856340d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 14:57:37 +0200 -Subject: wined3d: Don't discard new buffers. - ---- - dlls/wined3d/buffer.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 1081247..e6e56bb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1196,6 +1196,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - return hr; - } - buffer->buffer_type_hint = bind_hint; -+ buffer->ignore_discard = TRUE; - - TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, - debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,52 @@ +From 180d8cf49a4f4481b08e373e8c8a75c116094e63 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 15:09:44 +0200 +Subject: wined3d: Don't try to sync VBOs manually on OSX with CSMT. + +This fixes a performance regression in some games caused by +aaf4849718c3c3a763c460a24a51dd6c6b55524a. + +GL_ARB_sync and GL_APPLE_fence seem to be fairly slow on OSX. Putting the +buffer back into synchonized mode and synchronizing all future uploads +is about twice as fast. This was benchmarked with 3DMark2001. Gunpoint, +another game that depends on synchronized dynamic buffer maps, feels +smoother, although the lack of a benchmark mode makes testing this difficult. + +This assumes that if a game maps a dynamic buffer without NOOVERWRITE or +DISCARD once it will always do so. I have not seen a game yet that mixes +async and sync maps. If the game mixes them, the wined3d-side CS will still +update the buffer asynchronously. Only the worker thread -> GL copy is +synchronized, as it used to be for all buffers in cx13. + +This patch only changes the double-buffered (used for CSMT) codepath. Making +the same change to the glMapBuffer codepath improves 3DMark2001 performance +as well, but the difference is much smaller. I will leave the manual sync +code in place until we have a game that clearly profits from this change. +--- + dlls/wined3d/buffer.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index e6e56bb..b33dd5a 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -676,8 +676,14 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) + { + /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set +- * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ +- buffer_sync_apple(This, 0, gl_info); ++ * GL_BUFFER_SERIALIZED_MODIFY_APPLE to GL_FALSE. Unfortunately ARB_sync and APPLE_fence are pretty ++ * slow on OSX. Putting the buffer back into synchronized mode for future maps is a lot faster. ++ * (GeForce 650M, Mavericks). The difference between ARB_sync and normal buffer operation is small ++ * in the glMapBuffer codepath without CSMT. */ ++ glFinish(); ++ GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)); ++ checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"); ++ This->flags &= ~WINED3D_BUFFER_APPLESYNC; + } + + while (This->modified_areas) +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -From 180d8cf49a4f4481b08e373e8c8a75c116094e63 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 15:09:44 +0200 -Subject: wined3d: Don't try to sync VBOs manually on OSX with CSMT. - -This fixes a performance regression in some games caused by -aaf4849718c3c3a763c460a24a51dd6c6b55524a. - -GL_ARB_sync and GL_APPLE_fence seem to be fairly slow on OSX. Putting the -buffer back into synchonized mode and synchronizing all future uploads -is about twice as fast. This was benchmarked with 3DMark2001. Gunpoint, -another game that depends on synchronized dynamic buffer maps, feels -smoother, although the lack of a benchmark mode makes testing this difficult. - -This assumes that if a game maps a dynamic buffer without NOOVERWRITE or -DISCARD once it will always do so. I have not seen a game yet that mixes -async and sync maps. If the game mixes them, the wined3d-side CS will still -update the buffer asynchronously. Only the worker thread -> GL copy is -synchronized, as it used to be for all buffers in cx13. - -This patch only changes the double-buffered (used for CSMT) codepath. Making -the same change to the glMapBuffer codepath improves 3DMark2001 performance -as well, but the difference is much smaller. I will leave the manual sync -code in place until we have a game that clearly profits from this change. ---- - dlls/wined3d/buffer.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index e6e56bb..b33dd5a 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -676,8 +676,14 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) - { - /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set -- * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ -- buffer_sync_apple(This, 0, gl_info); -+ * GL_BUFFER_SERIALIZED_MODIFY_APPLE to GL_FALSE. Unfortunately ARB_sync and APPLE_fence are pretty -+ * slow on OSX. Putting the buffer back into synchronized mode for future maps is a lot faster. -+ * (GeForce 650M, Mavericks). The difference between ARB_sync and normal buffer operation is small -+ * in the glMapBuffer codepath without CSMT. */ -+ glFinish(); -+ GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)); -+ checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"); -+ This->flags &= ~WINED3D_BUFFER_APPLESYNC; - } - - while (This->modified_areas) --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Render-target-lock-hack.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Render-target-lock-hack.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Render-target-lock-hack.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Render-target-lock-hack.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,86 @@ +From 8b94a2168e87d63b4def608b239fc4cc4b1075d3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 23 Sep 2014 22:18:56 +0200 +Subject: wined3d: Render target lock hack + +--- + dlls/wined3d/resource.c | 17 +++++++++++++++++ + dlls/wined3d/wined3d_main.c | 7 +++++++ + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 25 insertions(+) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index dd58302..5bc7d9a 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -887,6 +887,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + TRACE("resource %p, map_desc %p, box %s, flags %#x.\n", + resource, map_desc, debug_box(box), flags); + ++ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) ++ { ++ WARN("Ignoring render target map, only finishing CS.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ map_desc->row_pitch = 0; ++ map_desc->slice_pitch = 0; ++ map_desc->data = NULL; ++ device->cs->ops->finish(device->cs); ++ return WINED3D_OK; ++ } ++ + if (resource->map_count) + { + WARN("Volume is already mapped.\n"); +@@ -986,6 +997,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + struct wined3d_device *device = resource->device; + TRACE("resource %p.\n", resource); + ++ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) ++ { ++ WARN("Ignoring render target unmap.\n"); ++ return WINED3D_OK; ++ } ++ + if (!resource->map_count) + { + WARN("Trying to unlock an unlocked resource %p.\n", resource); +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index 7b4fc40..0bc1120 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -87,6 +87,7 @@ struct wined3d_settings wined3d_settings = + ~0U, /* No PS shader model limit by default. */ + FALSE, /* 3D support enabled by default. */ + FALSE, /* No multithreaded CS by default. */ ++ FALSE, /* Do not ignore render target maps. */ + }; + + struct wined3d * CDECL wined3d_create(DWORD flags) +@@ -321,6 +322,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + TRACE("Enabling multithreaded command stream.\n"); + wined3d_settings.cs_multithreaded = TRUE; + } ++ if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) ++ && !strcmp(buffer,"enabled")) ++ { ++ TRACE("Ignoring render target maps.\n"); ++ wined3d_settings.ignore_rt_map = TRUE; ++ } + } + + if (appkey) RegCloseKey( appkey ); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 9a1c94d..d0453f1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -296,6 +296,7 @@ struct wined3d_settings + unsigned int max_sm_ps; + BOOL no_3d; + BOOL cs_multithreaded; ++ BOOL ignore_rt_map; + }; + + extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,42 @@ +From a2aa05486b1b77425b94657483334a1dd5763048 Mon Sep 17 00:00:00 2001 +From: Matteo Bruni +Date: Fri, 12 Sep 2014 19:03:05 +0200 +Subject: wined3d: Avoid calling wined3d_surface_blt() from + surface_upload_from_surface(). + +--- + dlls/wined3d/surface.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3557c00..9ab0738 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -37,6 +37,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); + #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ + + ++static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, ++ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, ++ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); ++ + void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) + { + if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) +@@ -1522,9 +1526,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + return WINED3DERR_INVALIDCALL; + } + +- /* Use wined3d_surface_blt() instead of uploading directly if we need conversion. */ ++ /* Use surface_cpu_blt() instead of uploading directly if we need ++ * conversion. Avoid calling wined3d_surface_blt() since that goes ++ * through the CS. */ + if (dst_format->convert || wined3d_format_get_color_key_conversion(dst_surface->container, FALSE)) +- return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); ++ return surface_cpu_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); + + context = context_acquire(dst_surface->resource.device, NULL); + gl_info = context->gl_info; +-- +2.1.3 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Render-target-lock-hack.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Render-target-lock-hack.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Render-target-lock-hack.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Render-target-lock-hack.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -From f23d42ca6a96a3d257fc57dbae8d5ebd3620e4b7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 23 Sep 2014 22:18:56 +0200 -Subject: wined3d: Render target lock hack - ---- - dlls/wined3d/resource.c | 17 +++++++++++++++++ - dlls/wined3d/wined3d_main.c | 7 +++++++ - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 25 insertions(+) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index cd60356..dc36dd5 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -777,6 +777,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", - resource, map_desc, box, flags); - -+ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) -+ { -+ WARN("Ignoring render target map, only finishing CS.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ map_desc->row_pitch = 0; -+ map_desc->slice_pitch = 0; -+ map_desc->data = NULL; -+ device->cs->ops->finish(device->cs); -+ return WINED3D_OK; -+ } -+ - if (resource->map_count) - { - WARN("Volume is already mapped.\n"); -@@ -880,6 +891,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - struct wined3d_device *device = resource->device; - TRACE("resource %p.\n", resource); - -+ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) -+ { -+ WARN("Ignoring render target unmap.\n"); -+ return WINED3D_OK; -+ } -+ - if (!resource->map_count) - { - WARN("Trying to unlock an unlocked resource %p.\n", resource); -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index e6dc444..a1e4e6c 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -86,6 +86,7 @@ struct wined3d_settings wined3d_settings = - ~0U, /* No PS shader model limit by default. */ - FALSE, /* 3D support enabled by default. */ - FALSE, /* No multithreaded CS by default. */ -+ FALSE, /* Do not ignore render target maps. */ - }; - - struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -311,6 +312,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - TRACE("Enabling multithreaded command stream.\n"); - wined3d_settings.cs_multithreaded = TRUE; - } -+ if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) -+ && !strcmp(buffer,"enabled")) -+ { -+ TRACE("Ignoring render target maps.\n"); -+ wined3d_settings.ignore_rt_map = TRUE; -+ } - } - - if (appkey) RegCloseKey( appkey ); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 88329e5..dd06525 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -281,6 +281,7 @@ struct wined3d_settings - unsigned int max_sm_ps; - BOOL no_3d; - BOOL cs_multithreaded; -+ BOOL ignore_rt_map; - }; - - extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From a2aa05486b1b77425b94657483334a1dd5763048 Mon Sep 17 00:00:00 2001 -From: Matteo Bruni -Date: Fri, 12 Sep 2014 19:03:05 +0200 -Subject: wined3d: Avoid calling wined3d_surface_blt() from - surface_upload_from_surface(). - ---- - dlls/wined3d/surface.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3557c00..9ab0738 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -37,6 +37,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); - #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ - - -+static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, -+ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); -+ - void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) - { - if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) -@@ -1522,9 +1526,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - return WINED3DERR_INVALIDCALL; - } - -- /* Use wined3d_surface_blt() instead of uploading directly if we need conversion. */ -+ /* Use surface_cpu_blt() instead of uploading directly if we need -+ * conversion. Avoid calling wined3d_surface_blt() since that goes -+ * through the CS. */ - if (dst_format->convert || wined3d_format_get_color_key_conversion(dst_surface->container, FALSE)) -- return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); -+ return surface_cpu_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); - - context = context_acquire(dst_surface->resource.device, NULL); - gl_info = context->gl_info; --- -2.1.3 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Only-discard-buffers-that-are-in-use.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Only-discard-buffers-that-are-in-use.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Only-discard-buffers-that-are-in-use.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Only-discard-buffers-that-are-in-use.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,33 @@ +From b5d14c60d7533217f9ea6b96c2fafc14eb9870cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 16 Jan 2015 19:19:05 +0100 +Subject: wined3d: Only discard buffers that are in use. + +No need to mess around with memory if it is idle. +--- + dlls/wined3d/buffer.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index f5bd06d..6995264 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1057,9 +1057,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; + if (flags & WINED3D_MAP_DISCARD && !swvp) + { +- buffer->ignore_discard = TRUE; +- wined3d_resource_allocate_sysmem(&buffer->resource); +- wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ if (buffer->resource.access_fence) ++ { ++ buffer->ignore_discard = TRUE; ++ wined3d_resource_allocate_sysmem(&buffer->resource); ++ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ } + } + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) + { +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Destroy-samplers-through-the-command-stream.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Destroy-samplers-through-the-command-stream.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Destroy-samplers-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Destroy-samplers-through-the-command-stream.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,135 @@ +From 94db69addfe7d9049300393410664dee39f695f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 27 Aug 2015 23:43:08 +0200 +Subject: wined3d: Destroy samplers through the command stream. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/sampler.c | 21 +++++++++++++-------- + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 44 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index e89e053..01c4ba3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -93,6 +93,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_DELETE_GL_CONTEXTS, + WINED3D_CS_OP_GETDC, + WINED3D_CS_OP_RELEASEDC, ++ WINED3D_CS_OP_SAMPLER_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -557,6 +558,12 @@ struct wined3d_cs_releasedc + struct wined3d_surface *surface; + }; + ++struct wined3d_cs_sampler_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_sampler *sampler; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2758,6 +2765,26 @@ void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *su + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_sampler_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_sampler_destroy *op = data; ++ ++ wined3d_sampler_destroy(op->sampler); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) ++{ ++ struct wined3d_cs_sampler_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SAMPLER_DESTROY; ++ op->sampler = sampler; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2829,6 +2856,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, + /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, + /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, ++ /* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c +index ffa1155..81bdb51 100644 +--- a/dlls/wined3d/sampler.c ++++ b/dlls/wined3d/sampler.c +@@ -33,22 +33,27 @@ ULONG CDECL wined3d_sampler_incref(struct wined3d_sampler *sampler) + return refcount; + } + ++void wined3d_sampler_destroy(struct wined3d_sampler *sampler) ++{ ++ struct wined3d_context *context = context_acquire(sampler->device, NULL); ++ const struct wined3d_gl_info *gl_info = context->gl_info; ++ ++ GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); ++ context_release(context); ++ ++ HeapFree(GetProcessHeap(), 0, sampler); ++} ++ + ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) + { + ULONG refcount = InterlockedDecrement(&sampler->refcount); +- const struct wined3d_gl_info *gl_info; +- struct wined3d_context *context; + + TRACE("%p decreasing refcount to %u.\n", sampler, refcount); + + if (!refcount) + { +- context = context_acquire(sampler->device, NULL); +- gl_info = context->gl_info; +- GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); +- context_release(context); +- +- HeapFree(GetProcessHeap(), 0, sampler); ++ struct wined3d_device *device = sampler->device; ++ wined3d_cs_emit_sampler_destroy(device->cs, sampler); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0adce02..9f4c9e1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2566,6 +2566,8 @@ struct wined3d_sampler + GLuint name; + }; + ++void wined3d_sampler_destroy(struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; ++ + struct wined3d_vertex_declaration_element + { + const struct wined3d_format *format; +@@ -2821,6 +2823,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.5.1 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Only-discard-buffers-that-are-in-use.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Only-discard-buffers-that-are-in-use.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Only-discard-buffers-that-are-in-use.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Only-discard-buffers-that-are-in-use.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -From b5d14c60d7533217f9ea6b96c2fafc14eb9870cc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 16 Jan 2015 19:19:05 +0100 -Subject: wined3d: Only discard buffers that are in use. - -No need to mess around with memory if it is idle. ---- - dlls/wined3d/buffer.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index f5bd06d..6995264 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1057,9 +1057,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; - if (flags & WINED3D_MAP_DISCARD && !swvp) - { -- buffer->ignore_discard = TRUE; -- wined3d_resource_allocate_sysmem(&buffer->resource); -- wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); -+ if (buffer->resource.access_fence) -+ { -+ buffer->ignore_discard = TRUE; -+ wined3d_resource_allocate_sysmem(&buffer->resource); -+ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); -+ } - } - else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) - { --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Destroy-samplers-through-the-command-stream.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Destroy-samplers-through-the-command-stream.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Destroy-samplers-through-the-command-stream.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Destroy-samplers-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -From 94db69addfe7d9049300393410664dee39f695f4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 27 Aug 2015 23:43:08 +0200 -Subject: wined3d: Destroy samplers through the command stream. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/sampler.c | 21 +++++++++++++-------- - dlls/wined3d/wined3d_private.h | 3 +++ - 3 files changed, 44 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index e89e053..01c4ba3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -93,6 +93,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_DELETE_GL_CONTEXTS, - WINED3D_CS_OP_GETDC, - WINED3D_CS_OP_RELEASEDC, -+ WINED3D_CS_OP_SAMPLER_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -557,6 +558,12 @@ struct wined3d_cs_releasedc - struct wined3d_surface *surface; - }; - -+struct wined3d_cs_sampler_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_sampler *sampler; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2758,6 +2765,26 @@ void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *su - cs->ops->finish(cs); - } - -+static UINT wined3d_cs_exec_sampler_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_sampler_destroy *op = data; -+ -+ wined3d_sampler_destroy(op->sampler); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) -+{ -+ struct wined3d_cs_sampler_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SAMPLER_DESTROY; -+ op->sampler = sampler; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2829,6 +2856,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, - /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, - /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, -+ /* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c -index ffa1155..81bdb51 100644 ---- a/dlls/wined3d/sampler.c -+++ b/dlls/wined3d/sampler.c -@@ -33,22 +33,27 @@ ULONG CDECL wined3d_sampler_incref(struct wined3d_sampler *sampler) - return refcount; - } - -+void wined3d_sampler_destroy(struct wined3d_sampler *sampler) -+{ -+ struct wined3d_context *context = context_acquire(sampler->device, NULL); -+ const struct wined3d_gl_info *gl_info = context->gl_info; -+ -+ GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); -+ context_release(context); -+ -+ HeapFree(GetProcessHeap(), 0, sampler); -+} -+ - ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) - { - ULONG refcount = InterlockedDecrement(&sampler->refcount); -- const struct wined3d_gl_info *gl_info; -- struct wined3d_context *context; - - TRACE("%p decreasing refcount to %u.\n", sampler, refcount); - - if (!refcount) - { -- context = context_acquire(sampler->device, NULL); -- gl_info = context->gl_info; -- GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); -- context_release(context); -- -- HeapFree(GetProcessHeap(), 0, sampler); -+ struct wined3d_device *device = sampler->device; -+ wined3d_cs_emit_sampler_destroy(device->cs, sampler); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0adce02..9f4c9e1 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2566,6 +2566,8 @@ struct wined3d_sampler - GLuint name; - }; - -+void wined3d_sampler_destroy(struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; -+ - struct wined3d_vertex_declaration_element - { - const struct wined3d_format *format; -@@ -2821,6 +2823,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Hack-to-reject-unsupported-color-fills.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Hack-to-reject-unsupported-color-fills.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Hack-to-reject-unsupported-color-fills.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Hack-to-reject-unsupported-color-fills.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,31 @@ +From 190f220b618f92af812a06ea75d1a7cf93ef6194 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 28 Aug 2015 00:01:39 +0200 +Subject: wined3d: Hack to reject unsupported color fills. + +--- + dlls/wined3d/surface.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index bf1f1cf..0a460cf 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -5220,6 +5220,14 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + } + } + ++ /* FIXME: We should select the blitter in the main thread, that way we can return an error if the blit ++ * is unsupported without duplicating all the checks... */ ++ if (flags & WINEDDBLT_COLORFILL && (dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)) ++ { ++ WARN("Block color fill, returning WINED3DERR_INVALIDCALL\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ + if (!fx || !(fx->dwDDFX)) + flags &= ~WINEDDBLT_DDFX; + +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,56 @@ +From b0f13fef660a46a781b1dd849996049ebe514242 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 28 Aug 2015 01:13:32 +0200 +Subject: wined3d: Alloc the buffer map array before mapping the buffer. + +FIXME: This needs to go into whatever patch creates the VBO on first map. +--- + dlls/wined3d/buffer.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 0c3dc56..531eb39 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1317,27 +1317,28 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + buffer->flags |= WINED3D_BUFFER_CREATEBO; + } + ++ buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); ++ if (!buffer->maps) ++ { ++ ERR("Out of memory\n"); ++ buffer_unload(&buffer->resource); ++ resource_cleanup(&buffer->resource); ++ return E_OUTOFMEMORY; ++ } ++ buffer->maps_size = 1; ++ + if (data) + { + if (FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data))) + { + ERR("Failed to upload data, hr %#x.\n", hr); ++ HeapFree(GetProcessHeap(), 0, buffer->maps); + buffer_unload(&buffer->resource); + resource_cleanup(&buffer->resource); + return hr; + } + } + +- buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); +- if (!buffer->maps) +- { +- ERR("Out of memory\n"); +- buffer_unload(&buffer->resource); +- resource_cleanup(&buffer->resource); +- return E_OUTOFMEMORY; +- } +- buffer->maps_size = 1; +- + if (wined3d_settings.cs_multithreaded) + buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; + +-- +2.6.4 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Hack-to-reject-unsupported-color-fills.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Hack-to-reject-unsupported-color-fills.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Hack-to-reject-unsupported-color-fills.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Hack-to-reject-unsupported-color-fills.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From e366ff98587ac212a25fd28f9f26f18ca5f30382 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 28 Aug 2015 00:01:39 +0200 -Subject: wined3d: Hack to reject unsupported color fills. - ---- - dlls/wined3d/surface.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e318bf106..f815b65 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -5302,6 +5302,14 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - memset(&src_rect, 0, sizeof(src_rect)); - } - -+ /* FIXME: We should select the blitter in the main thread, that way we can return an error if the blit -+ * is unsupported without duplicating all the checks... */ -+ if (flags & WINEDDBLT_COLORFILL && (dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)) -+ { -+ WARN("Block color fill, returning WINED3DERR_INVALIDCALL\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ - if (!fx || !(fx->dwDDFX)) - flags &= ~WINEDDBLT_DDFX; - --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -From b0f13fef660a46a781b1dd849996049ebe514242 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 28 Aug 2015 01:13:32 +0200 -Subject: wined3d: Alloc the buffer map array before mapping the buffer. - -FIXME: This needs to go into whatever patch creates the VBO on first map. ---- - dlls/wined3d/buffer.c | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 0c3dc56..531eb39 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1317,27 +1317,28 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - buffer->flags |= WINED3D_BUFFER_CREATEBO; - } - -+ buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); -+ if (!buffer->maps) -+ { -+ ERR("Out of memory\n"); -+ buffer_unload(&buffer->resource); -+ resource_cleanup(&buffer->resource); -+ return E_OUTOFMEMORY; -+ } -+ buffer->maps_size = 1; -+ - if (data) - { - if (FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data))) - { - ERR("Failed to upload data, hr %#x.\n", hr); -+ HeapFree(GetProcessHeap(), 0, buffer->maps); - buffer_unload(&buffer->resource); - resource_cleanup(&buffer->resource); - return hr; - } - } - -- buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); -- if (!buffer->maps) -- { -- ERR("Out of memory\n"); -- buffer_unload(&buffer->resource); -- resource_cleanup(&buffer->resource); -- return E_OUTOFMEMORY; -- } -- buffer->maps_size = 1; -- - if (wined3d_settings.cs_multithreaded) - buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; - --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Send-update_sub_resource-calls-through-the-c.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Send-update_sub_resource-calls-through-the-c.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Send-update_sub_resource-calls-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Send-update_sub_resource-calls-through-the-c.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,223 @@ +From ccca792636064c789f2f5b8f9b333f6591f275a8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 4 Sep 2015 15:22:49 +0200 +Subject: wined3d: Send update_sub_resource calls through the command stream. + +--- + dlls/wined3d/cs.c | 91 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 43 +------------------- + dlls/wined3d/wined3d_private.h | 3 ++ + 3 files changed, 95 insertions(+), 42 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 707f00d..e99a54d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -93,6 +93,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_GETDC, + WINED3D_CS_OP_RELEASEDC, + WINED3D_CS_OP_SAMPLER_DESTROY, ++ WINED3D_CS_OP_UPDATE_SUB_RESOURCE, + WINED3D_CS_OP_STOP, + }; + +@@ -557,6 +558,15 @@ struct wined3d_cs_sampler_destroy + struct wined3d_sampler *sampler; + }; + ++struct wined3d_cs_update_sub_resource ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++ unsigned int sub_resource_idx, row_pitch, depth_pitch; ++ const struct wined3d_box *box; ++ const void *data; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2752,6 +2762,86 @@ void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampl + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_update_sub_resource *op = data; ++ ++ struct wined3d_resource *sub_resource; ++ const struct wined3d_gl_info *gl_info; ++ struct wined3d_const_bo_address addr; ++ struct wined3d_context *context; ++ struct wined3d_texture *texture; ++ struct wined3d_surface *surface; ++ POINT dst_point; ++ RECT src_rect; ++ ++ texture = wined3d_texture_from_resource(op->resource); ++ sub_resource = wined3d_texture_get_sub_resource(texture, op->sub_resource_idx); ++ surface = surface_from_resource(sub_resource); ++ ++ src_rect.left = 0; ++ src_rect.top = 0; ++ if (op->box) ++ { ++ src_rect.right = op->box->right - op->box->left; ++ src_rect.bottom = op->box->bottom - op->box->top; ++ dst_point.x = op->box->left; ++ dst_point.y = op->box->top; ++ } ++ else ++ { ++ src_rect.right = sub_resource->width; ++ src_rect.bottom = sub_resource->height; ++ dst_point.x = 0; ++ dst_point.y = 0; ++ } ++ ++ addr.buffer_object = 0; ++ addr.addr = op->data; ++ ++ context = context_acquire(cs->device, NULL); ++ gl_info = context->gl_info; ++ ++ /* Only load the surface for partial updates. */ ++ if (!dst_point.x && !dst_point.y && src_rect.right == sub_resource->width ++ && src_rect.bottom == sub_resource->height) ++ wined3d_texture_prepare_texture(texture, context, FALSE); ++ else ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_texture_bind_and_dirtify(texture, context, FALSE); ++ ++ wined3d_surface_upload_data(surface, gl_info, op->resource->format, ++ &src_rect, op->row_pitch, &dst_point, FALSE, &addr); ++ ++ context_release(context); ++ ++ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, ++ unsigned int depth_pitch) ++{ ++ struct wined3d_cs_update_sub_resource *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; ++ op->resource = resource; ++ op->sub_resource_idx = sub_resource_idx; ++ op->box = box; ++ op->data = data; ++ op->row_pitch = row_pitch; ++ op->depth_pitch = depth_pitch; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ /* The data pointer may go away, need to wait until the data is read. Copying the data may be faster. ++ * Don't forget to copy box as well in this case. */ ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2823,6 +2913,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, + /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, + /* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy, ++ /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 6602fc3..a46f944 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4019,13 +4019,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str + unsigned int depth_pitch) + { + struct wined3d_resource *sub_resource; +- const struct wined3d_gl_info *gl_info; +- struct wined3d_const_bo_address addr; +- struct wined3d_context *context; + struct wined3d_texture *texture; +- struct wined3d_surface *surface; +- POINT dst_point; +- RECT src_rect; + + TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", + device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); +@@ -4059,10 +4053,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str + WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); + return; + } +- surface = surface_from_resource(sub_resource); + +- src_rect.left = 0; +- src_rect.top = 0; + if (box) + { + if (box->left >= box->right || box->right > sub_resource->width +@@ -4072,41 +4063,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str + WARN("Invalid box %s specified.\n", debug_box(box)); + return; + } +- +- src_rect.right = box->right - box->left; +- src_rect.bottom = box->bottom - box->top; +- dst_point.x = box->left; +- dst_point.y = box->top; + } +- else +- { +- src_rect.right = sub_resource->width; +- src_rect.bottom = sub_resource->height; +- dst_point.x = 0; +- dst_point.y = 0; +- } +- +- addr.buffer_object = 0; +- addr.addr = data; +- +- context = context_acquire(resource->device, NULL); +- gl_info = context->gl_info; +- +- /* Only load the surface for partial updates. */ +- if (!dst_point.x && !dst_point.y && src_rect.right == sub_resource->width +- && src_rect.bottom == sub_resource->height) +- wined3d_texture_prepare_texture(texture, context, FALSE); +- else +- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); +- wined3d_texture_bind_and_dirtify(texture, context, FALSE); +- +- wined3d_surface_upload_data(surface, gl_info, resource->format, +- &src_rect, row_pitch, &dst_point, FALSE, &addr); +- +- context_release(context); + +- wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); +- wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); + } + + HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f73c482..3789c55 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2939,6 +2939,9 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, + void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, ++ unsigned int depth_pitch) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Send-update_sub_resource-calls-through-the-c.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Send-update_sub_resource-calls-through-the-c.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Send-update_sub_resource-calls-through-the-c.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Send-update_sub_resource-calls-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -From 6e0637c6122e1cb792ae028ab60d45b91fb4d3a2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 4 Sep 2015 15:22:49 +0200 -Subject: wined3d: Send update_sub_resource calls through the command stream. - ---- - dlls/wined3d/cs.c | 91 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 43 +------------------- - dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 95 insertions(+), 42 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 01c4ba3..277291b 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -94,6 +94,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_GETDC, - WINED3D_CS_OP_RELEASEDC, - WINED3D_CS_OP_SAMPLER_DESTROY, -+ WINED3D_CS_OP_UPDATE_SUB_RESOURCE, - WINED3D_CS_OP_STOP, - }; - -@@ -564,6 +565,15 @@ struct wined3d_cs_sampler_destroy - struct wined3d_sampler *sampler; - }; - -+struct wined3d_cs_update_sub_resource -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+ unsigned int sub_resource_idx, row_pitch, depth_pitch; -+ const struct wined3d_box *box; -+ const void *data; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2785,6 +2795,86 @@ void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampl - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_sub_resource *op = data; -+ -+ struct wined3d_resource *sub_resource; -+ const struct wined3d_gl_info *gl_info; -+ struct wined3d_const_bo_address addr; -+ struct wined3d_context *context; -+ struct wined3d_texture *texture; -+ struct wined3d_surface *surface; -+ POINT dst_point; -+ RECT src_rect; -+ -+ texture = wined3d_texture_from_resource(op->resource); -+ sub_resource = wined3d_texture_get_sub_resource(texture, op->sub_resource_idx); -+ surface = surface_from_resource(sub_resource); -+ -+ src_rect.left = 0; -+ src_rect.top = 0; -+ if (op->box) -+ { -+ src_rect.right = op->box->right - op->box->left; -+ src_rect.bottom = op->box->bottom - op->box->top; -+ dst_point.x = op->box->left; -+ dst_point.y = op->box->top; -+ } -+ else -+ { -+ src_rect.right = sub_resource->width; -+ src_rect.bottom = sub_resource->height; -+ dst_point.x = 0; -+ dst_point.y = 0; -+ } -+ -+ addr.buffer_object = 0; -+ addr.addr = op->data; -+ -+ context = context_acquire(cs->device, NULL); -+ gl_info = context->gl_info; -+ -+ /* Only load the surface for partial updates. */ -+ if (!dst_point.x && !dst_point.y && src_rect.right == sub_resource->width -+ && src_rect.bottom == sub_resource->height) -+ wined3d_texture_prepare_texture(texture, context, FALSE); -+ else -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_texture_bind_and_dirtify(texture, context, FALSE); -+ -+ wined3d_surface_upload_data(surface, gl_info, op->resource->format, -+ &src_rect, op->row_pitch, &dst_point, FALSE, &addr); -+ -+ context_release(context); -+ -+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, -+ unsigned int depth_pitch) -+{ -+ struct wined3d_cs_update_sub_resource *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; -+ op->resource = resource; -+ op->sub_resource_idx = sub_resource_idx; -+ op->box = box; -+ op->data = data; -+ op->row_pitch = row_pitch; -+ op->depth_pitch = depth_pitch; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ /* The data pointer may go away, need to wait until the data is read. Copying the data may be faster. -+ * Don't forget to copy box as well in this case. */ -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2857,6 +2947,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, - /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, - /* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy, -+ /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a6766e5..93498d8 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3934,13 +3934,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - unsigned int depth_pitch) - { - struct wined3d_resource *sub_resource; -- const struct wined3d_gl_info *gl_info; -- struct wined3d_const_bo_address addr; -- struct wined3d_context *context; - struct wined3d_texture *texture; -- struct wined3d_surface *surface; -- POINT dst_point; -- RECT src_rect; - - TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n", - device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); -@@ -3957,10 +3951,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); - return; - } -- surface = surface_from_resource(sub_resource); - -- src_rect.left = 0; -- src_rect.top = 0; - if (box) - { - if (box->left >= box->right || box->right > sub_resource->width -@@ -3970,41 +3961,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - box->left, box->top, box->front, box->right, box->bottom, box->back); - return; - } -- -- src_rect.right = box->right - box->left; -- src_rect.bottom = box->bottom - box->top; -- dst_point.x = box->left; -- dst_point.y = box->top; - } -- else -- { -- src_rect.right = sub_resource->width; -- src_rect.bottom = sub_resource->height; -- dst_point.x = 0; -- dst_point.y = 0; -- } -- -- addr.buffer_object = 0; -- addr.addr = data; -- -- context = context_acquire(resource->device, NULL); -- gl_info = context->gl_info; -- -- /* Only load the surface for partial updates. */ -- if (!dst_point.x && !dst_point.y && src_rect.right == sub_resource->width -- && src_rect.bottom == sub_resource->height) -- wined3d_texture_prepare_texture(texture, context, FALSE); -- else -- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); -- wined3d_texture_bind_and_dirtify(texture, context, FALSE); -- -- wined3d_surface_upload_data(surface, gl_info, resource->format, -- &src_rect, row_pitch, &dst_point, FALSE, &addr); -- -- context_release(context); - -- wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); -- wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); - } - - HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9125336..d9dd839 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2823,6 +2823,9 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, - void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, -+ unsigned int depth_pitch) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.5.1 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2016-02-08 20:07:32.000000000 +0000 @@ -70,7 +70,7 @@ shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -7855,7 +7863,11 @@ +@@ -7873,7 +7881,11 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -82,7 +82,7 @@ == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { -@@ -7893,6 +7905,7 @@ +@@ -7911,6 +7923,7 @@ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -90,7 +90,7 @@ if (wined3d_settings.cs_multithreaded) context->gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -7904,6 +7917,17 @@ +@@ -7922,6 +7935,17 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -107,7 +107,7 @@ +#endif /* STAGING_CSMT */ } - static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, + static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -646,8 +646,8 @@ /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -1784,7 +1786,9 @@ - out: +@@ -1785,7 +1787,9 @@ + if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); +#if defined(STAGING_CSMT) @@ -656,7 +656,7 @@ HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1819,7 +1823,9 @@ +@@ -1820,7 +1824,9 @@ device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -666,7 +666,7 @@ HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2239,6 +2245,7 @@ +@@ -2240,6 +2246,7 @@ WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -674,7 +674,7 @@ wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); -@@ -2253,6 +2260,22 @@ +@@ -2254,6 +2261,22 @@ return context_generate_rt_mask_from_surface(rt); else return context_generate_rt_mask(context->offscreenBuffer); @@ -697,7 +697,7 @@ } /* Context activation is done by the caller. */ -@@ -2284,7 +2307,11 @@ +@@ -2285,7 +2308,11 @@ } else { @@ -709,7 +709,7 @@ } cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -@@ -2331,7 +2358,11 @@ +@@ -2332,7 +2359,11 @@ DWORD rt_mask = 0, *cur_mask; UINT i; @@ -721,7 +721,7 @@ || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2373,11 +2404,17 @@ +@@ -2374,11 +2405,17 @@ } else { @@ -739,7 +739,7 @@ } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2390,7 +2427,11 @@ +@@ -2391,7 +2428,11 @@ } else { @@ -751,7 +751,7 @@ rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } -@@ -2433,6 +2474,7 @@ +@@ -2434,6 +2475,7 @@ return TRUE; } @@ -759,7 +759,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { struct wined3d_rendertarget_view **rts = state->fb.render_targets; -@@ -2442,6 +2484,18 @@ +@@ -2443,6 +2485,18 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); @@ -778,7 +778,7 @@ else if (!context->render_offscreen) return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); -@@ -2464,8 +2518,14 @@ +@@ -2465,8 +2519,14 @@ /* Context activation is done by the caller. */ void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -793,7 +793,7 @@ DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2496,8 +2556,10 @@ +@@ -2497,8 +2557,10 @@ context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -804,7 +804,7 @@ } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -2744,12 +2806,22 @@ +@@ -2745,12 +2807,22 @@ /* Context activation is done by the caller. */ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -827,7 +827,7 @@ if (rt_mask != *cur_mask) { context_apply_draw_buffers(context, rt_mask); -@@ -2951,7 +3023,11 @@ +@@ -2952,7 +3024,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -839,7 +839,7 @@ context->use_immediate_mode_draw = TRUE; } else -@@ -3136,11 +3212,19 @@ +@@ -3137,11 +3213,19 @@ } /* Context activation is done by the caller. */ @@ -859,7 +859,7 @@ unsigned int i; WORD map; -@@ -3173,12 +3257,17 @@ +@@ -3174,12 +3258,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -877,7 +877,7 @@ } if (state->index_buffer) { -@@ -3273,7 +3362,11 @@ +@@ -3274,7 +3363,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -919,7 +919,7 @@ WINED3D_CS_OP_SET_VS_CONSTS_F, WINED3D_CS_OP_SET_VS_CONSTS_B, WINED3D_CS_OP_SET_VS_CONSTS_I, -@@ -133,6 +141,30 @@ +@@ -132,6 +140,30 @@ float depth; DWORD stencil; RECT rects[1]; @@ -950,7 +950,7 @@ }; struct wined3d_cs_draw -@@ -155,6 +187,7 @@ +@@ -154,6 +186,7 @@ struct wined3d_cs_set_viewport { enum wined3d_cs_op opcode; @@ -958,7 +958,7 @@ struct wined3d_viewport viewport; }; -@@ -162,6 +195,15 @@ +@@ -161,6 +194,15 @@ { enum wined3d_cs_op opcode; RECT rect; @@ -974,7 +974,7 @@ }; struct wined3d_cs_set_rendertarget_view -@@ -289,6 +331,7 @@ +@@ -288,6 +330,7 @@ { enum wined3d_cs_op opcode; enum wined3d_transform_state state; @@ -982,7 +982,7 @@ struct wined3d_matrix matrix; }; -@@ -303,6 +346,22 @@ +@@ -302,6 +345,22 @@ { enum wined3d_cs_op opcode; struct wined3d_material material; @@ -1005,7 +1005,7 @@ }; struct wined3d_cs_reset_state -@@ -310,6 +369,7 @@ +@@ -309,6 +368,7 @@ enum wined3d_cs_op opcode; }; @@ -1013,7 +1013,7 @@ struct wined3d_cs_set_consts_f { enum wined3d_cs_op opcode; -@@ -2881,197 +2941,971 @@ +@@ -2847,197 +2907,971 @@ /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, @@ -1066,7 +1066,6 @@ - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -- /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, @@ -1291,6 +1290,7 @@ +void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) { - wined3d_cs_mt_require_space, +- wined3d_cs_mt_require_space_prio, + struct wined3d_cs_set_viewport *op; + + op = cs->ops->require_space(cs, sizeof(*op)); @@ -1999,7 +1999,6 @@ + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -+ /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, @@ -2141,10 +2140,11 @@ +static const struct wined3d_cs_ops wined3d_cs_mt_ops = +{ + wined3d_cs_mt_require_space, - wined3d_cs_mt_require_space_prio, ++ wined3d_cs_mt_require_space_prio, wined3d_cs_mt_submit, wined3d_cs_mt_submit_prio, -@@ -3294,5 +4128,80 @@ + wined3d_cs_mt_finish, +@@ -3259,5 +4093,80 @@ ERR("Closing event failed.\n"); } @@ -2341,7 +2341,7 @@ { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -921,7 +969,11 @@ +@@ -923,7 +971,11 @@ BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; unsigned int i; @@ -2353,7 +2353,7 @@ { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -939,7 +991,13 @@ +@@ -941,7 +993,13 @@ struct wined3d_swapchain_desc *swapchain_desc) { static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -2367,7 +2367,7 @@ DWORD clear_flags = 0; HRESULT hr; -@@ -950,6 +1008,11 @@ +@@ -952,6 +1010,11 @@ if (device->wined3d->flags & WINED3D_NO3D) return WINED3DERR_INVALIDCALL; @@ -2379,7 +2379,7 @@ if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -990,8 +1053,16 @@ +@@ -1000,8 +1063,16 @@ device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -2396,7 +2396,7 @@ device->contexts[0]->last_was_rhw = 0; -@@ -1003,7 +1074,11 @@ +@@ -1013,7 +1084,11 @@ case ORM_BACKBUFFER: { @@ -2408,7 +2408,7 @@ { TRACE("Using auxiliary buffer for offscreen rendering\n"); device->offscreenBuffer = GL_AUX0; -@@ -1015,9 +1090,16 @@ +@@ -1025,9 +1100,16 @@ } } } @@ -2425,7 +2425,7 @@ /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) -@@ -1034,6 +1116,9 @@ +@@ -1044,6 +1126,9 @@ return WINED3D_OK; err_out: @@ -2435,7 +2435,7 @@ HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1091,6 +1176,10 @@ +@@ -1101,6 +1186,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { struct wined3d_resource *resource, *cursor; @@ -2446,7 +2446,7 @@ struct wined3d_surface *surface; UINT i; -@@ -1099,6 +1188,7 @@ +@@ -1109,6 +1198,7 @@ if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; @@ -2454,7 +2454,7 @@ if (wined3d_settings.cs_multithreaded) device->cs->ops->finish(device->cs); -@@ -1137,6 +1227,83 @@ +@@ -1147,6 +1237,83 @@ /* FIXME: Is this in the right place??? */ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); @@ -2538,7 +2538,7 @@ if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1154,6 +1321,11 @@ +@@ -1164,6 +1331,11 @@ device->swapchains = NULL; device->swapchain_count = 0; @@ -2550,7 +2550,7 @@ device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1540,6 +1712,16 @@ +@@ -1550,6 +1722,16 @@ TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", light->range, light->falloff, light->theta, light->phi); @@ -2567,7 +2567,7 @@ /* Save away the information. */ object->OriginalParms = *light; -@@ -1619,9 +1801,11 @@ +@@ -1629,9 +1811,11 @@ FIXME("Unrecognized light type %#x.\n", light->type); } @@ -2579,7 +2579,7 @@ return WINED3D_OK; } -@@ -1694,6 +1878,14 @@ +@@ -1704,6 +1888,14 @@ { if (light_info->glIndex != -1) { @@ -2594,7 +2594,7 @@ device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1735,11 +1927,23 @@ +@@ -1745,11 +1937,23 @@ WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -2618,7 +2618,7 @@ return WINED3D_OK; } -@@ -1914,9 +2118,11 @@ +@@ -1924,9 +2128,11 @@ TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -2630,7 +2630,7 @@ } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -1961,7 +2167,11 @@ +@@ -1972,7 +2178,11 @@ || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -2641,8 +2641,8 @@ +#endif /* STAGING_CSMT */ return; - wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -2288,7 +2498,11 @@ + SetRect(&dst_rect, 0, 0, surface->resource.width, surface->resource.height); +@@ -2301,7 +2511,11 @@ return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -2654,7 +2654,7 @@ { UINT i; -@@ -2321,8 +2535,12 @@ +@@ -2334,8 +2548,12 @@ } else { @@ -2667,7 +2667,7 @@ } return WINED3D_OK; -@@ -2369,8 +2587,12 @@ +@@ -2382,8 +2600,12 @@ } else { @@ -2680,7 +2680,7 @@ } return WINED3D_OK; -@@ -2421,8 +2643,13 @@ +@@ -2434,8 +2656,13 @@ memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); else @@ -2694,7 +2694,7 @@ return WINED3D_OK; } -@@ -2557,8 +2784,12 @@ +@@ -2570,8 +2797,12 @@ } else { @@ -2707,7 +2707,7 @@ } return WINED3D_OK; -@@ -2605,8 +2836,12 @@ +@@ -2618,8 +2849,12 @@ } else { @@ -2720,7 +2720,7 @@ } return WINED3D_OK; -@@ -2658,8 +2893,12 @@ +@@ -2671,8 +2906,12 @@ memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); else @@ -2733,7 +2733,7 @@ return WINED3D_OK; } -@@ -2819,6 +3058,7 @@ +@@ -2832,6 +3071,7 @@ return hr; } @@ -2741,7 +2741,7 @@ if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2826,6 +3066,7 @@ +@@ -2839,6 +3079,7 @@ device->cs->ops->finish(device->cs); } @@ -2749,7 +2749,7 @@ wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3311,6 +3552,10 @@ +@@ -3324,6 +3565,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -2760,7 +2760,7 @@ TRACE("device %p.\n", device); if (!device->inScene) -@@ -3319,6 +3564,15 @@ +@@ -3332,6 +3577,15 @@ return WINED3DERR_INVALIDCALL; } @@ -2776,7 +2776,7 @@ device->inScene = FALSE; return WINED3D_OK; } -@@ -3326,8 +3580,10 @@ +@@ -3339,8 +3593,10 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -2787,7 +2787,7 @@ TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3336,12 +3592,19 @@ +@@ -3349,12 +3605,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -2807,7 +2807,7 @@ if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3350,8 +3613,13 @@ +@@ -3363,8 +3626,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -2821,7 +2821,7 @@ { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3397,6 +3665,9 @@ +@@ -3410,6 +3678,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -2831,7 +2831,7 @@ TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3404,8 +3675,13 @@ +@@ -3417,8 +3688,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -2845,7 +2845,7 @@ } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3428,6 +3704,14 @@ +@@ -3441,6 +3717,14 @@ return WINED3DERR_INVALIDCALL; } @@ -2860,7 +2860,7 @@ wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3444,6 +3728,10 @@ +@@ -3457,6 +3741,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -2871,7 +2871,7 @@ TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); if (!device->state.index_buffer) -@@ -3462,6 +3750,15 @@ +@@ -3475,6 +3763,15 @@ return WINED3DERR_INVALIDCALL; } @@ -2887,7 +2887,7 @@ wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3477,6 +3774,7 @@ +@@ -3490,6 +3787,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -2895,10 +2895,10 @@ static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3513,6 +3811,88 @@ - { +@@ -3529,6 +3827,97 @@ enum wined3d_resource_type type = src_texture->resource.type; - unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; + + layer_count = src_texture->layer_count; +#else /* STAGING_CSMT */ +static HRESULT device_update_volume(struct wined3d_device *device, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) @@ -2948,8 +2948,9 @@ +HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) +{ ++ unsigned int src_size, dst_size, src_skip_levels = 0; ++ unsigned int layer_count, level_count, i, j; + enum wined3d_resource_type type; -+ unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; + HRESULT hr; + struct wined3d_context *context; + @@ -2980,11 +2981,19 @@ + WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); + return WINED3DERR_INVALIDCALL; + } ++ ++ layer_count = src_texture->layer_count; ++ if (layer_count != dst_texture->layer_count) ++ { ++ WARN("Source and destination have different layer counts.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ +#endif /* STAGING_CSMT */ - level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3531,7 +3911,13 @@ + +@@ -3546,7 +3935,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -2998,32 +3007,14 @@ /* Update every surface level of the texture. */ switch (type) -@@ -3546,7 +3932,16 @@ - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); -+#if defined(STAGING_CSMT) - surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); -+#else /* STAGING_CSMT */ -+ hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -+ if (FAILED(hr)) -+ { -+ WARN("Failed to update surface, hr %#x.\n", hr); -+ return hr; -+ } -+#endif /* STAGING_CSMT */ - } - break; - } -@@ -3566,7 +3961,16 @@ +@@ -3566,7 +3961,15 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); +#if defined(STAGING_CSMT) surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); +#else /* STAGING_CSMT */ -+ hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -+ if (FAILED(hr)) ++ if (FAILED(hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL))) + { + WARN("Failed to update surface, hr %#x.\n", hr); + return hr; @@ -3032,7 +3023,7 @@ } } break; -@@ -3576,6 +3980,7 @@ +@@ -3576,6 +3979,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3040,7 +3031,7 @@ device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)), -@@ -3629,6 +4034,25 @@ +@@ -3637,6 +4041,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3066,7 +3057,7 @@ return WINED3D_OK; } -@@ -3678,8 +4102,13 @@ +@@ -3686,8 +4109,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3080,7 +3071,7 @@ if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3778,6 +4207,7 @@ +@@ -3786,6 +4214,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -3088,7 +3079,7 @@ const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3785,6 +4215,7 @@ +@@ -3793,6 +4222,7 @@ RECT r, dst_rect; POINT p; @@ -3096,7 +3087,7 @@ TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3796,6 +4227,7 @@ +@@ -3804,6 +4234,7 @@ return WINED3DERR_INVALIDCALL; } @@ -3104,7 +3095,7 @@ if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3860,6 +4292,9 @@ +@@ -3868,6 +4299,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -3114,25 +3105,25 @@ } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -4032,7 +4467,17 @@ +@@ -4042,7 +4476,17 @@ unsigned int depth_pitch) { struct wined3d_resource *sub_resource; +#if defined(STAGING_CSMT) -+ struct wined3d_texture *texture; + struct wined3d_texture *texture; +#else /* STAGING_CSMT */ + const struct wined3d_gl_info *gl_info; + struct wined3d_const_bo_address addr; + struct wined3d_context *context; - struct wined3d_texture *texture; ++ struct wined3d_texture *texture; + struct wined3d_surface *surface; + POINT dst_point; + RECT src_rect; +#endif /* STAGING_CSMT */ - TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n", - device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); -@@ -4066,7 +4511,14 @@ + TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", + device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); +@@ -4076,7 +4520,14 @@ WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -3147,8 +3138,8 @@ if (box) { if (box->left >= box->right || box->right > sub_resource->width -@@ -4077,9 +4529,47 @@ - box->left, box->top, box->front, box->right, box->bottom, box->back); +@@ -4086,9 +4537,47 @@ + WARN("Invalid box %s specified.\n", debug_box(box)); return; } +#if defined(STAGING_CSMT) @@ -3195,7 +3186,7 @@ } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4110,8 +4600,14 @@ +@@ -4119,8 +4608,14 @@ rect = &r; } @@ -3210,7 +3201,7 @@ } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -4125,6 +4621,7 @@ +@@ -4134,6 +4629,7 @@ return NULL; } @@ -3218,7 +3209,7 @@ return device->state.fb.render_targets[view_idx]; } -@@ -4140,6 +4637,22 @@ +@@ -4149,6 +4645,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -3241,7 +3232,7 @@ TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4179,6 +4692,7 @@ +@@ -4188,6 +4700,7 @@ } @@ -3249,7 +3240,7 @@ prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -4186,6 +4700,15 @@ +@@ -4195,6 +4708,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -3265,7 +3256,7 @@ wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4197,6 +4720,7 @@ +@@ -4206,6 +4728,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -3273,7 +3264,7 @@ struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -4214,6 +4738,66 @@ +@@ -4223,6 +4746,66 @@ wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) wined3d_rendertarget_view_decref(prev); @@ -3315,7 +3306,7 @@ + data.row_pitch = map_desc.row_pitch; + data.slice_pitch = map_desc.slice_pitch; + -+ desc.resource_type = WINED3D_RTYPE_TEXTURE; ++ desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; + desc.format = WINED3DFMT_B8G8R8A8_UNORM; + desc.multisample_type = WINED3D_MULTISAMPLE_NONE; + desc.multisample_quality = 0; @@ -3326,7 +3317,7 @@ + desc.depth = 1; + desc.size = 0; + -+ hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, ++ hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, + &data, NULL, &wined3d_null_parent_ops, &texture); + wined3d_surface_unmap(cursor_image); + if (FAILED(hr)) @@ -3340,7 +3331,7 @@ } HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, -@@ -4234,6 +4818,14 @@ +@@ -4243,6 +4826,14 @@ cursor_image = surface_from_resource(sub_resource); @@ -3355,7 +3346,7 @@ if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) { WARN("Surface %p has an invalid format %s.\n", -@@ -4261,6 +4853,13 @@ +@@ -4270,6 +4861,13 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -3369,7 +3360,7 @@ if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) { -@@ -4365,6 +4964,12 @@ +@@ -4374,6 +4972,12 @@ else SetCursor(NULL); } @@ -3382,7 +3373,7 @@ return oldVisible; } -@@ -4375,8 +4980,10 @@ +@@ -4384,8 +4988,10 @@ TRACE("device %p.\n", device); @@ -3393,7 +3384,7 @@ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4384,6 +4991,7 @@ +@@ -4393,6 +4999,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -3401,7 +3392,7 @@ wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4402,6 +5010,37 @@ +@@ -4411,6 +5018,37 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -3439,7 +3430,7 @@ if (device->depth_blt_texture) { -@@ -4423,6 +5062,7 @@ +@@ -4432,6 +5070,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -3447,7 +3438,7 @@ swapchain->num_contexts = 0; } -@@ -4442,6 +5082,14 @@ +@@ -4451,6 +5090,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -3462,7 +3453,7 @@ HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4458,6 +5106,7 @@ +@@ -4467,6 +5114,7 @@ return hr; } @@ -3470,7 +3461,7 @@ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4468,6 +5117,35 @@ +@@ -4477,6 +5125,35 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -3506,7 +3497,7 @@ return WINED3D_OK; } -@@ -4486,9 +5164,11 @@ +@@ -4496,9 +5173,11 @@ TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -3518,7 +3509,7 @@ if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4503,9 +5183,21 @@ +@@ -4513,9 +5192,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -3540,7 +3531,7 @@ { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4514,6 +5206,7 @@ +@@ -4524,6 +5215,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -3548,7 +3539,7 @@ if (reset_state) { state_unbind_resources(&device->state); -@@ -4523,6 +5216,12 @@ +@@ -4533,6 +5225,12 @@ { wined3d_texture_decref(device->cs->onscreen_depth_stencil->container); device->cs->onscreen_depth_stencil = NULL; @@ -3561,7 +3552,7 @@ } if (reset_state) -@@ -4535,6 +5234,7 @@ +@@ -4545,6 +5243,7 @@ } } @@ -3569,7 +3560,7 @@ /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4556,6 +5256,7 @@ +@@ -4566,6 +5265,7 @@ } device->cs->ops->finish(device->cs); @@ -3577,7 +3568,7 @@ TRACE("New params:\n"); TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); -@@ -4682,6 +5383,13 @@ +@@ -4692,6 +5392,13 @@ swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) return hr; @@ -3591,7 +3582,7 @@ if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc texture_desc; -@@ -4724,6 +5432,13 @@ +@@ -4733,6 +5440,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -3602,10 +3593,10 @@ + device->back_buffer_view = NULL; + } +#endif /* STAGING_CSMT */ - if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), - NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4744,12 +5459,20 @@ + if (swapchain->desc.backbuffer_count) + { + view_desc.format_id = swapchain_desc->backbuffer_format; +@@ -4759,12 +5473,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -3626,7 +3617,7 @@ &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4758,6 +5481,7 @@ +@@ -4773,6 +5495,7 @@ } else if (device->back_buffer_view) { @@ -3634,7 +3625,7 @@ struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4773,6 +5497,24 @@ +@@ -4788,6 +5511,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -3659,7 +3650,7 @@ wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4848,6 +5590,10 @@ +@@ -4870,6 +5611,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -3670,7 +3661,7 @@ switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4858,6 +5604,7 @@ +@@ -4880,6 +5625,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -3678,7 +3669,7 @@ if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4869,6 +5616,19 @@ +@@ -4891,6 +5637,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -3698,7 +3689,7 @@ } } break; -@@ -5031,7 +5791,11 @@ +@@ -5052,7 +5811,11 @@ device->blitter = adapter->blitter; @@ -3710,7 +3701,7 @@ &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -5130,6 +5894,7 @@ +@@ -5151,6 +5914,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -3718,7 +3709,7 @@ /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5183,3 +5948,4 @@ +@@ -5204,3 +5968,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -3726,7 +3717,7 @@ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5555,9 +5555,15 @@ +@@ -5554,9 +5554,15 @@ DebugBreak(); } @@ -3980,7 +3971,7 @@ unsigned int i, extra_constants_needed = 0; const struct wined3d_shader_lconst *lconst; const char *prefix; -@@ -1905,7 +1913,11 @@ +@@ -1928,7 +1936,11 @@ { UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); @@ -3992,7 +3983,7 @@ declare_in_varying(gl_info, buffer, FALSE, "vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } -@@ -1946,6 +1958,7 @@ +@@ -1969,6 +1981,7 @@ } else { @@ -4000,7 +3991,7 @@ /* This happens because we do not have proper tracking of the * constant registers that are actually used, only the max * limit of the shader version. -@@ -1954,6 +1967,23 @@ +@@ -1977,6 +1990,23 @@ * it and just create the uniform. */ FIXME("Cannot find a free uniform for vpos correction params\n"); @@ -4554,7 +4545,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -203,7 +203,9 @@ +@@ -213,7 +213,9 @@ ERR("Failed to allocate system memory.\n"); return E_OUTOFMEMORY; } @@ -4564,7 +4555,7 @@ } else { -@@ -227,6 +229,7 @@ +@@ -237,6 +239,7 @@ return WINED3D_OK; } @@ -4572,7 +4563,7 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); -@@ -252,6 +255,7 @@ +@@ -262,6 +265,7 @@ resource->map_heap_memory = NULL; } @@ -4580,7 +4571,7 @@ void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; -@@ -264,7 +268,11 @@ +@@ -274,7 +278,11 @@ adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -4592,7 +4583,7 @@ device_resource_released(resource->device, resource); } -@@ -274,9 +282,11 @@ +@@ -284,9 +292,11 @@ if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -4604,7 +4595,7 @@ context_resource_unloaded(resource->device, resource, resource->type); } -@@ -355,7 +365,11 @@ +@@ -365,7 +375,11 @@ p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; *p = mem; @@ -4616,7 +4607,7 @@ return TRUE; } -@@ -421,7 +435,11 @@ +@@ -431,7 +445,11 @@ return ret; } @@ -4628,7 +4619,7 @@ { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -462,6 +480,7 @@ +@@ -472,6 +490,7 @@ else resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; } @@ -4636,7 +4627,7 @@ void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, UINT *slice_pitch) -@@ -1040,3 +1059,4 @@ +@@ -1046,3 +1065,4 @@ wined3d_resource_invalidate_location(resource, ~resource->map_binding); } @@ -4680,7 +4671,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -1904,7 +1904,11 @@ +@@ -2073,7 +2073,11 @@ } } @@ -4692,7 +4683,7 @@ { HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); -@@ -2163,10 +2167,16 @@ +@@ -2332,10 +2336,16 @@ if (!refcount) { @@ -4709,7 +4700,7 @@ } return refcount; -@@ -2449,7 +2459,11 @@ +@@ -2618,7 +2628,11 @@ memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) { @@ -5370,7 +5361,51 @@ else wined3d_surface_prepare(dst_surface, old_ctx, dst_location); -@@ -954,6 +1190,18 @@ +@@ -923,8 +1159,13 @@ + { + struct wined3d_resource *resource = &surface->container->resource; + struct wined3d_device *device = resource->device; ++#if defined(STAGING_CSMT) + struct wined3d_rendertarget_view view; + struct wined3d_texture *texture = surface->container; ++#else /* STAGING_CSMT */ ++ struct wined3d_rendertarget_view_desc view_desc; ++ struct wined3d_rendertarget_view *view; ++#endif /* STAGING_CSMT */ + const struct blit_shader *blitter; + HRESULT hr; + +@@ -935,6 +1176,7 @@ + return WINED3DERR_INVALIDCALL; + } + ++#if defined(STAGING_CSMT) + view.resource = &surface->container->resource; + view.parent = NULL; + view.parent_ops = &wined3d_null_parent_ops; +@@ -946,6 +1188,21 @@ + view.sub_resource_idx = surface->texture_layer * texture->level_count + surface->texture_level; + + hr = blitter->depth_fill(device, &view, rect, depth); ++#else /* STAGING_CSMT */ ++ view_desc.format_id = resource->format->id; ++ view_desc.u.texture.level_idx = surface->texture_level; ++ view_desc.u.texture.layer_idx = surface->texture_layer; ++ view_desc.u.texture.layer_count = 1; ++ if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, ++ resource, NULL, &wined3d_null_parent_ops, &view))) ++ { ++ ERR("Failed to create rendertarget view, hr %#x.\n", hr); ++ return hr; ++ } ++ ++ hr = blitter->depth_fill(device, view, rect, depth); ++ wined3d_rendertarget_view_decref(view); ++#endif /* STAGING_CSMT */ + + return hr; + } +@@ -968,6 +1225,18 @@ return WINED3D_OK; } @@ -5388,8 +5423,8 @@ +#endif /* STAGING_CSMT */ static ULONG surface_resource_incref(struct wined3d_resource *resource) { - return wined3d_surface_incref(surface_from_resource(resource)); -@@ -979,6 +1227,7 @@ + struct wined3d_surface *surface = surface_from_resource(resource); +@@ -1001,6 +1270,7 @@ if (resource->pool == WINED3D_POOL_DEFAULT) { @@ -5397,7 +5432,7 @@ /* Default pool resources are supposed to be destroyed before Reset is called. * Implicit resources stay however. So this means we have an implicit render target * or depth stencil. The content may be destroyed, but we still have to tear down -@@ -992,6 +1241,40 @@ +@@ -1014,6 +1284,40 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } @@ -5438,7 +5473,7 @@ /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1035,6 +1318,7 @@ +@@ -1057,6 +1361,7 @@ return WINED3DERR_INVALIDCALL; } @@ -5446,7 +5481,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1050,6 +1334,21 @@ +@@ -1072,6 +1377,21 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -5468,7 +5503,7 @@ }; /***************************************************************************** -@@ -1093,6 +1392,7 @@ +@@ -1115,6 +1435,7 @@ return WINED3D_OK; } @@ -5476,7 +5511,7 @@ static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1102,6 +1402,23 @@ +@@ -1124,6 +1445,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -5500,7 +5535,7 @@ }; /* This call just downloads data, the caller is responsible for binding the -@@ -1120,7 +1437,11 @@ +@@ -1142,7 +1480,11 @@ return; } @@ -5512,7 +5547,7 @@ if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1148,6 +1469,7 @@ +@@ -1170,6 +1512,7 @@ void *mem; GLenum gl_format = format->glFormat; GLenum gl_type = format->glType; @@ -5520,7 +5555,7 @@ UINT src_pitch = 0; UINT dst_row_pitch, dst_slice_pitch; -@@ -1156,6 +1478,16 @@ +@@ -1178,6 +1521,16 @@ unsigned char alignment = surface->resource.device->surface_alignment; src_pitch = format->byte_count * surface->pow2Width; wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); @@ -5537,7 +5572,7 @@ src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); } -@@ -1242,12 +1574,21 @@ +@@ -1264,12 +1617,21 @@ * won't be released, and doesn't have to be re-read. */ src_data = mem; dst_data = data.addr; @@ -5559,7 +5594,7 @@ } HeapFree(GetProcessHeap(), 0, mem); -@@ -1371,6 +1712,7 @@ +@@ -1393,6 +1755,7 @@ static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { @@ -5567,7 +5602,7 @@ if ((box->left >= box->right) || (box->top >= box->bottom) || (box->right > surface->resource.width) -@@ -1381,6 +1723,34 @@ +@@ -1403,6 +1766,34 @@ } BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) @@ -5602,7 +5637,7 @@ { struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1}; -@@ -1399,7 +1769,11 @@ +@@ -1421,7 +1812,11 @@ UINT update_w, update_h; UINT dst_w, dst_h; RECT r, dst_rect; @@ -5614,7 +5649,7 @@ POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1470,11 +1844,17 @@ +@@ -1492,11 +1887,17 @@ return WINED3DERR_INVALIDCALL; } @@ -5632,7 +5667,7 @@ context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1485,6 +1865,7 @@ +@@ -1507,6 +1908,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -5640,7 +5675,7 @@ wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); -@@ -1498,6 +1879,21 @@ +@@ -1520,6 +1922,21 @@ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -5662,7 +5697,7 @@ return WINED3D_OK; } -@@ -1611,6 +2007,7 @@ +@@ -1633,6 +2050,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -5670,7 +5705,7 @@ if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1619,6 +2016,16 @@ +@@ -1641,6 +2059,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -5687,33 +5722,7 @@ surface_evict_sysmem(surface); } -@@ -1701,6 +2108,7 @@ - - void CDECL wined3d_surface_preload(struct wined3d_surface *surface) - { -+#if defined(STAGING_CSMT) - const struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - -@@ -1711,6 +2119,17 @@ - } - - wined3d_cs_emit_surface_preload(device->cs, surface); -+#else /* STAGING_CSMT */ -+ TRACE("surface %p.\n", surface); -+ -+ if (!surface->resource.device->d3d_initialized) -+ { -+ ERR("D3D not initialized.\n"); -+ return; -+ } -+ -+ wined3d_texture_preload(surface->container); -+#endif /* STAGING_CSMT */ - } - - void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1729,10 +2148,28 @@ +@@ -1723,10 +2151,28 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { @@ -5742,7 +5751,7 @@ } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) -@@ -1857,6 +2294,7 @@ +@@ -1851,6 +2297,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -5750,7 +5759,7 @@ surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1865,6 +2303,15 @@ +@@ -1859,6 +2306,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -5766,7 +5775,7 @@ width = texture_resource->width; height = texture_resource->height; -@@ -1890,6 +2337,7 @@ +@@ -1884,6 +2340,7 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -5774,7 +5783,7 @@ if ((surface->resource.user_memory = mem)) { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; -@@ -1910,6 +2358,27 @@ +@@ -1904,6 +2361,27 @@ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); @@ -5802,7 +5811,7 @@ } /* The format might be changed to a format that needs conversion. -@@ -1932,11 +2401,19 @@ +@@ -1926,11 +2404,19 @@ if (!valid_location) { @@ -5822,7 +5831,7 @@ return WINED3D_OK; } -@@ -2295,6 +2772,7 @@ +@@ -2289,6 +2775,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -5830,7 +5839,7 @@ void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2303,6 +2781,13 @@ +@@ -2297,6 +2784,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -5844,7 +5853,7 @@ conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2326,6 +2811,7 @@ +@@ -2321,6 +2815,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -5852,7 +5861,7 @@ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2366,6 +2852,32 @@ +@@ -2361,6 +2856,32 @@ if (context) context_release(context); return NULL; @@ -5885,15 +5894,15 @@ } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2433,6 +2945,7 @@ +@@ -2423,6 +2944,7 @@ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { +#if defined(STAGING_CSMT) HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2443,6 +2956,20 @@ +@@ -2433,6 +2955,20 @@ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); return hr; @@ -5913,8 +5922,8 @@ +#endif /* STAGING_CSMT */ } - HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -@@ -2450,10 +2977,25 @@ + HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, +@@ -2440,6 +2976,21 @@ { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -5923,12 +5932,9 @@ + struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + BYTE *base_memory; - -- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box -- && !surface_check_block_align(surface, box)) -- { -+ TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", -+ surface, map_desc, box, flags); ++ ++ TRACE("surface %p, map_desc %p, box %s, flags %#x.\n", ++ surface, map_desc, debug_box(box), flags); + + if (surface->resource.map_count) + { @@ -5936,14 +5942,10 @@ + return WINED3DERR_INVALIDCALL; + } +#endif /* STAGING_CSMT */ -+ -+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box -+ && !surface_check_block_align(surface, box)) -+ { - WARN("Map rect %p is misaligned for %ux%u blocks.\n", - box, format->block_width, format->block_height); -@@ -2461,6 +3003,13 @@ + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box + && !surface_check_block_align(surface, box)) +@@ -2451,6 +3002,13 @@ return WINED3DERR_INVALIDCALL; } @@ -5957,7 +5959,7 @@ /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2476,6 +3025,7 @@ +@@ -2466,6 +3024,7 @@ } } @@ -5965,10 +5967,10 @@ if (box) { surface->lockedRect.left = box->left; -@@ -2499,6 +3049,120 @@ - HRESULT hr; - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; +@@ -2555,6 +3114,119 @@ + DWORD slice_pitch, pitch; + + wined3d_resource_get_memory(&surface->resource, dst_location, &data); +#else /* STAGING_CSMT */ + surface_prepare_map_memory(surface); + if (flags & WINED3D_MAP_DISCARD) @@ -6067,122 +6069,25 @@ + return WINED3D_OK; +} + -+HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) ++static void read_from_framebuffer(struct wined3d_surface *surface, ++ struct wined3d_context *old_ctx, DWORD dst_location) +{ -+ HRESULT hr; + struct wined3d_device *device = surface->resource.device; -+ struct wined3d_context *context = NULL; -+ -+ TRACE("surface %p, dc %p.\n", surface, dc); -+ -+ /* Give more detailed info for ddraw. */ -+ if (surface->flags & SFLAG_DCINUSE) -+ return WINEDDERR_DCALREADYCREATED; -+ -+ /* Can't GetDC if the surface is locked. */ -+ if (surface->resource.map_count) -+ return WINED3DERR_INVALIDCALL; -+#endif /* STAGING_CSMT */ - - if (device->d3d_initialized) - context = context_acquire(surface->resource.device, NULL); -@@ -2510,6 +3174,7 @@ - { - if (context) - context_release(context); -+#if defined(STAGING_CSMT) - return; - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -@@ -2557,6 +3222,50 @@ - void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) - { - if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -+#else /* STAGING_CSMT */ -+ return WINED3DERR_INVALIDCALL; -+ } -+ if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -+ || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -+ || surface->pbo)) -+ surface->resource.map_binding = WINED3D_LOCATION_DIB; -+ } -+ -+ surface_load_location(surface, context, WINED3D_LOCATION_DIB); -+ surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); -+ -+ if (context) -+ context_release(context); -+ -+ surface->flags |= SFLAG_DCINUSE; -+ surface->resource.map_count++; -+ -+ *dc = surface->hDC; -+ TRACE("Returning dc %p.\n", *dc); -+ -+ return WINED3D_OK; -+} -+ -+HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -+{ -+ TRACE("surface %p, dc %p.\n", surface, dc); -+ -+ if (!(surface->flags & SFLAG_DCINUSE)) -+ return WINEDDERR_NODC; -+ -+ if (surface->hDC != dc) -+ { -+ WARN("Application tries to release invalid DC %p, surface DC is %p.\n", -+ dc, surface->hDC); -+ return WINEDDERR_NODC; -+ } -+ -+ surface->resource.map_count--; -+ surface->flags &= ~SFLAG_DCINUSE; -+ -+ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -+ || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -+#endif /* STAGING_CSMT */ - && surface->resource.map_binding != WINED3D_LOCATION_DIB)) - { - /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2572,6 +3281,7 @@ - if (device->d3d_initialized) - context = context_acquire(device, NULL); - -+#if defined(STAGING_CSMT) - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); - if (context) -@@ -2597,6 +3307,13 @@ - surface->flags &= ~SFLAG_DCINUSE; - - wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); -+#else /* STAGING_CSMT */ -+ surface_load_location(surface, context, surface->resource.map_binding); -+ surface_invalidate_location(surface, WINED3D_LOCATION_DIB); -+ if (context) -+ context_release(context); -+ } -+#endif /* STAGING_CSMT */ - - return WINED3D_OK; - } -@@ -2613,9 +3330,14 @@ - int i; - BOOL srcIsUpsideDown; - struct wined3d_bo_address data; -+#if defined(STAGING_CSMT) - DWORD slice_pitch, pitch; - - wined3d_resource_get_memory(&surface->resource, dst_location, &data); -+#else /* STAGING_CSMT */ ++ const struct wined3d_gl_info *gl_info; ++ struct wined3d_context *context = old_ctx; ++ struct wined3d_surface *restore_rt = NULL; ++ BYTE *mem; ++ BYTE *row, *top, *bottom; ++ int i; ++ BOOL srcIsUpsideDown; ++ struct wined3d_bo_address data; + + surface_get_memory(surface, &data, dst_location); +#endif /* STAGING_CSMT */ if (surface != old_ctx->current_rt) { -@@ -2655,8 +3377,13 @@ +@@ -2594,8 +3266,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -6196,7 +6101,7 @@ checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2673,6 +3400,10 @@ +@@ -2612,6 +3289,10 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -6207,7 +6112,7 @@ if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2899,8 +3630,13 @@ +@@ -2856,8 +3537,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -6221,7 +6126,7 @@ } /* Uses the hardware to stretch and flip the image */ -@@ -2968,7 +3704,11 @@ +@@ -2925,7 +3611,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -6233,7 +6138,7 @@ } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3165,6 +3905,7 @@ +@@ -3122,6 +3812,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -6241,7 +6146,7 @@ if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3176,6 +3917,17 @@ +@@ -3133,6 +3824,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -6259,7 +6164,7 @@ } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3230,9 +3982,15 @@ +@@ -3187,9 +3889,15 @@ gl_info = context->gl_info; @@ -6275,7 +6180,7 @@ wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3275,9 +4033,13 @@ +@@ -3232,9 +3940,13 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -6289,7 +6194,51 @@ || (dst_surface->container->swapchain && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ -@@ -3307,8 +4069,13 @@ +@@ -3247,8 +3959,13 @@ + { + struct wined3d_resource *resource = &s->container->resource; + struct wined3d_device *device = resource->device; ++#if defined(STAGING_CSMT) + struct wined3d_rendertarget_view view; + struct wined3d_texture *texture = s->container; ++#else /* STAGING_CSMT */ ++ struct wined3d_rendertarget_view_desc view_desc; ++ struct wined3d_rendertarget_view *view; ++#endif /* STAGING_CSMT */ + const struct blit_shader *blitter; + HRESULT hr; + +@@ -3259,6 +3976,7 @@ + return WINED3DERR_INVALIDCALL; + } + ++#if defined(STAGING_CSMT) + /* Can't incref / decref the resource here. This is executed inside the worker + * thread. Playing with the refcount here makes the worker thread visible to + * the client lib. Problems occur when the worker thread happens to hold the +@@ -3275,6 +3993,21 @@ + view.sub_resource_idx = s->texture_layer * texture->level_count + s->texture_level; + + hr = blitter->color_fill(device, &view, rect, color); ++#else /* STAGING_CSMT */ ++ view_desc.format_id = resource->format->id; ++ view_desc.u.texture.level_idx = s->texture_level; ++ view_desc.u.texture.layer_idx = s->texture_layer; ++ view_desc.u.texture.layer_count = 1; ++ if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, ++ resource, NULL, &wined3d_null_parent_ops, &view))) ++ { ++ ERR("Failed to create rendertarget view, hr %#x.\n", hr); ++ return hr; ++ } ++ ++ hr = blitter->color_fill(device, view, rect, color); ++ wined3d_rendertarget_view_decref(view); ++#endif /* STAGING_CSMT */ + + return hr; + } +@@ -3284,8 +4017,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -6303,7 +6252,7 @@ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3499,6 +4266,7 @@ +@@ -3476,6 +4214,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -6311,7 +6260,7 @@ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3507,6 +4275,15 @@ +@@ -3484,6 +4223,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -6327,7 +6276,7 @@ } /* Context activation is done by the caller. */ -@@ -3521,7 +4298,11 @@ +@@ -3498,7 +4246,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -6339,7 +6288,7 @@ { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3548,6 +4329,7 @@ +@@ -3525,6 +4277,7 @@ } wined3d_surface_prepare(surface, context, location); @@ -6347,7 +6296,7 @@ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Surface was discarded, no need copy data.\n"); -@@ -3562,6 +4344,22 @@ +@@ -3539,6 +4292,22 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -6370,7 +6319,7 @@ surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3625,9 +4423,13 @@ +@@ -3602,9 +4371,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6384,7 +6333,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3643,9 +4445,13 @@ +@@ -3620,9 +4393,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6398,7 +6347,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3653,6 +4459,7 @@ +@@ -3630,6 +4407,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -6406,7 +6355,7 @@ surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3685,6 +4492,124 @@ +@@ -3662,6 +4440,124 @@ FIXME("Can't load surface %p with location flags %s into sysmem.\n", surface, wined3d_debug_location(surface->resource.locations)); @@ -6531,7 +6480,7 @@ } /* Context activation is done by the caller. */ -@@ -3693,12 +4618,14 @@ +@@ -3670,12 +4566,14 @@ { RECT r; @@ -6546,7 +6495,7 @@ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) { -@@ -3707,7 +4634,11 @@ +@@ -3684,7 +4582,11 @@ } surface_get_rect(surface, NULL, &r); @@ -6558,7 +6507,7 @@ surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3722,6 +4653,7 @@ +@@ -3699,6 +4601,7 @@ struct wined3d_device *device = surface->resource.device; const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; @@ -6566,7 +6515,7 @@ UINT width, src_row_pitch, src_slice_pitch, dst_pitch; struct wined3d_bo_address data; struct wined3d_format format; -@@ -3748,6 +4680,24 @@ +@@ -3725,6 +4628,24 @@ } if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) @@ -6591,7 +6540,7 @@ && (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, -@@ -3763,6 +4713,7 @@ +@@ -3740,6 +4661,7 @@ return WINED3D_OK; } @@ -6599,7 +6548,7 @@ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, -@@ -3770,6 +4721,15 @@ +@@ -3747,6 +4669,15 @@ NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) { DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? @@ -6615,7 +6564,7 @@ WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; RECT rect = {0, 0, surface->resource.width, surface->resource.height}; -@@ -3784,6 +4744,7 @@ +@@ -3761,6 +4692,7 @@ if (srgb) { @@ -6623,19 +6572,10 @@ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3818,15 +4779,55 @@ +@@ -3795,6 +4727,42 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); -- -- format = *texture->resource.format; -- if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -- format = *wined3d_get_format(gl_info, conversion->dst_format); -- -- /* Don't use PBOs for converted surfaces. During PBO conversion we look at -- * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is -- * getting called. */ -- if ((format.convert || conversion) && surface->resource.buffer) +#else /* STAGING_CSMT */ + if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) + == WINED3D_LOCATION_TEXTURE_RGB) @@ -6672,23 +6612,22 @@ + width = surface->resource.width; + src_pitch = wined3d_surface_get_pitch(surface); +#endif /* STAGING_CSMT */ -+ -+ format = *texture->resource.format; -+ if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -+ format = *wined3d_get_format(gl_info, conversion->dst_format); -+ -+ /* Don't use PBOs for converted surfaces. During PBO conversion we look at -+ * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is -+ * getting called. */ + + format = *texture->resource.format; + if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) +@@ -3803,7 +4771,11 @@ + /* Don't use PBOs for converted surfaces. During PBO conversion we look at + * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is + * getting called. */ +#if defined(STAGING_CSMT) -+ if ((format.convert || conversion) && surface->resource.buffer) + if ((format.convert || conversion) && surface->resource.buffer) +#else /* STAGING_CSMT */ + if ((format.convert || conversion) && surface->pbo) +#endif /* STAGING_CSMT */ { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3835,6 +4836,7 @@ +@@ -3812,6 +4784,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -6696,7 +6635,7 @@ wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3842,6 +4844,14 @@ +@@ -3819,6 +4792,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -6711,7 +6650,7 @@ if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3856,9 +4866,15 @@ +@@ -3833,9 +4814,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -6727,7 +6666,7 @@ data.addr = mem; } else if (conversion) -@@ -3878,6 +4894,7 @@ +@@ -3855,6 +4842,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -6735,7 +6674,7 @@ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, width, height, palette, &texture->async.gl_color_key); src_row_pitch = dst_pitch; -@@ -3886,6 +4903,16 @@ +@@ -3863,6 +4851,16 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -6752,7 +6691,7 @@ HeapFree(GetProcessHeap(), 0, mem); -@@ -3899,11 +4926,19 @@ +@@ -3876,11 +4874,19 @@ const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; DWORD src_location; @@ -6772,7 +6711,7 @@ src_location = WINED3D_LOCATION_TEXTURE_SRGB; else /* surface_blt_fbo will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB; -@@ -3912,11 +4947,17 @@ +@@ -3889,11 +4895,17 @@ surface, src_location, &rect, surface, dst_location, &rect); } @@ -6790,7 +6729,7 @@ HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -3924,6 +4965,7 @@ +@@ -3901,6 +4913,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -6798,7 +6737,7 @@ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -3947,6 +4989,45 @@ +@@ -3924,6 +4937,45 @@ { ERR("Surface %p does not have any up to date location.\n", surface); return; @@ -6844,7 +6783,7 @@ } switch (location) -@@ -3960,7 +5041,11 @@ +@@ -3937,7 +4989,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -6856,7 +6795,7 @@ break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3972,7 +5057,11 @@ +@@ -3949,7 +5005,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -6868,7 +6807,7 @@ break; default: -@@ -3980,12 +5069,21 @@ +@@ -3957,12 +5017,21 @@ break; } @@ -6890,66 +6829,19 @@ } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4094,6 +5192,7 @@ - const RECT *dst_rect, const struct wined3d_color *color) +@@ -4071,7 +5140,11 @@ + const RECT *rect, const struct wined3d_color *color) { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; + const RECT draw_rect = {0, 0, view->width, view->height}; +#if defined(STAGING_CSMT) - struct wined3d_rendertarget_view view, *view_ptr = &view; - struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; - struct wined3d_texture *texture = dst_surface->container; -@@ -4114,6 +5213,21 @@ - view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); + struct wined3d_fb_state fb = {&view, NULL, 1}; +#else /* STAGING_CSMT */ -+ struct wined3d_rendertarget_view *view; + struct wined3d_fb_state fb = {&view, NULL}; -+ HRESULT hr; -+ -+ if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -+ NULL, &wined3d_null_parent_ops, &view))) -+ { -+ ERR("Failed to create rendertarget view, hr %#x.\n", hr); -+ return hr; -+ } -+ -+ device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -+ wined3d_rendertarget_view_decref(view); +#endif /* STAGING_CSMT */ - return WINED3D_OK; - } -@@ -4122,6 +5236,7 @@ - const RECT *dst_rect, float depth) - { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; -+#if defined(STAGING_CSMT) - struct wined3d_rendertarget_view view; - struct wined3d_fb_state fb = {NULL, &view}; - struct wined3d_texture *texture = dst_surface->container; -@@ -4137,6 +5252,20 @@ - view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -+#else /* STAGING_CSMT */ -+ struct wined3d_fb_state fb = {NULL, NULL}; -+ HRESULT hr; -+ -+ if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -+ NULL, &wined3d_null_parent_ops, &fb.depth_stencil))) -+ { -+ ERR("Failed to create rendertarget view, hr %#x.\n", hr); -+ return hr; -+ } -+ -+ device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -+ wined3d_rendertarget_view_decref(fb.depth_stencil); -+#endif /* STAGING_CSMT */ + device_clear_render_targets(device, 1, &fb, 1, rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); - return WINED3D_OK; - } -@@ -4173,8 +5302,13 @@ +@@ -4121,8 +5194,13 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); @@ -6963,7 +6855,7 @@ } const struct blit_shader ffp_blit = { -@@ -4330,6 +5464,7 @@ +@@ -4278,6 +5356,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -6971,7 +6863,7 @@ int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; -@@ -4364,6 +5499,28 @@ +@@ -4312,6 +5391,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -7000,7 +6892,7 @@ src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4375,12 +5532,14 @@ +@@ -4323,12 +5424,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -7015,7 +6907,7 @@ if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4391,9 +5550,13 @@ +@@ -4339,9 +5442,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -7029,7 +6921,7 @@ src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4403,8 +5566,12 @@ +@@ -4351,8 +5458,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -7042,7 +6934,7 @@ } bpp = dst_surface->resource.format->byte_count; -@@ -4415,12 +5582,24 @@ +@@ -4363,12 +5474,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -7067,7 +6959,7 @@ if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4455,7 +5634,11 @@ +@@ -4403,7 +5526,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -7079,7 +6971,7 @@ src_format, flags, fx); goto release; } -@@ -4463,7 +5646,11 @@ +@@ -4411,7 +5538,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -7091,7 +6983,7 @@ flags &= ~WINEDDBLT_COLORFILL; } -@@ -4513,6 +5700,7 @@ +@@ -4461,6 +5592,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -7099,7 +6991,7 @@ sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4526,6 +5714,21 @@ +@@ -4474,6 +5606,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -7121,7 +7013,7 @@ memcpy(dbuf, sbuf, width); } } -@@ -4535,8 +5738,13 @@ +@@ -4483,8 +5630,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -7135,7 +7027,7 @@ } } } -@@ -4545,9 +5753,15 @@ +@@ -4493,9 +5645,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7151,7 +7043,7 @@ } } } -@@ -4557,6 +5771,7 @@ +@@ -4505,6 +5663,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7159,7 +7051,7 @@ sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4564,6 +5779,15 @@ +@@ -4512,6 +5671,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -7175,7 +7067,7 @@ } else { -@@ -4610,6 +5834,7 @@ +@@ -4558,6 +5726,7 @@ } #undef STRETCH_ROW } @@ -7183,7 +7075,7 @@ dbuf += dst_row_pitch; last_sy = sy; } -@@ -4618,6 +5843,16 @@ +@@ -4566,6 +5735,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -7200,7 +7092,7 @@ DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4667,7 +5902,11 @@ +@@ -4615,7 +5794,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -7212,7 +7104,7 @@ dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4744,6 +5983,7 @@ +@@ -4692,6 +5875,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -7220,7 +7112,7 @@ #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4765,6 +6005,29 @@ +@@ -4713,6 +5897,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -7250,7 +7142,7 @@ switch (bpp) { -@@ -4783,7 +6046,11 @@ +@@ -4731,7 +5938,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7262,7 +7154,7 @@ dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4814,10 +6081,12 @@ +@@ -4762,10 +5973,12 @@ } } @@ -7275,7 +7167,7 @@ error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4825,6 +6094,7 @@ +@@ -4773,6 +5986,7 @@ } release: @@ -7283,7 +7175,7 @@ if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4843,6 +6113,14 @@ +@@ -4791,6 +6005,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -7298,38 +7190,25 @@ return hr; } -@@ -4887,6 +6165,7 @@ +@@ -4836,7 +6058,11 @@ cpu_blit_blit_surface, }; +#if defined(STAGING_CSMT) void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, - struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4894,6 +6173,16 @@ - struct wined3d_swapchain *src_swapchain, *dst_swapchain; - struct wined3d_device *device = dst_surface->resource.device; - DWORD src_ds_flags, dst_ds_flags; +#else /* STAGING_CSMT */ -+HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -+{ -+ struct wined3d_swapchain *src_swapchain, *dst_swapchain; -+ struct wined3d_device *device = dst_surface->resource.device; -+ DWORD src_ds_flags, dst_ds_flags; -+ RECT src_rect, dst_rect; ++HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, +#endif /* STAGING_CSMT */ - BOOL scale, convert; - - static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4905,6 +6194,106 @@ + struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) + { +@@ -4854,6 +6080,98 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; +#if !defined(STAGING_CSMT) -+ TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n", -+ dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), ++ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", ++ dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), + flags, fx, debug_d3dtexturefiltertype(filter)); + TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); + @@ -7370,13 +7249,11 @@ + return WINEDDERR_SURFACEBUSY; + } + -+ surface_get_rect(dst_surface, dst_rect_in, &dst_rect); -+ -+ if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom -+ || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 -+ || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 -+ || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 -+ || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) ++ if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom ++ || dst_rect->left > dst_surface->resource.width || dst_rect->left < 0 ++ || dst_rect->top > dst_surface->resource.height || dst_rect->top < 0 ++ || dst_rect->right > dst_surface->resource.width || dst_rect->right < 0 ++ || dst_rect->bottom > dst_surface->resource.height || dst_rect->bottom < 0) + { + WARN("The application gave us a bad destination rectangle.\n"); + return WINEDDERR_INVALIDRECT; @@ -7384,22 +7261,16 @@ + + if (src_surface) + { -+ surface_get_rect(src_surface, src_rect_in, &src_rect); -+ -+ if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom -+ || src_rect.left > src_surface->resource.width || src_rect.left < 0 -+ || src_rect.top > src_surface->resource.height || src_rect.top < 0 -+ || src_rect.right > src_surface->resource.width || src_rect.right < 0 -+ || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) ++ if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom ++ || src_rect->left > src_surface->resource.width || src_rect->left < 0 ++ || src_rect->top > src_surface->resource.height || src_rect->top < 0 ++ || src_rect->right > src_surface->resource.width || src_rect->right < 0 ++ || src_rect->bottom > src_surface->resource.height || src_rect->bottom < 0) + { -+ WARN("Application gave us bad source rectangle for Blt.\n"); ++ WARN("The application gave us a bad source rectangle.\n"); + return WINEDDERR_INVALIDRECT; + } + } -+ else -+ { -+ memset(&src_rect, 0, sizeof(src_rect)); -+ } + + if (!fx || !(fx->dwDDFX)) + flags &= ~WINEDDBLT_DDFX; @@ -7430,21 +7301,7 @@ if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4947,8 +6336,13 @@ - } - - scale = src_surface -+#if defined(STAGING_CSMT) - && (src_rect->right - src_rect->left != dst_rect->right - dst_rect->left - || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); -+#else /* STAGING_CSMT */ -+ && (src_rect.right - src_rect.left != dst_rect.right - dst_rect.left -+ || src_rect.bottom - src_rect.top != dst_rect.bottom - dst_rect.top); -+#endif /* STAGING_CSMT */ - convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; - - dst_ds_flags = dst_surface->container->resource.format_flags -@@ -4968,6 +6362,7 @@ +@@ -4917,6 +6235,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -7452,14 +7309,14 @@ return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -4978,6 +6373,24 @@ +@@ -4927,6 +6246,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; +#else /* STAGING_CSMT */ + return WINED3DERR_INVALIDCALL; + -+ if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, &dst_rect, depth))) ++ if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) + return WINED3D_OK; + } + else @@ -7471,13 +7328,13 @@ + } + + if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, -+ &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect))) ++ src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) + return WINED3D_OK; +#endif /* STAGING_CSMT */ } } else -@@ -4986,8 +6399,13 @@ +@@ -4935,8 +6272,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -7491,21 +7348,19 @@ { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5008,8 +6426,13 @@ - palette, fx->u5.dwFillColor, &color)) +@@ -4958,7 +6300,11 @@ goto fallback; -+#if defined(STAGING_CSMT) if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) ++#if defined(STAGING_CSMT) return; +#else /* STAGING_CSMT */ -+ if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) + return WINED3D_OK; +#endif /* STAGING_CSMT */ } else { -@@ -5031,8 +6454,13 @@ +@@ -4980,8 +6326,13 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } @@ -7519,26 +7374,17 @@ { /* Upload */ if (scale) -@@ -5041,6 +6469,7 @@ - TRACE("Not doing upload because of format conversion.\n"); - else - { +@@ -4997,11 +6348,18 @@ + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) + { + struct wined3d_context *context = context_acquire(device, dst_surface); +#if defined(STAGING_CSMT) - POINT dst_point = {dst_rect->left, dst_rect->top}; - - if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5053,6 +6482,19 @@ + wined3d_resource_load_location(&dst_surface->resource, context, + dst_surface->container->resource.draw_binding); context_release(context); } return; +#else /* STAGING_CSMT */ -+ POINT dst_point = {dst_rect.left, dst_rect.top}; -+ -+ if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) -+ { -+ if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) -+ { -+ struct wined3d_context *context = context_acquire(device, dst_surface); + surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); + context_release(context); + } @@ -7547,48 +7393,49 @@ } } } -@@ -5076,6 +6518,7 @@ +@@ -5025,7 +6383,11 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; +#if defined(STAGING_CSMT) return; ++#else /* STAGING_CSMT */ ++ return WINED3D_OK; ++#endif /* STAGING_CSMT */ } -@@ -5284,6 +6727,54 @@ - wined3d_surface_location_invalidated, - wined3d_surface_load_location, - }; + if (fbo_blit_supported(&device->adapter->gl_info, blit_op, +@@ -5041,10 +6403,17 @@ + dst_surface, dst_surface->container->resource.draw_binding, dst_rect); + context_release(context); + ++#if defined(STAGING_CSMT) + wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); + wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); + + return; +#else /* STAGING_CSMT */ -+ return WINED3D_OK; -+ } -+ -+ if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -+ &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) -+ { -+ struct wined3d_context *context; -+ TRACE("Using FBO blit.\n"); -+ -+ context = context_acquire(device, NULL); -+ surface_blt_fbo(device, context, filter, -+ src_surface, src_surface->container->resource.draw_binding, &src_rect, -+ dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); -+ context_release(context); -+ + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + + return WINED3D_OK; -+ } -+ -+ blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -+ &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); -+ if (blitter) -+ { -+ blitter->blit_surface(device, blit_op, filter, src_surface, -+ &src_rect, dst_surface, &dst_rect, color_key); ++#endif /* STAGING_CSMT */ + } + + blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, +@@ -5054,6 +6423,7 @@ + { + blitter->blit_surface(device, blit_op, filter, src_surface, + src_rect, dst_surface, dst_rect, color_key); ++#if defined(STAGING_CSMT) + return; + } + } +@@ -5219,6 +6589,21 @@ + wined3d_surface_location_invalidated, + wined3d_surface_load_location, + }; ++#else /* STAGING_CSMT */ + return WINED3D_OK; + } + } @@ -7596,21 +7443,17 @@ + +fallback: + /* Special cases for render targets. */ -+ if (SUCCEEDED(surface_blt_special(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter))) ++ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) + return WINED3D_OK; + +cpu: -+ -+ /* For the rest call the X11 surface implementation. For render targets -+ * this should be implemented OpenGL accelerated in surface_blt_special(), -+ * other blits are rather rare. */ -+ return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); ++ return surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); +} +#endif /* STAGING_CSMT */ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5345,7 +6836,11 @@ +@@ -5280,7 +6665,11 @@ } surface->container = container; @@ -7622,7 +7465,7 @@ list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5377,9 +6872,14 @@ +@@ -5312,9 +6701,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -7637,7 +7480,7 @@ } return hr; -@@ -5406,7 +6906,11 @@ +@@ -5341,7 +6735,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -8125,61 +7968,8 @@ +#endif /* STAGING_CSMT */ }; - static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, -@@ -991,7 +1050,9 @@ - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, texture); -+#endif /* STAGING_CSMT */ - return WINED3DERR_INVALIDCALL; - } - -@@ -1001,6 +1062,7 @@ - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); -+#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } -@@ -1009,6 +1071,14 @@ - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); - HeapFree(GetProcessHeap(), 0, texture); -+#else /* STAGING_CSMT */ -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (levels != 1) -+ { -+ WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); -+#endif /* STAGING_CSMT */ - return WINED3DERR_INVALIDCALL; - } - } -@@ -1029,7 +1099,9 @@ - else - { - WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); -+#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, texture); -+#endif /* STAGING_CSMT */ - return WINED3DERR_INVALIDCALL; - } - } -@@ -1039,7 +1111,9 @@ - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x\n", hr); -+#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, texture); -+#endif /* STAGING_CSMT */ - return hr; - } - -@@ -1102,7 +1176,9 @@ + static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, +@@ -993,7 +1052,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -8189,17 +7979,17 @@ return WINED3DERR_INVALIDCALL; } -@@ -1133,7 +1209,9 @@ +@@ -1024,7 +1085,9 @@ else { - WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); + WARN("Attempted to create a mipmapped/cube NPOT texture without unconditional NPOT support.\n"); +#if defined(STAGING_CSMT) HeapFree(GetProcessHeap(), 0, texture); +#endif /* STAGING_CSMT */ return WINED3DERR_INVALIDCALL; } } -@@ -1146,6 +1224,7 @@ +@@ -1037,6 +1100,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -8207,7 +7997,7 @@ HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1154,6 +1233,14 @@ +@@ -1045,6 +1109,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -8215,15 +8005,15 @@ + return WINED3DERR_INVALIDCALL; + } + -+ if (levels != 1) ++ if (level_count != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); +#endif /* STAGING_CSMT */ return WINED3DERR_INVALIDCALL; } } -@@ -1162,7 +1249,9 @@ - surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) +@@ -1053,7 +1125,9 @@ + flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); +#if defined(STAGING_CSMT) @@ -8232,7 +8022,7 @@ return hr; } -@@ -1248,12 +1337,25 @@ +@@ -1156,12 +1230,25 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -8258,7 +8048,7 @@ } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -1263,7 +1365,11 @@ +@@ -1171,7 +1258,11 @@ struct wined3d_const_bo_address addr; unsigned int row_pitch, slice_pitch; @@ -8270,7 +8060,7 @@ if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); -@@ -1348,6 +1454,7 @@ +@@ -1256,6 +1347,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -8278,7 +8068,7 @@ HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1356,6 +1463,14 @@ +@@ -1264,6 +1356,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -8293,7 +8083,7 @@ return WINED3DERR_INVALIDCALL; } -@@ -1365,6 +1480,7 @@ +@@ -1273,6 +1373,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -8301,7 +8091,7 @@ HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1373,6 +1489,14 @@ +@@ -1281,6 +1382,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -8316,7 +8106,7 @@ return WINED3DERR_INVALIDCALL; } } -@@ -1400,7 +1524,9 @@ +@@ -1308,7 +1417,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -8326,7 +8116,7 @@ return WINED3DERR_INVALIDCALL; } } -@@ -1410,7 +1536,9 @@ +@@ -1318,7 +1429,9 @@ 0, device, parent, parent_ops, &texture3d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -8336,7 +8126,7 @@ return hr; } -@@ -1511,6 +1639,9 @@ +@@ -1438,6 +1551,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -8346,10 +8136,126 @@ return hr; } +@@ -1459,8 +1575,15 @@ + HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc) + { + struct wined3d_device *device = texture->resource.device; ++#if defined(STAGING_CSMT) + struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; ++#else /* STAGING_CSMT */ ++ struct wined3d_context *context = NULL; ++ struct wined3d_resource *sub_resource; ++ struct wined3d_surface *surface; ++ HRESULT hr; ++#endif /* STAGING_CSMT */ + + TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); + +@@ -1475,12 +1598,14 @@ + + surface = surface_from_resource(sub_resource); + ++#if defined(STAGING_CSMT) + if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) + { + WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); + return WINED3DERR_INVALIDCALL; + } + ++#endif /* STAGING_CSMT */ + /* Give more detailed info for ddraw. */ + if (surface->flags & SFLAG_DCINUSE) + return WINEDDERR_DCALREADYCREATED; +@@ -1489,6 +1614,7 @@ + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; + ++#if defined(STAGING_CSMT) + surface->flags |= SFLAG_DCINUSE; + surface->resource.map_count++; + wined3d_cs_emit_getdc(device->cs, surface); +@@ -1501,6 +1627,45 @@ + HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) + { + struct wined3d_device *device = texture->resource.device; ++#else /* STAGING_CSMT */ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ /* Create a DIB section if there isn't a dc yet. */ ++ if (!surface->hDC) ++ { ++ if (FAILED(hr = surface_create_dib_section(surface))) ++ { ++ if (context) ++ context_release(context); ++ return WINED3DERR_INVALIDCALL; ++ } ++ if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY ++ || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++ || surface->pbo)) ++ surface->resource.map_binding = WINED3D_LOCATION_DIB; ++ } ++ ++ surface_load_location(surface, context, WINED3D_LOCATION_DIB); ++ surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); ++ ++ if (context) ++ context_release(context); ++ ++ surface->flags |= SFLAG_DCINUSE; ++ surface->resource.map_count++; ++ ++ *dc = surface->hDC; ++ TRACE("Returning dc %p.\n", *dc); ++ ++ return WINED3D_OK; ++} ++ ++HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) ++{ ++ struct wined3d_device *device = texture->resource.device; ++ struct wined3d_context *context = NULL; ++#endif /* STAGING_CSMT */ + struct wined3d_resource *sub_resource; + struct wined3d_surface *surface; + +@@ -1530,7 +1695,30 @@ + surface->resource.map_count--; + surface->flags &= ~SFLAG_DCINUSE; + ++#if defined(STAGING_CSMT) + wined3d_cs_emit_releasedc(device->cs, surface); ++#else /* STAGING_CSMT */ ++ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY ++ || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++ && surface->resource.map_binding != WINED3D_LOCATION_DIB)) ++ { ++ /* The game Salammbo modifies the surface contents without mapping the surface between ++ * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active ++ * copy and is copied to the screen, this update, which draws the mouse pointer, is lost. ++ * Do not only copy the DIB to the map location, but also make sure the map location is ++ * copied back to the DIB in the next getdc call. ++ * ++ * The same consideration applies to user memory surfaces. */ ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ surface_load_location(surface, context, surface->resource.map_binding); ++ surface_invalidate_location(surface, WINED3D_LOCATION_DIB); ++ if (context) ++ context_release(context); ++ } ++#endif /* STAGING_CSMT */ + + return WINED3D_OK; + } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -3765,7 +3765,11 @@ +@@ -3824,7 +3824,11 @@ float y_offset = context->render_offscreen ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -8361,7 +8267,7 @@ state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? 2.0f : 0.0f; float z_offset = zenable ? -1.0f : 0.0f; -@@ -3888,6 +3892,7 @@ +@@ -3947,6 +3951,7 @@ /* case WINED3D_TTFF_COUNT1: Won't ever get here. */ case WINED3D_TTFF_COUNT2: mat._13 = mat._23 = mat._33 = mat._43 = 0.0f; @@ -8369,7 +8275,7 @@ /* OpenGL divides the first 3 vertex coord by the 4th by default, * which is essentially the same as D3DTTFF_PROJECTED. Make sure that * the 4th coord evaluates to 1.0 to eliminate that. -@@ -3900,6 +3905,20 @@ +@@ -3959,6 +3964,20 @@ * A more serious problem occurs if the app passes 4 coordinates in, and the * 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow * or a replacement shader. */ @@ -8390,7 +8296,7 @@ default: mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; } -@@ -4357,7 +4376,11 @@ +@@ -4405,7 +4424,11 @@ unsigned int i; DWORD ttff; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; @@ -8892,7 +8798,7 @@ HRESULT hr; const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; -@@ -410,6 +683,177 @@ +@@ -410,6 +683,173 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -8904,8 +8810,8 @@ + const struct wined3d_format *format = volume->resource.format; + const unsigned int fmt_flags = volume->container->resource.format_flags; + -+ TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", -+ volume, map_desc, box, flags); ++ TRACE("volume %p, map_desc %p, box %s, flags %#x.\n", ++ volume, map_desc, debug_box(box), flags); + + map_desc->data = NULL; + if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) @@ -8925,8 +8831,8 @@ + } + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) + { -+ WARN("Map box is misaligned for %ux%u blocks.\n", -+ format->block_width, format->block_height); ++ WARN("Map box %s is misaligned for %ux%u blocks.\n", ++ debug_box(box), format->block_width, format->block_height); + return WINED3DERR_INVALIDCALL; + } + @@ -8999,14 +8905,10 @@ + + if (!box) + { -+ TRACE("No box supplied - all is ok\n"); + map_desc->data = base_memory; + } + else + { -+ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", -+ box, box->left, box->top, box->right, box->bottom, box->front, box->back); -+ + if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + { + /* Compressed textures are block based, so calculate the offset of @@ -9070,7 +8972,7 @@ } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -420,11 +864,13 @@ +@@ -420,11 +860,13 @@ return wined3d_texture_incref(volume->container); } @@ -9084,7 +8986,7 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -446,6 +892,7 @@ +@@ -446,6 +888,7 @@ return WINED3DERR_INVALIDCALL; } @@ -9092,7 +8994,7 @@ static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -454,6 +901,7 @@ +@@ -454,6 +897,7 @@ wined3d_texture_set_dirty(volume->container); } @@ -9100,7 +9002,7 @@ static const struct wined3d_resource_ops volume_resource_ops = { volume_resource_incref, -@@ -461,8 +909,10 @@ +@@ -461,8 +905,10 @@ volume_unload, volume_resource_sub_resource_map, volume_resource_sub_resource_unmap, @@ -9111,7 +9013,7 @@ }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -494,7 +944,11 @@ +@@ -494,7 +940,11 @@ } volume->texture_level = level; @@ -9123,7 +9025,7 @@ if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -502,7 +956,9 @@ +@@ -502,7 +952,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -9136,7 +9038,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -87,8 +87,10 @@ +@@ -86,8 +86,10 @@ ~0U, /* No GS shader model limit by default. */ ~0U, /* No PS shader model limit by default. */ FALSE, /* 3D support enabled by default. */ @@ -9147,7 +9049,7 @@ }; struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -328,6 +330,7 @@ +@@ -316,6 +318,7 @@ TRACE("Disabling 3D support.\n"); wined3d_settings.no_3d = TRUE; } @@ -9155,7 +9057,7 @@ if (!get_config_key(hkey, appkey, "CSMT", buffer, size) && !strcmp(buffer,"disabled")) { -@@ -344,6 +347,9 @@ +@@ -332,6 +335,9 @@ FIXME_(winediag)("Experimental wined3d CSMT feature is currently %s.\n", wined3d_settings.cs_multithreaded ? "enabled" : "disabled"); @@ -9215,7 +9117,7 @@ #include #include #include -@@ -284,8 +312,10 @@ +@@ -295,8 +323,10 @@ unsigned int max_sm_gs; unsigned int max_sm_ps; BOOL no_3d; @@ -9226,7 +9128,7 @@ }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1038,9 +1068,14 @@ +@@ -1104,9 +1134,14 @@ WORD use_map; /* MAX_ATTRIBS, 16 */ }; @@ -9241,7 +9143,7 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; #define eps 1e-8f -@@ -1128,8 +1163,10 @@ +@@ -1194,8 +1229,10 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -9252,7 +9154,7 @@ }; union wined3d_gl_query_object -@@ -1165,6 +1202,7 @@ +@@ -1231,6 +1268,7 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -9260,7 +9162,7 @@ UINT64 timestamp; }; -@@ -1200,6 +1238,12 @@ +@@ -1266,6 +1304,12 @@ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) dst->render_targets[i] = src->render_targets[i]; } @@ -9273,7 +9175,7 @@ struct wined3d_context { -@@ -1215,7 +1259,9 @@ +@@ -1281,7 +1325,9 @@ DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -9283,7 +9185,7 @@ struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1313,8 +1359,17 @@ +@@ -1379,8 +1425,17 @@ GLfloat fog_coord_value; GLfloat color[4], fogstart, fogend, fogcolor[4]; GLuint dummy_arbfp_prog; @@ -9301,7 +9203,7 @@ }; typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); -@@ -1457,8 +1512,12 @@ +@@ -1523,8 +1578,12 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; @@ -9314,7 +9216,7 @@ void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, -@@ -2041,7 +2100,11 @@ +@@ -2107,7 +2166,11 @@ struct wined3d_state { DWORD flags; @@ -9326,7 +9228,7 @@ struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2086,6 +2149,7 @@ +@@ -2152,6 +2215,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -9334,7 +9236,7 @@ struct wined3d_gl_bo { GLuint name; -@@ -2094,6 +2158,7 @@ +@@ -2160,6 +2224,7 @@ UINT size; }; @@ -9342,7 +9244,7 @@ #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2149,11 +2214,23 @@ +@@ -2215,11 +2280,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -9366,7 +9268,7 @@ /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2164,6 +2241,9 @@ +@@ -2230,6 +2307,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -9376,7 +9278,7 @@ HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2198,6 +2278,7 @@ +@@ -2264,6 +2344,7 @@ UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -9384,7 +9286,7 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2210,6 +2291,11 @@ +@@ -2276,6 +2357,11 @@ void device_create_default_sampler(struct wined3d_device *device); void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -9396,7 +9298,7 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2229,9 +2315,11 @@ +@@ -2295,9 +2381,11 @@ HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx); @@ -9408,7 +9310,7 @@ }; struct wined3d_resource -@@ -2256,6 +2344,7 @@ +@@ -2322,6 +2410,7 @@ UINT depth; UINT size; DWORD priority; @@ -9416,7 +9318,7 @@ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2263,6 +2352,10 @@ +@@ -2329,6 +2418,10 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -9427,7 +9329,7 @@ void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2287,6 +2380,7 @@ +@@ -2353,6 +2446,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -9435,7 +9337,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2335,6 +2429,15 @@ +@@ -2401,6 +2495,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -9451,7 +9353,7 @@ /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2419,7 +2522,9 @@ +@@ -2485,7 +2588,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -9461,7 +9363,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2451,8 +2556,15 @@ +@@ -2517,8 +2622,15 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -9477,7 +9379,7 @@ }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2460,6 +2572,7 @@ +@@ -2526,6 +2638,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -9485,7 +9387,7 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2475,6 +2588,27 @@ +@@ -2541,6 +2654,27 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -9513,7 +9415,7 @@ UINT bitmap_size; }; -@@ -2500,7 +2634,11 @@ +@@ -2566,7 +2700,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -9525,7 +9427,7 @@ }; struct wined3d_surface -@@ -2508,12 +2646,26 @@ +@@ -2574,12 +2712,26 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -9552,7 +9454,7 @@ GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2557,11 +2709,22 @@ +@@ -2627,11 +2779,22 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -9572,10 +9474,10 @@ +HRESULT surface_load_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; +#endif /* STAGING_CSMT */ + HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, - DWORD location) DECLSPEC_HIDDEN; -@@ -2573,6 +2736,7 @@ +@@ -2646,6 +2809,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -9583,7 +9485,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2587,6 +2751,17 @@ +@@ -2660,6 +2824,17 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -9601,7 +9503,7 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2607,8 +2782,10 @@ +@@ -2680,8 +2855,10 @@ GLuint name; }; @@ -9612,7 +9514,7 @@ struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -2637,8 +2814,10 @@ +@@ -2710,8 +2887,10 @@ BOOL half_float_conv_needed; }; @@ -9623,7 +9525,7 @@ struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2706,6 +2885,7 @@ +@@ -2779,6 +2958,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9631,7 +9533,7 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2756,6 +2936,32 @@ +@@ -2829,6 +3009,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -9664,7 +9566,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2805,6 +3011,7 @@ +@@ -2878,6 +3084,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -9672,7 +9574,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2868,6 +3075,7 @@ +@@ -2940,6 +3147,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int depth_pitch) DECLSPEC_HIDDEN; @@ -9680,7 +9582,7 @@ /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2882,8 +3090,12 @@ +@@ -2954,8 +3162,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -9693,7 +9595,7 @@ }; struct wined3d_query -@@ -2897,12 +3109,16 @@ +@@ -2969,12 +3181,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -9710,7 +9612,7 @@ /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2929,7 +3145,9 @@ +@@ -3001,7 +3217,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -9720,7 +9622,7 @@ void *map_ptr; struct wined3d_map_range *maps; -@@ -2954,11 +3172,15 @@ +@@ -3026,11 +3244,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9736,7 +9638,7 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; -@@ -2999,8 +3221,10 @@ +@@ -3068,8 +3290,10 @@ return surface_from_resource(resource); } @@ -9747,7 +9649,7 @@ struct wined3d_shader_resource_view { LONG refcount; -@@ -3013,8 +3237,12 @@ +@@ -3082,8 +3306,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -9760,7 +9662,7 @@ }; struct wined3d_swapchain -@@ -3053,8 +3281,10 @@ +@@ -3122,8 +3350,10 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -9771,7 +9673,7 @@ /***************************************************************************** * Utility function prototypes -@@ -3258,7 +3488,9 @@ +@@ -3327,7 +3557,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -From 7543fa04f189e57eb56c7d697920342e8f28b0de Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=B3zef=20Kucia?= -Date: Sun, 10 Jan 2016 17:59:00 +0100 -Subject: wined3d: Ignore invalid render states. - ---- - dlls/wined3d/device.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 7c5a4c2..b0f4bf4 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -2027,10 +2027,17 @@ static void resolve_depth_buffer(struct wined3d_state *state) - void CDECL wined3d_device_set_render_state(struct wined3d_device *device, - enum wined3d_render_state state, DWORD value) - { -- DWORD old_value = device->state.render_states[state]; -+ DWORD old_value; - - TRACE("device %p, state %s (%#x), value %#x.\n", device, debug_d3drenderstate(state), state, value); - -+ if (state > WINEHIGHEST_RENDER_STATE) -+ { -+ WARN("Ignoring unrecognized render state %#x, value %#x.\n", state, value); -+ return; -+ } -+ -+ old_value = device->state.render_states[state]; - device->update_state->render_states[state] = value; - - /* Handle recording of state blocks. */ --- -2.6.4 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/definition wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Invalid_Render_States/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [33988] Ignore invalid render states in wined3d_device_set_render_state diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -From 20c5727bab6314d9d788f5b782cf8f5d1b6fc281 Mon Sep 17 00:00:00 2001 -From: Austin English -Date: Sat, 28 Feb 2015 00:34:07 +0100 -Subject: wined3d: Allow to specify multisampling AA quality levels via - registry. - ---- - dlls/wined3d/directx.c | 7 ++++++- - dlls/wined3d/wined3d_main.c | 12 ++++++++++++ - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 019b415..b9eb03c 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -4404,7 +4404,12 @@ HRESULT CDECL wined3d_check_device_multisample_type(const struct wined3d *wined3 - - if (quality_levels) - { -- if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) -+ if (wined3d_settings.msaa_quality_levels) -+ { -+ *quality_levels = wined3d_settings.msaa_quality_levels; -+ TRACE("Overriding MSAA quality levels to %i\n", *quality_levels); -+ } -+ else if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) - *quality_levels = gl_info->limits.samples; - else - *quality_levels = 1; -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 0543d97..c985c2d 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -77,6 +77,7 @@ struct wined3d_settings wined3d_settings = - ORM_FBO, /* Use FBOs to do offscreen rendering */ - PCI_VENDOR_NONE,/* PCI Vendor ID */ - PCI_DEVICE_NONE,/* PCI Device ID */ -+ 0, /* Multisampling AA Quality Levels */ - 0, /* The default of memory is set in init_driver_info */ - NULL, /* No wine logo by default */ - TRUE, /* Multisampling enabled by default. */ -@@ -261,6 +262,17 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - wined3d_settings.pci_vendor_id = pci_vendor_id; - } - } -+ if (!get_config_key( hkey, appkey, "MultisamplingAAQualityLevels", buffer, size )) -+ { -+ int quality_levels = atoi(buffer); -+ if(quality_levels > 0) -+ { -+ wined3d_settings.msaa_quality_levels = quality_levels; -+ TRACE("Setting MultisamplingAAQualityLevels to %i\n", quality_levels); -+ } -+ else -+ ERR("MultisamplingAAQualityLevels is %i but must be >0\n", quality_levels); -+ } - if ( !get_config_key( hkey, appkey, "VideoMemorySize", buffer, size) ) - { - int TmpVideoMemorySize = atoi(buffer); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7847557..9e39dd7 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -268,6 +268,7 @@ struct wined3d_settings - unsigned short pci_vendor_id; - unsigned short pci_device_id; - /* Memory tracking and object counting. */ -+ unsigned int msaa_quality_levels; - UINT64 emulated_textureram; - char *logo; - int allow_multisampling; --- -2.5.0 - diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Multisampling/definition wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Multisampling/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Multisampling/definition 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Multisampling/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Fixes: [12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. -Category: stable diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,287 @@ +From 93ac240a91cc8c02bafe7207ffdb64fe9f9945f9 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 4 Nov 2015 19:31:30 +0100 +Subject: wined3d: Rename wined3d_resource_(un)map to + wined3d_resource_sub_resource_(un)map. + +To avoid name conflicts in the CSMT patchset. +--- + dlls/d3d11/device.c | 4 ++-- + dlls/d3d11/texture.c | 8 ++++---- + dlls/d3d8/surface.c | 4 ++-- + dlls/d3d8/volume.c | 4 ++-- + dlls/d3d9/surface.c | 4 ++-- + dlls/d3d9/volume.c | 4 ++-- + dlls/ddraw/surface.c | 14 +++++++------- + dlls/wined3d/resource.c | 4 ++-- + dlls/wined3d/wined3d.spec | 4 ++-- + include/wine/wined3d.h | 6 +++--- + 10 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c +index fb308d0..9658c21 100644 +--- a/dlls/d3d11/device.c ++++ b/dlls/d3d11/device.c +@@ -267,7 +267,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext + wined3d_resource = wined3d_resource_from_d3d11_resource(resource); + + wined3d_mutex_lock(); +- hr = wined3d_resource_map(wined3d_resource, subresource_idx, ++ hr = wined3d_resource_sub_resource_map(wined3d_resource, subresource_idx, + &map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)); + wined3d_mutex_unlock(); + +@@ -288,7 +288,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext + wined3d_resource = wined3d_resource_from_d3d11_resource(resource); + + wined3d_mutex_lock(); +- wined3d_resource_unmap(wined3d_resource, subresource_idx); ++ wined3d_resource_sub_resource_unmap(wined3d_resource, subresource_idx); + wined3d_mutex_unlock(); + } + +diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c +index 11bda45..e24f945 100644 +--- a/dlls/d3d11/texture.c ++++ b/dlls/d3d11/texture.c +@@ -366,7 +366,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UIN + FIXME("Ignoring map_flags %#x.\n", map_flags); + + wined3d_mutex_lock(); +- if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, ++ if (SUCCEEDED(hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, + &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) + { + mapped_texture->pData = wined3d_map_desc.data; +@@ -384,7 +384,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT + TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); + + wined3d_mutex_lock(); +- wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); ++ wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); + wined3d_mutex_unlock(); + } + +@@ -825,7 +825,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN + FIXME("Ignoring map_flags %#x.\n", map_flags); + + wined3d_mutex_lock(); +- if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, ++ if (SUCCEEDED(hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, + &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) + { + mapped_texture->pData = wined3d_map_desc.data; +@@ -844,7 +844,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT + TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); + + wined3d_mutex_lock(); +- wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); ++ wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); + wined3d_mutex_unlock(); + } + +diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c +index ec263b1..5100101 100644 +--- a/dlls/d3d8/surface.c ++++ b/dlls/d3d8/surface.c +@@ -244,7 +244,7 @@ static HRESULT WINAPI d3d8_surface_LockRect(IDirect3DSurface8 *iface, + box.back = 1; + } + +- hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, ++ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, + &map_desc, rect ? &box : NULL, flags); + wined3d_mutex_unlock(); + +@@ -270,7 +270,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface) + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); + wined3d_mutex_unlock(); + + switch(hr) +diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c +index f26e424..d1ee0b5 100644 +--- a/dlls/d3d8/volume.c ++++ b/dlls/d3d8/volume.c +@@ -148,7 +148,7 @@ static HRESULT WINAPI d3d8_volume_LockBox(IDirect3DVolume8 *iface, + iface, locked_box, box, flags); + + wined3d_mutex_lock(); +- hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, ++ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, + &map_desc, (const struct wined3d_box *)box, flags); + wined3d_mutex_unlock(); + +@@ -167,7 +167,7 @@ static HRESULT WINAPI d3d8_volume_UnlockBox(IDirect3DVolume8 *iface) + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); + wined3d_mutex_unlock(); + + return hr; +diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c +index c3032dc..120f5c9 100644 +--- a/dlls/d3d9/surface.c ++++ b/dlls/d3d9/surface.c +@@ -251,7 +251,7 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface, + } + + wined3d_mutex_lock(); +- hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, ++ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, + &map_desc, rect ? &box : NULL, flags); + wined3d_mutex_unlock(); + +@@ -272,7 +272,7 @@ static HRESULT WINAPI d3d9_surface_UnlockRect(IDirect3DSurface9 *iface) + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); + wined3d_mutex_unlock(); + + switch(hr) +diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c +index 52502bf..a81b6c7 100644 +--- a/dlls/d3d9/volume.c ++++ b/dlls/d3d9/volume.c +@@ -148,7 +148,7 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface, + iface, locked_box, box, flags); + + wined3d_mutex_lock(); +- hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, ++ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, + &map_desc, (const struct wined3d_box *)box, flags); + wined3d_mutex_unlock(); + +@@ -167,7 +167,7 @@ static HRESULT WINAPI d3d9_volume_UnlockBox(IDirect3DVolume9 *iface) + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); + wined3d_mutex_unlock(); + + return hr; +diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c +index 923a935..409fa32 100644 +--- a/dlls/ddraw/surface.c ++++ b/dlls/ddraw/surface.c +@@ -984,7 +984,7 @@ static HRESULT surface_lock(struct ddraw_surface *surface, + if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(surface, rect, TRUE); + if (SUCCEEDED(hr)) +- hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), ++ hr = wined3d_resource_sub_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), + surface->sub_resource_idx, &map_desc, rect ? &box : NULL, flags); + if (FAILED(hr)) + { +@@ -1159,7 +1159,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface + TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); + if (SUCCEEDED(hr) && surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(surface, &surface->ddraw->primary_lock, FALSE); + wined3d_mutex_unlock(); +@@ -5134,7 +5134,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu + DDCKEY_SRCBLT, &src_desc->ddckCKSrcBlt); + } + +- if (FAILED(hr = wined3d_resource_map(src_resource, ++ if (FAILED(hr = wined3d_resource_sub_resource_map(src_resource, + src_surface->sub_resource_idx, &src_map_desc, NULL, 0))) + { + ERR("Failed to lock source surface, hr %#x.\n", hr); +@@ -5142,11 +5142,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu + return D3DERR_TEXTURE_LOAD_FAILED; + } + +- if (FAILED(hr = wined3d_resource_map(dst_resource, ++ if (FAILED(hr = wined3d_resource_sub_resource_map(dst_resource, + dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0))) + { + ERR("Failed to lock destination surface, hr %#x.\n", hr); +- wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx); ++ wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx); + wined3d_mutex_unlock(); + return D3DERR_TEXTURE_LOAD_FAILED; + } +@@ -5156,8 +5156,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu + else + memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight); + +- wined3d_resource_unmap(dst_resource, dst_surface->sub_resource_idx); +- wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx); ++ wined3d_resource_sub_resource_unmap(dst_resource, dst_surface->sub_resource_idx); ++ wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx); + } + + if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index a4936cf..44cdb43 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -305,7 +305,7 @@ void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, st + desc->size = resource->size; + } + +-HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, ++HRESULT CDECL wined3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { + TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", +@@ -314,7 +314,7 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i + return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags); + } + +-HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) ++HRESULT CDECL wined3d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) + { + TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); + +diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec +index aa468d1..9d451a1 100644 +--- a/dlls/wined3d/wined3d.spec ++++ b/dlls/wined3d/wined3d.spec +@@ -182,10 +182,10 @@ + @ cdecl wined3d_resource_get_desc(ptr ptr) + @ cdecl wined3d_resource_get_parent(ptr) + @ cdecl wined3d_resource_get_priority(ptr) +-@ cdecl wined3d_resource_map(ptr long ptr ptr long) + @ cdecl wined3d_resource_set_parent(ptr ptr) + @ cdecl wined3d_resource_set_priority(ptr long) +-@ cdecl wined3d_resource_unmap(ptr long) ++@ cdecl wined3d_resource_sub_resource_map(ptr long ptr ptr long) ++@ cdecl wined3d_resource_sub_resource_unmap(ptr long) + + @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) + @ cdecl wined3d_rendertarget_view_create_from_sub_resource(ptr long ptr ptr ptr) +diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h +index 507d63f..50d3213 100644 +--- a/include/wine/wined3d.h ++++ b/include/wine/wined3d.h +@@ -2421,11 +2421,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, + struct wined3d_resource_desc *desc); + void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); + DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource); +-HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, +- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); + void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); + DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority); +-HRESULT __cdecl wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx); ++HRESULT __cdecl wined3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, ++ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); ++HRESULT __cdecl wined3d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx); + + HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, + struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Revert_PixelFormat/0003-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Revert_PixelFormat/0003-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/wined3d-Revert_PixelFormat/0003-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/wined3d-Revert_PixelFormat/0003-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 5328b553ac1e9b1c57045fc8a0e2964f66a47d25 Mon Sep 17 00:00:00 2001 +From 8e605496655d72d832a822ba6adc77fdc2540216 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Sun, 14 Sep 2014 19:47:03 -0500 Subject: Revert "wined3d: Track if a context's hdc is private so we never need @@ -11,7 +11,7 @@ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index c11dd08..10e484c 100644 +index cfd6ec6..ed14aa4 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -812,7 +812,7 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx) @@ -76,7 +76,7 @@ @@ -1446,7 +1445,6 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, int swap_interval; DWORD state; - HDC hdc; + HDC hdc = 0; - BOOL hdc_is_private = FALSE; TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); @@ -110,10 +110,10 @@ ret->needs_set = 1; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d5a881f..e9bc39e 100644 +index a5e7167..00ecbc4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1195,9 +1195,8 @@ struct wined3d_context +@@ -1218,9 +1218,8 @@ struct wined3d_context DWORD use_immediate_mode_draw : 1; DWORD rebind_fbo : 1; DWORD needs_set : 1; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-getsockopt/0001-ws2_32-Divide-values-returned-by-SO_RCVBUF-and-SO_SN.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-getsockopt/0001-ws2_32-Divide-values-returned-by-SO_RCVBUF-and-SO_SN.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-getsockopt/0001-ws2_32-Divide-values-returned-by-SO_RCVBUF-and-SO_SN.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-getsockopt/0001-ws2_32-Divide-values-returned-by-SO_RCVBUF-and-SO_SN.patch 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1,73 @@ +From 881b4446e9f6abc97ff6bead1bfba18b49a5acca Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 8 Feb 2016 02:31:00 +0100 +Subject: ws2_32: Divide values returned by SO_RCVBUF and SO_SNDBUF getsockopt + options by two. + +--- + dlls/ws2_32/socket.c | 8 ++++++++ + dlls/ws2_32/tests/sock.c | 22 ++++++++++++++++++++++ + 2 files changed, 30 insertions(+) + +diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c +index f62c9cd..e17b163 100644 +--- a/dlls/ws2_32/socket.c ++++ b/dlls/ws2_32/socket.c +@@ -3736,6 +3736,14 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, + SetLastError(wsaErrno()); + ret = SOCKET_ERROR; + } ++ #ifdef __linux__ ++ else if (optname == SO_RCVBUF || optname == SO_SNDBUF) ++ { ++ /* For SO_RCVBUF / SO_SNDBUF, the Linux kernel always sets twice the value. ++ * Divide by two to ensure applications do not get confused by the result. */ ++ *(int *)optval /= 2; ++ } ++ #endif + release_sock_fd( s, fd ); + return ret; + case WS_SO_ACCEPTCONN: +diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c +index aeb7a62..2e7ab20 100644 +--- a/dlls/ws2_32/tests/sock.c ++++ b/dlls/ws2_32/tests/sock.c +@@ -1328,6 +1328,7 @@ static void test_set_getsockopt(void) + WSAPROTOCOL_INFOA infoA; + WSAPROTOCOL_INFOW infoW; + char providername[WSAPROTOCOL_LEN + 1]; ++ DWORD value; + struct _prottest + { + int family, type, proto; +@@ -1371,6 +1372,27 @@ static void test_set_getsockopt(void) + err = getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char *) &timeout, &size); + ok( !err, "get/setsockopt(SO_SNDTIMEO) failed error: %d\n", WSAGetLastError()); + ok( timeout == SOCKTIMEOUT2, "getsockopt(SO_SNDTIMEO) returned wrong value %d\n", timeout); ++ ++ /* SO_SNDBUF */ ++ value = 4096; ++ size = sizeof(DWORD); ++ err = setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&value, size); ++ ok( !err, "setsockopt(SO_SNDBUF) failed error: %u\n", WSAGetLastError()); ++ value = 0xdeadbeef; ++ err = getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&value, &size); ++ ok( !err, "getsockopt(SO_SNDBUF) failed error: %u\n", WSAGetLastError()); ++ ok( value == 4096, "expected 4096, got %u\n", value ); ++ ++ /* SO_RCVBUF */ ++ value = 4096; ++ size = sizeof(DWORD); ++ err = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&value, size); ++ ok( !err, "setsockopt(SO_RCVBUF) failed error: %u\n", WSAGetLastError()); ++ value = 0xdeadbeef; ++ err = getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&value, &size); ++ ok( !err, "getsockopt(SO_RCVBUF) failed error: %u\n", WSAGetLastError()); ++ ok( value == 4096, "expected 4096, got %u\n", value ); ++ + /* SO_LINGER */ + for( i = 0; i < sizeof(linger_testvals)/sizeof(LINGER);i++) { + size = sizeof(lingval); +-- +2.7.0 + diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-getsockopt/definition wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-getsockopt/definition --- wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-getsockopt/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-getsockopt/definition 2016-02-08 20:07:32.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [8606] Divide values returned by SO_RCVBUF and SO_SNDBUF getsockopt options by two diff -Nru wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch --- wine-staging-1.9.2~ubuntu12.04.1/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch 2016-02-08 20:07:32.000000000 +0000 @@ -1,4 +1,4 @@ -From 361a906c0026d132a08bc292450a098fd2fc072b Mon Sep 17 00:00:00 2001 +From 93e58d6178dcfdea0c120c1330e28df88c47439b Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 19:08:30 -0700 Subject: ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile. @@ -12,10 +12,10 @@ 5 files changed, 75 insertions(+), 11 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 9cff400..c2dbbf4 100644 +index cb16583..c7a7c54 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c -@@ -2888,6 +2888,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws +@@ -2933,6 +2933,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws if (status != STATUS_SUCCESS) return status; @@ -33,7 +33,7 @@ if (wsa->flags & TF_DISCONNECT) { /* we can't use WS_closesocket because it modifies the last error */ -@@ -2931,7 +2942,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD +@@ -2976,7 +2987,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers, DWORD flags ) { @@ -43,10 +43,10 @@ unsigned int uaddrlen = sizeof(uaddr); struct ws2_transmitfile_async *wsa; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c -index 41554b4..9462628 100644 +index e10d01c..82f8ef0 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c -@@ -8049,7 +8049,6 @@ static void test_TransmitFile(void) +@@ -8053,7 +8053,6 @@ static void test_TransmitFile(void) err, WSAENOTSOCK); /* Test TransmitFile with a UDP datagram socket */ @@ -67,10 +67,10 @@ #define FD_WINE_NONBLOCKING 0x20000000 #define FD_WINE_CONNECTED 0x40000000 diff --git a/server/protocol.def b/server/protocol.def -index 04814c9..8a2d395 100644 +index a5a45eb..592fbe2 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -1263,6 +1263,12 @@ enum server_fd_type +@@ -1260,6 +1260,12 @@ enum server_fd_type @END @@ -84,7 +84,7 @@ @REQ(set_socket_event) obj_handle_t handle; /* handle to the socket */ diff --git a/server/sock.c b/server/sock.c -index 57d3d93..37c78b1 100644 +index a11964f..26f1c72 100644 --- a/server/sock.c +++ b/server/sock.c @@ -86,6 +86,7 @@ @@ -103,8 +103,8 @@ static int sock_get_ntstatus( int err ); static int sock_get_error( int err ); -@@ -155,7 +157,7 @@ static const struct object_ops sock_ops = - no_lookup_name, /* lookup_name */ +@@ -157,7 +159,7 @@ static const struct object_ops sock_ops = + NULL, /* unlink_name */ no_open_file, /* open_file */ no_alloc_handle, /* alloc_handle */ - fd_close_handle, /* close_handle */ @@ -112,7 +112,7 @@ sock_destroy /* destroy */ }; -@@ -627,6 +629,47 @@ static struct fd *sock_get_fd( struct object *obj ) +@@ -629,6 +631,47 @@ static struct fd *sock_get_fd( struct object *obj ) return (struct fd *)grab_object( sock->fd ); } @@ -160,7 +160,7 @@ static void sock_destroy( struct object *obj ) { struct sock *sock = (struct sock *)obj; -@@ -678,15 +721,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne +@@ -680,15 +723,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne struct sock *sock; int sockfd; @@ -177,7 +177,7 @@ if (!(sock = alloc_object( &sock_ops ))) { close( sockfd ); -@@ -1263,6 +1299,17 @@ DECL_HANDLER(accept_into_socket) +@@ -1267,6 +1303,17 @@ DECL_HANDLER(accept_into_socket) release_object( sock ); } @@ -196,5 +196,5 @@ DECL_HANDLER(set_socket_event) { -- -2.6.2 +2.7.0 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ar.po wine-staging-1.9.3~ubuntu12.04.1/po/ar.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ar.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ar.po 2016-02-08 19:32:34.000000000 +0000 @@ -13238,7 +13238,9 @@ "معين." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "أ&ضف تطبيقًا..." #: winecfg.rc:160 @@ -13299,9 +13301,9 @@ msgid "&New override for library:" msgstr "إعداد سي&طرة مكتباتية جديد:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "أ&ضف" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13328,7 +13330,9 @@ msgstr "الأ&صليّة (المأخوذة من وندوز)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "المضمّنة ثمّ الأصليّة" #: winecfg.rc:212 @@ -13353,19 +13357,25 @@ msgstr "فشل الاتّصال بمدير المحرّكات ، لا يمكن تحريرالاعدادات" #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "أ&ضف..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "ك&شف تلقائي" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "تحديد تلقائي" #: winecfg.rc:241 msgid "&Path:" msgstr "الم&سار:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "الخيارات المتقدمة" #: winecfg.rc:249 @@ -13385,7 +13395,9 @@ msgstr "المس&لسل:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "أظهر الملفات المخفيّة" #: winecfg.rc:265 @@ -13467,7 +13479,9 @@ msgstr "اختر دليلًا متوافقًا مع طريقة يونكس من فضلك." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "أخفِ الخيارات المت&قدمة" #: winecfg.rc:39 @@ -13942,7 +13956,11 @@ msgstr "خطأ في التهيئة" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "حجم تدفق الشاشة يجب ان يكون أكبر أو يساوي حجم تدفق النافذة" #: wineconsole.rc:37 @@ -14644,6 +14662,10 @@ msgid "Tab stops" msgstr "وقف اللسان" +#: wordpad.rc:247 +msgid "&Add" +msgstr "أ&ضف" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "حذف ال&كل" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/bg.po wine-staging-1.9.3~ubuntu12.04.1/po/bg.po --- wine-staging-1.9.2~ubuntu12.04.1/po/bg.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/bg.po 2016-02-08 19:32:34.000000000 +0000 @@ -12871,7 +12871,9 @@ "приложенията настройки." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Добавяне на приложение..." #: winecfg.rc:160 @@ -12934,9 +12936,9 @@ msgid "&New override for library:" msgstr "Нова библиотечна замяна:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Добави" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -12964,7 +12966,9 @@ msgstr "&Собствена (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "В&градена, после собствена" #: winecfg.rc:212 @@ -12989,11 +12993,14 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Добави..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "&Открий" #: winecfg.rc:241 @@ -13001,7 +13008,9 @@ msgstr "&Път:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Покажи допълнителните" #: winecfg.rc:249 @@ -13021,7 +13030,9 @@ msgstr "&Номер:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Показвай файловете, започващи с точка" #: winecfg.rc:265 @@ -13106,7 +13117,9 @@ msgstr "Изберете Unix директория" #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Скрий допълнителните" #: winecfg.rc:39 @@ -13585,7 +13598,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14318,6 +14333,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Добави" + #: wordpad.rc:251 #, fuzzy msgid "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ca.po wine-staging-1.9.3~ubuntu12.04.1/po/ca.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ca.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ca.po 2016-02-08 19:32:34.000000000 +0000 @@ -13152,7 +13152,9 @@ "aquelles pestanyes també." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "A&fegeix aplicació..." #: winecfg.rc:160 @@ -13213,9 +13215,9 @@ msgid "&New override for library:" msgstr "Reemplaçament &nou per a la biblioteca:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Afegeix" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13242,7 +13244,9 @@ msgstr "&Nativa (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "In&terna, després Nativa" #: winecfg.rc:212 @@ -13266,19 +13270,25 @@ "es pot editar." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "A&fegeix..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detecta" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Autodetecta" #: winecfg.rc:241 msgid "&Path:" msgstr "&Camí:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "&Vista avançada" #: winecfg.rc:249 @@ -13298,7 +13308,9 @@ msgstr "&Serial:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "&Mostra els fitxers de punt" #: winecfg.rc:265 @@ -13378,7 +13390,9 @@ msgstr "Seleccioneu el directori de destinació d'Unix, si us plau." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "&Vista bàsica" #: winecfg.rc:39 @@ -13840,7 +13854,11 @@ msgstr "Error de configuració" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "La mida de la memòria intermèdia de pantalla ha de ser major o igual al de " "la finestra" @@ -14549,6 +14567,10 @@ msgid "Tab stops" msgstr "Aturades de tabulador" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Afegeix" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "&Elimina tots" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/cs.po wine-staging-1.9.3~ubuntu12.04.1/po/cs.po --- wine-staging-1.9.2~ubuntu12.04.1/po/cs.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/cs.po 2016-02-08 19:32:34.000000000 +0000 @@ -12931,7 +12931,9 @@ "celého systému nebo nastavení každé aplikace zvlášť." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Přid&at aplikaci..." #: winecfg.rc:160 @@ -12991,9 +12993,9 @@ msgid "&New override for library:" msgstr "&Nové nastavení pro knihovnu:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "Přid&at" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13020,7 +13022,9 @@ msgstr "&Nativní (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "V&estavěná pak nativní" #: winecfg.rc:212 @@ -13046,19 +13050,25 @@ "diskových jednotek." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "Přid&at..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detekce" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Autodetekce" #: winecfg.rc:241 msgid "&Path:" msgstr "&Cesta:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Zobrazit rozšířené &možnosti" #: winecfg.rc:249 @@ -13078,7 +13088,9 @@ msgstr "&Sériové číslo:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Zo&brazit soubory s tečkou na začátku názvu" #: winecfg.rc:265 @@ -13160,7 +13172,9 @@ msgstr "Vyberte, prosím, cílový unixový adresář." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Schovat rozšířené &možnosti" #: winecfg.rc:39 @@ -13637,7 +13651,11 @@ msgstr "Chyba nastavení" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Zásobník obrazovky musí být větší nebo stejně velký jako zásobník okna" #: wineconsole.rc:37 @@ -14342,6 +14360,10 @@ msgid "Tab stops" msgstr "Zarážky" +#: wordpad.rc:247 +msgid "&Add" +msgstr "Přid&at" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "&Odebrat vše" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/da.po wine-staging-1.9.3~ubuntu12.04.1/po/da.po --- wine-staging-1.9.2~ubuntu12.04.1/po/da.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/da.po 2016-02-08 19:32:34.000000000 +0000 @@ -13201,7 +13201,9 @@ "faneblade." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Tilføj program..." #: winecfg.rc:160 @@ -13261,9 +13263,9 @@ msgid "&New override for library:" msgstr "&Nye overstyringer for bibliotek:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Tilføj" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13290,7 +13292,9 @@ msgstr "Ind&født (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Indb&ygget derefter indfødt" #: winecfg.rc:212 @@ -13316,11 +13320,15 @@ "ikke redigeres." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Tilføj..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" msgstr "Auto&detekter" #: winecfg.rc:241 @@ -13328,7 +13336,9 @@ msgstr "&Sti:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Vis &avanceret" #: winecfg.rc:249 @@ -13348,7 +13358,9 @@ msgstr "Se&riel:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Vis &dot filer" #: winecfg.rc:265 @@ -13430,7 +13442,9 @@ msgstr "Vælg venligst Unix mappen." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Skjul &avanceret" #: winecfg.rc:39 @@ -13906,7 +13920,11 @@ msgstr "Konfigurationfejl" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Skærm buffer størrelsen, skal være større eller lig med vinduet" #: wineconsole.rc:37 @@ -14623,6 +14641,10 @@ msgid "Tab stops" msgstr "Tabulatorstop" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Tilføj" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Fjern a&lle" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/de.po wine-staging-1.9.3~ubuntu12.04.1/po/de.po --- wine-staging-1.9.2~ubuntu12.04.1/po/de.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/de.po 2016-02-08 19:32:34.000000000 +0000 @@ -13126,7 +13126,9 @@ "Einstellungen in diesen Reitern vornehmen können." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Anw. &hinzufügen..." #: winecfg.rc:160 @@ -13187,9 +13189,9 @@ msgid "&New override for library:" msgstr "&Neue Überschreibung für:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Festlegen" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13216,7 +13218,9 @@ msgstr "&Native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Bui<in dann Native" #: winecfg.rc:212 @@ -13240,19 +13244,25 @@ "nicht bearbeitet werden." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Hinzufügen..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "&Automatisch" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Automatisch" #: winecfg.rc:241 msgid "&Path:" msgstr "&Pfad:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "&Erweitert" #: winecfg.rc:249 @@ -13272,7 +13282,9 @@ msgstr "S&erien-Nr.:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "D&ot-Dateien anzeigen" #: winecfg.rc:265 @@ -13352,7 +13364,9 @@ msgstr "Bitte wählen Sie das Unix-Zielverzeichnis." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "&Erweitert ausblenden" #: winecfg.rc:39 @@ -13816,7 +13830,11 @@ msgstr "Konfigurationsfehler" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "Die Größe des Zeichenpuffers muss mindestens der Fenstergröße entsprechen" @@ -14524,6 +14542,10 @@ msgid "Tab stops" msgstr "Tabstoppposition" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Festlegen" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "&Alle löschen" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/el.po wine-staging-1.9.3~ubuntu12.04.1/po/el.po --- wine-staging-1.9.2~ubuntu12.04.1/po/el.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/el.po 2016-02-08 19:32:34.000000000 +0000 @@ -12635,7 +12635,7 @@ #: winecfg.rc:159 #, fuzzy -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Επιλογές" #: winecfg.rc:160 @@ -12695,8 +12695,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12725,7 +12725,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12748,11 +12748,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12760,7 +12760,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12780,8 +12780,9 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "" +#, fuzzy +msgid "&Show dot files" +msgstr "Λεπτομέρειες" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -12863,7 +12864,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13330,7 +13331,9 @@ msgstr "Επιλογές" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14023,6 +14026,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/en.po wine-staging-1.9.3~ubuntu12.04.1/po/en.po --- wine-staging-1.9.2~ubuntu12.04.1/po/en.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/en.po 2016-02-08 19:32:34.000000000 +0000 @@ -13034,8 +13034,8 @@ "or per-application settings in those tabs as well." #: winecfg.rc:159 -msgid "&Add application..." -msgstr "&Add application..." +msgid "Add appli&cation..." +msgstr "Add appli&cation..." #: winecfg.rc:160 msgid "&Remove application" @@ -13095,9 +13095,9 @@ msgid "&New override for library:" msgstr "&New override for library:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Add" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "A&dd" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13124,8 +13124,8 @@ msgstr "&Native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "Bui<in then Native" +msgid "Buil&tin then Native" +msgstr "Buil&tin then Native" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -13148,20 +13148,20 @@ "edited." #: winecfg.rc:236 -msgid "&Add..." -msgstr "&Add..." +msgid "A&dd..." +msgstr "A&dd..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detect" +msgid "Aut&odetect" +msgstr "Aut&odetect" #: winecfg.rc:241 msgid "&Path:" msgstr "&Path:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "Show &Advanced" +msgid "Show Advan&ced" +msgstr "Show Advan&ced" #: winecfg.rc:249 msgid "De&vice:" @@ -13180,8 +13180,8 @@ msgstr "S&erial:" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "Show &dot files" +msgid "&Show dot files" +msgstr "&Show dot files" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13260,8 +13260,8 @@ msgstr "Select the Unix target directory, please." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "Hide &Advanced" +msgid "Hide Advan&ced" +msgstr "Hide Advan&ced" #: winecfg.rc:39 msgid "(No Theme)" @@ -13721,8 +13721,10 @@ msgstr "Configuration error" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" -msgstr "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." +msgstr "The size of the screen buffer must be greater than or equal to the size of the window." #: wineconsole.rc:37 msgid "Each character is %1!u! pixels wide and %2!u! pixels high" @@ -14427,6 +14429,10 @@ msgid "Tab stops" msgstr "Tab stops" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Add" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/en_US.po wine-staging-1.9.3~ubuntu12.04.1/po/en_US.po --- wine-staging-1.9.2~ubuntu12.04.1/po/en_US.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/en_US.po 2016-02-08 19:32:34.000000000 +0000 @@ -13034,8 +13034,8 @@ "or per-application settings in those tabs as well." #: winecfg.rc:159 -msgid "&Add application..." -msgstr "&Add application..." +msgid "Add appli&cation..." +msgstr "Add appli&cation..." #: winecfg.rc:160 msgid "&Remove application" @@ -13095,9 +13095,9 @@ msgid "&New override for library:" msgstr "&New override for library:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Add" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "A&dd" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13124,8 +13124,8 @@ msgstr "&Native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "Bui<in then Native" +msgid "Buil&tin then Native" +msgstr "Buil&tin then Native" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -13148,20 +13148,20 @@ "edited." #: winecfg.rc:236 -msgid "&Add..." -msgstr "&Add..." +msgid "A&dd..." +msgstr "A&dd..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detect" +msgid "Aut&odetect" +msgstr "Aut&odetect" #: winecfg.rc:241 msgid "&Path:" msgstr "&Path:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "Show &Advanced" +msgid "Show Advan&ced" +msgstr "Show Advan&ced" #: winecfg.rc:249 msgid "De&vice:" @@ -13180,8 +13180,8 @@ msgstr "S&erial:" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "Show &dot files" +msgid "&Show dot files" +msgstr "&Show dot files" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13260,8 +13260,8 @@ msgstr "Select the Unix target directory, please." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "Hide &Advanced" +msgid "Hide Advan&ced" +msgstr "Hide Advan&ced" #: winecfg.rc:39 msgid "(No Theme)" @@ -13721,8 +13721,10 @@ msgstr "Configuration error" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" -msgstr "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." +msgstr "The size of the screen buffer must be greater than or equal to the size of the window." #: wineconsole.rc:37 msgid "Each character is %1!u! pixels wide and %2!u! pixels high" @@ -14427,6 +14429,10 @@ msgid "Tab stops" msgstr "Tab stops" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Add" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/eo.po wine-staging-1.9.3~ubuntu12.04.1/po/eo.po --- wine-staging-1.9.2~ubuntu12.04.1/po/eo.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/eo.po 2016-02-08 19:32:34.000000000 +0000 @@ -12524,7 +12524,9 @@ "permesi, ke vi ŝanĝu agordaĵojn tutsisteme aŭ ĉiuprograme." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Aldoni programon..." #: winecfg.rc:160 @@ -12582,9 +12584,9 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Aldoni" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -12611,7 +12613,9 @@ msgstr "&Indiĝena (Vindozo)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "&Post ena indiĝena" #: winecfg.rc:212 @@ -12635,11 +12639,13 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Aldoni..." #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12647,7 +12653,9 @@ msgstr "&Vojo:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Montri &Altnivele" #: winecfg.rc:249 @@ -12667,7 +12675,9 @@ msgstr "&Seria:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Montri &punktajn dosierojn" #: winecfg.rc:265 @@ -12749,8 +12759,10 @@ msgstr "Bonvolu elekti la celan dosierujon." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "" +#, fuzzy +#| msgid "Advanced" +msgid "Hide Advan&ced" +msgstr "Altnivela" #: winecfg.rc:39 msgid "(No Theme)" @@ -13212,7 +13224,11 @@ msgstr "Eraro de agordado" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "Ekran-bufra grandeco devas esti pli granda aŭ egala ol fenestr-bufra tiu" @@ -13901,6 +13917,10 @@ msgid "Tab stops" msgstr "Tabaj celoj" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Aldoni" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Forigi ĉion" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/es.po wine-staging-1.9.3~ubuntu12.04.1/po/es.po --- wine-staging-1.9.2~ubuntu12.04.1/po/es.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/es.po 2016-02-08 19:32:34.000000000 +0000 @@ -13291,7 +13291,9 @@ "cambiar la configuración global o la configuración por aplicación." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Añadir aplicación..." #: winecfg.rc:160 @@ -13352,9 +13354,9 @@ msgid "&New override for library:" msgstr "&Nueva sustitución de librería:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Añadir" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13381,7 +13383,9 @@ msgstr "&Nativa (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "I&nterna y luego nativa" #: winecfg.rc:212 @@ -13407,19 +13411,25 @@ "se ha podido editar." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Añadir..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detectar" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Autodetectar" #: winecfg.rc:241 msgid "&Path:" msgstr "&Ruta:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Mostrar &avanzado" #: winecfg.rc:249 @@ -13439,7 +13449,9 @@ msgstr "&Nº serie:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Mostrar archivos &punto" #: winecfg.rc:265 @@ -13521,7 +13533,9 @@ msgstr "Por favor, seleccione el directorio Unix de destino." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Ocultar &avanzado" #: winecfg.rc:39 @@ -13997,7 +14011,11 @@ msgstr "Error de configuración" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "El tamaño del búfer de la pantalla debe ser mayor o igual que el de la " "ventana" @@ -14718,6 +14736,10 @@ msgid "Tab stops" msgstr "Fin de la tabulación" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Añadir" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "&Quitar todo" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/fa.po wine-staging-1.9.3~ubuntu12.04.1/po/fa.po --- wine-staging-1.9.2~ubuntu12.04.1/po/fa.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/fa.po 2016-02-08 19:32:34.000000000 +0000 @@ -12638,7 +12638,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12697,8 +12697,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12730,7 +12730,7 @@ msgstr "ذخیره &به نام..." #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12754,11 +12754,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12766,7 +12766,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12786,7 +12786,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12869,7 +12869,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13336,7 +13336,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14055,6 +14057,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/fi.po wine-staging-1.9.3~ubuntu12.04.1/po/fi.po --- wine-staging-1.9.2~ubuntu12.04.1/po/fi.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/fi.po 2016-02-08 19:32:34.000000000 +0000 @@ -13010,7 +13010,7 @@ "järjestelmän laajuiset ja sovelluskohtaiset asetukset." #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Lisää sovellus..." #: winecfg.rc:160 @@ -13071,8 +13071,8 @@ msgid "&New override for library:" msgstr "&Uusi ohitus kirjastolle:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "&Lisää" #: winecfg.rc:197 @@ -13100,12 +13100,12 @@ msgstr "&Natiivi (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "S&isäinen, sitten natiivi" #: winecfg.rc:212 msgid "Nati&ve then Builtin" -msgstr "Natiivi, sitten sisäinen" +msgstr "Na&tiivi, sitten sisäinen" #: winecfg.rc:220 msgid "Select Drive Letter" @@ -13122,24 +13122,24 @@ msgstr "Levyasemien hallintaan ei saatu yhteyttä. Asemia ei voi muokata." #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "&Lisää..." #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "&Hae automaattisesti" #: winecfg.rc:241 msgid "&Path:" -msgstr "&Polku:" +msgstr "P&olku:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "Nä&ytä lisäasetukset" +msgid "Show Advan&ced" +msgstr "Näytä lisä&asetukset" #: winecfg.rc:249 msgid "De&vice:" -msgstr "Lai&te:" +msgstr "La&ite:" #: winecfg.rc:251 msgid "Bro&wse..." @@ -13151,11 +13151,11 @@ #: winecfg.rc:255 msgid "S&erial:" -msgstr "&Sarjanumero:" +msgstr "Sarjanumer&o:" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "Näytä p&istetiedostot" +msgid "&Show dot files" +msgstr "N&äytä pistetiedostot" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13234,8 +13234,8 @@ msgstr "Valitse unix-kohdekansio." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "&Piilota lisäasetukset" +msgid "Hide Advan&ced" +msgstr "Piilota lisä&asetukset" #: winecfg.rc:39 msgid "(No Theme)" @@ -13695,8 +13695,10 @@ msgstr "Virhe asetuksissa" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" -msgstr "Näytön puskurin on oltava suurempi tai yhtä suuri kuin ikkunan" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." +msgstr "Näyttöpuskurin on oltava vähintään ikkunan kokoinen" #: wineconsole.rc:37 msgid "Each character is %1!u! pixels wide and %2!u! pixels high" @@ -14398,6 +14400,10 @@ msgid "Tab stops" msgstr "Sarkainkohdat" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Lisää" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Poista &kaikki" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/fr.po wine-staging-1.9.3~ubuntu12.04.1/po/fr.po --- wine-staging-1.9.2~ubuntu12.04.1/po/fr.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/fr.po 2016-02-08 19:32:34.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-12-26 15:07+0100\n" +"PO-Revision-Date: 2016-04-02 12:50+0100\n" "Last-Translator: Frédéric Delanoy \n" "Language-Team: French\n" "Language: fr\n" @@ -1045,7 +1045,7 @@ #: comdlg32.rc:148 msgid "Font size has to be a number." -msgstr "" +msgstr "La taille de police doit être un nombre." #: comdlg32.rc:83 oleview.rc:98 msgid "Ready" @@ -13196,8 +13196,8 @@ "onglets." #: winecfg.rc:159 -msgid "&Add application..." -msgstr "&Ajouter une application..." +msgid "Add appli&cation..." +msgstr "Ajouter une appli&cation..." #: winecfg.rc:160 msgid "&Remove application" @@ -13258,9 +13258,9 @@ msgid "&New override for library:" msgstr "&Nouveau remplacement pour :" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "A&jouter" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "Ajou&ter" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13287,7 +13287,7 @@ msgstr "&native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "i&ntégrée puis native" #: winecfg.rc:212 @@ -13311,24 +13311,24 @@ "n'a pu être éditée." #: winecfg.rc:236 -msgid "&Add..." -msgstr "&Ajouter..." +msgid "A&dd..." +msgstr "Ajo&uter..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "&Détection automatique" +msgid "Aut&odetect" +msgstr "Aut&o-détection" #: winecfg.rc:241 msgid "&Path:" msgstr "&Chemin :" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "Afficher les dé&tails" +msgid "Show Advan&ced" +msgstr "Afficher les &détails" #: winecfg.rc:249 msgid "De&vice:" -msgstr "&Périphérique :" +msgstr "Périp&hérique :" #: winecfg.rc:251 msgid "Bro&wse..." @@ -13336,15 +13336,15 @@ #: winecfg.rc:253 msgid "&Label:" -msgstr "É&tiquette :" +msgstr "Ét&iquette :" #: winecfg.rc:255 msgid "S&erial:" -msgstr "N° de &série :" +msgstr "N° de sé&rie :" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "Montrer les fichiers cachés" +msgid "&Show dot files" +msgstr "&Montrer les fichiers cachés" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13423,8 +13423,8 @@ msgstr "Veuillez sélectionner le répertoire Unix cible." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "Cacher les dé&tails" +msgid "Hide Advan&ced" +msgstr "Cacher les &détails" #: winecfg.rc:39 msgid "(No Theme)" @@ -13887,7 +13887,11 @@ msgstr "Erreur de configuration" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "La taille du tampon écran doit être plus grande ou égale à celle du tampon " "de la fenêtre" @@ -14598,6 +14602,10 @@ msgid "Tab stops" msgstr "Taquets de tabulation" +#: wordpad.rc:247 +msgid "&Add" +msgstr "A&jouter" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Supprimer &tous" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/he.po wine-staging-1.9.3~ubuntu12.04.1/po/he.po --- wine-staging-1.9.2~ubuntu12.04.1/po/he.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/he.po 2016-02-08 19:32:34.000000000 +0000 @@ -13021,7 +13021,7 @@ #: winecfg.rc:159 #, fuzzy -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "יישום" #: winecfg.rc:160 @@ -13084,9 +13084,9 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "הו&ספה" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13118,7 +13118,7 @@ #: winecfg.rc:211 #, fuzzy -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "מובנה, טבעי" #: winecfg.rc:212 @@ -13144,12 +13144,12 @@ #: winecfg.rc:236 #, fuzzy -msgid "&Add..." +msgid "A&dd..." msgstr "הו&ספה" #: winecfg.rc:238 #, fuzzy -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "זיהוי אוטומטי" #: winecfg.rc:241 @@ -13159,7 +13159,7 @@ #: winecfg.rc:248 winecfg.rc:38 #, fuzzy -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "הצגת אפשרויות מ&תקדמות" #: winecfg.rc:249 @@ -13181,7 +13181,7 @@ #: winecfg.rc:258 #, fuzzy -msgid "Show &dot files" +msgid "&Show dot files" msgstr "אין עוד קבצים\n" #: winecfg.rc:265 @@ -13273,7 +13273,7 @@ #: winecfg.rc:37 #, fuzzy -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "ה&סתרת האפשרויות המתקדמות" #: winecfg.rc:39 @@ -13817,7 +13817,11 @@ msgstr "שגיאת תצוגה" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "גודל מאגר המסך חייב להיות גדול או שווה לזה של החלון" #: wineconsole.rc:37 @@ -14535,6 +14539,10 @@ msgid "Tab stops" msgstr "טאבי עצירה" +#: wordpad.rc:247 +msgid "&Add" +msgstr "הו&ספה" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "הסרת ה&כול" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/hi.po wine-staging-1.9.3~ubuntu12.04.1/po/hi.po --- wine-staging-1.9.2~ubuntu12.04.1/po/hi.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/hi.po 2016-02-08 19:32:34.000000000 +0000 @@ -12429,7 +12429,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12487,8 +12487,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12517,7 +12517,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12539,11 +12539,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12551,7 +12551,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12571,7 +12571,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12651,7 +12651,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13102,7 +13102,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13794,6 +13796,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/hr.po wine-staging-1.9.3~ubuntu12.04.1/po/hr.po --- wine-staging-1.9.2~ubuntu12.04.1/po/hr.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/hr.po 2016-02-08 19:32:34.000000000 +0000 @@ -12739,7 +12739,9 @@ "promjene ili za podešavanje aplikacija u tim istim tabovima." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Dodaj aplikaciju..." #: winecfg.rc:160 @@ -12799,9 +12801,9 @@ msgid "&New override for library:" msgstr "&Novo nadjačavanje biblioteke:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Dodaj" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -12828,7 +12830,9 @@ msgstr "&Nativno (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Ugrađe&no pa nativno" #: winecfg.rc:212 @@ -12854,19 +12858,25 @@ "može izmijeniti." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Dodaj..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detektiraj" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Autodetektiraj" #: winecfg.rc:241 msgid "&Path:" msgstr "&Putanja:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Pokaži &napredno" #: winecfg.rc:249 @@ -12886,7 +12896,9 @@ msgstr "S&erijski:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Prikaži &dot datoteke" #: winecfg.rc:265 @@ -12968,7 +12980,9 @@ msgstr "Molimo izaberite Unix glavni direktorij." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Sakrij &napredno" #: winecfg.rc:39 @@ -13444,7 +13458,9 @@ msgstr "Pogreška konfiguracije" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14142,6 +14158,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Dodaj" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "&Ukloni sve" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/hu.po wine-staging-1.9.3~ubuntu12.04.1/po/hu.po --- wine-staging-1.9.2~ubuntu12.04.1/po/hu.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/hu.po 2016-02-08 19:32:34.000000000 +0000 @@ -13199,7 +13199,9 @@ "is." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Alkalmazás hozzáadás..." #: winecfg.rc:160 @@ -13260,9 +13262,9 @@ msgid "&New override for library:" msgstr "Új felülbírálás könyvtárhoz:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "Hozzá&adás" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13289,7 +13291,9 @@ msgstr "&Natív (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Beépítet&t, natív" #: winecfg.rc:212 @@ -13315,11 +13319,14 @@ "szerkeszteni." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "Hozzá&ad..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "Automata &felismerés" #: winecfg.rc:241 @@ -13327,7 +13334,9 @@ msgstr "&Útvonal:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Haladó >>" #: winecfg.rc:249 @@ -13347,7 +13356,9 @@ msgstr "S&orozatszám:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Rejtett fájlok megjelenítése" #: winecfg.rc:265 @@ -13429,7 +13440,9 @@ msgstr "Kérem válasszon unix célkönyvtárat." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Haladó <<" #: winecfg.rc:39 @@ -13906,7 +13919,11 @@ msgstr "Beállítási hiba" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "Képernyő pufferméretnek nagyobbnak egy egyenlőnek kell lennie az ablakénál" @@ -14623,6 +14640,10 @@ msgid "Tab stops" msgstr "Tab sorrend" +#: wordpad.rc:247 +msgid "&Add" +msgstr "Hozzá&adás" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Az összes &eltávolítása" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/it.po wine-staging-1.9.3~ubuntu12.04.1/po/it.po --- wine-staging-1.9.2~ubuntu12.04.1/po/it.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/it.po 2016-02-08 19:32:34.000000000 +0000 @@ -13294,7 +13294,9 @@ "quelle schede." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Aggiungi applicazione..." #: winecfg.rc:160 @@ -13355,9 +13357,9 @@ msgid "&New override for library:" msgstr "&Nuova sostituzione per la libreria:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Aggiungi" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13384,7 +13386,9 @@ msgstr "&Nativa (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "In&tegrata poi nativa" #: winecfg.rc:212 @@ -13410,11 +13414,14 @@ "non può essere modificata." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "Aggiungi..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "&Rileva automaticamente" #: winecfg.rc:241 @@ -13422,7 +13429,9 @@ msgstr "&Percorso:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Mostra controlli &avanzati" #: winecfg.rc:249 @@ -13442,7 +13451,9 @@ msgstr "Numero &seriale:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Mostra file &dot" #: winecfg.rc:265 @@ -13524,7 +13535,9 @@ msgstr "Seleziona la cartella Unix desiderata, prego." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Nascondi controlli &avanzati" #: winecfg.rc:39 @@ -14001,7 +14014,11 @@ msgstr "Errore di configurazione" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "Il buffer dello schermo deve essere uguale o più grande di quello della " "finestra" @@ -14717,6 +14734,10 @@ msgid "Tab stops" msgstr "Punti di fermata delle tabulazioni" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Aggiungi" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Rimuovi &tutti" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ja.po wine-staging-1.9.3~ubuntu12.04.1/po/ja.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ja.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ja.po 2016-02-08 19:32:34.000000000 +0000 @@ -13022,8 +13022,8 @@ "体の設定や 個別アプリケーションの設定の変更が行えます。" #: winecfg.rc:159 -msgid "&Add application..." -msgstr "アプリケーションを追加(&A)..." +msgid "Add appli&cation..." +msgstr "アプリケーションを追加(&C)..." #: winecfg.rc:160 msgid "&Remove application" @@ -13082,9 +13082,9 @@ msgid "&New override for library:" msgstr "ライブラリの新規オーバーライド(&N):" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "追加(&A)" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "追加(&D)" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13111,8 +13111,8 @@ msgstr "ネイティブ版(Windows)(&N)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "内蔵版後にネイティブ版(&L)" +msgid "Buil&tin then Native" +msgstr "内蔵版後にネイティブ版(&T)" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -13134,20 +13134,20 @@ "マウント マネージャへの接続に失敗したため、ドライブ設定は変更できません。" #: winecfg.rc:236 -msgid "&Add..." -msgstr "追加(&A)..." +msgid "A&dd..." +msgstr "追加(&D)..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "自動検出(&D)" +msgid "Aut&odetect" +msgstr "自動検出(&O)" #: winecfg.rc:241 msgid "&Path:" msgstr "パス(&P):" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "詳細を表示(&A)" +msgid "Show Advan&ced" +msgstr "詳細を表示(&C)" #: winecfg.rc:249 msgid "De&vice:" @@ -13166,8 +13166,8 @@ msgstr "シリアル番号(&E):" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "ドット ファイルを表示する" +msgid "&Show dot files" +msgstr "ドット ファイルを表示する(&S)" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13246,8 +13246,8 @@ msgstr "Unix の対象ディレクトリを選択してください。" #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "詳細を隠す(&A)" +msgid "Hide Advan&ced" +msgstr "詳細を隠す(&C)" #: winecfg.rc:39 msgid "(No Theme)" @@ -13710,7 +13710,11 @@ msgstr "構成エラー" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "スクリーン バッファ サイズはウィンドウ バッファ サイズ以上にしてください" @@ -14414,6 +14418,10 @@ msgid "Tab stops" msgstr "タブの停止位置" +#: wordpad.rc:247 +msgid "&Add" +msgstr "追加(&A)" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "すべて削除(&L)" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ko.po wine-staging-1.9.3~ubuntu12.04.1/po/ko.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ko.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ko.po 2016-02-08 19:32:34.000000000 +0000 @@ -13263,8 +13263,8 @@ "수 있도록 라이브러리 및 그래픽 탭에 연결되어 있습니다." #: winecfg.rc:159 -msgid "&Add application..." -msgstr "응용프로그램 추가(&A)..." +msgid "Add appli&cation..." +msgstr "응용프로그램 추가(&C)..." #: winecfg.rc:160 msgid "&Remove application" @@ -13323,9 +13323,9 @@ msgid "&New override for library:" msgstr "새로 덮어쓸 라이브러리(&N):" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "더하기(&A)" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "더하기(&D)" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13352,8 +13352,8 @@ msgstr "네이티브(&N)(Win)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "내장, 네이티브(&L)" +msgid "Buil&tin then Native" +msgstr "내장, 네이티브(&T)" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -13377,20 +13377,20 @@ "연결 관리자가 연결하는 데 실패함, 이 드라이브 설정을 수정될 수 없습니다." #: winecfg.rc:236 -msgid "&Add..." -msgstr "추가(&A)..." +msgid "A&dd..." +msgstr "추가(&D)..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "자동찾기(&D)" +msgid "Aut&odetect" +msgstr "자동찾기(&O)" #: winecfg.rc:241 msgid "&Path:" msgstr "경로(&P):" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "추가옵션 보이기(&A)" +msgid "Show Advan&ced" +msgstr "추가옵션 보이기(&C)" #: winecfg.rc:249 msgid "De&vice:" @@ -13409,8 +13409,8 @@ msgstr "시리얼(&E):" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "숨은 파일 보이기(&D)" +msgid "&Show dot files" +msgstr "숨은 파일 보이기(&S)" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13491,8 +13491,8 @@ msgstr "유닉스 목적 폴더를 선택하십시오." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "추가옵션 숨기기(&A)" +msgid "Hide Advan&ced" +msgstr "추가옵션 숨기기(&C)" #: winecfg.rc:39 msgid "(No Theme)" @@ -13967,7 +13967,11 @@ msgstr "설정 오류" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "스크린 버퍼 크기는 반드시 창보다 같거나 커야합니다" #: wineconsole.rc:37 @@ -14671,6 +14675,10 @@ msgid "Tab stops" msgstr "탭 정지" +#: wordpad.rc:247 +msgid "&Add" +msgstr "더하기(&A)" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "모두 지우기(&L)" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/lt.po wine-staging-1.9.3~ubuntu12.04.1/po/lt.po --- wine-staging-1.9.2~ubuntu12.04.1/po/lt.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/lt.po 2016-02-08 19:32:34.000000000 +0000 @@ -13050,7 +13050,9 @@ "atskirai." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Pridėti programą..." #: winecfg.rc:160 @@ -13110,9 +13112,9 @@ msgid "&New override for library:" msgstr "&Naujas nustelbimas bibliotekai:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Pridėti" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13139,7 +13141,9 @@ msgstr "&Sava („Windows“)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Į&taisyta, po to sava" #: winecfg.rc:212 @@ -13163,19 +13167,25 @@ "redaguojama." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Pridėti..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Automatiškai &aptikti" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Automatiškai aptikti" #: winecfg.rc:241 msgid "&Path:" msgstr "&Kelias:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Rodyti papil&domas" #: winecfg.rc:249 @@ -13195,7 +13205,9 @@ msgstr "N&umeris:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Rodyti &failus su tašku" #: winecfg.rc:265 @@ -13275,7 +13287,9 @@ msgstr "Išrinkite Unix paskirties aplanką." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Slėpti papil&domas" #: winecfg.rc:39 @@ -13737,7 +13751,11 @@ msgstr "Konfigūracijos klaida" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Ekrano buferio dydis turi būti didesnis arba lygus lango buferiui" #: wineconsole.rc:37 @@ -14442,6 +14460,10 @@ msgid "Tab stops" msgstr "Tabuliavimo pozicija" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Pridėti" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Pašalinti &visas" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ml.po wine-staging-1.9.3~ubuntu12.04.1/po/ml.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ml.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ml.po 2016-02-08 19:32:34.000000000 +0000 @@ -12429,7 +12429,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12487,8 +12487,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12517,7 +12517,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12539,11 +12539,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12551,7 +12551,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12571,7 +12571,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12651,7 +12651,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13102,7 +13102,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13794,6 +13796,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/nb_NO.po wine-staging-1.9.3~ubuntu12.04.1/po/nb_NO.po --- wine-staging-1.9.2~ubuntu12.04.1/po/nb_NO.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/nb_NO.po 2016-02-08 19:32:34.000000000 +0000 @@ -13107,7 +13107,9 @@ "innstillinger for hele systemet eller enkelte programmer der også." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Legg til progr&am..." #: winecfg.rc:160 @@ -13168,9 +13170,9 @@ msgid "&New override for library:" msgstr "Ny overstyring for bibliotek:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Legg til" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13197,7 +13199,9 @@ msgstr "I&nnfødt (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "&Innebygget så innfødt" #: winecfg.rc:212 @@ -13221,19 +13225,25 @@ "redigeres." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Legg til..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "&Automatisk" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Finn automatisk" #: winecfg.rc:241 msgid "&Path:" msgstr "&Sti:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Avansert visning" #: winecfg.rc:249 @@ -13253,7 +13263,9 @@ msgstr "S&erienummer:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Vis .-filer" #: winecfg.rc:265 @@ -13335,7 +13347,9 @@ msgstr "Velg Unix-målkatalogen." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Enkel visning" #: winecfg.rc:39 @@ -13808,7 +13822,11 @@ msgstr "Konfigurasjonsfeil" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Skjermens hurtigminnestørrelse må være større eller lik vinduets" #: wineconsole.rc:37 @@ -14513,6 +14531,10 @@ msgid "Tab stops" msgstr "Tabulatorstopp" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Legg til" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Fjern all&e" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/nl.po wine-staging-1.9.3~ubuntu12.04.1/po/nl.po --- wine-staging-1.9.2~ubuntu12.04.1/po/nl.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/nl.po 2016-02-08 19:32:34.000000000 +0000 @@ -13258,7 +13258,9 @@ "maken." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Toepassing toevoegen..." #: winecfg.rc:160 @@ -13320,9 +13322,9 @@ msgid "&New override for library:" msgstr "Nieuwe override voor dll:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Toevoegen" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13349,7 +13351,9 @@ msgstr "Wi&ndows (MSWindows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Bui<in dan Native" #: winecfg.rc:212 @@ -13375,19 +13379,25 @@ "worden bewerkt." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Toevoegen..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "&Automatisch instellen" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "&Automatisch detecteren" #: winecfg.rc:241 msgid "&Path:" msgstr "&Pad:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Toon uitgebreid" #: winecfg.rc:249 @@ -13407,7 +13417,9 @@ msgstr "S&erienummer:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Toon \".\" bestanden" #: winecfg.rc:265 @@ -13489,7 +13501,9 @@ msgstr "Selecteer de Unix doelmap a.u.b." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Verberg uitgebreid" #: winecfg.rc:39 @@ -13967,7 +13981,11 @@ msgstr "Configuratiefout" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "De schermbuffer moet groter dan of gelijk zijn aan de vensterbuffer" #: wineconsole.rc:37 @@ -14679,6 +14697,10 @@ msgid "Tab stops" msgstr "Tab-einden" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Toevoegen" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Verwijder al&len" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/or.po wine-staging-1.9.3~ubuntu12.04.1/po/or.po --- wine-staging-1.9.2~ubuntu12.04.1/po/or.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/or.po 2016-02-08 19:32:34.000000000 +0000 @@ -12429,7 +12429,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12487,8 +12487,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12517,7 +12517,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12539,11 +12539,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12551,7 +12551,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12571,7 +12571,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12651,7 +12651,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13102,7 +13102,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13794,6 +13796,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/pa.po wine-staging-1.9.3~ubuntu12.04.1/po/pa.po --- wine-staging-1.9.2~ubuntu12.04.1/po/pa.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/pa.po 2016-02-08 19:32:34.000000000 +0000 @@ -12429,7 +12429,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12487,8 +12487,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12517,7 +12517,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12539,11 +12539,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12551,7 +12551,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12571,7 +12571,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12651,7 +12651,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13102,7 +13102,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13794,6 +13796,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/pl.po wine-staging-1.9.3~ubuntu12.04.1/po/pl.po --- wine-staging-1.9.2~ubuntu12.04.1/po/pl.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/pl.po 2016-02-08 19:32:34.000000000 +0000 @@ -13097,7 +13097,9 @@ "również dotyczą wszystkich aplikacji lub tylko wybranej." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Dodaj aplikację..." #: winecfg.rc:160 @@ -13158,9 +13160,9 @@ msgid "&New override for library:" msgstr "&Nowa reguła dla biblioteki:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "Dod&aj" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13187,7 +13189,9 @@ msgstr "Tylko &natywna (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Preferuj w&budowaną" #: winecfg.rc:212 @@ -13211,19 +13215,25 @@ "zmienić ustawień napędu." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "Dod&aj..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Wykryj &samoczynnie" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Wykryj samoczynnie" #: winecfg.rc:241 msgid "&Path:" msgstr "&Ścieżka:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Opcje z&aawansowane >>" #: winecfg.rc:249 @@ -13243,7 +13253,9 @@ msgstr "Numer s&eryjny:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Pokazuj pliki zaczynające się od kropki" #: winecfg.rc:265 @@ -13323,7 +13335,9 @@ msgstr "Proszę wybrać docelowy katalog Uniksowy." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Ukryj z&aawansowane <<" #: winecfg.rc:39 @@ -13785,7 +13799,11 @@ msgstr "Błąd ustawiania" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Wielkość bufora ekranu musi być większa niż wielkość bufora okna" #: wineconsole.rc:37 @@ -14491,6 +14509,10 @@ msgid "Tab stops" msgstr "Pozycje tabulatorów" +#: wordpad.rc:247 +msgid "&Add" +msgstr "Dod&aj" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Usuń &wszystkie" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/pt_BR.po wine-staging-1.9.3~ubuntu12.04.1/po/pt_BR.po --- wine-staging-1.9.2~ubuntu12.04.1/po/pt_BR.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/pt_BR.po 2016-02-08 19:32:34.000000000 +0000 @@ -13109,7 +13109,9 @@ "configurações globais ou por aplicativo também nessas abas." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Adicionar aplicativo..." #: winecfg.rc:160 @@ -13170,9 +13172,9 @@ msgid "&New override for library:" msgstr "&Nova substituição para a biblioteca:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Adicionar" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13199,7 +13201,9 @@ msgstr "&Nativa (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "E&mbutida depois Nativa" #: winecfg.rc:212 @@ -13223,19 +13227,25 @@ "não pôde ser alterada." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Adicionar..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto &Detectar" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Auto detectar" #: winecfg.rc:241 msgid "&Path:" msgstr "&Caminho:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "&Avançado" #: winecfg.rc:249 @@ -13255,7 +13265,9 @@ msgstr "&Serial:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "&Mostrar arquivos com ponto" #: winecfg.rc:265 @@ -13335,7 +13347,9 @@ msgstr "Por favor, selecione o diretório Unix alvo." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "&Ocultar" #: winecfg.rc:39 @@ -13797,7 +13811,11 @@ msgstr "Erro de configuração" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Tamanho do buffer de tela deve ser maior ou igual ao da janela" #: wineconsole.rc:37 @@ -14502,6 +14520,10 @@ msgid "Tab stops" msgstr "Marcas de tabulação" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Adicionar" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Remover &todos" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/pt_PT.po wine-staging-1.9.3~ubuntu12.04.1/po/pt_PT.po --- wine-staging-1.9.2~ubuntu12.04.1/po/pt_PT.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/pt_PT.po 2016-02-08 19:32:34.000000000 +0000 @@ -13085,7 +13085,9 @@ "definições por aplicação ou no sistema também nessas abas." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Adicionar aplicação..." #: winecfg.rc:160 @@ -13146,9 +13148,9 @@ msgid "&New override for library:" msgstr "&Nova substituição para:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Adicionar" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13175,7 +13177,9 @@ msgstr "&Nativa (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "E&mbutida depois Nativa" #: winecfg.rc:212 @@ -13201,19 +13205,25 @@ "ser editada." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Adicionar..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Auto&detectar" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Auto detectar" #: winecfg.rc:241 msgid "&Path:" msgstr "&Localização:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "&Avançado" #: winecfg.rc:249 @@ -13233,7 +13243,9 @@ msgstr "Nº S&erie:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Mostrar &ficheiros com pontos" #: winecfg.rc:265 @@ -13315,7 +13327,9 @@ msgstr "Por favor, seleccione o directório Unix de destino." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "&Ocultar" #: winecfg.rc:39 @@ -13790,7 +13804,11 @@ msgstr "Erro de configuração" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "O tamanho do 'buffer' do ecrã deve ser maior ou igual ao da janela" #: wineconsole.rc:37 @@ -14498,6 +14516,10 @@ msgid "Tab stops" msgstr "Marca de tabulação" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Adicionar" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Remover &todos" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/rm.po wine-staging-1.9.3~ubuntu12.04.1/po/rm.po --- wine-staging-1.9.2~ubuntu12.04.1/po/rm.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/rm.po 2016-02-08 19:32:34.000000000 +0000 @@ -12517,8 +12517,9 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." -msgstr "" +#, fuzzy +msgid "Add appli&cation..." +msgstr "&Annotaziun..." #: winecfg.rc:160 #, fuzzy @@ -12577,8 +12578,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12609,7 +12610,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12632,11 +12633,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12644,7 +12645,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12664,7 +12665,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12747,7 +12748,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13201,7 +13202,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13898,6 +13901,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 #, fuzzy msgid "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ro.po wine-staging-1.9.3~ubuntu12.04.1/po/ro.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ro.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ro.po 2016-02-08 19:32:34.000000000 +0000 @@ -13297,7 +13297,9 @@ "aplicație în această subfereastră." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Adaugă o aplicație..." #: winecfg.rc:160 @@ -13357,9 +13359,9 @@ msgid "&New override for library:" msgstr "Suprascriere nouă pentru librăria:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Adaugă" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13386,7 +13388,9 @@ msgstr "&Native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Bui<in apoi Native" #: winecfg.rc:212 @@ -13412,19 +13416,25 @@ "fi schimbată." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Adaugă..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "&Detectează" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Detectează automat" #: winecfg.rc:241 msgid "&Path:" msgstr "&Calea:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Afișează opțiunile a&vansate" #: winecfg.rc:249 @@ -13444,7 +13454,9 @@ msgstr "N&umăr de serie:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Afișează &fișierele ascunse" #: winecfg.rc:265 @@ -13526,7 +13538,9 @@ msgstr "Selectați dosarul destinație unix." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Ascunde opțiunile a&vansate" #: winecfg.rc:39 @@ -14003,7 +14017,11 @@ msgstr "Eroare de configurare" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" "Mărimea memoriei tampon a ecranului trebuie să fie egală sau mai mare decât " "cea a ferestrei" @@ -14708,6 +14726,10 @@ msgid "Tab stops" msgstr "Spațiere tab" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Adaugă" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "E&limină tot" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/ru.po wine-staging-1.9.3~ubuntu12.04.1/po/ru.po --- wine-staging-1.9.2~ubuntu12.04.1/po/ru.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/ru.po 2016-02-08 19:32:34.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-12-23 01:22+0300\n" +"PO-Revision-Date: 2016-01-26 15:30+0300\n" "Last-Translator: Nikolay Sivov \n" "Language-Team: Russian\n" "Language: ru\n" @@ -13041,7 +13041,7 @@ "приложения, так и глобально." #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Добавить приложение..." #: winecfg.rc:160 @@ -13101,9 +13101,9 @@ msgid "&New override for library:" msgstr "Новое замещение для библиотеки:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Установить" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "&Добавить" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13127,15 +13127,15 @@ #: winecfg.rc:210 msgid "&Native (Windows)" -msgstr "С&торонняя (Windows)" +msgstr "&Сторонняя (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "В&строенная, затем сторонняя" +msgid "Buil&tin then Native" +msgstr "Вс&троенная, затем сторонняя" #: winecfg.rc:212 msgid "Nati&ve then Builtin" -msgstr "Ст&оронняя, затем встроенная" +msgstr "Сто&ронняя, затем встроенная" #: winecfg.rc:220 msgid "Select Drive Letter" @@ -13154,11 +13154,11 @@ "редактироваться." #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "&Добавить..." #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "&Автоопределение" #: winecfg.rc:241 @@ -13166,8 +13166,8 @@ msgstr "&Путь:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "&Дополнительно" +msgid "Show Advan&ced" +msgstr "До&полнительно" #: winecfg.rc:249 msgid "De&vice:" @@ -13186,8 +13186,8 @@ msgstr "Сер. &номер:" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "Показывать файлы, начинающиеся с точки" +msgid "&Show dot files" +msgstr "Показывать файлы, начинающиеся с &точки" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13266,8 +13266,8 @@ msgstr "Выберите целевой каталог в системе." #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "Скрыть дополнительные" +msgid "Hide Advan&ced" +msgstr "&Скрыть доп. настройки" #: winecfg.rc:39 msgid "(No Theme)" @@ -13728,7 +13728,11 @@ msgstr "Ошибка настройки" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Размер буфера экрана должен быть не менее буфера окна" #: wineconsole.rc:37 @@ -14433,6 +14437,10 @@ msgid "Tab stops" msgstr "Позиции табуляции" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Установить" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Очистить &все" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/sk.po wine-staging-1.9.3~ubuntu12.04.1/po/sk.po --- wine-staging-1.9.2~ubuntu12.04.1/po/sk.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/sk.po 2016-02-08 19:32:34.000000000 +0000 @@ -12693,7 +12693,9 @@ "alebo pre konkrétnu aplikáciu nastavenia v týchto kartách." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Pridať aplikáciu..." #: winecfg.rc:160 @@ -12754,9 +12756,9 @@ msgid "&New override for library:" msgstr "&Nové prepísanie pre knižnicu:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Pridať" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -12783,7 +12785,9 @@ msgstr "&Natívne (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Vst&avané potom natívne" #: winecfg.rc:212 @@ -12806,11 +12810,14 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Pridať..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "Automatická &detekcia" #: winecfg.rc:241 @@ -12818,7 +12825,9 @@ msgstr "&Cesta:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Ukáž &pokročilé" #: winecfg.rc:249 @@ -12838,8 +12847,9 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "" +#, fuzzy +msgid "&Show dot files" +msgstr "&Detaily" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -12921,8 +12931,10 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "" +#, fuzzy +#| msgid "Advanced" +msgid "Hide Advan&ced" +msgstr "Pokročilý" #: winecfg.rc:39 msgid "(No Theme)" @@ -13386,7 +13398,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14091,6 +14105,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Pridať" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Odstrániť &všetko" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/sl.po wine-staging-1.9.3~ubuntu12.04.1/po/sl.po --- wine-staging-1.9.2~ubuntu12.04.1/po/sl.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/sl.po 2016-02-08 19:32:34.000000000 +0000 @@ -13227,7 +13227,9 @@ "posamezne programe." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Dodaj program ..." #: winecfg.rc:160 @@ -13288,9 +13290,9 @@ msgid "&New override for library:" msgstr "&Nov prepis za knjižnico:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Dodaj" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13317,7 +13319,9 @@ msgstr "&Izvorna (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Vgra&jena, izvorna" #: winecfg.rc:212 @@ -13343,11 +13347,14 @@ "nastavitev pogonov ne bo mogoče urejati." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Dodaj ..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "&Samodejno zaznaj" #: winecfg.rc:241 @@ -13355,7 +13362,9 @@ msgstr "&Pot:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Pokaži &napredno" #: winecfg.rc:249 @@ -13375,7 +13384,9 @@ msgstr "Zapor&edna št.:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Pokaži &datoteke s piko" #: winecfg.rc:265 @@ -13457,7 +13468,9 @@ msgstr "Izberite ciljno mapo Unix." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Skrij &napredno" #: winecfg.rc:39 @@ -13934,7 +13947,11 @@ msgstr "Napaka nastavitve" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Velikost zaslonskega medpomnilnika mora biti večja ali enaka okenskemu" #: wineconsole.rc:37 @@ -14652,6 +14669,10 @@ msgid "Tab stops" msgstr "Položaji tabulatorja" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Dodaj" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Odstrani v&se" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/sr_RS@cyrillic.po wine-staging-1.9.3~ubuntu12.04.1/po/sr_RS@cyrillic.po --- wine-staging-1.9.2~ubuntu12.04.1/po/sr_RS@cyrillic.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/sr_RS@cyrillic.po 2016-02-08 19:32:34.000000000 +0000 @@ -13155,7 +13155,7 @@ #: winecfg.rc:159 #, fuzzy -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "програм" #: winecfg.rc:160 @@ -13218,8 +13218,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -13252,7 +13252,7 @@ msgstr "&Прозор" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -13276,11 +13276,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -13288,7 +13288,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -13313,8 +13313,9 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "" +#, fuzzy +msgid "&Show dot files" +msgstr "&Детаљи" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13401,7 +13402,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13904,7 +13905,9 @@ msgstr "Грешка у радњама" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14655,6 +14658,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 #, fuzzy msgid "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/sr_RS@latin.po wine-staging-1.9.3~ubuntu12.04.1/po/sr_RS@latin.po --- wine-staging-1.9.2~ubuntu12.04.1/po/sr_RS@latin.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/sr_RS@latin.po 2016-02-08 19:32:34.000000000 +0000 @@ -13305,7 +13305,9 @@ "podešavanje aplikacija u istim tabovima." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Dodaj aplikaciju..." #: winecfg.rc:160 @@ -13368,9 +13370,9 @@ msgid "&New override for library:" msgstr "&Novo podešavanje biblioteke:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Dodaj" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13398,7 +13400,9 @@ msgstr "&Native (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Bui<in pa Native" #: winecfg.rc:212 @@ -13424,11 +13428,14 @@ "izmeniti." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Dodaj..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +msgid "Aut&odetect" msgstr "Auto&matski" #: winecfg.rc:241 @@ -13436,7 +13443,9 @@ msgstr "&Putanja:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Pokaži &Napredno" #: winecfg.rc:249 @@ -13456,7 +13465,9 @@ msgstr "S&erijski:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Prikaži &dot fajlove" #: winecfg.rc:265 @@ -13541,7 +13552,9 @@ msgstr "Izaberite unix glavni direktorijum, molim." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Sakrij &Napredno" #: winecfg.rc:39 @@ -14044,7 +14057,9 @@ msgstr "Greška u radnjama" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14798,6 +14813,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Dodaj" + #: wordpad.rc:251 #, fuzzy msgid "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/sv.po wine-staging-1.9.3~ubuntu12.04.1/po/sv.po --- wine-staging-1.9.2~ubuntu12.04.1/po/sv.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/sv.po 2016-02-08 19:32:34.000000000 +0000 @@ -12913,7 +12913,9 @@ "program." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Lägg till program..." #: winecfg.rc:160 @@ -12974,9 +12976,9 @@ msgid "&New override for library:" msgstr "&Ny åsidosättning för bibliotek:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "Lägg &till" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13003,7 +13005,9 @@ msgstr "&Ursprunglig (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Inb&yggd sedan Ursprunglig" #: winecfg.rc:212 @@ -13027,19 +13031,25 @@ "Enhetskonfigurationen kan inte redigeras." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Lägg till..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Upptäck aut&omatiskt" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Upptäck automatiskt" #: winecfg.rc:241 msgid "&Path:" msgstr "&Sökväg:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Visa &avancerat" #: winecfg.rc:249 @@ -13059,7 +13069,9 @@ msgstr "S&erienr:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Visa &punktfiler" #: winecfg.rc:265 @@ -13139,7 +13151,9 @@ msgstr "Välj unix-målkatalog, tack." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Dölj &avancerat" #: winecfg.rc:39 @@ -13600,7 +13614,9 @@ msgstr "Konfigurationsfel" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14305,6 +14321,10 @@ msgid "Tab stops" msgstr "Tabbstopp" +#: wordpad.rc:247 +msgid "&Add" +msgstr "Lägg &till" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Ta bort a&lla" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/te.po wine-staging-1.9.3~ubuntu12.04.1/po/te.po --- wine-staging-1.9.2~ubuntu12.04.1/po/te.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/te.po 2016-02-08 19:32:34.000000000 +0000 @@ -12429,7 +12429,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12487,8 +12487,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12517,7 +12517,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12539,11 +12539,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12551,7 +12551,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12571,7 +12571,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12651,7 +12651,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13102,7 +13102,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13794,6 +13796,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/th.po wine-staging-1.9.3~ubuntu12.04.1/po/th.po --- wine-staging-1.9.2~ubuntu12.04.1/po/th.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/th.po 2016-02-08 19:32:34.000000000 +0000 @@ -12678,7 +12678,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12737,8 +12737,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12767,7 +12767,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12791,11 +12791,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12803,7 +12803,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12823,8 +12823,9 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "" +#, fuzzy +msgid "&Show dot files" +msgstr "รายละเอียด" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -12907,7 +12908,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13373,7 +13374,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -14091,6 +14094,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/tr.po wine-staging-1.9.3~ubuntu12.04.1/po/tr.po --- wine-staging-1.9.2~ubuntu12.04.1/po/tr.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/tr.po 2016-02-08 19:32:34.000000000 +0000 @@ -13057,7 +13057,9 @@ "çapındaki veya uygulamaya özel ayarları yapmanıza izin verir." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "Uygulama &Ekle..." #: winecfg.rc:160 @@ -13118,9 +13120,9 @@ msgid "&New override for library:" msgstr "Kitaplık için yeni öncelik:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Ekle" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13147,7 +13149,9 @@ msgstr "&Doğal (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "Önce Yer&leşik sonra Doğal" #: winecfg.rc:212 @@ -13170,11 +13174,15 @@ "Bağlama yöneticisine bağlanılamadı, sürücü yapılandırması düzenlenemiyor." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Ekle..." #: winecfg.rc:238 -msgid "Auto&detect" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" msgstr "Otomatik &Algıla" #: winecfg.rc:241 @@ -13182,7 +13190,9 @@ msgstr "&Yol:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Gelişmiş Ayarlar" #: winecfg.rc:249 @@ -13202,7 +13212,9 @@ msgstr "S&eri No:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Noktayla başlayan dosyaları göster" #: winecfg.rc:265 @@ -13282,7 +13294,9 @@ msgstr "Lütfen Unix hedef dizinini seçin." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Temel Ayarlar" #: winecfg.rc:39 @@ -13745,7 +13759,11 @@ msgstr "Yapılandırma hatası" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Ekran tamponu en az pencereninki kadar büyük olmalıdır" #: wineconsole.rc:37 @@ -14447,6 +14465,10 @@ msgid "Tab stops" msgstr "Sekme durmaları" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Ekle" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Tümünü &kaldır" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/uk.po wine-staging-1.9.3~ubuntu12.04.1/po/uk.po --- wine-staging-1.9.2~ubuntu12.04.1/po/uk.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/uk.po 2016-02-08 19:32:34.000000000 +0000 @@ -13122,7 +13122,9 @@ "цих вкладках як для окремої програми, так і глобально." #: winecfg.rc:159 -msgid "&Add application..." +#, fuzzy +#| msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Додати програму..." #: winecfg.rc:160 @@ -13182,9 +13184,9 @@ msgid "&New override for library:" msgstr "&Нове заміщення для бібліотеки:" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "&Додати" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13211,7 +13213,9 @@ msgstr "&Стороння (Windows)" #: winecfg.rc:211 -msgid "Bui<in then Native" +#, fuzzy +#| msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "В&будована, потім стороння" #: winecfg.rc:212 @@ -13235,19 +13239,25 @@ "редагуватися." #: winecfg.rc:236 -msgid "&Add..." +#, fuzzy +#| msgid "&Add..." +msgid "A&dd..." msgstr "&Додати..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "Автови&значення" +#, fuzzy +#| msgid "Autodetect" +msgid "Aut&odetect" +msgstr "Автовизначення" #: winecfg.rc:241 msgid "&Path:" msgstr "&Шлях:" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +#, fuzzy +#| msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "Показати &Додаткове" #: winecfg.rc:249 @@ -13267,7 +13277,9 @@ msgstr "&Сер.ном:" #: winecfg.rc:258 -msgid "Show &dot files" +#, fuzzy +#| msgid "Show &dot files" +msgid "&Show dot files" msgstr "Показати &файли, що починаються з крапки" #: winecfg.rc:265 @@ -13347,7 +13359,9 @@ msgstr "Будь ласка, виберіть цільову теку Unix." #: winecfg.rc:37 -msgid "Hide &Advanced" +#, fuzzy +#| msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "Сховати &Додаткове" #: winecfg.rc:39 @@ -13809,7 +13823,11 @@ msgstr "Помилка конфігурації" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "Розмір буфера екрану повинен бути не менший буфера вікна" #: wineconsole.rc:37 @@ -14513,6 +14531,10 @@ msgid "Tab stops" msgstr "Позиції табуляції" +#: wordpad.rc:247 +msgid "&Add" +msgstr "&Додати" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "Видалити в&се" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/wa.po wine-staging-1.9.3~ubuntu12.04.1/po/wa.po --- wine-staging-1.9.2~ubuntu12.04.1/po/wa.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/wa.po 2016-02-08 19:32:34.000000000 +0000 @@ -12587,7 +12587,7 @@ #: winecfg.rc:159 #, fuzzy -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "&Options" #: winecfg.rc:160 @@ -12646,8 +12646,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12677,7 +12677,7 @@ msgstr "Å dfait di &Wine..." #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12700,11 +12700,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12712,7 +12712,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12732,7 +12732,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12816,7 +12816,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13278,7 +13278,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13997,6 +13999,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 #, fuzzy msgid "Remove al&l" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/wine.pot wine-staging-1.9.3~ubuntu12.04.1/po/wine.pot --- wine-staging-1.9.2~ubuntu12.04.1/po/wine.pot 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/wine.pot 2016-02-08 19:32:34.000000000 +0000 @@ -12363,7 +12363,7 @@ msgstr "" #: winecfg.rc:159 -msgid "&Add application..." +msgid "Add appli&cation..." msgstr "" #: winecfg.rc:160 @@ -12421,8 +12421,8 @@ msgid "&New override for library:" msgstr "" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" +#: winecfg.rc:196 +msgid "A&dd" msgstr "" #: winecfg.rc:197 @@ -12450,7 +12450,7 @@ msgstr "" #: winecfg.rc:211 -msgid "Bui<in then Native" +msgid "Buil&tin then Native" msgstr "" #: winecfg.rc:212 @@ -12472,11 +12472,11 @@ msgstr "" #: winecfg.rc:236 -msgid "&Add..." +msgid "A&dd..." msgstr "" #: winecfg.rc:238 -msgid "Auto&detect" +msgid "Aut&odetect" msgstr "" #: winecfg.rc:241 @@ -12484,7 +12484,7 @@ msgstr "" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" +msgid "Show Advan&ced" msgstr "" #: winecfg.rc:249 @@ -12504,7 +12504,7 @@ msgstr "" #: winecfg.rc:258 -msgid "Show &dot files" +msgid "&Show dot files" msgstr "" #: winecfg.rc:265 @@ -12584,7 +12584,7 @@ msgstr "" #: winecfg.rc:37 -msgid "Hide &Advanced" +msgid "Hide Advan&ced" msgstr "" #: winecfg.rc:39 @@ -13033,7 +13033,9 @@ msgstr "" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "" #: wineconsole.rc:37 @@ -13713,6 +13715,10 @@ msgid "Tab stops" msgstr "" +#: wordpad.rc:247 +msgid "&Add" +msgstr "" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/zh_CN.po wine-staging-1.9.3~ubuntu12.04.1/po/zh_CN.po --- wine-staging-1.9.2~ubuntu12.04.1/po/zh_CN.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/zh_CN.po 2016-02-08 19:32:34.000000000 +0000 @@ -12533,8 +12533,8 @@ "示”标签页中作不同的设置。" #: winecfg.rc:159 -msgid "&Add application..." -msgstr "增加程序设置(&A)..." +msgid "Add appli&cation..." +msgstr "增加程序设置(&C)..." #: winecfg.rc:160 msgid "&Remove application" @@ -12593,9 +12593,9 @@ msgid "&New override for library:" msgstr "新增函数库顶替(&N):" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "添加(&A)" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "添加(&D)" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -12622,8 +12622,8 @@ msgstr "原装(Windows)(&N)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "内建先于原装(&L)" +msgid "Buil&tin then Native" +msgstr "内建先于原装(&T)" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -12644,20 +12644,20 @@ msgstr "无法连接到挂载管理器。不能修改驱动器配置。" #: winecfg.rc:236 -msgid "&Add..." -msgstr "添加(&A)..." +msgid "A&dd..." +msgstr "添加(&D)..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "自动侦测(&D)" +msgid "Aut&odetect" +msgstr "自动侦测(&O)" #: winecfg.rc:241 msgid "&Path:" msgstr "路径(&P):" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "显示高级选项(&A)" +msgid "Show Advan&ced" +msgstr "显示高级选项(&C)" #: winecfg.rc:249 msgid "De&vice:" @@ -12676,8 +12676,8 @@ msgstr "序列号(&E):" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "显示隐藏文件(&D)" +msgid "&Show dot files" +msgstr "显示隐藏文件(&S)" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -12756,8 +12756,8 @@ msgstr "请选择目标 Unix 文件夹。" #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "隐藏高级选项(&A)" +msgid "Hide Advan&ced" +msgstr "隐藏高级选项(&C)" #: winecfg.rc:39 msgid "(No Theme)" @@ -13218,7 +13218,11 @@ msgstr "配置错误" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "屏幕缓冲区大小必须不小于窗口" #: wineconsole.rc:37 @@ -13917,6 +13921,10 @@ msgid "Tab stops" msgstr "制表位宽度" +#: wordpad.rc:247 +msgid "&Add" +msgstr "添加(&A)" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "全部删除(&R)" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/po/zh_TW.po wine-staging-1.9.3~ubuntu12.04.1/po/zh_TW.po --- wine-staging-1.9.2~ubuntu12.04.1/po/zh_TW.po 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/po/zh_TW.po 2016-02-08 19:32:34.000000000 +0000 @@ -13140,8 +13140,8 @@ "到這個分頁, 除了調整預設設定, 也能調整個別程式的設定。" #: winecfg.rc:159 -msgid "&Add application..." -msgstr "新增程式設定(&A)..." +msgid "Add appli&cation..." +msgstr "新增程式設定(&C)..." #: winecfg.rc:160 msgid "&Remove application" @@ -13200,9 +13200,9 @@ msgid "&New override for library:" msgstr "新增函式庫覆載(&N):" -#: winecfg.rc:196 wordpad.rc:247 -msgid "&Add" -msgstr "新增(&A)" +#: winecfg.rc:196 +msgid "A&dd" +msgstr "新增(&D)" #: winecfg.rc:197 msgid "Existing &overrides:" @@ -13229,8 +13229,8 @@ msgstr "原生(Windows)(&N)" #: winecfg.rc:211 -msgid "Bui<in then Native" -msgstr "內建先於原生(&L)" +msgid "Buil&tin then Native" +msgstr "內建先於原生(&T)" #: winecfg.rc:212 msgid "Nati&ve then Builtin" @@ -13253,20 +13253,20 @@ msgstr "連線到掛載管理員時失敗,無法編輯磁碟組態。" #: winecfg.rc:236 -msgid "&Add..." -msgstr "加入(&A)..." +msgid "A&dd..." +msgstr "加入(&D)..." #: winecfg.rc:238 -msgid "Auto&detect" -msgstr "自動偵測(&D)" +msgid "Aut&odetect" +msgstr "自動偵測(&O)" #: winecfg.rc:241 msgid "&Path:" msgstr "路徑(&P):" #: winecfg.rc:248 winecfg.rc:38 -msgid "Show &Advanced" -msgstr "顯示進階選項(&A)" +msgid "Show Advan&ced" +msgstr "顯示進階選項(&C)" #: winecfg.rc:249 msgid "De&vice:" @@ -13285,8 +13285,8 @@ msgstr "序號(&E):" #: winecfg.rc:258 -msgid "Show &dot files" -msgstr "顯示隱藏檔案(&D)" +msgid "&Show dot files" +msgstr "顯示隱藏檔案(&S)" #: winecfg.rc:265 msgid "Driver diagnostics" @@ -13367,8 +13367,8 @@ msgstr "請選擇 Unix 資料夾。" #: winecfg.rc:37 -msgid "Hide &Advanced" -msgstr "隱藏進階選項(&A)" +msgid "Hide Advan&ced" +msgstr "隱藏進階選項(&C)" #: winecfg.rc:39 msgid "(No Theme)" @@ -13843,7 +13843,11 @@ msgstr "組態錯誤" #: wineconsole.rc:42 -msgid "Screen buffer size must be greater or equal to the window's one" +#, fuzzy +#| msgid "Screen buffer size must be greater or equal to the window's one" +msgid "" +"The size of the screen buffer must be greater than or equal to the size of " +"the window." msgstr "螢幕緩衝區大小必須大於或等於視窗緩衝區" #: wineconsole.rc:37 @@ -14542,6 +14546,10 @@ msgid "Tab stops" msgstr "定位停點" +#: wordpad.rc:247 +msgid "&Add" +msgstr "新增(&A)" + #: wordpad.rc:251 msgid "Remove al&l" msgstr "全部刪除(&L)" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/programs/winecfg/winecfg.rc wine-staging-1.9.3~ubuntu12.04.1/programs/winecfg/winecfg.rc --- wine-staging-1.9.2~ubuntu12.04.1/programs/winecfg/winecfg.rc 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/programs/winecfg/winecfg.rc 2016-02-08 19:32:34.000000000 +0000 @@ -33,8 +33,8 @@ IDS_TAB_DLLS "Libraries" IDS_TAB_DRIVES "Drives" IDS_CHOOSE_PATH "Select the Unix target directory, please." - IDS_HIDE_ADVANCED "Hide &Advanced" - IDS_SHOW_ADVANCED "Show &Advanced" + IDS_HIDE_ADVANCED "Hide Advan&ced" + IDS_SHOW_ADVANCED "Show Advan&ced" IDS_NOTHEME "(No Theme)" IDS_TAB_GRAPHICS "Graphics" IDS_TAB_DESKTOP_INTEGRATION "Desktop Integration" @@ -155,7 +155,7 @@ IDC_STATIC,15,15,227,45 CONTROL "",IDC_APP_LISTVIEW,"SysListView32",WS_BORDER | WS_TABSTOP | LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS, 15,60,230,110 - PUSHBUTTON "&Add application...",IDC_APP_ADDAPP, 15,174,112,14 + PUSHBUTTON "Add appli&cation...",IDC_APP_ADDAPP, 15,174,112,14 PUSHBUTTON "&Remove application",IDC_APP_REMOVEAPP, 133,174,112,14 LTEXT "&Windows Version:",IDC_STATIC,17,196,80,8 COMBOBOX IDC_WINVER,100,194,145,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -192,7 +192,7 @@ ,IDC_STATIC,16,16,228,32 LTEXT "&New override for library:",IDC_STATIC,16,58,220,8 COMBOBOX IDC_DLLCOMBO,16,68,140,14,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP | CBS_SORT | CBS_LOWERCASE - PUSHBUTTON "&Add",IDC_DLLS_ADDDLL, 164,68,82,13 + PUSHBUTTON "A&dd",IDC_DLLS_ADDDLL, 164,68,82,13 LTEXT "Existing &overrides:",IDC_STATIC,16,86,100,8 LISTBOX IDC_DLLS_LIST,16,96,140,112,WS_BORDER | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "&Edit...",IDC_DLLS_EDITDLL,164,96,82,14 @@ -207,7 +207,7 @@ GROUPBOX "Load order",IDC_STATIC,8,4,144,66 CONTROL "&Builtin (Wine)",IDC_RAD_BUILTIN,"Button", BS_AUTORADIOBUTTON | WS_GROUP,16,14,125,10 CONTROL "&Native (Windows)",IDC_RAD_NATIVE,"Button", BS_AUTORADIOBUTTON,16,24,125,10 - CONTROL "Bui<in then Native",IDC_RAD_BUILTIN_NATIVE,"Button", BS_AUTORADIOBUTTON,16,34,125,10 + CONTROL "Buil&tin then Native",IDC_RAD_BUILTIN_NATIVE,"Button", BS_AUTORADIOBUTTON,16,34,125,10 CONTROL "Nati&ve then Builtin",IDC_RAD_NATIVE_BUILTIN,"Button", BS_AUTORADIOBUTTON,16,44,125,10 CONTROL "&Disable",IDC_RAD_DISABLE,"Button", BS_AUTORADIOBUTTON,16,54,125,10 DEFPUSHBUTTON "OK",IDOK,8,74,45,14,WS_GROUP @@ -232,9 +232,9 @@ LTEXT "Failed to connect to the mount manager, the drive configuration cannot be edited.", IDC_STATIC_MOUNTMGR_ERROR, 15,30,190,76 CONTROL "",IDC_LIST_DRIVES,"SysListView32",LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP, 15,18,232,76 - PUSHBUTTON "&Add...",IDC_BUTTON_ADD,15,98,53,14 + PUSHBUTTON "A&dd...",IDC_BUTTON_ADD,15,98,53,14 PUSHBUTTON "&Remove",IDC_BUTTON_REMOVE,72,98,53,14 - PUSHBUTTON "Auto&detect",IDC_BUTTON_AUTODETECT,146,98,100,14 + PUSHBUTTON "Aut&odetect",IDC_BUTTON_AUTODETECT,146,98,100,14 /* editing drive details */ LTEXT "&Path:",IDC_STATIC_PATH,15,123,42,9 @@ -244,7 +244,7 @@ LTEXT "&Type:",IDC_STATIC_TYPE,15,138,42,10 COMBOBOX IDC_COMBO_TYPE,59,135,77,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Show &Advanced",IDC_BUTTON_SHOW_HIDE_ADVANCED,146,135,100,13 + PUSHBUTTON "Show Advan&ced",IDC_BUTTON_SHOW_HIDE_ADVANCED,146,135,100,13 LTEXT "De&vice:",IDC_STATIC_DEVICE,15,153,42,9 EDITTEXT IDC_EDIT_DEVICE,59,150,122,13,ES_AUTOHSCROLL | WS_TABSTOP PUSHBUTTON "Bro&wse...",IDC_BUTTON_BROWSE_DEVICE,186,150,60,13 @@ -254,7 +254,7 @@ LTEXT "S&erial:",IDC_STATIC_SERIAL,15,183,42,12 EDITTEXT IDC_EDIT_SERIAL,59,180,78,13,ES_AUTOHSCROLL | WS_TABSTOP - CONTROL "Show &dot files",IDC_SHOW_DOT_FILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,205,230,8 + CONTROL "&Show dot files",IDC_SHOW_DOT_FILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,205,230,8 END IDD_AUDIOCFG DIALOG 0, 0, 260, 220 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/dialog.c wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/dialog.c --- wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/dialog.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/dialog.c 2016-02-08 19:32:34.000000000 +0000 @@ -190,12 +190,15 @@ hFont = (HFONT)GetWindowLongPtrW(hWnd, 0); if (hFont) { + COLORREF bkcolor; WCHAR ascii[] = {'A','S','C','I','I',':',' ','a','b','c','X','Y','Z','\0'}; WCHAR buf[256]; int len; hOldFont = SelectObject(ps.hdc, hFont); - SetBkColor(ps.hdc, WCUSER_ColorMap[GetWindowLongW(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]); + bkcolor = WCUSER_ColorMap[GetWindowLongW(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]; + FillRect(ps.hdc, &ps.rcPaint, CreateSolidBrush(bkcolor)); + SetBkColor(ps.hdc, bkcolor); SetTextColor(ps.hdc, WCUSER_ColorMap[GetWindowLongW(GetDlgItem(di->hDlg, IDC_FNT_COLOR_FG), 0)]); len = LoadStringW(GetModuleHandleW(NULL), IDS_FNT_PREVIEW, buf, sizeof(buf) / sizeof(buf[0])); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/wineconsole.c wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/wineconsole.c --- wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/wineconsole.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/wineconsole.c 2016-02-08 19:32:34.000000000 +0000 @@ -441,7 +441,12 @@ } if (data->curcfg.def_attr != cfg->def_attr) { + DWORD screen_size, written; + COORD top_left = {0,0}; + data->curcfg.def_attr = cfg->def_attr; + screen_size = cfg->win_width * (cfg->win_height + 1); + FillConsoleOutputAttribute(data->hConOut, cfg->def_attr, screen_size, top_left, &written); SetConsoleTextAttribute(data->hConOut, cfg->def_attr); } /* now let's look at the window / sb size changes... diff -Nru wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/wineconsole.rc wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/wineconsole.rc --- wine-staging-1.9.2~ubuntu12.04.1/programs/wineconsole/wineconsole.rc 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/programs/wineconsole/wineconsole.rc 2016-02-08 19:32:34.000000000 +0000 @@ -38,7 +38,7 @@ IDS_DLG_TIT_DEFAULT, "Setup - Default settings" IDS_DLG_TIT_CURRENT, "Setup - Current settings" IDS_DLG_TIT_ERROR, "Configuration error" -IDS_DLG_ERR_SBWINSIZE, "Screen buffer size must be greater or equal to the window's one" +IDS_DLG_ERR_SBWINSIZE, "The size of the screen buffer must be greater than or equal to the size of the window." IDS_CMD_INVALID_EVENT_ID "wineconsole: Couldn't parse event id\n" IDS_CMD_INVALID_BACKEND "wineconsole: Invalid backend\n" diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/async.c wine-staging-1.9.3~ubuntu12.04.1/server/async.c --- wine-staging-1.9.2~ubuntu12.04.1/server/async.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/async.c 2016-02-08 19:32:34.000000000 +0000 @@ -65,6 +65,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ async_destroy /* destroy */ @@ -98,6 +100,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ async_queue_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/atom.c wine-staging-1.9.3~ubuntu12.04.1/server/atom.c --- wine-staging-1.9.2~ubuntu12.04.1/server/atom.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/atom.c 2016-02-08 19:32:34.000000000 +0000 @@ -87,6 +87,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ atom_table_destroy /* destroy */ @@ -382,12 +384,11 @@ /* add a global atom */ DECL_HANDLER(add_atom) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct atom_table *table = get_table( req->table, 1 ); if (table) { - get_req_unicode_str( &name ); reply->atom = add_atom( table, &name ); release_object( table ); } @@ -407,12 +408,11 @@ /* find a global atom */ DECL_HANDLER(find_atom) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct atom_table *table = get_table( req->table, 0 ); if (table) { - get_req_unicode_str( &name ); reply->atom = find_atom( table, &name ); release_object( table ); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/change.c wine-staging-1.9.3~ubuntu12.04.1/server/change.c --- wine-staging-1.9.2~ubuntu12.04.1/server/change.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/change.c 2016-02-08 19:32:34.000000000 +0000 @@ -166,6 +166,8 @@ dir_get_sd, /* get_sd */ dir_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ dir_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/class.c wine-staging-1.9.3~ubuntu12.04.1/server/class.c --- wine-staging-1.9.2~ubuntu12.04.1/server/class.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/class.c 2016-02-08 19:32:34.000000000 +0000 @@ -150,10 +150,9 @@ DECL_HANDLER(create_class) { struct window_class *class; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); atom_t atom; - get_req_unicode_str( &name ); if (name.len) { atom = add_global_atom( NULL, &name ); @@ -197,10 +196,9 @@ DECL_HANDLER(destroy_class) { struct window_class *class; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); atom_t atom = req->atom; - get_req_unicode_str( &name ); if (name.len) atom = find_global_atom( NULL, &name ); if (!(class = find_class( current->process, atom, req->instance ))) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/clipboard.c wine-staging-1.9.3~ubuntu12.04.1/server/clipboard.c --- wine-staging-1.9.2~ubuntu12.04.1/server/clipboard.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/clipboard.c 2016-02-08 19:32:34.000000000 +0000 @@ -65,6 +65,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/completion.c wine-staging-1.9.3~ubuntu12.04.1/server/completion.c --- wine-staging-1.9.2~ubuntu12.04.1/server/completion.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/completion.c 2016-02-08 19:32:34.000000000 +0000 @@ -72,6 +72,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ completion_destroy /* destroy */ @@ -177,12 +179,11 @@ { struct completion *completion; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; if ((completion = create_completion( root, &name, objattr->attributes, req->concurrent, sd ))) { @@ -196,23 +197,10 @@ /* open a completion */ DECL_HANDLER(open_completion) { - struct completion *completion; - struct unicode_str name; - struct directory *root = NULL; - - reply->handle = 0; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; + struct unicode_str name = get_req_unicode_str(); - if ( (completion = open_object_dir( root, &name, req->attributes, &completion_ops )) != NULL ) - { - reply->handle = alloc_handle( current->process, completion, req->access, req->attributes ); - release_object( completion ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &completion_ops, &name, req->attributes ); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/console.c wine-staging-1.9.3~ubuntu12.04.1/server/console.c --- wine-staging-1.9.2~ubuntu12.04.1/server/console.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/console.c 2016-02-08 19:32:34.000000000 +0000 @@ -84,6 +84,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ console_input_destroy /* destroy */ @@ -116,6 +118,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ console_input_events_destroy /* destroy */ @@ -168,6 +172,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ screen_buffer_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/debugger.c wine-staging-1.9.3~ubuntu12.04.1/server/debugger.c --- wine-staging-1.9.2~ubuntu12.04.1/server/debugger.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/debugger.c 2016-02-08 19:32:34.000000000 +0000 @@ -81,6 +81,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ debug_event_destroy /* destroy */ @@ -105,6 +107,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ debug_ctx_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/device.c wine-staging-1.9.3~ubuntu12.04.1/server/device.c --- wine-staging-1.9.2~ubuntu12.04.1/server/device.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/device.c 2016-02-08 19:32:34.000000000 +0000 @@ -78,6 +78,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ irp_call_destroy /* destroy */ @@ -112,6 +114,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ device_manager_destroy /* destroy */ @@ -151,6 +155,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ device_open_file, /* open_file */ no_close_handle, /* close_handle */ device_destroy /* destroy */ @@ -197,6 +203,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ device_file_close_handle, /* close_handle */ device_file_destroy /* destroy */ @@ -708,7 +716,7 @@ DECL_HANDLER(create_device) { struct device *device; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct device_manager *manager; struct directory *root = NULL; @@ -716,7 +724,6 @@ 0, &device_manager_ops ))) return; - get_req_unicode_str( &name ); if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) { release_object( manager ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/directory.c wine-staging-1.9.3~ubuntu12.04.1/server/directory.c --- wine-staging-1.9.2~ubuntu12.04.1/server/directory.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/directory.c 2016-02-08 19:32:34.000000000 +0000 @@ -64,6 +64,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ @@ -97,6 +99,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ directory_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ directory_destroy /* destroy */ @@ -173,6 +177,20 @@ return NULL; } +int directory_link_name( struct object *obj, struct object_name *name, struct object *parent ) +{ + struct directory *dir = (struct directory *)parent; + + if (parent->ops != &directory_ops) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return 0; + } + namespace_add( dir->entries, name ); + name->parent = grab_object( parent ); + return 1; +} + static void directory_destroy( struct object *obj ) { struct directory *dir = (struct directory *)obj; @@ -192,7 +210,7 @@ if (!(dir->entries = create_namespace( hash_size ))) { release_object( dir ); - dir = NULL; + return NULL; } if (sd) default_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION ); @@ -305,15 +323,7 @@ return obj; } - /* ATM we can't insert objects into anything else but directories */ - if (obj->ops != &directory_ops) - set_error( STATUS_OBJECT_TYPE_MISMATCH ); - else - { - struct directory *dir = (struct directory *)obj; - if ((new_obj = create_object( dir->entries, ops, &new_name, &dir->obj ))) - clear_error(); - } + if ((new_obj = create_object( obj, ops, &new_name ))) clear_error(); release_object( obj ); return new_obj; @@ -503,12 +513,11 @@ DECL_HANDLER(create_directory) { struct unicode_str name; - struct directory *dir, *root = NULL; + struct directory *dir, *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; if ((dir = create_directory( root, &name, objattr->attributes, HASH_SIZE, sd ))) { @@ -522,20 +531,10 @@ /* open a directory object */ DECL_HANDLER(open_directory) { - struct unicode_str name; - struct directory *dir, *root = NULL; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; + struct unicode_str name = get_req_unicode_str(); - if ((dir = open_object_dir( root, &name, req->attributes, &directory_ops ))) - { - reply->handle = alloc_handle( current->process, &dir->obj, req->access, req->attributes ); - release_object( dir ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &directory_ops, &name, req->attributes ); } /* get a directory entry by index */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/event.c wine-staging-1.9.3~ubuntu12.04.1/server/event.c --- wine-staging-1.9.2~ubuntu12.04.1/server/event.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/event.c 2016-02-08 19:32:34.000000000 +0000 @@ -65,6 +65,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ @@ -96,6 +98,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ @@ -280,15 +284,12 @@ { struct event *event; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; - if ((event = create_event( root, &name, objattr->attributes, req->manual_reset, req->initial_state, sd ))) { @@ -306,21 +307,10 @@ /* open a handle to an event */ DECL_HANDLER(open_event) { - struct unicode_str name; - struct directory *root = NULL; - struct event *event; + struct unicode_str name = get_req_unicode_str(); - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; - - if ((event = open_object_dir( root, &name, req->attributes, &event_ops ))) - { - reply->handle = alloc_handle( current->process, &event->obj, req->access, req->attributes ); - release_object( event ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &event_ops, &name, req->attributes ); } /* do an event operation */ @@ -365,14 +355,12 @@ { struct keyed_event *event; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; - if ((event = create_keyed_event( root, &name, objattr->attributes, sd ))) { if (get_error() == STATUS_OBJECT_NAME_EXISTS) @@ -388,17 +376,8 @@ /* open a handle to a keyed event */ DECL_HANDLER(open_keyed_event) { - struct unicode_str name; - struct directory *root = NULL; - struct keyed_event *event; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) return; + struct unicode_str name = get_req_unicode_str(); - if ((event = open_object_dir( root, &name, req->attributes, &keyed_event_ops ))) - { - reply->handle = alloc_handle( current->process, &event->obj, req->access, req->attributes ); - release_object( event ); - } - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &keyed_event_ops, &name, req->attributes ); } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/fd.c wine-staging-1.9.3~ubuntu12.04.1/server/fd.c --- wine-staging-1.9.2~ubuntu12.04.1/server/fd.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/fd.c 2016-02-08 19:32:34.000000000 +0000 @@ -209,6 +209,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ fd_destroy /* destroy */ @@ -246,6 +248,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ device_destroy /* destroy */ @@ -282,6 +286,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ inode_destroy /* destroy */ @@ -320,6 +326,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ @@ -2384,11 +2392,10 @@ /* open a file object */ DECL_HANDLER(open_file_object) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct directory *root = NULL; struct object *obj, *result; - get_req_unicode_str( &name ); if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) { if (get_error() != STATUS_OBJECT_TYPE_MISMATCH) return; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/file.c wine-staging-1.9.3~ubuntu12.04.1/server/file.c --- wine-staging-1.9.2~ubuntu12.04.1/server/file.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/file.c 2016-02-08 19:32:34.000000000 +0000 @@ -91,6 +91,8 @@ file_get_sd, /* get_sd */ file_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ file_open_file, /* open_file */ fd_close_handle, /* close_handle */ file_destroy /* destroy */ @@ -688,7 +690,7 @@ struct fd *root_fd = NULL; struct unicode_str unicode_name; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &unicode_name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &unicode_name, NULL ); const char *name; data_size_t name_len; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/handle.c wine-staging-1.9.3~ubuntu12.04.1/server/handle.c --- wine-staging-1.9.2~ubuntu12.04.1/server/handle.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/handle.c 2016-02-08 19:32:34.000000000 +0000 @@ -130,6 +130,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ handle_table_destroy /* destroy */ @@ -571,21 +573,28 @@ } /* open a new handle to an existing object */ -obj_handle_t open_object( const struct namespace *namespace, const struct unicode_str *name, - const struct object_ops *ops, unsigned int access, unsigned int attr ) +obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned int access, + const struct object_ops *ops, const struct unicode_str *name, + unsigned int attributes ) { obj_handle_t handle = 0; - struct object *obj = find_object( namespace, name, attr ); - if (obj) + struct directory *root = NULL; + struct object *obj; + + if (name->len >= 65534) { - if (ops && obj->ops != ops) - set_error( STATUS_OBJECT_TYPE_MISMATCH ); - else - handle = alloc_handle( current->process, obj, access, attr ); + set_error( STATUS_OBJECT_NAME_INVALID ); + return 0; + } + + if (parent && !(root = get_directory_obj( process, parent, 0 ))) return 0; + + if ((obj = open_object_dir( root, name, attributes, ops ))) + { + handle = alloc_handle( process, obj, access, attributes ); release_object( obj ); } - else - set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + if (root) release_object( root ); return handle; } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/handle.h wine-staging-1.9.3~ubuntu12.04.1/server/handle.h --- wine-staging-1.9.2~ubuntu12.04.1/server/handle.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/handle.h 2016-02-08 19:32:34.000000000 +0000 @@ -44,8 +44,9 @@ extern unsigned int get_handle_access( struct process *process, obj_handle_t handle ); extern obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst, unsigned int access, unsigned int attr, unsigned int options ); -extern obj_handle_t open_object( const struct namespace *namespace, const struct unicode_str *name, - const struct object_ops *ops, unsigned int access, unsigned int attr ); +extern obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned int access, + const struct object_ops *ops, const struct unicode_str *name, + unsigned int attr ); extern obj_handle_t find_inherited_handle( struct process *process, const struct object_ops *ops ); extern obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops, unsigned int *index ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/hook.c wine-staging-1.9.3~ubuntu12.04.1/server/hook.c --- wine-staging-1.9.2~ubuntu12.04.1/server/hook.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/hook.c 2016-02-08 19:32:34.000000000 +0000 @@ -88,6 +88,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ hook_table_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/mailslot.c wine-staging-1.9.3~ubuntu12.04.1/server/mailslot.c --- wine-staging-1.9.2~ubuntu12.04.1/server/mailslot.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/mailslot.c 2016-02-08 19:32:34.000000000 +0000 @@ -66,6 +66,7 @@ static void mailslot_dump( struct object*, int ); static struct fd *mailslot_get_fd( struct object * ); static unsigned int mailslot_map_access( struct object *obj, unsigned int access ); +static int mailslot_link_name( struct object *obj, struct object_name *name, struct object *parent ); static struct object *mailslot_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); static void mailslot_destroy( struct object * ); @@ -85,6 +86,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + mailslot_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ mailslot_open_file, /* open_file */ fd_close_handle, /* close_handle */ mailslot_destroy /* destroy */ @@ -138,6 +141,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ mail_writer_destroy /* destroy */ @@ -192,6 +197,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ mailslot_device_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ mailslot_device_open_file, /* open_file */ fd_close_handle, /* close_handle */ mailslot_device_destroy /* destroy */ @@ -254,6 +261,20 @@ return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } +static int mailslot_link_name( struct object *obj, struct object_name *name, struct object *parent ) +{ + struct mailslot_device *dev = (struct mailslot_device *)parent; + + if (parent->ops != &mailslot_device_ops) + { + set_error( STATUS_OBJECT_NAME_INVALID ); + return 0; + } + namespace_add( dev->mailslots, name ); + name->parent = grab_object( parent ); + return 1; +} + static struct object *mailslot_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ) { @@ -399,11 +420,14 @@ { struct object *obj; struct unicode_str new_name; - struct mailslot_device *dev; struct mailslot *mailslot; int fds[2]; - if (!name || !name->len) return alloc_object( &mailslot_ops ); + if (!name || !name->len) + { + mailslot = alloc_object( &mailslot_ops ); + goto init; + } if (!(obj = find_object_dir( root, name, attr, &new_name ))) { @@ -424,17 +448,10 @@ return NULL; } - if (obj->ops != &mailslot_device_ops) - { - set_error( STATUS_OBJECT_NAME_INVALID ); - release_object( obj ); - return NULL; - } - - dev = (struct mailslot_device *)obj; - mailslot = create_object( dev->mailslots, &mailslot_ops, &new_name, NULL ); - release_object( dev ); + mailslot = create_object( obj, &mailslot_ops, &new_name ); + release_object( obj ); +init: if (!mailslot) return NULL; mailslot->fd = NULL; @@ -509,12 +526,21 @@ { struct mailslot *mailslot; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; + + if (!name.len) /* mailslots need a root directory even without a name */ + { + if (!objattr->rootdir) + { + set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); + return; + } + else if (!(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; + } if ((mailslot = create_mailslot( root, &name, objattr->attributes, req->max_msgsize, req->read_timeout, sd ))) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/mapping.c wine-staging-1.9.3~ubuntu12.04.1/server/mapping.c --- wine-staging-1.9.2~ubuntu12.04.1/server/mapping.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/mapping.c 2016-02-08 19:32:34.000000000 +0000 @@ -91,6 +91,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ mapping_destroy /* destroy */ @@ -661,15 +663,12 @@ { struct object *obj; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; - if ((obj = create_mapping( root, &name, objattr->attributes, req->size, req->protect, req->file_handle, sd ))) { @@ -687,21 +686,10 @@ /* open a handle to a mapping */ DECL_HANDLER(open_mapping) { - struct unicode_str name; - struct directory *root = NULL; - struct mapping *mapping; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; + struct unicode_str name = get_req_unicode_str(); - if ((mapping = open_object_dir( root, &name, req->attributes, &mapping_ops ))) - { - reply->handle = alloc_handle( current->process, &mapping->obj, req->access, req->attributes ); - release_object( mapping ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &mapping_ops, &name, req->attributes ); } /* get a mapping information */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/mutex.c wine-staging-1.9.3~ubuntu12.04.1/server/mutex.c --- wine-staging-1.9.2~ubuntu12.04.1/server/mutex.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/mutex.c 2016-02-08 19:32:34.000000000 +0000 @@ -68,6 +68,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ mutex_destroy /* destroy */ @@ -208,15 +210,12 @@ { struct mutex *mutex; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; - if ((mutex = create_mutex( root, &name, objattr->attributes, req->owned, sd ))) { if (get_error() == STATUS_OBJECT_NAME_EXISTS) @@ -233,21 +232,10 @@ /* open a handle to a mutex */ DECL_HANDLER(open_mutex) { - struct unicode_str name; - struct directory *root = NULL; - struct mutex *mutex; + struct unicode_str name = get_req_unicode_str(); - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; - - if ((mutex = open_object_dir( root, &name, req->attributes, &mutex_ops ))) - { - reply->handle = alloc_handle( current->process, &mutex->obj, req->access, req->attributes ); - release_object( mutex ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &mutex_ops, &name, req->attributes ); } /* release a mutex */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/named_pipe.c wine-staging-1.9.3~ubuntu12.04.1/server/named_pipe.c --- wine-staging-1.9.2~ubuntu12.04.1/server/named_pipe.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/named_pipe.c 2016-02-08 19:32:34.000000000 +0000 @@ -112,6 +112,7 @@ static void named_pipe_dump( struct object *obj, int verbose ); static unsigned int named_pipe_map_access( struct object *obj, unsigned int access ); +static int named_pipe_link_name( struct object *obj, struct object_name *name, struct object *parent ); static struct object *named_pipe_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); static void named_pipe_destroy( struct object *obj ); @@ -131,6 +132,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + named_pipe_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ named_pipe_open_file, /* open_file */ no_close_handle, /* close_handle */ named_pipe_destroy /* destroy */ @@ -160,6 +163,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ pipe_server_destroy /* destroy */ @@ -202,6 +207,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ pipe_client_destroy /* destroy */ @@ -248,6 +255,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ named_pipe_device_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ named_pipe_device_open_file, /* open_file */ fd_close_handle, /* close_handle */ named_pipe_device_destroy /* destroy */ @@ -693,14 +702,8 @@ return (struct named_pipe *)obj; } - if (obj->ops != &named_pipe_device_ops) - set_error( STATUS_OBJECT_NAME_INVALID ); - else - { - struct named_pipe_device *dev = (struct named_pipe_device *)obj; - if ((pipe = create_object( dev->pipes, &named_pipe_ops, &new_name, NULL ))) - clear_error(); - } + if ((pipe = create_object( obj, &named_pipe_ops, &new_name ))) + clear_error(); release_object( obj ); return pipe; @@ -778,6 +781,20 @@ return NULL; } +static int named_pipe_link_name( struct object *obj, struct object_name *name, struct object *parent ) +{ + struct named_pipe_device *dev = (struct named_pipe_device *)parent; + + if (parent->ops != &named_pipe_device_ops) + { + set_error( STATUS_OBJECT_NAME_INVALID ); + return 0; + } + namespace_add( dev->pipes, name ); + name->parent = grab_object( parent ); + return 1; +} + static struct object *named_pipe_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ) { @@ -917,9 +934,9 @@ struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; @@ -930,8 +947,15 @@ return; } - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; + if (!name.len) /* pipes need a root directory even without a name */ + { + if (!objattr->rootdir) + { + set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); + return; + } + else if (!(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; + } pipe = create_named_pipe( root, &name, objattr->attributes | OBJ_OPENIF, sd ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/object.c wine-staging-1.9.3~ubuntu12.04.1/server/object.c --- wine-staging-1.9.2~ubuntu12.04.1/server/object.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/object.c 2016-02-08 19:32:34.000000000 +0000 @@ -40,15 +40,6 @@ #include "security.h" -struct object_name -{ - struct list entry; /* entry in the hash list */ - struct object *obj; /* object owning this name */ - struct object *parent; /* parent object */ - data_size_t len; /* name length in bytes */ - WCHAR name[1]; -}; - struct namespace { unsigned int hash_size; /* size of hash table */ @@ -130,6 +121,13 @@ return hash % namespace->hash_size; } +void namespace_add( struct namespace *namespace, struct object_name *ptr ) +{ + int hash = get_name_hash( namespace, ptr->name, ptr->len ); + + list_add_head( &namespace->names[hash], &ptr->entry ); +} + /* allocate a name for an object */ static struct object_name *alloc_name( const struct unicode_str *name ) { @@ -144,26 +142,6 @@ return ptr; } -/* free the name of an object */ -static void free_name( struct object *obj ) -{ - struct object_name *ptr = obj->name; - list_remove( &ptr->entry ); - if (ptr->parent) release_object( ptr->parent ); - free( ptr ); -} - -/* set the name of an existing object */ -static void set_object_name( struct namespace *namespace, - struct object *obj, struct object_name *ptr ) -{ - int hash = get_name_hash( namespace, ptr->name, ptr->len ); - - list_add_head( &namespace->names[hash], &ptr->entry ); - ptr->obj = obj; - obj->name = ptr; -} - /* get the name of an existing object */ const WCHAR *get_object_name( struct object *obj, data_size_t *len ) { @@ -222,8 +200,18 @@ return NULL; } -void *create_object( struct namespace *namespace, const struct object_ops *ops, - const struct unicode_str *name, struct object *parent ) +/* free an object once it has been destroyed */ +void free_object( struct object *obj ) +{ + free( obj->sd ); +#ifdef DEBUG_OBJECTS + list_remove( &obj->obj_list ); + memset( obj, 0xaa, obj->ops->size ); +#endif + free( obj ); +} + +void *create_object( struct object *parent, const struct object_ops *ops, const struct unicode_str *name ) { struct object *obj; struct object_name *name_ptr; @@ -231,15 +219,20 @@ if (!(name_ptr = alloc_name( name ))) return NULL; if ((obj = alloc_object( ops ))) { - set_object_name( namespace, obj, name_ptr ); - if (parent) name_ptr->parent = grab_object( parent ); + if (!obj->ops->link_name( obj, name_ptr, parent )) + { + free_object( obj ); + return NULL; + } + name_ptr->obj = obj; + obj->name = name_ptr; } else free( name_ptr ); return obj; } -void *create_named_object( struct namespace *namespace, const struct object_ops *ops, +void *create_named_object( struct object *parent, struct namespace *namespace, const struct object_ops *ops, const struct unicode_str *name, unsigned int attributes ) { struct object *obj; @@ -265,7 +258,7 @@ } return obj; } - if ((obj = create_object( namespace, ops, name, NULL ))) clear_error(); + if ((obj = create_object( parent, ops, name ))) clear_error(); return obj; } @@ -292,8 +285,13 @@ /* unlink a named object from its namespace, without freeing the object itself */ void unlink_named_object( struct object *obj ) { - if (obj->name) free_name( obj ); + struct object_name *name_ptr = obj->name; + + if (!name_ptr) return; obj->name = NULL; + obj->ops->unlink_name( obj, name_ptr ); + if (name_ptr->parent) release_object( name_ptr->parent ); + free( name_ptr ); } /* mark an object as being stored statically, i.e. only released at shutdown */ @@ -324,14 +322,9 @@ assert( !obj->handle_count ); /* if the refcount is 0, nobody can be in the wait queue */ assert( list_empty( &obj->wait_queue )); + unlink_named_object( obj ); obj->ops->destroy( obj ); - if (obj->name) free_name( obj ); - free( obj->sd ); -#ifdef DEBUG_OBJECTS - list_remove( &obj->obj_list ); - memset( obj, 0xaa, obj->ops->size ); -#endif - free( obj ); + free_object( obj ); } } @@ -551,6 +544,17 @@ return NULL; } +int no_link_name( struct object *obj, struct object_name *name, struct object *parent ) +{ + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return 0; +} + +void default_unlink_name( struct object *obj, struct object_name *name ) +{ + list_remove( &name->entry ); +} + struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/object.h wine-staging-1.9.3~ubuntu12.04.1/server/object.h --- wine-staging-1.9.2~ubuntu12.04.1/server/object.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/object.h 2016-02-08 19:32:34.000000000 +0000 @@ -83,6 +83,10 @@ int (*set_sd)( struct object *, const struct security_descriptor *, unsigned int ); /* lookup a name if an object has a namespace */ struct object *(*lookup_name)(struct object *, struct unicode_str *,unsigned int); + /* link an object's name into a parent object */ + int (*link_name)(struct object *, struct object_name *, struct object *); + /* unlink an object's name from its parent */ + void (*unlink_name)(struct object *, struct object_name *); /* open a file object to access this object */ struct object *(*open_file)(struct object *, unsigned int access, unsigned int sharing, unsigned int options); @@ -105,6 +109,15 @@ #endif }; +struct object_name +{ + struct list entry; /* entry in the hash list */ + struct object *obj; /* object owning this name */ + struct object *parent; /* parent object */ + data_size_t len; /* name length in bytes */ + WCHAR name[1]; +}; + struct wait_queue_entry { struct list entry; @@ -115,12 +128,13 @@ extern void *mem_alloc( size_t size ); /* malloc wrapper */ extern void *memdup( const void *data, size_t len ); extern void *alloc_object( const struct object_ops *ops ); +extern void namespace_add( struct namespace *namespace, struct object_name *ptr ); extern const WCHAR *get_object_name( struct object *obj, data_size_t *len ); extern WCHAR *get_object_full_name( struct object *obj, data_size_t *ret_len ); extern void dump_object_name( struct object *obj ); -extern void *create_object( struct namespace *namespace, const struct object_ops *ops, - const struct unicode_str *name, struct object *parent ); -extern void *create_named_object( struct namespace *namespace, const struct object_ops *ops, +extern void *create_object( struct object *parent, const struct object_ops *ops, + const struct unicode_str *name ); +extern void *create_named_object( struct object *parent, struct namespace *namespace, const struct object_ops *ops, const struct unicode_str *name, unsigned int attributes ); extern void unlink_named_object( struct object *obj ); extern void make_object_static( struct object *obj ); @@ -143,6 +157,8 @@ extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, unsigned int set_info, struct token *token ); extern struct object *no_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attributes ); +extern int no_link_name( struct object *obj, struct object_name *name, struct object *parent ); +extern void default_unlink_name( struct object *obj, struct object_name *name ); extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); extern int no_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); @@ -217,6 +233,7 @@ extern void *open_object_dir( struct directory *root, const struct unicode_str *name, unsigned int attr, const struct object_ops *ops ); extern struct object_type *get_object_type( const struct unicode_str *name ); +extern int directory_link_name( struct object *obj, struct object_name *name, struct object *parent ); extern void init_directories(void); /* symbolic link functions */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/process.c wine-staging-1.9.3~ubuntu12.04.1/server/process.c --- wine-staging-1.9.2~ubuntu12.04.1/server/process.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/process.c 2016-02-08 19:32:34.000000000 +0000 @@ -81,6 +81,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ process_destroy /* destroy */ @@ -129,6 +131,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ startup_info_destroy /* destroy */ @@ -170,6 +174,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ job_close_handle, /* close_handle */ job_destroy /* destroy */ @@ -1538,14 +1544,12 @@ { struct job *job; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; - if ((job = create_job_object( root, &name, objattr->attributes, sd ))) { if (get_error() == STATUS_OBJECT_NAME_EXISTS) @@ -1558,6 +1562,15 @@ if (root) release_object( root ); } +/* open a job object */ +DECL_HANDLER(open_job) +{ + struct unicode_str name = get_req_unicode_str(); + + reply->handle = open_object( current->process, req->rootdir, req->access, + &job_ops, &name, req->attributes ); +} + /* assign a job object to a process */ DECL_HANDLER(assign_job) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/protocol.def wine-staging-1.9.3~ubuntu12.04.1/server/protocol.def --- wine-staging-1.9.2~ubuntu12.04.1/server/protocol.def 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/protocol.def 2016-02-08 19:32:34.000000000 +0000 @@ -2968,7 +2968,7 @@ int x; /* caret x position */ int y; /* caret y position */ int hide; /* increment for hide count (can be negative to show it) */ - int state; /* caret state (1=on, 0=off, -1=toggle current state) */ + int state; /* caret state (see below) */ @REPLY user_handle_t full_handle; /* handle to the current caret window */ rectangle_t old_rect; /* previous caret rectangle */ @@ -2978,6 +2978,13 @@ #define SET_CARET_POS 0x01 /* set the caret position from x,y */ #define SET_CARET_HIDE 0x02 /* increment the caret hide count */ #define SET_CARET_STATE 0x04 /* set the caret on/off state */ +enum caret_state +{ + CARET_STATE_OFF, /* off */ + CARET_STATE_ON, /* on */ + CARET_STATE_TOGGLE, /* toggle current state */ + CARET_STATE_ON_IF_MOVED /* on if the position differs, unchanged otherwise */ +}; /* Set a window hook */ @@ -3628,6 +3635,17 @@ @REPLY obj_handle_t handle; /* handle to the job */ @END + + +/* Open a job object */ +@REQ(open_job) + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ + obj_handle_t rootdir; /* root directory */ + VARARG(name,unicode_str); /* object name */ +@REPLY + obj_handle_t handle; /* handle to the job */ +@END /* Assign a job object to a process */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/queue.c wine-staging-1.9.3~ubuntu12.04.1/server/queue.c --- wine-staging-1.9.2~ubuntu12.04.1/server/queue.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/queue.c 2016-02-08 19:32:34.000000000 +0000 @@ -178,6 +178,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ msg_queue_destroy /* destroy */ @@ -211,6 +213,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ thread_input_destroy /* destroy */ @@ -2581,13 +2585,21 @@ } else { + lparam_t end_id = queue->next_timer_id; + /* find a free id for it */ - do + while (1) { id = queue->next_timer_id; if (--queue->next_timer_id <= 0x100) queue->next_timer_id = 0x7fff; + + if (!find_timer( queue, 0, req->msg, id )) break; + if (queue->next_timer_id == end_id) + { + set_win32_error( ERROR_NO_MORE_USER_HANDLES ); + return; + } } - while (find_timer( queue, 0, req->msg, id )); } } @@ -3039,8 +3051,15 @@ } if (req->flags & SET_CARET_STATE) { - if (req->state == -1) input->caret_state = !input->caret_state; - else input->caret_state = !!req->state; + switch (req->state) + { + case CARET_STATE_OFF: input->caret_state = 0; break; + case CARET_STATE_ON: input->caret_state = 1; break; + case CARET_STATE_TOGGLE: input->caret_state = !input->caret_state; break; + case CARET_STATE_ON_IF_MOVED: + if (req->x != reply->old_rect.left || req->y != reply->old_rect.top) input->caret_state = 1; + break; + } } } diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/registry.c wine-staging-1.9.3~ubuntu12.04.1/server/registry.c --- wine-staging-1.9.2~ubuntu12.04.1/server/registry.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/registry.c 2016-02-08 19:32:34.000000000 +0000 @@ -166,6 +166,8 @@ key_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ key_close_handle, /* close_handle */ key_destroy /* destroy */ @@ -2026,7 +2028,7 @@ struct unicode_str name, class; unsigned int access = req->access; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL ); if (!objattr) return; @@ -2142,12 +2144,11 @@ DECL_HANDLER(get_key_value) { struct key *key; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); reply->total = 0; if ((key = get_hkey_obj( req->hkey, KEY_QUERY_VALUE ))) { - get_req_unicode_str( &name ); get_value( key, &name, &reply->type, &reply->total ); release_object( key ); } @@ -2169,11 +2170,10 @@ DECL_HANDLER(delete_key_value) { struct key *key; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); if ((key = get_hkey_obj( req->hkey, KEY_SET_VALUE ))) { - get_req_unicode_str( &name ); delete_value( key, &name ); release_object( key ); } @@ -2185,7 +2185,9 @@ struct key *key, *parent; struct unicode_str name; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL ); + + if (!objattr) return; if (!thread_single_check_privilege( current, &SeRestorePrivilege )) { diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/request.c wine-staging-1.9.3~ubuntu12.04.1/server/request.c --- wine-staging-1.9.2~ubuntu12.04.1/server/request.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/request.c 2016-02-08 19:32:34.000000000 +0000 @@ -104,6 +104,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ master_socket_destroy /* destroy */ @@ -167,12 +169,15 @@ /* return object attributes from the current request */ const struct object_attributes *get_req_object_attributes( const struct security_descriptor **sd, - struct unicode_str *name ) + struct unicode_str *name, + struct directory **root ) { static const struct object_attributes empty_attributes; const struct object_attributes *attr = get_req_data(); data_size_t size = get_req_data_size(); + if (root) *root = NULL; + if (!size) { *sd = NULL; @@ -196,6 +201,10 @@ set_error( STATUS_OBJECT_NAME_INVALID ); return NULL; } + if (root && attr->rootdir && attr->name_len) + { + if (!(*root = get_directory_obj( current->process, attr->rootdir, 0 ))) return NULL; + } *sd = attr->sd_len ? (const struct security_descriptor *)(attr + 1) : NULL; name->len = attr->name_len; name->str = (const WCHAR *)(attr + 1) + attr->sd_len / sizeof(WCHAR); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/request.h wine-staging-1.9.3~ubuntu12.04.1/server/request.h --- wine-staging-1.9.2~ubuntu12.04.1/server/request.h 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/request.h 2016-02-08 19:32:34.000000000 +0000 @@ -47,7 +47,8 @@ extern const char *get_config_dir(void); extern void *set_reply_data_size( data_size_t size ); extern const struct object_attributes *get_req_object_attributes( const struct security_descriptor **sd, - struct unicode_str *name ); + struct unicode_str *name, + struct directory **root ); extern const void *get_req_data_after_objattr( const struct object_attributes *attr, data_size_t *len ); extern int receive_fd( struct process *process ); extern int send_client_fd( struct process *process, int fd, obj_handle_t handle ); @@ -77,10 +78,12 @@ } /* get the request vararg as unicode string */ -static inline void get_req_unicode_str( struct unicode_str *str ) +static inline struct unicode_str get_req_unicode_str(void) { - str->str = get_req_data(); - str->len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR); + struct unicode_str ret; + ret.str = get_req_data(); + ret.len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR); + return ret; } /* get the reply maximum vararg size */ @@ -374,6 +377,7 @@ DECL_HANDLER(get_suspend_context); DECL_HANDLER(set_suspend_context); DECL_HANDLER(create_job); +DECL_HANDLER(open_job); DECL_HANDLER(assign_job); DECL_HANDLER(process_in_job); DECL_HANDLER(set_job_limits); @@ -650,6 +654,7 @@ (req_handler)req_get_suspend_context, (req_handler)req_set_suspend_context, (req_handler)req_create_job, + (req_handler)req_open_job, (req_handler)req_assign_job, (req_handler)req_process_in_job, (req_handler)req_set_job_limits, @@ -2265,6 +2270,12 @@ C_ASSERT( sizeof(struct create_job_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct create_job_reply, handle) == 8 ); C_ASSERT( sizeof(struct create_job_reply) == 16 ); +C_ASSERT( FIELD_OFFSET(struct open_job_request, access) == 12 ); +C_ASSERT( FIELD_OFFSET(struct open_job_request, attributes) == 16 ); +C_ASSERT( FIELD_OFFSET(struct open_job_request, rootdir) == 20 ); +C_ASSERT( sizeof(struct open_job_request) == 24 ); +C_ASSERT( FIELD_OFFSET(struct open_job_reply, handle) == 8 ); +C_ASSERT( sizeof(struct open_job_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct assign_job_request, job) == 12 ); C_ASSERT( FIELD_OFFSET(struct assign_job_request, process) == 16 ); C_ASSERT( sizeof(struct assign_job_request) == 24 ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/semaphore.c wine-staging-1.9.3~ubuntu12.04.1/server/semaphore.c --- wine-staging-1.9.2~ubuntu12.04.1/server/semaphore.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/semaphore.c 2016-02-08 19:32:34.000000000 +0000 @@ -65,6 +65,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ no_destroy /* destroy */ @@ -176,15 +178,12 @@ { struct semaphore *sem; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) - return; - if ((sem = create_semaphore( root, &name, objattr->attributes, req->initial, req->max, sd ))) { if (get_error() == STATUS_OBJECT_NAME_EXISTS) @@ -201,21 +200,10 @@ /* open a handle to a semaphore */ DECL_HANDLER(open_semaphore) { - struct unicode_str name; - struct directory *root = NULL; - struct semaphore *sem; + struct unicode_str name = get_req_unicode_str(); - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; - - if ((sem = open_object_dir( root, &name, req->attributes, &semaphore_ops ))) - { - reply->handle = alloc_handle( current->process, &sem->obj, req->access, req->attributes ); - release_object( sem ); - } - - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &semaphore_ops, &name, req->attributes ); } /* release a semaphore */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/serial.c wine-staging-1.9.3~ubuntu12.04.1/server/serial.c --- wine-staging-1.9.2~ubuntu12.04.1/server/serial.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/serial.c 2016-02-08 19:32:34.000000000 +0000 @@ -62,12 +62,15 @@ static enum server_fd_type serial_get_fd_type( struct fd *fd ); static void serial_queue_async( struct fd *fd, const async_data_t *data, int type, int count ); +static void serial_reselect_async( struct fd *fd, struct async_queue *queue ); struct serial { struct object obj; struct fd *fd; + struct timeout_user *read_timer; + /* timeout values */ unsigned int readinterval; unsigned int readconst; @@ -100,6 +103,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ serial_destroy /* destroy */ @@ -115,7 +120,7 @@ no_fd_flush, /* flush */ default_fd_ioctl, /* ioctl */ serial_queue_async, /* queue_async */ - default_fd_reselect_async, /* reselect_async */ + serial_reselect_async, /* reselect_async */ default_fd_cancel_async /* cancel_async */ }; @@ -134,6 +139,7 @@ if (!(serial = alloc_object( &serial_ops ))) return NULL; + serial->read_timer = NULL; serial->readinterval = 0; serial->readmult = 0; serial->readconst = 0; @@ -157,6 +163,7 @@ static void serial_destroy( struct object *obj) { struct serial *serial = (struct serial *)obj; + if (serial->read_timer) remove_timeout_user( serial->read_timer ); release_object( serial->fd ); } @@ -203,6 +210,34 @@ } } +static void serial_read_timeout( void *arg ) +{ + struct serial *serial = arg; + + serial->read_timer = NULL; + fd_async_wake_up( serial->fd, ASYNC_TYPE_READ, STATUS_TIMEOUT ); +} + +static void serial_reselect_async( struct fd *fd, struct async_queue *queue ) +{ + struct serial *serial = get_fd_user( fd ); + + if (serial->read_timer) + { + if (!(default_fd_get_poll_events( fd ) & POLLIN)) + { + remove_timeout_user( serial->read_timer ); + serial->read_timer = NULL; + } + } + else if (serial->readinterval && (default_fd_get_poll_events( fd ) & POLLIN)) + { + serial->read_timer = add_timeout_user( (timeout_t)serial->readinterval * -10000, + serial_read_timeout, serial ); + } + default_fd_reselect_async( fd, queue ); +} + DECL_HANDLER(get_serial_info) { struct serial *serial; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/signal.c wine-staging-1.9.3~ubuntu12.04.1/server/signal.c --- wine-staging-1.9.2~ubuntu12.04.1/server/signal.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/signal.c 2016-02-08 19:32:34.000000000 +0000 @@ -74,6 +74,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ handler_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/snapshot.c wine-staging-1.9.3~ubuntu12.04.1/server/snapshot.c --- wine-staging-1.9.2~ubuntu12.04.1/server/snapshot.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/snapshot.c 2016-02-08 19:32:34.000000000 +0000 @@ -68,6 +68,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ snapshot_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/sock.c wine-staging-1.9.3~ubuntu12.04.1/server/sock.c --- wine-staging-1.9.2~ubuntu12.04.1/server/sock.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/sock.c 2016-02-08 19:32:34.000000000 +0000 @@ -153,6 +153,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ fd_close_handle, /* close_handle */ sock_destroy /* destroy */ @@ -995,6 +997,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ ifchange_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/symlink.c wine-staging-1.9.3~ubuntu12.04.1/server/symlink.c --- wine-staging-1.9.2~ubuntu12.04.1/server/symlink.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/symlink.c 2016-02-08 19:32:34.000000000 +0000 @@ -67,6 +67,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ symlink_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ symlink_destroy /* destroy */ @@ -166,17 +168,15 @@ { struct symlink *symlink; struct unicode_str name, target; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; target.str = get_req_data_after_objattr( objattr, &target.len ); target.len = (target.len / sizeof(WCHAR)) * sizeof(WCHAR); - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; - if ((symlink = create_symlink( root, &name, objattr->attributes, &target, sd ))) { reply->handle = alloc_handle( current->process, symlink, req->access, objattr->attributes ); @@ -189,21 +189,10 @@ /* open a symbolic link object */ DECL_HANDLER(open_symlink) { - struct unicode_str name; - struct directory *root = NULL; - struct symlink *symlink; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; - - if ((symlink = open_object_dir( root, &name, req->attributes | OBJ_OPENLINK, &symlink_ops ))) - { - reply->handle = alloc_handle( current->process, &symlink->obj, req->access, req->attributes ); - release_object( symlink ); - } + struct unicode_str name = get_req_unicode_str(); - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &symlink_ops, &name, req->attributes | OBJ_OPENLINK ); } /* query a symbolic link object */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/thread.c wine-staging-1.9.3~ubuntu12.04.1/server/thread.c --- wine-staging-1.9.2~ubuntu12.04.1/server/thread.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/thread.c 2016-02-08 19:32:34.000000000 +0000 @@ -117,6 +117,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ thread_apc_destroy /* destroy */ @@ -146,6 +148,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ destroy_thread /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/timer.c wine-staging-1.9.3~ubuntu12.04.1/server/timer.c --- wine-staging-1.9.2~ubuntu12.04.1/server/timer.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/timer.c 2016-02-08 19:32:34.000000000 +0000 @@ -72,6 +72,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ timer_destroy /* destroy */ @@ -232,12 +234,11 @@ { struct timer *timer; struct unicode_str name; - struct directory *root = NULL; + struct directory *root; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); if (!objattr) return; - if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return; if ((timer = create_timer( root, &name, objattr->attributes, req->manual, sd ))) { @@ -251,21 +252,10 @@ /* open a handle to a timer */ DECL_HANDLER(open_timer) { - struct unicode_str name; - struct directory *root = NULL; - struct timer *timer; - - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) - return; - - if ((timer = open_object_dir( root, &name, req->attributes, &timer_ops ))) - { - reply->handle = alloc_handle( current->process, &timer->obj, req->access, req->attributes ); - release_object( timer ); - } + struct unicode_str name = get_req_unicode_str(); - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &timer_ops, &name, req->attributes ); } /* set a waitable timer */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/token.c wine-staging-1.9.3~ubuntu12.04.1/server/token.c --- wine-staging-1.9.2~ubuntu12.04.1/server/token.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/token.c 2016-02-08 19:32:34.000000000 +0000 @@ -158,6 +158,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ no_open_file, /* open_file */ no_close_handle, /* close_handle */ token_destroy /* destroy */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/trace.c wine-staging-1.9.3~ubuntu12.04.1/server/trace.c --- wine-staging-1.9.2~ubuntu12.04.1/server/trace.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/trace.c 2016-02-08 19:32:34.000000000 +0000 @@ -4255,6 +4255,19 @@ fprintf( stderr, " handle=%04x", req->handle ); } +static void dump_open_job_request( const struct open_job_request *req ) +{ + fprintf( stderr, " access=%08x", req->access ); + fprintf( stderr, ", attributes=%08x", req->attributes ); + fprintf( stderr, ", rootdir=%04x", req->rootdir ); + dump_varargs_unicode_str( ", name=", cur_size ); +} + +static void dump_open_job_reply( const struct open_job_reply *req ) +{ + fprintf( stderr, " handle=%04x", req->handle ); +} + static void dump_assign_job_request( const struct assign_job_request *req ) { fprintf( stderr, " job=%04x", req->job ); @@ -4552,6 +4565,7 @@ (dump_func)dump_get_suspend_context_request, (dump_func)dump_set_suspend_context_request, (dump_func)dump_create_job_request, + (dump_func)dump_open_job_request, (dump_func)dump_assign_job_request, (dump_func)dump_process_in_job_request, (dump_func)dump_set_job_limits_request, @@ -4825,6 +4839,7 @@ (dump_func)dump_get_suspend_context_reply, NULL, (dump_func)dump_create_job_reply, + (dump_func)dump_open_job_reply, NULL, NULL, NULL, @@ -5098,6 +5113,7 @@ "get_suspend_context", "set_suspend_context", "create_job", + "open_job", "assign_job", "process_in_job", "set_job_limits", @@ -5145,6 +5161,7 @@ { "ERROR_INVALID_CURSOR_HANDLE", 0xc0010000 | ERROR_INVALID_CURSOR_HANDLE }, { "ERROR_INVALID_INDEX", 0xc0010000 | ERROR_INVALID_INDEX }, { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE }, + { "ERROR_NO_MORE_USER_HANDLES", 0xc0010000 | ERROR_NO_MORE_USER_HANDLES }, { "ERROR_WINDOW_OF_OTHER_THREAD", 0xc0010000 | ERROR_WINDOW_OF_OTHER_THREAD }, { "FILE_DELETED", STATUS_FILE_DELETED }, { "FILE_IS_A_DIRECTORY", STATUS_FILE_IS_A_DIRECTORY }, diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/window.c wine-staging-1.9.3~ubuntu12.04.1/server/window.c --- wine-staging-1.9.2~ubuntu12.04.1/server/window.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/window.c 2016-02-08 19:32:34.000000000 +0000 @@ -1884,7 +1884,7 @@ DECL_HANDLER(create_window) { struct window *win, *parent = NULL, *owner = NULL; - struct unicode_str cls_name; + struct unicode_str cls_name = get_req_unicode_str(); atom_t atom; reply->handle = 0; @@ -1904,7 +1904,6 @@ while (!is_desktop_window(owner->parent)) owner = owner->parent; } - get_req_unicode_str( &cls_name ); atom = cls_name.len ? find_global_atom( NULL, &cls_name ) : req->atom; if (!(win = create_window( parent, owner, atom, req->instance ))) return; @@ -2118,11 +2117,10 @@ unsigned int total; user_handle_t *data; data_size_t len; - struct unicode_str cls_name; + struct unicode_str cls_name = get_req_unicode_str(); atom_t atom = req->atom; struct desktop *desktop = NULL; - get_req_unicode_str( &cls_name ); if (cls_name.len && !(atom = find_global_atom( NULL, &cls_name ))) return; if (req->desktop) @@ -2673,12 +2671,11 @@ /* set a window property */ DECL_HANDLER(set_window_property) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct window *win = get_window( req->window ); if (!win) return; - get_req_unicode_str( &name ); if (name.len) { atom_t atom = add_global_atom( NULL, &name ); @@ -2695,10 +2692,9 @@ /* remove a window property */ DECL_HANDLER(remove_window_property) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct window *win = get_window( req->window ); - get_req_unicode_str( &name ); if (win) { atom_t atom = name.len ? find_global_atom( NULL, &name ) : req->atom; @@ -2710,10 +2706,9 @@ /* get a window property */ DECL_HANDLER(get_window_property) { - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct window *win = get_window( req->window ); - get_req_unicode_str( &name ); if (win) { atom_t atom = name.len ? find_global_atom( NULL, &name ) : req->atom; diff -Nru wine-staging-1.9.2~ubuntu12.04.1/server/winstation.c wine-staging-1.9.3~ubuntu12.04.1/server/winstation.c --- wine-staging-1.9.2~ubuntu12.04.1/server/winstation.c 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/server/winstation.c 2016-02-08 19:32:34.000000000 +0000 @@ -50,6 +50,7 @@ static unsigned int winstation_map_access( struct object *obj, unsigned int access ); static void desktop_dump( struct object *obj, int verbose ); static struct object_type *desktop_get_type( struct object *obj ); +static int desktop_link_name( struct object *obj, struct object_name *name, struct object *parent ); static int desktop_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void desktop_destroy( struct object *obj ); static unsigned int desktop_map_access( struct object *obj, unsigned int access ); @@ -69,6 +70,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ winstation_close_handle, /* close_handle */ winstation_destroy /* destroy */ @@ -90,6 +93,8 @@ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ + desktop_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ desktop_close_handle, /* close_handle */ desktop_destroy /* destroy */ @@ -125,6 +130,7 @@ return NULL; } } + else clear_error(); } return winstation; } @@ -189,13 +195,7 @@ { struct desktop *desktop; - if (memchrW( name->str, '\\', name->len / sizeof(WCHAR) )) /* no backslash allowed in name */ - { - set_error( STATUS_INVALID_PARAMETER ); - return NULL; - } - - if ((desktop = create_named_object( winstation->desktop_names, &desktop_ops, name, attr ))) + if ((desktop = create_named_object( &winstation->obj, winstation->desktop_names, &desktop_ops, name, attr ))) { if (get_error() != STATUS_OBJECT_NAME_EXISTS) { @@ -213,6 +213,7 @@ list_add_tail( &winstation->desktops, &desktop->entry ); list_init( &desktop->hotkeys ); } + else clear_error(); } return desktop; } @@ -232,6 +233,24 @@ return get_object_type( &str ); } +static int desktop_link_name( struct object *obj, struct object_name *name, struct object *parent ) +{ + struct winstation *winstation = (struct winstation *)parent; + + if (parent->ops != &winstation_ops) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return 0; + } + if (memchrW( name->name, '\\', name->len / sizeof(WCHAR) )) /* no backslash allowed in name */ + { + set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); + return 0; + } + namespace_add( winstation->desktop_names, name ); + return 1; +} + static int desktop_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) { struct thread *thread; @@ -253,7 +272,6 @@ if (desktop->global_hooks) release_object( desktop->global_hooks ); if (desktop->close_timeout) remove_timeout_user( desktop->close_timeout ); list_remove( &desktop->entry ); - unlink_named_object( obj ); release_object( desktop->winstation ); } @@ -401,11 +419,10 @@ DECL_HANDLER(create_winstation) { struct winstation *winstation; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); struct directory *root = NULL; reply->handle = 0; - get_req_unicode_str( &name ); if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) return; if ((winstation = create_winstation( root, &name, req->attributes, req->flags ))) @@ -419,19 +436,10 @@ /* open a handle to a window station */ DECL_HANDLER(open_winstation) { - struct winstation *winstation; - struct unicode_str name; - struct directory *root = NULL; + struct unicode_str name = get_req_unicode_str(); - get_req_unicode_str( &name ); - if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 ))) return; - - if ((winstation = open_object_dir( root, &name, req->attributes, &winstation_ops ))) - { - reply->handle = alloc_handle( current->process, &winstation->obj, req->access, req->attributes ); - release_object( winstation ); - } - if (root) release_object( root ); + reply->handle = open_object( current->process, req->rootdir, req->access, + &winstation_ops, &name, req->attributes ); } @@ -475,10 +483,9 @@ { struct desktop *desktop; struct winstation *winstation; - struct unicode_str name; + struct unicode_str name = get_req_unicode_str(); reply->handle = 0; - get_req_unicode_str( &name ); if ((winstation = get_process_winstation( current->process, WINSTA_CREATEDESKTOP ))) { if ((desktop = create_desktop( &name, req->attributes, req->flags, winstation ))) @@ -494,9 +501,8 @@ DECL_HANDLER(open_desktop) { struct winstation *winstation; - struct unicode_str name; - - get_req_unicode_str( &name ); + struct object *obj; + struct unicode_str name = get_req_unicode_str(); /* FIXME: check access rights */ if (!req->winsta) @@ -504,12 +510,17 @@ else winstation = (struct winstation *)get_handle_obj( current->process, req->winsta, 0, &winstation_ops ); - if (winstation) + if (!winstation) return; + + if ((obj = find_object( winstation->desktop_names, &name, req->attributes ))) { - reply->handle = open_object( winstation->desktop_names, &name, &desktop_ops, - req->access, req->attributes ); - release_object( winstation ); + assert( obj->ops == &desktop_ops ); + reply->handle = alloc_handle( current->process, obj, req->access, req->attributes ); + release_object( obj ); } + else set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + + release_object( winstation ); } /* open a handle to current input desktop */ diff -Nru wine-staging-1.9.2~ubuntu12.04.1/staging/patchupdate.py wine-staging-1.9.3~ubuntu12.04.1/staging/patchupdate.py --- wine-staging-1.9.2~ubuntu12.04.1/staging/patchupdate.py 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/staging/patchupdate.py 2016-02-08 20:07:32.000000000 +0000 @@ -63,7 +63,7 @@ bugtracker_url = "https://bugs.winehq.org/xmlrpc.cgi" bugtracker_defaultcc = ["michael@fds-team.de", "sebastian@fds-team.de", - "erich.e.hoover@wine-staging.com"] + "erich.e.hoover@wine-staging.com", "dmitry@baikal.ru"] bugtracker_user = None bugtracker_pass = None diff -Nru wine-staging-1.9.2~ubuntu12.04.1/staging/patchutils.py wine-staging-1.9.3~ubuntu12.04.1/staging/patchutils.py --- wine-staging-1.9.2~ubuntu12.04.1/staging/patchutils.py 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/staging/patchutils.py 2016-02-08 20:07:32.000000000 +0000 @@ -302,6 +302,8 @@ if r is not None: return subject, int(r.group(2)) r = re.match("^(.*)\\(%s\\)$" % version, subject, re.IGNORECASE) if r is not None: return r.group(1).strip(), int(r.group(3)) + r = re.match("^(.*)\\[%s\\]$" % version, subject, re.IGNORECASE) + if r is not None: return r.group(1).strip(), int(r.group(3)) r = re.match("^(.*)[.,] +%s$" % version, subject, re.IGNORECASE) if r is not None: return r.group(1).strip(), int(r.group(3)) r = re.match("^([^:]+) %s: (.*)$" % version, subject, re.IGNORECASE) diff -Nru wine-staging-1.9.2~ubuntu12.04.1/staging/VERSION wine-staging-1.9.3~ubuntu12.04.1/staging/VERSION --- wine-staging-1.9.2~ubuntu12.04.1/staging/VERSION 2016-01-24 17:20:05.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/staging/VERSION 2016-02-08 20:07:32.000000000 +0000 @@ -1 +1 @@ -Wine Staging 1.9.3 (unreleased) +Wine Staging 1.9.3 diff -Nru wine-staging-1.9.2~ubuntu12.04.1/tools/make_announce wine-staging-1.9.3~ubuntu12.04.1/tools/make_announce --- wine-staging-1.9.2~ubuntu12.04.1/tools/make_announce 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/tools/make_announce 2016-02-08 19:32:34.000000000 +0000 @@ -0,0 +1,172 @@ +#!/usr/bin/perl -w +# +# Update the ANNOUNCE file for a new release. +# +# Usage: make_announce [new_version] +# +# Copyright 2016 Alexandre Julliard +# +# 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 +# + +use strict; +use locale; +use POSIX; +use Text::CSV::Encoded; +binmode STDOUT, ':utf8'; + +sub unescape($) +{ + my $str = shift; + $str =~ s/"/\"/g; + $str =~ s/'/\'/g; + $str =~ s/&/&/g; + $str =~ s/<//g; + $str =~ s/@/\@/g; + return $str; +} + +# update a file if changed +sub update_file($) +{ + my $file = shift; + if (!(-f $file) || system "cmp $file $file.new >/dev/null") + { + rename "$file.new", "$file"; + print "$file updated\n"; + } + else + { + unlink "$file.new"; + } +} + +# determine the current version number +sub get_current_version() +{ + my $version; + + open VERSION, " =~ /Wine version (\S+)/) { $version = $1; } + close VERSION; + die "failed to parse VERSION" unless $version; + return $version; +} + +# retrieve a list of bugs with the specified filter +sub get_bugs($) +{ + my $filter = shift; + my $csv = Text::CSV::Encoded->new({ encoding_in => "utf-8", encoding_out => "utf-8" }); + my %bugs; + + open QUERY, "-|" or exec "wget", "-qO-", "https://bugs.winehq.org/buglist.cgi?columnlist=short_desc&query_format=advanced&ctype=csv&$filter" + or die "cannot query bug list"; + ; # skip header line + while () + { + next unless $csv->parse($_); + my ($id, $descr) = $csv->fields(); + $bugs{$id} = $descr; + } + close QUERY; + return %bugs; +} + +# retrieve the current list of authors +sub get_authors() +{ + my %authors; + + open AUTHORS, "; # skip header line + while () + { + chomp; + next if /^$/; + $authors{$_} = 1; + } + close AUTHORS; + return %authors; +} + +# determine the version number + +my $old = get_current_version(); +my $new = $ARGV[0]; +unless ($new) +{ + if ($old =~ /^([0-9]+)\.([0-9]+)$/) { $new = "$1.$2.1"; } + elsif ($old =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)$/) { $new = "$1.$2." . ($3 + 1); } + elsif ($old =~ /^([0-9]+)\.([0-9]+)-rc([0-9]+)$/) { $new = "$1.$2-rc" . ($3 + 1); } + else { die "unknown version format $old"; } +} + +print "Updating files for release $new\n"; + +(my $reldir = $new) =~ s/^([0-9]+\.[0-9]+).*/$1/; +my $is_stable = ($new =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)$/) && !($2 % 2); # stable releases have an even minor number +my $filter = "product=Wine&resolution=FIXED&" . ($is_stable ? "target_milestone=$reldir.x" : "bug_status=RESOLVED"); + +my %bugs = get_bugs( $filter ); +my %authors = get_authors(); + +# update the ANNOUNCE file + +open ANNOUNCE, "ANNOUNCE.new" or die "cannot create ANNOUNCE.new"; +while () +{ + last if /^------------------/; + s!http://mirrors.ibiblio.org/wine/source/.*!http://mirrors.ibiblio.org/wine/source/$reldir/wine-$new.tar.bz2!; + s!http://dl.winehq.org/wine/source/.*!http://dl.winehq.org/wine/source/$reldir/wine-$new.tar.bz2!; + print NEW $_; +} + +print NEW "----------------------------------------------------------------\n\n"; +printf NEW "Bugs fixed in %s (total %u):\n\n", $new, scalar( keys %bugs ); +foreach my $id (sort {$a <=> $b} keys %bugs) +{ + printf NEW " %6d %s\n", $id, unescape( $bugs{$id} ); +} + +print NEW "\n----------------------------------------------------------------\n\n"; +print NEW "Changes since $old:\n\n"; + +open LOG, "-|" or exec "git", "shortlog", "wine-$old..HEAD" or die "cannot run git shortlog"; +while () +{ + if (/^(\S.*)\s\(\d+\):$/) { $authors{$1} = 1; } + print NEW $_; +} +close LOG; + +while () { last if /^--$/; } +print NEW "--\n"; +while () { print NEW $_; } + +close ANNOUNCE; +close NEW; +update_file( "ANNOUNCE" ); + +# update the AUTHORS file + +setlocale( LC_COLLATE, "en_US.UTF-8" ); + +open AUTHORS, ">AUTHORS.new" or die "cannot create AUTHORS.new"; +print AUTHORS "Wine is available thanks to the work of:\n\n", join( "\n", sort keys %authors ), "\n"; +close AUTHORS; +update_file( "AUTHORS" ); diff -Nru wine-staging-1.9.2~ubuntu12.04.1/VERSION wine-staging-1.9.3~ubuntu12.04.1/VERSION --- wine-staging-1.9.2~ubuntu12.04.1/VERSION 2016-01-24 17:04:16.000000000 +0000 +++ wine-staging-1.9.3~ubuntu12.04.1/VERSION 2016-02-08 19:32:34.000000000 +0000 @@ -1 +1 @@ -Wine version 1.9.2 +Wine version 1.9.3